StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DSMLayer_B001_2014_B.cc
1 #include "DSMLayer_B001_2014_B.hh"
2 
3 #include "DSMAlgo_BE001_2014_b.hh"
4 #include "DSMAlgo_BE003_2014_b.hh"
5 #include "DSMAlgo_BW001_2014_b.hh"
6 #include "DSMAlgo_BW003_2014_b.hh"
7 
8 DSMLayer_B001_2014_B::DSMLayer_B001_2014_B() : DSMLayer_B001_2009()
9 {
10  // West
11  //printf("DSMLayer_B001_2014_B constructor\n");
12  for (int dsm = 0; dsm < 15; ++dsm)
13  (*this)[dsm].setName("BW", 0, dsm);
14 
15  // East
16 
17  for (int dsm = 15; dsm < 30; ++dsm)
18  (*this)[dsm].setName("BE", 0, dsm-15);
19 }
20 
21 void DSMLayer_B001_2014_B::write(DSMLayer<TriggerDataBlk>& layer)
22 {
23  int dsm = 0;
24  int dsmWest = 0;
25  int dsmEast = 15;
26 
27  // Loop over BEMC layer 1 DSM's
28 
29  while (dsm < 6) {
30 
31  // BC101/103/105
32 
33  layer[dsm].channels[0] = (*this)[dsmEast++].output; // BE001/BE006/BE011
34  layer[dsm].channels[1] = (*this)[dsmWest++].output; // BW001/BW006/BW011
35  layer[dsm].channels[2] = (*this)[dsmEast++].output; // BE002/BE007/BE012
36  layer[dsm].channels[3] = (*this)[dsmWest++].output; // BW002/BW007/BW012
37  layer[dsm].channels[4] = (*this)[dsmEast].output >> 16 & 0xffff; // BE003/BE008/BE013 JP1 (0-15)
38  layer[dsm].channels[5] = (*this)[dsmWest].output & 0xffff; // BW003/BW008/BW013 JP1 (0-15)
39 
40  ++dsm;
41 
42  // BC102/104/106
43 
44  layer[dsm].channels[0] = (*this)[dsmEast++].output & 0xffff; // BE003/BE008/BE013 JP6 (16-31)
45  layer[dsm].channels[1] = (*this)[dsmWest++].output >> 16 & 0xffff; // BW003/BW008/BW013 JP6 (16-31)
46  layer[dsm].channels[2] = (*this)[dsmEast++].output; // BE004/BE009/BE014
47  layer[dsm].channels[3] = (*this)[dsmWest++].output; // BW004/BW009/BW014
48  layer[dsm].channels[4] = (*this)[dsmEast++].output; // BE005/BE010/BE015
49  layer[dsm].channels[5] = (*this)[dsmWest++].output; // BW005/BW010/BW015
50 
51  ++dsm;
52  }
53 }
54 
55 void DSMLayer_B001_2014_B::run()
56 {
57  int dsm = 0;
58 
59  while (dsm < 15) {
60  DSMAlgo_BW001_2014_b()((*this)[dsm++]); // BW001/BW006/BW011
61  DSMAlgo_BW001_2014_b()((*this)[dsm++]); // BW002/BW007/BW012
62  DSMAlgo_BW003_2014_b()((*this)[dsm++]); // BW003/BW008/BW013
63  DSMAlgo_BW001_2014_b()((*this)[dsm++]); // BW004/BW009/BW014
64  DSMAlgo_BW001_2014_b()((*this)[dsm++]); // BW005/BW010/BW015
65  }
66 
67  // East
68 
69  while (dsm < 30) {
70  DSMAlgo_BE001_2014_b()((*this)[dsm++]); // BE001/BE006/BE011
71  DSMAlgo_BE001_2014_b()((*this)[dsm++]); // BE002/BE007/BE012
72  DSMAlgo_BE003_2014_b()((*this)[dsm++]); // BE003/BE008/BE013
73  DSMAlgo_BE001_2014_b()((*this)[dsm++]); // BE004/BE009/BE014
74  DSMAlgo_BE001_2014_b()((*this)[dsm++]); // BE005/BE010/BE015
75  }
76 }