StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DSMAlgo_BW003_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_BW003_2009.hh"
10 
11 void DSMAlgo_BW003_2009::operator()(DSM& dsm)
12 {
13  // INPUT:
14 
15  // 10 12-bit BEMC channels
16  // (5-0) high-tower
17  // (11-6) trigger-patch
18 
19  // J1 - ch0/2/4/6/8 (even channels) -> (16-31)
20  // J3 - ch1/3/5/7/9 (odd channels) -> ( 0-15)
21 
22  // REGISTERS:
23 
24  // R0: BEMC-High-Tower-Th0 (6)
25  // R1: BEMC-High-Tower-Th1 (6)
26  // R2: BEMC-High-Tower-Th2 (6)
27  // R3: BEMC-High-Tower-Th3 (6)
28 
29  // ACTION:
30 
31  // JP1 - odd channels - to upper DSM
32 
33  int highTowerBitsJP1 = 0;
34  int lowEtaSumJP1 = 0;
35  int highEtaSumJP1 = 0;
36 
37  // Args: dsm, chMin, chMax, step, targetPedestal, sum, highTowerBits
38 
39  sumTriggerPatchChannels(dsm, 1, 3, 2, 1, lowEtaSumJP1, highTowerBitsJP1);
40  sumTriggerPatchChannels(dsm, 5, 9, 2, 1, highEtaSumJP1, highTowerBitsJP1);
41 
42  // JP6 - even channels - to lower DSM
43 
44  int highTowerBitsJP6 = 0;
45  int lowEtaSumJP6 = 0;
46  int highEtaSumJP6 = 0;
47 
48  // Args: dsm, chMin, chMax, step, targetPedestal, sum, highTowerBits
49 
50  sumTriggerPatchChannels(dsm, 0, 2, 2, 1, lowEtaSumJP6, highTowerBitsJP6);
51  sumTriggerPatchChannels(dsm, 4, 8, 2, 1, highEtaSumJP6, highTowerBitsJP6);
52 
53  // OUTPUT (32):
54 
55  // JP1 (0-15) to upper DSM
56 
57  // (0-5) TP sum for low-eta group (6)
58  // (6-11) TP sum for high-eta group (6)
59  // (12-15) HT bits (4)
60 
61  // JP6 (16-31) to lower DSM
62 
63  // (16-21) TP sum for low-eta group (6)
64  // (22-27) TP sum for high-eta group (6)
65  // (28-31) HT bits (4)
66 
67  // JP1 (0-15)
68 
69  int out = 0;
70 
71  out |= lowEtaSumJP1;
72  out |= highEtaSumJP1 << 6;
73  out |= highTowerBitsJP1 << 12;
74 
75  // JP6 (16-31)
76 
77  out |= lowEtaSumJP6 << 16;
78  out |= highEtaSumJP6 << 22;
79  out |= highTowerBitsJP6 << 28;
80 
81  dsm.output = out;
82 }
Definition: DSM.hh:16