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