Install fatal handler with default options.
This is meant to be easy to call from python via ctypes.
Install fatal handler with default options.
getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Only dead or distorted, or short known BCs are considered below.
136 ATH_MSG_ERROR(
"Do not have Bad chan container " << m_BCKey.key() );
137 return StatusCode::FAILURE;
143 return StatusCode::FAILURE;
148 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
149 return StatusCode::FAILURE;
157 std::map<unsigned,Average> averageMap;
161 std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin();
162 std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end();
164 for(; itOnId!=itOnIdEnd;++itOnId){
166 if (!
cabling->isOnlineConnected(chid))
continue;
171 const float ampl=waveHelper.
getMaxAmp(cwv[0]);
172 const float wid =waveHelper.
getWidth(cwv[0])*cwv[0].getDt();
173 const float tmax=waveHelper.
getMax(cwv[0])*cwv[0].getDt();
175 CellData thisCellData;
176 thisCellData.m_chid=chid;
177 thisCellData.m_ampl=ampl;
178 thisCellData.m_wid =wid;
179 thisCellData.m_tmax=tmax;
181 const unsigned regId=getSymId(chid,
cabling);
182 Average& avreg=averageMap[regId];
190 avreg.m_nPed[
igain]++;
191 avreg.m_vmedPedRMS[
igain].push_back(
ped);
196 avreg.m_avAmpl[0]+=ampl;
197 avreg.m_avAmplSD[0]+=ampl*ampl;
199 avreg.m_vmedAmpl[0].push_back(ampl);
201 avreg.m_avWid[0]+=wid;
202 avreg.m_avWidSD[0]+=wid*wid;
204 avreg.m_vmedWid[0].push_back(wid);
206 avreg.m_avTmax[0]+=tmax;
207 avreg.m_avTmaxSD[0]+=tmax*tmax;
209 avreg.m_vmedTmax[0].push_back(tmax);
215 for(
auto &[
i,
average]:averageMap) {
223 typedef std::vector<std::pair<HWIdentifier,LArBadChannel> > BCV_t;
236 typedef std::pair<unsigned,std::vector<size_t> > goodAndBad_t;
237 typedef std::map<HWIdentifier,goodAndBad_t> goodAndBadMap_t;
239 goodAndBadMap_t calibLineMap;
242 std::vector<CellData>::const_iterator itcells=
cellData.begin();
243 std::vector<CellData>::const_iterator itcells_e=
cellData.end();
245 for (;itcells!=itcells_e;++itcells) {
246 const CellData& thisCellData=*itcells;
249 unsigned regId=getSymId(chid,
cabling);
251 std::map<unsigned,Average>::const_iterator febit=averageMap.find(regId);
252 if (febit==averageMap.end())
continue;
253 const Average& avreg=febit->second;
259 if (avreg.m_nPed[
igain]>2) {
260 const float rms=thisCellData.m_pedRMS[
igain];
263 if ( m_cutType==
"SIG" ) {
264 lowCut_rms=m_lowNoiseTh[
igain]*avreg.m_avPedRMSSD[
igain];
265 higCut_rms=m_highNoiseTh[
igain]*avreg.m_avPedRMSSD[
igain];
267 else if ( m_cutType==
"PER") {
268 lowCut_rms=m_lowNoiseTh[
igain]*avreg.m_avPedRMS[
igain]*0.01;
269 higCut_rms=m_highNoiseTh[
igain]*avreg.m_avPedRMS[
igain]*0.01;
276 << avreg.m_avPedRMS[
igain] <<
" Median: " << avreg.m_medPedRMS ) ;
278 if ( (
rms-avreg.m_avPedRMS[
igain]) > higCut_rms ) {
281 else if ( (
rms-avreg.m_avPedRMS[
igain]) > lowCut_rms ) {
286 std::string my_status;
293 <<
" RMS: " <<
rms <<
" ( " << avreg.m_avPedRMS[
igain] <<
" , "
294 <<
float(
int(10000*(
rms-avreg.m_avPedRMS[
igain])/avreg.m_avPedRMS[
igain]))/100 <<
" %) " <<
", #Sig: "
295 <<
float(
int(100*(
rms-avreg.m_avPedRMS[
igain])/avreg.m_avPedRMSSD[
igain]))/100
296 <<
" ( " << avreg.m_avPedRMSSD[
igain] <<
" ) " ) ;
303 if (avreg.m_nAmpls[0]>2 && avreg.m_nWids[0]>2 && avreg.m_nTmaxs[0]>2) {
304 const float ampl=thisCellData.m_ampl;
305 const float wid=thisCellData.m_wid;
306 const float tmax=thisCellData.m_tmax;
314 if ( m_cutType==
"SIG" ) {
315 lowCut_amp=m_distampTh[0]*avreg.m_avAmplSD[0];
316 higCut_amp=m_amplTh[0]*avreg.m_avAmplSD[0];
317 lowCut_wid=m_distwidTh[0]*avreg.m_avWidSD[0];
318 higCut_wid=m_widTh[0]*avreg.m_avWidSD[0];
319 Cut_tmax=m_tmaxampTh[0]*avreg.m_avTmaxSD[0];
321 else if ( m_cutType==
"PER") {
322 lowCut_amp=m_distampTh[0]*avreg.m_avAmpl[0]*0.01;
323 higCut_amp=m_amplTh[0]*avreg.m_avAmpl[0]*0.01;
324 lowCut_wid=m_distwidTh[0]*avreg.m_avWid[0]*0.01;
325 higCut_wid=m_widTh[0]*avreg.m_avWid[0]*0.01;
326 Cut_tmax=m_tmaxampTh[0]*avreg.m_avTmax[0]*0.01;
330 if (ampl==-1 || wid==-1) {
331 ATH_MSG_INFO (
"No Amplitude or Width found for " << channelDescription(chid,
cabling,0) ) ;
335 ATH_MSG_VERBOSE (
"Ampl gain: "<< 0<<
":"<< ampl<<
" Average: " << avreg.m_avAmpl[0]) ;
337 if (fabs(ampl-avreg.m_avAmpl[0])>higCut_amp || fabs(wid-avreg.m_avWid[0])>higCut_wid) {
341 else if (fabs(ampl-avreg.m_avAmpl[0])>lowCut_amp || fabs(wid-avreg.m_avWid[0])>lowCut_wid){
345 else if (fabs(tmax-avreg.m_avTmax[0])>Cut_tmax) {
357 std::string my_status;
358 if ( !(problem.deadReadout()||problem.distorted())
365 <<
" Amp: " << ampl <<
" ( " << avreg.m_avAmpl[0] <<
" , "
366 <<
float(
int(10000*(ampl-avreg.m_avAmpl[0])/avreg.m_avAmpl[0]))/100 <<
" %) " <<
" #Sig: "
367 <<
float(
int(100*(ampl-avreg.m_avAmpl[0])/avreg.m_avAmplSD[0]))/100 <<
" ( " << avreg.m_avAmplSD[0] <<
" ) "
368 <<
" FWHM: " << wid <<
" ( " << avreg.m_avWid[0] <<
" , "
369 <<
float(
int(10000*(wid-avreg.m_avWid[0])/avreg.m_avWid[0]))/100 <<
" %) " <<
" #Sig: "
370 <<
float(
int(100*(wid-avreg.m_avWid[0])/avreg.m_avWidSD[0]))/100
371 <<
" ( " << avreg.m_avWidSD[0] <<
" ) "
372 <<
" Tmax: " << tmax <<
" ( " << avreg.m_avTmax[0] <<
" , "
373 <<
float(
int(10000*(tmax-avreg.m_avTmax[0])/avreg.m_avTmax[0]))/100 <<
" %) " <<
" #Sig:"
374 <<
float(
int(100*(tmax-avreg.m_avTmax[0])/avreg.m_avTmaxSD[0]))/100
381 const std::vector<HWIdentifier>& cLids=clCont->calibSlotLine(chid);
383 goodAndBad_t& gb=calibLineMap[hwid];
384 if (problem.deadReadout()||problem.distorted())
385 gb.second.push_back(badChanVec.size());
389 if (!problem.good()) badChanVec.push_back(std::make_pair(chid,problem));
394 for(
const auto & kv: calibLineMap) {
395 const goodAndBad_t& gb=kv.second;
396 for (
unsigned i=0;
i<gb.second.size();
i++) {
398 ATH_MSG_INFO (
"All channels belonging to calibLine " << channelDescription(badChanVec[gb.second[
i]].first,
cabling)
399 <<
" don't respond to pulses. Assume bad calib line." ) ;
407 if (m_outFileName.size()) {
408 std::ofstream
outfile(m_outFileName.c_str());
410 ATH_MSG_ERROR (
"Failed to open output file " << m_outFileName <<
". No output will be written." ) ;
413 BCV_t::const_iterator bcvit=badChanVec.begin();
414 BCV_t::const_iterator bcvit_e=badChanVec.end();
415 for(;bcvit!=bcvit_e;++bcvit) {
420 std::string my_ps=(bc2.
good())?
"NEW " :
"BC ";
421 if (!bc2.
good()&&m_outOnlyNew)
continue;
422 outfile << m_onlineId->barrel_ec(chid) <<
" "
423 << m_onlineId->pos_neg(chid) <<
" "
424 << m_onlineId->feedthrough(chid) <<
" "
425 << m_onlineId->slot(chid) <<
" "
426 << m_onlineId->channel(chid) <<
" "
427 << m_onlineId->channel(cLid) <<
" "
429 << my_ps << std::endl;
435 return StatusCode::SUCCESS;