ATLAS Offline Software
Loading...
Searching...
No Matches
LArShapeDumper Class Reference

#include <LArShapeDumper.h>

Inheritance diagram for LArShapeDumper:

Public Member Functions

 LArShapeDumper (const std::string &name, ISvcLocator *pSvcLocator)
 ~LArShapeDumper ()
virtual StatusCode initialize () override
virtual StatusCode start () override
virtual StatusCode execute () override
virtual StatusCode stop () override
virtual StatusCode finalize () override
int makeEvent (LArSamples::EventData *&eventData, int run, int event, int lumiBlock, int bunchXing) const
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_fileName
int m_prescale
unsigned m_count
unsigned m_maxChannels
unsigned m_nWrongBunchGroup
unsigned m_nPrescaledAway
unsigned m_nLArError
unsigned m_nNoDigits
unsigned m_nNoDigitsSC
std::string m_caloType
double m_energyCut
double m_noiseSignifCut
double m_energyCutSC
int m_minADCMax
int m_minADCMaxSC
std::string m_gainSpec
bool m_dumpDisc
std::vector< std::string > m_triggerNames
ToolHandle< ILArShapeDumperToolm_dumperTool {this,"LArShapeDumperTool","LArShapeDumperTool"}
ToolHandle< ILArShapeDumperToolm_dumperToolSC {this,"LArShapeDumperToolSC","LArShapeDumperToolSC"}
LArBadChannelMask m_bcMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask {this,"ProblemsToMask",{}, "Bad-Channel categories to patch"}
LArBadChannelMask m_bcMaskSC
Gaudi::Property< std::vector< std::string > > m_problemsToMaskSC {this,"ProblemsToMaskSC",{}, "Bad-Channel categories to mask"}
SG::ReadHandleKey< LArDigitContainerm_digitsKey {this, "DigitsKey", "FREE", "key for LArDigitContainer"}
SG::ReadHandleKey< LArRawChannelContainerm_channelsKey {this, "ChannelsKey", "LArRawChannels", "key for LArRawChannels"}
SG::ReadHandleKey< LArDigitContainerm_digitsKeySC {this, "DigitsKeySC", "SC_ADC_BAS", "key for LArDigitContainer for SC"}
SG::ReadHandleKey< LArRawSCContainerm_rawscKey {this, "RawSCKey", "SC_ET_ID", "key for LArRawSCContainer"}
SG::ReadHandleKey< LArRawSCContainerm_rawRecomputedscKey {this, "RecomputedSCKey", "SC_ET_RECO", "key for recomputed LArRawSCContainer"}
SG::ReadCondHandleKey< LArADC2MeVm_adc2mevKey {this,"ADC2MeVKey","LArADC2MeV","SG Key of ADC2MeV conditions object"}
PublicToolHandle< Trig::TrigDecisionToolm_trigDec {this, "TrigDecisionTool", "", "Handle to the TrigDecisionTool"}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKeySC {this,"CablingKeySC","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object for SC"}
SG::ReadCondHandleKey< LArBadChannelContm_BCKey {this, "BadChanKey", "LArBadChannel", "SG bad channels key"}
SG::ReadCondHandleKey< LArBadChannelContm_BCKeySC {this, "BadChanKeySC", "LArBadChannelSC", "SG bad channels key"}
SG::ReadCondHandleKey< CaloNoisem_noiseCDOKey {this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}
SG::ReadCondHandleKey< BunchCrossingCondDatam_bcDataKey {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"}
SG::ReadCondHandleKey< ILArPedestalm_pedestalKey {this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"}
SG::ReadCondHandleKey< ILArPedestalm_pedestalKeySC {this,"PedestalKeySC","LArPedestalSC","SG Key of LArPedestal object"}
SG::ReadCondHandleKey< ILArAutoCorrm_acorrKey {this,"AutocorrKey","LArAutoCorr","SG Key of LArAutoCorr object"}
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
SG::ReadCondHandleKey< CaloSuperCellDetDescrManagerm_caloSuperCellMgrKey
const LArOnlineIDm_onlineHelper
const LArOnline_SuperCellIDm_onlineHelperSC
bool m_doStream
bool m_doTrigger
bool m_doOFCIter
bool m_doAllEvents
bool m_doRoIs
bool m_doAllLvl1
bool m_dumpChannelInfos
bool m_doEM
bool m_doHEC
bool m_doFCAL
bool m_doSC
bool m_gains [CaloGain::LARNGAIN] {}
bool m_onlyEmptyBC
LArSamples::DataStorem_samples
std::unique_ptr< LArSamples::RunDatam_runData
std::vector< const Trig::ChainGroup * > m_triggerGroups
TRandom m_random
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArShapeDumper()

LArShapeDumper::LArShapeDumper ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 42 of file LArShapeDumper.cxx.

42 :
43 AthAlgorithm(name, pSvcLocator),
44 m_count(0),
47 m_nLArError(0),
48 m_nNoDigits(0),
50 m_onlineHelper(nullptr),
51 m_onlineHelperSC(nullptr),
52 m_doEM(false),
53 m_doHEC(false),
54 m_doFCAL(false),
55 m_doSC(false),
56 m_samples(nullptr)
57{
58 declareProperty("FileName", m_fileName = "samples.root");
59 declareProperty("MaxChannels", m_maxChannels = 200000);
60 declareProperty("Prescale", m_prescale = 1);
61 declareProperty("CaloType", m_caloType = "EMHECFCALSC");
62 declareProperty("EnergyCut", m_energyCut = -1);
63 declareProperty("EnergyCutSC", m_energyCutSC = -1);
64 declareProperty("NoiseSignifCut", m_noiseSignifCut = 3);
65 declareProperty("MinADCMax", m_minADCMax = -1);
66 declareProperty("MinADCMaxSC", m_minADCMaxSC = -1);
67 declareProperty("Gains", m_gainSpec = "HIGH,MEDIUM,LOW");
68 declareProperty("DumpDisconnected", m_dumpDisc = false);
69 declareProperty("DoStream", m_doStream = false);
70 declareProperty("DoTrigger", m_doTrigger = true);
71 declareProperty("DoOFCIter", m_doOFCIter = true);
72 declareProperty("DoAllEvents", m_doAllEvents = true);
73 declareProperty("DumpChannelInfos", m_dumpChannelInfos = false);
74 declareProperty("DoRoIs", m_doRoIs = true);
75 declareProperty("TriggerNames", m_triggerNames);
76 declareProperty("DoAllLvl1", m_doAllLvl1 = true);
77 declareProperty("onlyEmptyBC",m_onlyEmptyBC=false);
78
79 m_bcMaskSC.setSC();
80}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::string m_gainSpec
unsigned m_maxChannels
std::vector< std::string > m_triggerNames
unsigned m_nPrescaledAway
unsigned m_nLArError
std::string m_caloType
double m_noiseSignifCut
LArSamples::DataStore * m_samples
const LArOnlineID * m_onlineHelper
unsigned m_nNoDigits
LArBadChannelMask m_bcMaskSC
const LArOnline_SuperCellID * m_onlineHelperSC
unsigned m_nWrongBunchGroup
std::string m_fileName
unsigned m_nNoDigitsSC

◆ ~LArShapeDumper()

LArShapeDumper::~LArShapeDumper ( )

Definition at line 83 of file LArShapeDumper.cxx.

84{
85}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LArShapeDumper::execute ( )
overridevirtual

Definition at line 218 of file LArShapeDumper.cxx.

219{
220 m_count++;
221 const EventContext& ctx = Gaudi::Hive::currentContext();
222 if ((m_prescale > 1 && m_random.Rndm() > 1.0/m_prescale) || m_prescale <= 0) {
223 ATH_MSG_VERBOSE ( "======== prescaling event "<< m_count << " ========" );
225 return StatusCode::SUCCESS;
226 }
227
228 ATH_MSG_VERBOSE ( "======== executing event "<< m_count << " ========" );
229
230 const xAOD::EventInfo* eventInfo = nullptr;
231 ATH_CHECK( evtStore()->retrieve(eventInfo) );
232
233 int event = eventInfo->eventNumber();
234 int run = eventInfo->runNumber();
235 int lumiBlock = eventInfo->lumiBlock();
236 int bunchId = eventInfo->bcid();
237
238
240 ATH_MSG_DEBUG("Ignoring Event b/c of LAr ERROR");
241 m_nLArError++;
242 return StatusCode::SUCCESS;
243 }
244
245
246 SG::ReadCondHandle<BunchCrossingCondData> bccd (m_bcDataKey,ctx);
247 const BunchCrossingCondData* bunchCrossing=*bccd;
248 if (!bunchCrossing) {
249 ATH_MSG_ERROR("Failed to retrieve Bunch Crossing obj");
250 return StatusCode::FAILURE;
251 }
252
253 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
254 ATH_CHECK(caloMgrHandle.isValid());
255 const CaloDetDescrManager* caloMgr = *caloMgrHandle;
256
257 if (m_onlyEmptyBC) {
258 if (!bccd->isFilled(bunchId)) {
259 ATH_MSG_DEBUG("Ignoring Event with bunch crossing type ");
261 return StatusCode::SUCCESS;
262 }
263 }
264
265
266 EventData* eventData = nullptr;
267 int eventIndex = -1;
268 if (m_doAllEvents) {
269 eventIndex = makeEvent(eventData, run, event, lumiBlock, bunchId);
270 if (eventIndex < 0) return StatusCode::FAILURE;
271 }
272
273 SG::ReadHandle<LArDigitContainer> hdlDigit(m_digitsKey, ctx);
274 if(!hdlDigit.isValid()) {
275 ATH_MSG_WARNING( "Unable to retrieve LArDigitContainer with key " << m_digitsKey << " from DetectorStore. " );
276 return StatusCode::SUCCESS;
277 } else
278 ATH_MSG_DEBUG( "Got LArDigitContainer with key " << m_digitsKey.key() );
279 const LArDigitContainer* larDigitContainer = &(*hdlDigit);
280
281 if (larDigitContainer->empty()) {
282 ATH_MSG_WARNING ( "LArDigitContainer with key=" << m_digitsKey.key() << " is empty!" );
283 m_nNoDigits++;
284 return StatusCode::SUCCESS;
285 }
286
287 SG::ReadHandle<LArRawChannelContainer> hdlRaw(m_channelsKey, ctx);
288 if(!hdlRaw.isValid()) {
289 ATH_MSG_WARNING( "Unable to retrieve LArRawChannelsContainer with key " << m_channelsKey.key() << " from DetectorStore. " );
290 return StatusCode::SUCCESS;
291 } else
292 ATH_MSG_DEBUG( "Got LArRawChannelsContainer with key " << m_channelsKey.key() );
293 const LArRawChannelContainer* rawChannelContainer = &(*hdlRaw);;
294
295 if (rawChannelContainer->empty()) {
296 ATH_MSG_WARNING ( "LArRawChannelContainer with key=" << m_channelsKey << " is empty!" );
297 m_nNoDigits++;
298 return StatusCode::SUCCESS;
299 }
300
301
302
303 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
304 const LArOnOffIdMapping* cabling=*cablingHdl;
305 if(!cabling) {
306 ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping" );
307 return StatusCode::FAILURE;
308 }
309
310 SG::ReadCondHandle<LArADC2MeV> adc2mevHdl(m_adc2mevKey, ctx);
311 const LArADC2MeV* adc2MeV=*adc2mevHdl;
312 if(!adc2MeV) {
313 ATH_MSG_ERROR( "Failed to retreive ADC2MeV cond obj" );
314 return StatusCode::FAILURE;
315 }
316
317 SG::ReadCondHandle<ILArPedestal> pedHdl(m_pedestalKey, ctx);
318 const ILArPedestal* pedestals=*pedHdl;
319 if (!pedestals) {
320 ATH_MSG_ERROR("Failed to retrieve pedestal cond obj");
321 return StatusCode::FAILURE;
322 }
323
324 const ILArAutoCorr* aCorr=nullptr;
325 if(m_dumperTool->doShape()) {
326 SG::ReadCondHandle<ILArAutoCorr> acorrHdl(m_acorrKey, ctx);
327 aCorr=*acorrHdl;
328 if (!aCorr) {
329 ATH_MSG_ERROR("Failed to retrieve AutoCorr cond obj");
330 return StatusCode::FAILURE;
331 }
332 }
333
334 SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey};
335 const LArBadChannelCont *bcCont {*readHandle};
336 if(!bcCont) {
337 ATH_MSG_ERROR( "Do not have Bad chan container " << m_BCKey.key() );
338 return StatusCode::FAILURE;
339 }
340
341 const LArOFIterResultsContainer* ofIterResult = nullptr;
342 if (m_doOFCIter) {
343 if (evtStore()->contains<LArOFIterResultsContainer> ("LArOFIterResult")) {
344 ATH_CHECK( evtStore()->retrieve(ofIterResult, "LArOFIterResult") );
345 } else {
346 ATH_MSG_WARNING("Do not have LArOFIterResult in this event");
347 }
348 }
349
350 const LArFebErrorSummary* larFebErrorSummary = nullptr;
351 ATH_CHECK( evtStore()->retrieve(larFebErrorSummary, "LArFebErrorSummary") );
352 const std::map<unsigned int,uint16_t>& febErrorMap = larFebErrorSummary->get_all_febs();
353 std::map<unsigned int, const LArRawChannel*> channelsToKeep;
354
355 for (LArRawChannelContainer::const_iterator channel = rawChannelContainer->begin();
356 channel != rawChannelContainer->end(); ++channel)
357 {
358 if (m_energyCut > 0 && TMath::Abs(channel->energy()) < m_energyCut) continue;
359 if (m_bcMask.cellShouldBeMasked(bcCont,channel->channelID())) continue;
360
361 IdentifierHash hash = m_onlineHelper->channel_Hash(channel->channelID());
362
363 if (!hash.is_valid()) {
364 ATH_MSG_FATAL ( "Found a LArRawChannel whose HWIdentifier (" << channel->channelID()
365 << ") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
366 return StatusCode::FAILURE;
367 }
368 channelsToKeep[hash] = &*channel;
369 if (m_dumpChannelInfos) {
370 HistoryContainer* histCont = m_samples->hist_cont(hash);
371 CellInfo* info = nullptr;
372 if (!histCont) {
373 HWIdentifier channelID = channel->hardwareID();
374 const Identifier id = cabling->cnvToIdentifier(channelID);
375 const CaloDetDescrElement* caloDetElement = caloMgr->get_element(id);
376 info = m_dumperTool->makeCellInfo(channelID, id, caloDetElement);
377 if (!info) continue;
378 m_samples->makeNewHistory(hash, info);
379 }
380 }
381 }
382
383 std::map<HWIdentifier, LArOFIterResultsContainer::const_iterator> ofcResultPosition;
384 if (m_doOFCIter && ofIterResult) {
385 for (LArOFIterResultsContainer::const_iterator ofResult = ofIterResult->begin();
386 ofResult != ofIterResult->end(); ++ofResult)
387 ofcResultPosition[ofResult->getChannelID()] = ofResult;
388
389 ATH_MSG_DEBUG ( "njpbSizes : " << larDigitContainer->size()
390 << " " << (ofIterResult ? ofIterResult->size() : 0) << " "
391 << rawChannelContainer->size() << " " << channelsToKeep.size() );
392 }
393 SG::ReadCondHandle<CaloNoise> noiseHdl{m_noiseCDOKey};
394 const CaloNoise* noiseCDO=*noiseHdl;
395
396 for (LArDigitContainer::const_iterator digit = larDigitContainer->begin();
397 digit != larDigitContainer->end(); ++digit)
398 {
399 //Check Energy selection
400 IdentifierHash hash = m_onlineHelper->channel_Hash((*digit)->channelID());
401
402 std::map<unsigned int, const LArRawChannel*>::const_iterator findChannel = channelsToKeep.find(hash);
403 if (findChannel == channelsToKeep.end()) continue;
404 const LArRawChannel* rawChannel = findChannel->second;
405
406 //Check detector part
407 HWIdentifier channelID = (*digit)->hardwareID();
408 if ((m_onlineHelper->isEMBchannel(channelID) || m_onlineHelper->isEMECchannel(channelID)) && !m_doEM) continue;
409 if (m_onlineHelper->isHECchannel(channelID) && !m_doHEC) continue;
410 if (m_onlineHelper->isFCALchannel(channelID) && !m_doFCAL) continue;
411
412 //Check gain
413 CaloGain::CaloGain gain=(*digit)->gain();
414 if (gain >= CaloGain::LARNGAIN || m_gains[gain] == false) continue;
415
416 //Check if connected
417 const bool connected = cabling->isOnlineConnected(channelID);
418 if (!connected && !m_dumpDisc) continue;
419
420 // Check ADCMax selection
421 float pedestal = pedestals->pedestal(channelID, gain);
422 float pedestalRMS = pedestals->pedestalRMS(channelID, gain);
423 if (m_minADCMax > 0 || m_noiseSignifCut > 0) {
424 const std::vector<short>& samples = (*digit)->samples();
425 double maxValue = -1;
426 for (short sample : samples)
427 if (sample - pedestal > maxValue) maxValue = sample - pedestal;
428 if (m_minADCMax > 0 && fabs(maxValue) < m_minADCMax) continue;
429 if (m_noiseSignifCut > 0 && fabs(maxValue) < pedestalRMS*m_noiseSignifCut) continue;
430 }
431
432 const Identifier id = cabling->cnvToIdentifier(channelID);
433 const CaloDetDescrElement* caloDetElement = nullptr;
434
435 HistoryContainer* histCont = m_samples->hist_cont(hash);
436 CellInfo* info = nullptr;
437 if (!histCont) {
438 if (!caloDetElement) caloDetElement = caloMgr->get_element(id);
439 info = m_dumperTool->makeCellInfo(channelID, id, caloDetElement);
440 if (!info) continue;
441 histCont = m_samples->makeNewHistory(hash, info);
442 }
443 else
444 info = histCont->cell_info();
445
446 float noise = -1;
447 unsigned int status = 0xFFFFFFFF;
448 if (connected) {
449 if (!caloDetElement) caloDetElement = caloMgr->get_element(id);
450 noise = noiseCDO->getNoise(id,gain);
451 status = bcCont->status(channelID).packedData();
452 HWIdentifier febId = m_onlineHelper->feb_Id(m_onlineHelper->feedthrough_Id(channelID), m_onlineHelper->slot(channelID));
453 std::map<unsigned int,uint16_t>::const_iterator findError = febErrorMap.find(febId.get_identifier32().get_compact());
454 if (findError != febErrorMap.end()) {
455 unsigned int febErrWord = findError->second;
456 status = status & (febErrWord >> 17);
457 }
458 }
459
460 //std::vector<float> autoCorr;
462 if (m_dumperTool->doShape()) {
463 const LArAutoCorrComplete* autoCorrObj = dynamic_cast<const LArAutoCorrComplete*>(aCorr);
464 if (!autoCorrObj)
465 ATH_MSG_WARNING ( "AutoCorr object is not of type LArAutoCorrComplete!" );
466 else
467 autoCorr = autoCorrObj->autoCorr(channelID, gain);
468 }
469
470 if (!info->shape((*digit)->gain())) // this happens if doAllShapes is off
471 info->setShape((*digit)->gain(), m_dumperTool->retrieveShape(channelID, gain));
472
473 if (!eventData) {
474 eventIndex = makeEvent(eventData, run, event, lumiBlock, bunchId); // this happens if doAllEvents is off
475 if (eventIndex < 0) return StatusCode::FAILURE;
476 }
477
478 DataContainer* data =
479 new DataContainer((*digit)->gain(), (*digit)->samples(),
480 rawChannel->energy(),
481 rawChannel->time()/double(1000),
482 rawChannel->quality(),
483 eventIndex,
484 autoCorr,
485 noise, pedestal, pedestalRMS, status);
486
487 // std::map<HWIdentifier, LArOFIterResultsContainer::const_iterator>::const_iterator findResult = ofcResultPosition.find(channelID);
488// if (findResult != ofcResultPosition.end()) {
489// LArOFIterResultsContainer::const_iterator ofResult = findResult->second;
490// if (ofResult->getValid() && ofResult->getConverged())
491// data->setADCMax(ofResult->getAmplitude());
492// }
493// else
494// msg() << MSG::INFO << "OFResult for channel 0x" << MSG::hex << channelID << MSG::dec
495// << " not found. (size was " << ofcResultPosition.size() << ")" << endmsg;
496
497
498 const auto ramp=adc2MeV->ADC2MEV(channelID,gain); //dudu
499 data->setADCMax(rawChannel->energy()/ramp[1]); //pow(ADCPeak,i); //dudu
500
501
502 histCont->add(data);
503 }
504
505 if(m_doSC) {
506 std::map<unsigned int, const LArRawSC*> scToKeep;
507
508 SG::ReadHandle<LArRawSCContainer> hdlSC(m_rawscKey, ctx);
509 if(!hdlSC.isValid()) {
510 ATH_MSG_WARNING( "Unable to retrieve LArRawSCContainer with key " << m_rawscKey << " from EventStore. " );
511 return StatusCode::SUCCESS;
512 } else
513 ATH_MSG_DEBUG( "Got LArRawSCContainer with key " << m_rawscKey.key() );
514
515 if (hdlSC->empty()) {
516 ATH_MSG_WARNING ( "LArRawSCContainer with key=" << m_rawscKey.key() << " is empty!" );
517 return StatusCode::SUCCESS;
518 }
519
520 SG::ReadHandle<LArRawSCContainer> hdlrecoSC(m_rawRecomputedscKey, ctx);
521 if(!hdlrecoSC.isValid()) {
522 ATH_MSG_WARNING( "Unable to retrieve LArRawSCContainer with key " << m_rawRecomputedscKey << " from EventStore. " );
523 return StatusCode::SUCCESS;
524 } else
525 ATH_MSG_DEBUG( "Got LArRawSCContainer with key " << m_rawRecomputedscKey.key() );
526
527 if (hdlrecoSC->empty()) {
528 ATH_MSG_WARNING ( "LArRawSCContainer with key=" << m_rawRecomputedscKey.key() << " is empty!" );
529 return StatusCode::SUCCESS;
530 }
531
532 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC, ctx};
533 const LArOnOffIdMapping* cablingSC=*cablingHdl;
534 if(!cablingSC) {
535 ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping" );
536 return StatusCode::FAILURE;
537 }
538
539 SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloMgrHandle{m_caloSuperCellMgrKey};
540 ATH_CHECK(caloMgrHandle.isValid());
541 const CaloSuperCellDetDescrManager* caloMgrSC = *caloMgrHandle;
542
543 SG::ReadCondHandle<ILArPedestal> pedHdl(m_pedestalKeySC, ctx);
544 const ILArPedestal* pedestalsSC=*pedHdl;
545 if (!pedestals) {
546 ATH_MSG_ERROR("Failed to retrieve pedestal cond obj for SC");
547 return StatusCode::FAILURE;
548 }
549
550 std::map<unsigned int, std::pair<float, std::pair<float,float> > > channelsToKeepSC;
551
552 for (const LArRawSC* rawSC : *hdlSC) { // from bytestream
553
554 // is SC masked ?
555 if (m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID())) continue;
556
557 const std::vector<unsigned short>& bcids = rawSC->bcids();
558 const std::vector<int>& energies = rawSC->energies();
559 const std::vector<bool>& satur = rawSC->satur();
560
561 // Look for bcid:
562 float scEne = 0;
563 float defValue = -99999999.;
564
565 const size_t nBCIDs = bcids.size();
566 size_t i = 0;
567 for (i = 0; i < nBCIDs && bcids[i] != bunchId; i++)
568 ;
569 if(i==nBCIDs) continue;
570 if (satur[i]) continue;
571
572 scEne = energies[i];
573 if (m_energyCutSC > 0 && TMath::Abs(scEne) < m_energyCutSC) continue;
574 if (m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID())) continue;
575
576 IdentifierHash hash = m_onlineHelperSC->channel_Hash(rawSC->hardwareID());
577
578 if (!hash.is_valid()) {
579 ATH_MSG_FATAL ( "Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
580 << ") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
581 return StatusCode::FAILURE;
582 }
583
584 channelsToKeepSC[hash] = std::make_pair(scEne, std::make_pair(defValue,defValue));
585
586 if (m_dumpChannelInfos) {
587 HistoryContainer* histCont = m_samples->hist_cont_sc(hash);
588 CellInfo* info = nullptr;
589 if (!histCont) {
590 HWIdentifier channelID = rawSC->hardwareID();
591 const Identifier id = cablingSC->cnvToIdentifier(channelID);
592 const CaloDetDescrElement* caloDetElement = caloMgrSC->get_element(id);
593 info = m_dumperToolSC->makeCellInfo(channelID, id, caloDetElement);
594 if (!info) continue;
595 m_samples->makeNewHistorySC(hash, info);
596 }
597 }
598 }
599 ATH_MSG_INFO("SC to keep in this event: "<<channelsToKeepSC.size());
600
601 for (const LArRawSC* rawSC : *hdlrecoSC) { //reconstructed
602
603 if (m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID())) continue;
604 IdentifierHash hash = m_onlineHelperSC->channel_Hash(rawSC->hardwareID());
605 if (!hash.is_valid()) {
606 ATH_MSG_FATAL ( "Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
607 << ") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
608 return StatusCode::FAILURE;
609 }
610
611 // do we keep this SC ?
612 if (channelsToKeepSC.find(hash) == channelsToKeepSC.end()) continue;
613
614 const std::vector<unsigned short>& bcids = rawSC->bcids();
615 const std::vector<int>& energies = rawSC->energies();
616 const std::vector<int>& tauenergies = rawSC->tauEnergies();
617
618 // Look for bcid:
619 float scEne = 0;
620 float scTim = -99999999.;
621
622 const size_t nBCIDs = bcids.size();
623 size_t i = 0;
624 for (i = 0; i < nBCIDs && bcids[i] != bunchId; i++)
625 ;
626 if(i==nBCIDs) continue;
627
628 scEne = energies[i];
629
630 if(tauenergies.size() && scEne != 0) scTim = tauenergies[i] / scEne;
631
632 channelsToKeepSC[hash].second = std::make_pair(scEne, scTim);
633
634 if (m_dumpChannelInfos) {
635 HistoryContainer* histCont = m_samples->hist_cont_sc(hash);
636 CellInfo* info = nullptr;
637 if (!histCont) {
638 HWIdentifier channelID = rawSC->hardwareID();
639 const Identifier id = cablingSC->cnvToIdentifier(channelID);
640 const CaloDetDescrElement* caloDetElement = caloMgrSC->get_element(id);
641 info = m_dumperToolSC->makeCellInfo(channelID, id, caloDetElement);
642 if (!info) continue;
643 m_samples->makeNewHistorySC(hash, info);
644 }
645 }
646 }
647
648 SG::ReadHandle<LArDigitContainer> hdlSCDigit(m_digitsKeySC, ctx);
649 if(!hdlSCDigit.isValid()) {
650 ATH_MSG_WARNING( "Unable to retrieve LArDigitContainer with key " << m_digitsKeySC << " from DetectorStore. " );
651 return StatusCode::SUCCESS;
652 } else
653 ATH_MSG_DEBUG( "Got LArDigitContainer with key " << m_digitsKeySC.key() );
654 const LArDigitContainer* larSCDigitContainer = &(*hdlSCDigit);
655
656 if (larSCDigitContainer->empty()) {
657 ATH_MSG_WARNING ( "LArDigitContainer with key=" << m_digitsKeySC.key() << " is empty!" );
659 return StatusCode::SUCCESS;
660 }
661
662 for (LArDigitContainer::const_iterator digit = larSCDigitContainer->begin();
663 digit != larSCDigitContainer->end(); ++digit)
664 {
665 //Check Energy selection
666 IdentifierHash hash = m_onlineHelperSC->channel_Hash((*digit)->channelID());
667
668 std::map<unsigned int, std::pair<float, std::pair<float,float> > >::const_iterator findChannel = channelsToKeepSC.find(hash);
669 if (findChannel == channelsToKeepSC.end()) continue;
670
671 // Check ADCMax selection
672 float pedestal = pedestalsSC->pedestal((*digit)->channelID(), 0);
673 if (m_minADCMaxSC > 0 ) {
674 const std::vector<short>& samples = (*digit)->samples();
675 double maxValue = -1;
676 for (short sample : samples)
677 if (sample - pedestal > maxValue) maxValue = sample - pedestal;
678 if (fabs(maxValue) < m_minADCMax) continue;
679 }
680
681 const Identifier id = cablingSC->cnvToIdentifier((*digit)->channelID());
682 const CaloDetDescrElement* caloDetElement = nullptr;
683
684 HistoryContainer* histCont = m_samples->hist_cont_sc(hash);
685 CellInfo* info = nullptr;
686 if (!histCont) {
687 if (!caloDetElement) caloDetElement = caloMgrSC->get_element(id);
688 info = m_dumperToolSC->makeCellInfo((*digit)->channelID(), id, caloDetElement);
689 if (!info) continue;
690 histCont = m_samples->makeNewHistorySC(hash, info);
691 }
692 else
693 info = histCont->cell_info();
694
695 if (!eventData) {
696 eventIndex = makeEvent(eventData, run, event, lumiBlock, bunchId); // this happens if doAllEvents is off
697 if (eventIndex < 0) return StatusCode::FAILURE;
698 }
699
700 DataContainer* data =
701 new DataContainer((*digit)->gain(), (*digit)->samples(),
702 findChannel->second.first,
703 findChannel->second.second.second,
704 findChannel->second.second.first,
705 eventIndex,
706 LArVectorProxy(),
707 -1, pedestal, 0, 0);
708
709
710 histCont->add(data);
711 }
712
713 } //m_doSC
714
715 return StatusCode::SUCCESS;
716}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define maxValue(current, test)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
LArBadXCont< LArBadChannel > LArBadChannelCont
LArFebErrorSummary
Definition LArTPCnv.cxx:56
Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old LArRawChannelContainer
Definition LArTPCnv.cxx:86
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:34
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
LArVectorProxy AutoCorrRef_t
virtual float pedestal(const HWIdentifier &id, int gain) const =0
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
Definition LArADC2MeV.h:32
virtual AutoCorrRef_t autoCorr(const HWIdentifier &CellID, int gain) const
BitWord packedData() const
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
const std::map< unsigned int, uint16_t > & get_all_febs() const
get all febs with error
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
int time() const
uint16_t quality() const
int energy() const
void add(const DataContainer *data)
append data (takes ownership)
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKeySC
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadHandleKey< LArRawSCContainer > m_rawscKey
ToolHandle< ILArShapeDumperTool > m_dumperToolSC
SG::ReadHandleKey< LArRawSCContainer > m_rawRecomputedscKey
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
int makeEvent(LArSamples::EventData *&eventData, int run, int event, int lumiBlock, int bunchXing) const
ToolHandle< ILArShapeDumperTool > m_dumperTool
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
LArBadChannelMask m_bcMask
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::ReadCondHandleKey< ILArAutoCorr > m_acorrKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
bool m_gains[CaloGain::LARNGAIN]
SG::ReadHandleKey< LArRawChannelContainer > m_channelsKey
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
SG::ReadHandleKey< LArDigitContainer > m_digitsKeySC
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
SG::ReadHandleKey< LArDigitContainer > m_digitsKey
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.
uint32_t runNumber() const
The current event's run number.
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
uint64_t eventNumber() const
The current event's event number.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
@ LARNGAIN
Definition CaloGain.h:19
thread_local event_number_t eventIndex
status
Definition merge.py:16
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
EventInfo_v1 EventInfo
Definition of the latest event info version.
setTeId lumiBlock

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode LArShapeDumper::finalize ( )
overridevirtual

