36 <<
"MicromegasCombinedDataDecoder::Init -"
37 <<
" m_calibration_filename: "
42 <<
"MicromegasCombinedDataDecoder::Init -"
43 <<
" m_hot_channel_map_filename: "
47 std::cout <<
"MicromegasCombinedDataDecoder::Init - m_n_sigma: " <<
m_n_sigma << std::endl;
48 std::cout <<
"MicromegasCombinedDataDecoder::Init - m_min_adc: " <<
m_min_adc << std::endl;
49 std::cout <<
"MicromegasCombinedDataDecoder::Init - m_sample_min: " <<
m_sample_min << std::endl;
50 std::cout <<
"MicromegasCombinedDataDecoder::Init - m_sample_max: " <<
m_sample_max << std::endl;
71 std::cout <<
"MicromegasCombinedDataDecoder::InitRun - DST Node missing, doing nothing." << std::endl;
76 auto hitsetcontainer = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
79 std::cout <<
"MicromegasCombinedDataDecoder::InitRun - creating TRKR_HITSET." << std::endl;
87 dstNode->addNode(trkrnode);
93 trkrnode->addNode(newNode);
106 auto trkrhitsetcontainer = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
107 assert(trkrhitsetcontainer);
110 auto rawhitcontainer = findNode::getClass<MicromegasRawHitContainer>(topNode,
m_rawhitnodename);
111 assert( rawhitcontainer );
115 { std::cout <<
"MicromegasCombinedDataDecoder::process_event - hits: " << rawhitcontainer->get_nhits() << std::endl; }
117 int n_signal_hits = 0;
120 uint64_t first_lvl1_bco = 0;
122 for(
unsigned int ihit = 0;
ihit < rawhitcontainer->get_nhits(); ++
ihit )
124 const auto rawhit = rawhitcontainer->get_hit(
ihit);
125 const auto packet_id = rawhit->get_packetid();
130 first_lvl1_bco = rawhit->get_gtm_bco();
136 std::cout <<
"MicromegasCombinedDataDecoder::process_event - invalid packet: " << packet_id << std::endl;
140 const int fee = rawhit->get_fee();
141 const auto channel = rawhit->get_channel();
142 const int samples = rawhit->get_samples();
147 if( !hitsetkey )
continue;
153 if( strip < 0 )
continue;
163 if( rms <= 0 )
continue;
166 std::vector<int> adc;
168 { adc.push_back(rawhit->get_adc(is)); }
170 if( adc.empty() )
continue;
174 auto max_adc = *std::max_element( adc.begin(), adc.end() );
180 if( max_adc < pedestal +
m_n_sigma * rms )
continue;
184 const auto bco = rawhit->get_gtm_bco();
185 std::cout <<
"MicromegasCombinedDataDecoder::process_event -"
187 <<
" layer: " << layer
190 <<
" strip: " << strip
191 <<
" adc: " << max_adc
196 const auto hitset_it = trkrhitsetcontainer->findOrAddHitSet(hitsetkey);
202 auto hit = hitset_it->second->getHit(hitkey);
212 hitset_it->second->addHitSpecificKey(hitkey, hit);
220 { std::cout <<
"MicromegasCombinedDataDecoder::process_event - BCO: " << first_lvl1_bco <<
" n_signal_hits: " << n_signal_hits << std::endl; }
231 { std::cout <<
"MicromegasCombinedDataDecoder::End - hitsetkey: " <<
hitsetkey <<
", count: " <<
count << std::endl; }