StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DSMAlgo_EE002_2009.cc
1 //
2 // Pibero Djawotho <pibero@comp.tamu.edu>
3 // Texas A&M University Cyclotron Institute
4 // 7 Jan 2009
5 //
6 
7 #include "DSM.hh"
8 #include "sumTriggerPatchChannels.hh"
9 #include "DSMAlgo_EE002_2009.hh"
10 
11 void DSMAlgo_EE002_2009::operator()(DSM& dsm)
12 {
13  // INPUT:
14 
15  // 10 x 12-bit EEMC channels
16  // (0-5) high tower
17  // (6-11) trigger patch
18 
19  // REGISTERS:
20 
21  // R0: EEMC-High-Tower-Th0 (6)
22  // R1: EEMC-High-Tower-Th1 (6)
23 
24  // ACTION:
25 
26  // J0 (ch0/1/2/3/4) to first output cable (0-15)
27 
28  int sumJ0 = 0;
29  int highTowerBitsJ0 = 0;
30 
31  // Args: dsm, chMin, chMax, step, targetPedestal, sum, highTowerBits
32  //printf("ee002 r0=%d\n", dsm.registers[0]);
33  sumTriggerPatchChannels(dsm, 0, 4, 1, 1, sumJ0, highTowerBitsJ0);
34 
35  // J1 (ch5/6/7/8/9) to second output cable (16-31)
36 
37  int sumJ1 = 0;
38  int highTowerBitsJ1 = 0;
39 
40  // Args: dsm, chMin, chMax, step, targetPedestal, sum, highTowerBits
41  sumTriggerPatchChannels(dsm, 5, 9, 1, 1, sumJ1, highTowerBitsJ1);
42 
43  // OUTPUT (32):
44 
45  // (0-5) TP sum JO (6)
46  // (6-11) Unused (2)
47  // (12-13) HT bits J0 (2)
48  // (14-15) Unused (2)
49 
50  int out = 0;
51 
52  out |= sumJ0;
53  out |= highTowerBitsJ0 << 12;
54 
55  // (16-21) TP sum J1 (6)
56  // (22-27) Unused (2)
57  // (28-29) HT bits J1 (2)
58  // (30-31) Unused (2)
59 
60  out |= sumJ1 << 16;
61  out |= highTowerBitsJ1 << 28;
62 
63  dsm.output = out;
64 }
Definition: DSM.hh:16