Definition at line 726 of file LArShapeDumper.cxx.

727{
728 ATH_MSG_DEBUG ("in finalize() ");
729
730 if (m_prescale>1) ATH_MSG_INFO("Prescale dropped " << m_nPrescaledAway << "/" << m_count << " events");
731 if (m_onlyEmptyBC) ATH_MSG_INFO("Dropped " << m_nWrongBunchGroup << "/" << m_count << " events b/c of wrong bunch group");
732 ATH_MSG_INFO("Dropped " << m_nLArError << "/" << m_count << " Events b/c of LAr Veto (Noise burst or corruption)");
733
734
735 int n = 0;
736 for (unsigned int i = 0; i < m_samples->nChannels(); i++)
737 if (m_samples->historyContainer(i)) {
738 if (m_samples->historyContainer(i)->cellInfo() == nullptr)
739 ATH_MSG_INFO ( "Cell with no cellInfo at index " << i << " !!" );
740 //else if (m_samples->historyContainer(i)->cellInfo()->shape() == 0)
741 //msg() << MSG::INFO << "Cell with no ShapeInfo at index " << i << " !!" << endmsg;
742 //msg() << MSG::INFO << "Non-zero cell at index " << i << " " << m_samples->shape(i)->size() << endmsg;
743 n++;
744 }
745
746 //for (unsigned int i = 0; i < m_samples->nEvents(); i++) {
747 // msg() << MSG::INFO << "Event " << i << " = "
748 // << m_samples->eventData(i)->run() << " " << m_samples->eventData(i)->event()
749 // << "trigger = " << m_samples->eventData(i)->triggers() << ", nRoIs = " << m_samples->eventData(i)->nRoIs() << endmsg;
750 // }
751 ATH_MSG_INFO ( "Non-zero cells = " << n << ", footprint = " << m_samples->footprint() );
752 ATH_MSG_INFO ( "Writing..." );
753
754 if (!m_doStream) {
755 m_samples->writeTrees(m_fileName.c_str());
756/* TFile* f = TFile::Open(m_fileName.c_str(), "RECREATE");
757 msg() << MSG::INFO << "Writing (2)..." << endmsg;
758 f->WriteObjectAny(m_samples, "Container", "LArSamples");
759 msg() << MSG::INFO << "Closing..." << endmsg;
760 f->Close();
761 msg() << MSG::INFO << "Deleting..." << endmsg;
762 delete m_samples;*/
763 msg() << MSG::INFO << "Done!" << endmsg;
764 }
765
766 return StatusCode::SUCCESS;
767}
#define endmsg
MsgStream & msg() const

