32 std::ostream& operator << ( std::ostream& out, const std::list<T>& list )
34 if( list.empty() )
out <<
"{}";
39 for(
const auto&
value:list )
41 if( !first )
out <<
", ";
83 lvl1_bco_list.clear();
84 lvl1_count_list.clear();
115 auto rawhitcontainer = findNode::getClass<MicromegasRawHitContainer>(topNode,
m_rawhitnodename);
116 assert( rawhitcontainer );
122 std::multimap<uint64_t, Sample> sample_map;
123 std::multimap<uint64_t, Waveform> waveform_map;
126 std::map<unsigned int, size_t> packet_waveforms;
130 { std::cout <<
"MicromegasCombinedDataEvaluation::process_event - hits: " << rawhitcontainer->get_nhits() << std::endl; }
133 uint64_t first_lvl1_bco = 0;
136 for(
unsigned int ihit = 0;
ihit < rawhitcontainer->get_nhits(); ++
ihit )
138 const auto rawhit = rawhitcontainer->get_hit(
ihit);
139 const auto packet_id = rawhit->get_packetid();
144 std::cout <<
"MicromegasCombinedDataEvaluation::process_event - invalid packet: " << packet_id << std::endl;
148 ++packet_waveforms[packet_id];
153 sample.
fee_id = rawhit->get_fee();
160 sample.
fee_bco = rawhit->get_bco();
161 sample.
lvl1_bco = rawhit->get_gtm_bco();
166 first_lvl1_bco = rawhit->get_gtm_bco();
181 sample.
channel = rawhit->get_channel();
191 const auto samples = rawhit->get_samples();
194 std::cout <<
"MicromegasCombinedDataEvaluation::process_event -"
195 <<
" fee: " << sample.
fee_id
196 <<
" tile: " << sample.
tile
197 <<
" layer: " << sample.
layer
198 <<
" tile: " << sample.
tile
200 <<
" fee_bco: " << sample.
fee_bco
202 <<
" channel: " << sample.
channel
203 <<
" strip: " << sample.
strip
204 <<
" samples: " << samples
209 for(
unsigned short is = 0; is < std::min<unsigned short>( samples, 100 ); ++is )
212 auto adc = rawhit->get_adc(is);
215 sample_map.emplace( sample.
lvl1_bco, sample );
217 if( sample.
adc > sample_max.
adc )
218 { sample_max = sample; }
231 waveform_map.emplace( waveform.
lvl1_bco, waveform );
235 for(
auto&& [lvl_bco, sample]:sample_map )
238 for(
auto&& [lvl1_bco, waveform]:waveform_map )
242 for(
const auto& [packet_id, n_waveforms]:packet_waveforms )
263 for(
const auto& [bco,nwaveforms]:
m_bco_map )
264 { std::cout <<
"MicromegasCombinedDataEvaluation::End - bco: 0x" << std::hex << bco << std::dec <<
", nwaveforms: " << nwaveforms << std::endl; }
269 std::cout <<
"const std::vector<uint64_t> lvl1_bco_list = {" << std::endl;
272 for(
const auto& [bco,nwaveforms]:m_bco_map )
274 if( !first ) std::cout <<
", ";
279 std::cout << std::endl;
281 std::cout <<
" 0x" << std::hex << bco << std::dec;
284 std::cout << std::endl <<
"};" << std::endl;