15 #include <Event/Event.h>
16 #include <Event/EventTypes.h>
17 #include <Event/Eventiterator.h>
18 #include <Event/fileEventiterator.h>
67 std::cout <<
"Fetching next Event" << evt->
getEvtSequence() << std::endl;
86 for (
int i = 0;
i < npackets;
i++)
102 uint64_t gtm_bco = previous_bco;
104 uint64_t m_nTaggerInFrame = packet->lValue(0,
"N_TAGGER");
105 for (uint64_t
t = 0;
t < m_nTaggerInFrame;
t++)
108 const auto is_lvl1 =
static_cast<uint8_t
>(packet->lValue(
t,
"IS_LEVEL1_TRIGGER"));
111 gtm_bco = packet->lValue(
t,
"BCO");
114 std::cout <<
"bco: 0x" << std::hex << gtm_bco << std::dec << std::endl;
117 previous_bco = gtm_bco;
121 int m_nWaveormInFrame = packet->iValue(0,
"NR_WF");
122 for (
int wf = 0; wf < m_nWaveormInFrame; wf++)
125 int FEE = packet->iValue(wf,
"FEE");
126 newhit->
set_bco(packet->iValue(wf,
"BCO"));
133 newhit->
set_channel(packet->iValue(wf,
"CHANNEL"));
142 const uint16_t samples = packet->iValue(wf,
"SAMPLES");
146 for( uint16_t is =0; is < samples; ++is )
147 { newhit->
set_adc( is, packet->iValue( wf, is ) ); }
153 std::cout <<
"evtno: " << EventSequence
155 <<
", num waveforms: " << m_nWaveormInFrame
156 <<
", bco: 0x" << std::hex << gtm_bco << std::dec
157 <<
", FEE: " << FEE << std::endl;
175 if (what ==
"ALL" || what ==
"FEE")
179 std::cout <<
"Beam clock 0x" << std::hex << bcliter.first << std::dec << std::endl;
180 for (
auto feeiter : bcliter.second)
182 std::cout <<
"FEM: " << feeiter << std::endl;
186 if (what ==
"ALL" || what ==
"FEEBCLK")
190 std::cout <<
"FEE" << bcliter.first <<
" bclk: 0x"
191 << std::hex << bcliter.second << std::dec << std::endl;
194 if (what ==
"ALL" || what ==
"STORAGE")
198 std::cout <<
"Beam clock 0x" << std::hex << bcliter.first << std::dec << std::endl;
199 for (
auto feeiter : bcliter.second)
201 std::cout <<
"fee: " << feeiter->get_fee()
202 <<
" at " << std::hex << feeiter << std::dec << std::endl;
206 if (what ==
"ALL" || what ==
"STACK")
210 std::cout <<
"stacked bclk: 0x" << std::hex << iter << std::dec << std::endl;
217 std::vector<uint64_t> toclearbclk;
220 if (iter.first <= bclk)
222 for (
auto pktiter : iter.second)
226 toclearbclk.push_back(iter.first);
238 for (
auto iter : toclearbclk)
242 m_TpcRawHitMap.erase(iter);
257 std::cout <<
"my bclk 0x" << std::hex << iter.second
258 <<
" req: 0x" << bclk << std::dec << std::endl;
260 if (iter.second < bclk)
264 std::cout <<
"FEE " << iter.first <<
" beamclock 0x" << std::hex << iter.second
265 <<
" smaller than req bclk: 0x" << bclk << std::dec << std::endl;
299 if (bcliter.second <= lowest_bclk)
334 TpcRawHitContainer *tpchitcont = findNode::getClass<TpcRawHitContainer>(detNode,
"TPCRAWHIT");
339 detNode->addNode(newNode);