◆ initialize()

StatusCode LArShapeDumper::initialize ( )
overridevirtual

Get bad-channel mask (only if jO IgnoreBadChannels is true)

Definition at line 88 of file LArShapeDumper.cxx.

89{
90 ATH_MSG_DEBUG ("in initialize()");
91
92 m_samples = new DataStore();
93
94 std::transform(m_caloType.begin(), m_caloType.end(), m_caloType.begin(), toupper);
95 m_doEM = (m_caloType.find("EM") != std::string::npos);
96 m_doHEC = (m_caloType.find("HEC") != std::string::npos);
97 m_doFCAL = (m_caloType.find("FCAL") != std::string::npos);
98 m_doSC = (m_caloType.find("SC") != std::string::npos);
99
100 ATH_CHECK( m_cablingKey.initialize() );
101 ATH_CHECK( m_BCKey.initialize() );
102 ATH_CHECK( m_BCKeySC.initialize(m_doSC) );
103 ATH_CHECK( m_noiseCDOKey.initialize() );
104 ATH_CHECK( m_adc2mevKey.initialize() );
105 ATH_CHECK( m_pedestalKey.initialize() );
106 ATH_CHECK( m_bcDataKey.initialize() );
107
108 ATH_CHECK( m_digitsKey.initialize() );
109 ATH_CHECK( m_channelsKey.initialize() );
110
111 ATH_CHECK( m_digitsKeySC.initialize(m_doSC) );
112 ATH_CHECK( m_rawscKey.initialize(m_doSC) );
114 ATH_CHECK( m_cablingKeySC.initialize(m_doSC) );
115 ATH_CHECK( m_pedestalKeySC.initialize(m_doSC) );
116
117 ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
118 ATH_CHECK(m_caloMgrKey.initialize());
120 if(m_doSC) ATH_CHECK( detStore()->retrieve(m_onlineHelperSC, "LArOnline_SuperCellID") );
121
123 ATH_CHECK(m_bcMask.buildBitMask(m_problemsToMask,msg()));
124 if(m_doSC) ATH_CHECK(m_bcMaskSC.buildBitMask(m_problemsToMaskSC,msg()));
125
126
127 if (m_doTrigger) {
128 CHECK( m_trigDec.retrieve() );
129 }
130
131 ATH_CHECK( m_dumperTool.retrieve() );
132
133 ATH_CHECK(m_acorrKey.initialize(m_dumperTool->doShape()) );
134
135 std::transform(m_gainSpec.begin(), m_gainSpec.end(), m_gainSpec.begin(), toupper);
136 m_gains[CaloGain::LARHIGHGAIN] = (m_gainSpec.find("HIGH") != std::string::npos);
137 m_gains[CaloGain::LARMEDIUMGAIN] = (m_gainSpec.find("MEDIUM") != std::string::npos);
138 m_gains[CaloGain::LARLOWGAIN] = (m_gainSpec.find("LOW") != std::string::npos);
139
140 //if (m_onlyEmptyBC)
141 //ATH_CHECK(m_bcidTool.retrieve());
142
143 return StatusCode::SUCCESS;
144}
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::vector< std::string > > m_problemsToMask
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKeySC
Gaudi::Property< std::vector< std::string > > m_problemsToMaskSC
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ makeEvent()

