StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DSMLayer_E101_2009.cc
1 #include "DSMAlgo_EE101_2009.hh"
2 #include "DSMAlgo_EE102_2009.hh"
3 
4 #include "DSMLayer_E001_2009.hh"
5 #include "DSMLayer_E101_2009.hh"
6 
7 //DSMLayer_E101_2009::DSMLayer_E101_2009() : StDSMLayer(2) //DSMLayer<TriggerDataBlk>(2)
8 DSMLayer_E101_2009::DSMLayer_E101_2009() : DSMLayer<TriggerDataBlk>(2)
9 {
10  (*this)[0].name = "EE101";
11  (*this)[1].name = "EE102";
12 }
13 
14 bool DSMLayer_E101_2009::read(const TriggerDataBlk& event)
15 {
16  bool bc1_in = event.MainX[BC1_CONF_NUM].offset && event.MainX[BC1_CONF_NUM].length;
17 
18  if (bc1_in) {
19  BELayerBlock* bc1 = (BELayerBlock*)((char*)&event+event.MainX[BC1_CONF_NUM].offset);
20  for (size_t dsm = 0; dsm < size(); ++dsm)
21  copy_and_swap8((*this)[dsm].channels, &bc1->EEMClayer1[dsm*8]);
22  }
23 
24  return bc1_in;
25 }
26 
27 void DSMLayer_E101_2009::write(DSMLayer<TriggerDataBlk>& layer)
28 {
29  for (int ch = 6; ch < 8; ++ch)
30  layer[0].channels[ch] = (*this)[ch-6].output;
31 }
32 
33 void DSMLayer_E101_2009::run()
34 {
35  DSMAlgo_EE101_2009()((*this)[0]); // EE101
36  DSMAlgo_EE102_2009()((*this)[1]); // EE102
37 }