StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DSMAlgo_EE001_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_EE001_2009.hh"
10 
11 void DSMAlgo_EE001_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  int lowEtaSum = 0;
27  int highEtaSum = 0;
28  int highTowerBits = 0;
29 
30  // Args: dsm, chMin, chMax, step, targetPedestal, sum, highTowerBits
31  //printf("r0=%d\n", dsm.registers[0]);
32  sumTriggerPatchChannels(dsm, 0, 8, 2, 3, lowEtaSum, highTowerBits);
33  sumTriggerPatchChannels(dsm, 1, 9, 2, 2, highEtaSum, highTowerBits);
34 
35  // OUTPUT (14):
36 
37  // (0-5) TP sum for low-eta group (6)
38  // (6-11) TP sum for high-eta group (6)
39  // (12-13) HT bits (2)
40 
41  int out = 0;
42 
43  out |= lowEtaSum;
44  out |= highEtaSum << 6;
45  out |= highTowerBits << 12;
46 
47  dsm.output = out;
48 }
Definition: DSM.hh:16