int LArShapeDumper::makeEvent ( LArSamples::EventData *& eventData,
int run,
int event,
int lumiBlock,
int bunchXing ) const

Definition at line 770 of file LArShapeDumper.cxx.

773{
774 std::vector<unsigned int> triggerWords;
775 if (m_doTrigger) {
776 const ROIB::RoIBResult* l1Result = nullptr;
777 if (evtStore()->retrieve(l1Result).isFailure() || !l1Result) {
778 ATH_MSG_FATAL ( "Could not retrieve RoIBResult!" );
779 return -1;
780 }
781 const std::vector<ROIB::CTPRoI> tav = l1Result->cTPResult().TAV();
782 for (const ROIB::CTPRoI& word : tav)
783 triggerWords.push_back(word.roIWord());
784
785 for (const std::pair<const TString, unsigned int>& p : m_runData->triggerConfig()) {
786 while (triggerWords.size() <= p.second/32) triggerWords.push_back(0);
787 if (m_trigDec->isPassed(p.first.Data())) {
788 triggerWords[p.second/32] |= (0x1 << (p.second % 32));
789 //msg() << MSG::INFO << "Trigger line " << p.first.Data() << " passed" << endmsg;
790 }
791 }
792 //msg() << MSG::INFO << "Trigger words : ";
793 //for (unsigned int i = 0; i < triggerWords.size(); i++) msg() << MSG::INFO << triggerWords[i] << " ";
794 //msg() << MSG::INFO << endmsg;
795 }
796
797 eventData = new EventData(event, 0, lumiBlock, bunchXing);
798 if (m_runData->run() == 0) m_runData->setRun(run);
799 eventData->setRunData(m_runData.get());
800 eventData->setTriggerData(triggerWords);
801 if (m_doRoIs) {
802 //msg() << MSG::INFO << "Filling RoI list" << endmsg;
803 for (const Trig::ChainGroup* group : m_triggerGroups) {
804 std::vector<Trig::Feature<TrigRoiDescriptor> > roIs = group->features().get<TrigRoiDescriptor>();
805 for (const Trig::Feature<TrigRoiDescriptor>& roI : roIs) {
806 //msg() << MSG::INFO << "Found an roi for chain ";
807 //for (unsigned int i = 0; i < group->getListOfTriggers().size(); i++) cout << group->getListOfTriggers()[i] << " ";
808 //cout << "@ " << roI.cptr()->eta() << ", " << roI.cptr()->phi() << ", TE = "
809 // << roI.te()->getId() << " " << Trig::getTEName(*roI.te()) << " with label " << roI.label() << endmsg;
810 eventData->addRoI(roI.cptr()->eta(), roI.cptr()->phi(), group->getListOfTriggers()[0].c_str(), roI.label().c_str());
811 //msg() << MSG::INFO << "nRoIs so far = " << eventData->nRoIs() << endmsg;
812 }
813 }
814 }
815 return m_samples->addEvent(eventData);
816}
Athena::TPCnvVers::Current TrigRoiDescriptor
void setTriggerData(const std::vector< unsigned int > &words)
Definition EventData.cxx:75
void addRoI(float eta, float phi, const char *name="", const char *label="")
std::vector< const Trig::ChainGroup * > m_triggerGroups
std::unique_ptr< LArSamples::RunData > m_runData
const std::vector< CTPRoI > TAV() const
get trigger result after veto
const CTPResult & cTPResult() const
Gets the CTP part of the L1 RDO.

◆ msg()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ start()

StatusCode LArShapeDumper::start ( )
overridevirtual

Definition at line 147 of file LArShapeDumper.cxx.

148{
149 m_runData = std::make_unique<RunData>(0);
150
151 if (m_doTrigger) {
152 std::vector<std::regex> regexs;
153 regexs.reserve(m_triggerNames.size());
154for (const std::string& name : m_triggerNames) {
155 regexs.push_back(std::regex(name));
156 }
157
158 std::vector<std::string> chains = m_trigDec->getListOfTriggers();
159 std::vector<std::string> myChains;
160 std::cmatch match;
161
162 for (const std::string& chain : chains) {
163 ATH_MSG_INFO ( "Configured chain : " << chain );
164 for (const std::regex& regex : regexs) {
165 if (std::regex_match(chain.c_str(), match, regex)) myChains.push_back(chain);
166 }
167 }
168 for (const std::string& group : m_trigDec->getListOfGroups())
169 ATH_MSG_INFO ( "Configured group : " << group );
170 const Trig::ChainGroup* calibStreamGroup = m_trigDec->getChainGroup("Calibration");
171 if (calibStreamGroup) {
172 std::vector<std::string> chains = calibStreamGroup->getListOfTriggers();
173 ATH_MSG_INFO ( "Chains for Calibration group:" );
174 for (const std::string& chain : chains)
175 ATH_MSG_INFO ( "Calib chain : " << chain );
176 }
177
178 unsigned int idx = 0;
179
180 if (m_doAllLvl1) {
181 const Trig::ChainGroup* group = m_trigDec->getChainGroup("L1_.*");
182 for (const std::string& l1Item : group->getListOfTriggers()) {
183 const TrigConf::TriggerItem* confItem = m_trigDec->ExperimentalAndExpertMethods().getItemConfigurationDetails(l1Item);
184 if (!confItem) {
185 ATH_MSG_WARNING ( "LVL1 item " << l1Item << ", obtained from TrigConfig, cannot be retrieved!" );
186 continue;
187 }
188 int pos = confItem->ctpId();
189 if (pos < 0 || pos >= 256) {
190 ATH_MSG_WARNING ( "LVL1 item " << l1Item << "has out-of-range ctpId " << pos );
191 continue;
192 }
193 m_runData->addBit(l1Item.c_str(), pos);
194 ATH_MSG_INFO ( "Adding LVL1 trigger bit for " << l1Item << " at position " << pos );
195 }
196 idx = 256;
197 }
198
199 for (const std::string& name : myChains) {
200 if (m_trigDec->getListOfTriggers(name).empty()) {
201 ATH_MSG_WARNING ( "Requested trigger name " << name << " is not configured in this run" );
202 continue;
203 }
204 const Trig::ChainGroup* group = m_trigDec->getChainGroup(name);
205 if (!group) {
206 ATH_MSG_WARNING ( "Could not retrieve chain group for trigger " << name );
207 continue;
208 }
209 m_runData->addBit(name.c_str(), idx++);
210 m_triggerGroups.push_back(group);
211 ATH_MSG_INFO ( "Adding trigger bit for " << name << " at position " << idx-1 );
212 }
213 }
214 return StatusCode::SUCCESS;
215}
std::vector< std::string > getListOfTriggers() const
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition hcg.cxx:357

◆ stop()

StatusCode LArShapeDumper::stop ( )
overridevirtual

Definition at line 719 of file LArShapeDumper.cxx.

720{
721 m_samples->addRun(m_runData.release());
722 return StatusCode::SUCCESS;
723}

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_acorrKey

SG::ReadCondHandleKey<ILArAutoCorr> LArShapeDumper::m_acorrKey {this,"AutocorrKey","LArAutoCorr","SG Key of LArAutoCorr object"}
private

Definition at line 137 of file LArShapeDumper.h.

137{this,"AutocorrKey","LArAutoCorr","SG Key of LArAutoCorr object"};

◆ m_adc2mevKey

SG::ReadCondHandleKey<LArADC2MeV> LArShapeDumper::m_adc2mevKey {this,"ADC2MeVKey","LArADC2MeV","SG Key of ADC2MeV conditions object"}
private

Definition at line 119 of file LArShapeDumper.h.

119{this,"ADC2MeVKey","LArADC2MeV","SG Key of ADC2MeV conditions object"};

◆ m_bcDataKey

SG::ReadCondHandleKey<BunchCrossingCondData> LArShapeDumper::m_bcDataKey {this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"}
private

Definition at line 131 of file LArShapeDumper.h.

131{this, "BunchCrossingCondDataKey", "BunchCrossingData" ,"SG Key of BunchCrossing CDO"};

◆ m_BCKey

SG::ReadCondHandleKey<LArBadChannelCont> LArShapeDumper::m_BCKey {this, "BadChanKey", "LArBadChannel", "SG bad channels key"}
private

Definition at line 126 of file LArShapeDumper.h.

126{this, "BadChanKey", "LArBadChannel", "SG bad channels key"};

◆ m_BCKeySC

SG::ReadCondHandleKey<LArBadChannelCont> LArShapeDumper::m_BCKeySC {this, "BadChanKeySC", "LArBadChannelSC", "SG bad channels key"}
private

Definition at line 127 of file LArShapeDumper.h.

127{this, "BadChanKeySC", "LArBadChannelSC", "SG bad channels key"};

◆ m_bcMask

LArBadChannelMask LArShapeDumper::m_bcMask
private

Definition at line 107 of file LArShapeDumper.h.

◆ m_bcMaskSC

LArBadChannelMask LArShapeDumper::m_bcMaskSC
private

Definition at line 109 of file LArShapeDumper.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArShapeDumper::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 123 of file LArShapeDumper.h.

123{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> LArShapeDumper::m_cablingKeySC {this,"CablingKeySC","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object for SC"}
private

Definition at line 124 of file LArShapeDumper.h.

124{this,"CablingKeySC","LArOnOffIdMapSC","SG Key of LArOnOffIdMapping object for SC"};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> LArShapeDumper::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 138 of file LArShapeDumper.h.

138 { this
139 , "CaloDetDescrManager"
140 , "CaloDetDescrManager"
141 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_caloSuperCellMgrKey

SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> LArShapeDumper::m_caloSuperCellMgrKey
private
Initial value:
{this,
"CaloSuperCellDetDescrManager", "CaloSuperCellDetDescrManager",
"SG key of the resulting CaloSuperCellDetDescrManager" }

Definition at line 142 of file LArShapeDumper.h.

142 {this,
143 "CaloSuperCellDetDescrManager", "CaloSuperCellDetDescrManager",
144 "SG key of the resulting CaloSuperCellDetDescrManager" };

◆ m_caloType

std::string LArShapeDumper::m_caloType
private

Definition at line 96 of file LArShapeDumper.h.

◆ m_channelsKey

SG::ReadHandleKey<LArRawChannelContainer> LArShapeDumper::m_channelsKey {this, "ChannelsKey", "LArRawChannels", "key for LArRawChannels"}
private

Definition at line 112 of file LArShapeDumper.h.

112{this, "ChannelsKey", "LArRawChannels", "key for LArRawChannels"};

◆ m_count

unsigned LArShapeDumper::m_count
private

Definition at line 87 of file LArShapeDumper.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_digitsKey

SG::ReadHandleKey<LArDigitContainer> LArShapeDumper::m_digitsKey {this, "DigitsKey", "FREE", "key for LArDigitContainer"}
private

Definition at line 111 of file LArShapeDumper.h.

111{this, "DigitsKey", "FREE", "key for LArDigitContainer"};

◆ m_digitsKeySC

SG::ReadHandleKey<LArDigitContainer> LArShapeDumper::m_digitsKeySC {this, "DigitsKeySC", "SC_ADC_BAS", "key for LArDigitContainer for SC"}
private

Definition at line 114 of file LArShapeDumper.h.

114{this, "DigitsKeySC", "SC_ADC_BAS", "key for LArDigitContainer for SC"};

◆ m_doAllEvents

bool LArShapeDumper::m_doAllEvents
private

Definition at line 151 of file LArShapeDumper.h.

◆ m_doAllLvl1

bool LArShapeDumper::m_doAllLvl1
private

Definition at line 151 of file LArShapeDumper.h.

◆ m_doEM

bool LArShapeDumper::m_doEM
private

Definition at line 152 of file LArShapeDumper.h.

◆ m_doFCAL

bool LArShapeDumper::m_doFCAL
private

Definition at line 152 of file LArShapeDumper.h.

◆ m_doHEC

bool LArShapeDumper::m_doHEC
private

Definition at line 152 of file LArShapeDumper.h.

◆ m_doOFCIter

bool LArShapeDumper::m_doOFCIter
private

Definition at line 150 of file LArShapeDumper.h.

◆ m_doRoIs

bool LArShapeDumper::m_doRoIs
private

Definition at line 151 of file LArShapeDumper.h.

◆ m_doSC

bool LArShapeDumper::m_doSC
private

Definition at line 152 of file LArShapeDumper.h.

◆ m_doStream

bool LArShapeDumper::m_doStream
private

Definition at line 150 of file LArShapeDumper.h.

◆ m_doTrigger

bool LArShapeDumper::m_doTrigger
private

Definition at line 150 of file LArShapeDumper.h.

◆ m_dumpChannelInfos

bool LArShapeDumper::m_dumpChannelInfos
private

Definition at line 151 of file LArShapeDumper.h.

◆ m_dumpDisc

bool LArShapeDumper::m_dumpDisc
private

Definition at line 101 of file LArShapeDumper.h.

◆ m_dumperTool

ToolHandle<ILArShapeDumperTool> LArShapeDumper::m_dumperTool {this,"LArShapeDumperTool","LArShapeDumperTool"}
private

Definition at line 104 of file LArShapeDumper.h.

104{this,"LArShapeDumperTool","LArShapeDumperTool"};

◆ m_dumperToolSC

ToolHandle<ILArShapeDumperTool> LArShapeDumper::m_dumperToolSC {this,"LArShapeDumperToolSC","LArShapeDumperToolSC"}
private

Definition at line 105 of file LArShapeDumper.h.

105{this,"LArShapeDumperToolSC","LArShapeDumperToolSC"};

◆ m_energyCut

double LArShapeDumper::m_energyCut
private

Definition at line 97 of file LArShapeDumper.h.

◆ m_energyCutSC

double LArShapeDumper::m_energyCutSC
private

Definition at line 98 of file LArShapeDumper.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fileName

std::string LArShapeDumper::m_fileName
private

Definition at line 84 of file LArShapeDumper.h.

◆ m_gains

bool LArShapeDumper::m_gains[CaloGain::LARNGAIN] {}
private

Definition at line 153 of file LArShapeDumper.h.

153{};

◆ m_gainSpec

std::string LArShapeDumper::m_gainSpec
private

Definition at line 100 of file LArShapeDumper.h.

◆ m_maxChannels

unsigned LArShapeDumper::m_maxChannels
private

Definition at line 88 of file LArShapeDumper.h.

◆ m_minADCMax

int LArShapeDumper::m_minADCMax
private

Definition at line 99 of file LArShapeDumper.h.

◆ m_minADCMaxSC

int LArShapeDumper::m_minADCMaxSC
private

Definition at line 99 of file LArShapeDumper.h.

◆ m_nLArError

unsigned LArShapeDumper::m_nLArError
private

Definition at line 91 of file LArShapeDumper.h.

◆ m_nNoDigits

unsigned LArShapeDumper::m_nNoDigits
private

Definition at line 92 of file LArShapeDumper.h.

◆ m_nNoDigitsSC

unsigned LArShapeDumper::m_nNoDigitsSC
private

Definition at line 93 of file LArShapeDumper.h.

◆ m_noiseCDOKey

SG::ReadCondHandleKey<CaloNoise> LArShapeDumper::m_noiseCDOKey {this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}
private

Definition at line 129 of file LArShapeDumper.h.

129{this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"};

◆ m_noiseSignifCut

double LArShapeDumper::m_noiseSignifCut
private

Definition at line 97 of file LArShapeDumper.h.

◆ m_nPrescaledAway

unsigned LArShapeDumper::m_nPrescaledAway
private

Definition at line 90 of file LArShapeDumper.h.

◆ m_nWrongBunchGroup

unsigned LArShapeDumper::m_nWrongBunchGroup
private

Definition at line 89 of file LArShapeDumper.h.

◆ m_onlineHelper

const LArOnlineID* LArShapeDumper::m_onlineHelper
private

Definition at line 145 of file LArShapeDumper.h.

◆ m_onlineHelperSC

const LArOnline_SuperCellID* LArShapeDumper::m_onlineHelperSC
private

Definition at line 146 of file LArShapeDumper.h.

◆ m_onlyEmptyBC

bool LArShapeDumper::m_onlyEmptyBC
private

Definition at line 155 of file LArShapeDumper.h.

◆ m_pedestalKey

SG::ReadCondHandleKey<ILArPedestal> LArShapeDumper::m_pedestalKey {this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"}
private

Definition at line 134 of file LArShapeDumper.h.

134{this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"};

◆ m_pedestalKeySC

SG::ReadCondHandleKey<ILArPedestal> LArShapeDumper::m_pedestalKeySC {this,"PedestalKeySC","LArPedestalSC","SG Key of LArPedestal object"}
private

Definition at line 135 of file LArShapeDumper.h.

135{this,"PedestalKeySC","LArPedestalSC","SG Key of LArPedestal object"};

◆ m_prescale

int LArShapeDumper::m_prescale
private

Definition at line 86 of file LArShapeDumper.h.

◆ m_problemsToMask

Gaudi::Property<std::vector<std::string> > LArShapeDumper::m_problemsToMask {this,"ProblemsToMask",{}, "Bad-Channel categories to patch"}
private

Definition at line 108 of file LArShapeDumper.h.

108{this,"ProblemsToMask",{}, "Bad-Channel categories to patch"};

◆ m_problemsToMaskSC

Gaudi::Property<std::vector<std::string> > LArShapeDumper::m_problemsToMaskSC {this,"ProblemsToMaskSC",{}, "Bad-Channel categories to mask"}
private

Definition at line 110 of file LArShapeDumper.h.

110{this,"ProblemsToMaskSC",{}, "Bad-Channel categories to mask"};

◆ m_random

TRandom LArShapeDumper::m_random
private

Definition at line 160 of file LArShapeDumper.h.

◆ m_rawRecomputedscKey

SG::ReadHandleKey<LArRawSCContainer> LArShapeDumper::m_rawRecomputedscKey {this, "RecomputedSCKey", "SC_ET_RECO", "key for recomputed LArRawSCContainer"}
private

Definition at line 116 of file LArShapeDumper.h.

116{this, "RecomputedSCKey", "SC_ET_RECO", "key for recomputed LArRawSCContainer"};

◆ m_rawscKey

SG::ReadHandleKey<LArRawSCContainer> LArShapeDumper::m_rawscKey {this, "RawSCKey", "SC_ET_ID", "key for LArRawSCContainer"}
private

Definition at line 115 of file LArShapeDumper.h.

115{this, "RawSCKey", "SC_ET_ID", "key for LArRawSCContainer"};

◆ m_runData

std::unique_ptr<LArSamples::RunData> LArShapeDumper::m_runData
private

Definition at line 158 of file LArShapeDumper.h.

◆ m_samples

LArSamples::DataStore* LArShapeDumper::m_samples
private

Definition at line 157 of file LArShapeDumper.h.

◆ m_trigDec

PublicToolHandle< Trig::TrigDecisionTool > LArShapeDumper::m_trigDec {this, "TrigDecisionTool", "", "Handle to the TrigDecisionTool"}
private

Definition at line 121 of file LArShapeDumper.h.

121{this, "TrigDecisionTool", "", "Handle to the TrigDecisionTool"};

◆ m_triggerGroups

std::vector<const Trig::ChainGroup*> LArShapeDumper::m_triggerGroups
private

Definition at line 159 of file LArShapeDumper.h.

◆ m_triggerNames

std::vector<std::string> LArShapeDumper::m_triggerNames
private

Definition at line 102 of file LArShapeDumper.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: