ATLAS Offline Software
Loading...
Searching...
No Matches
LArCalibValidationAlg.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7
14
15
16#ifndef LARCALIBVALIDATIONALG_H
17#define LARCALIBVALIDATIONALG_H
18
19#include <vector>
20#include <string>
21#include <sstream>
22#include <fstream>
23
25#include "GaudiKernel/ToolHandle.h"
27
32
35
36
45
46template<class CONDITIONSCONTAINER, class REFCONTAINER>
48
49public:
53 LArCalibValidationAlg (const std::string& name, ISvcLocator* pSvcLocator);
54
59
63 StatusCode initialize();
64
69 StatusCode execute() {return StatusCode::SUCCESS;}
70
75 StatusCode stop();
76 StatusCode finalize(){return StatusCode::SUCCESS;}
77
78protected:
79 typedef typename CONDITIONSCONTAINER::ConstConditionsMapIterator CONTIT;
80 typedef typename CONDITIONSCONTAINER::LArCondObj LArCondObj;
81 typedef typename CONDITIONSCONTAINER::MultChanCollection MULTICHANCOLL;
82
87 virtual StatusCode preLoop();
88
89
98 virtual bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont)=0;
99
100
103 virtual LArCondObj getRefObj(const HWIdentifier chid, const int gain) const=0;
104
112 virtual StatusCode summary(const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont);
113
123 const std::string channelDescription(const HWIdentifier& chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const;
124
125
126private:
133
134
135 typedef std::vector<std::pair<HWIdentifier,unsigned> > FEBANDGAIN_t;
143 bool patchMissingFEBs(const FEBANDGAIN_t& febAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont);
144
145typedef std::vector<std::pair<std::pair<HWIdentifier,unsigned>, unsigned > > CBANDCHANANDGAIN_t;
153 bool patchMissingCalibBoards(const CBANDCHANANDGAIN_t& CBAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont);
154
155 void febOutput(const HWIdentifier& febid, const unsigned gain, const unsigned nGood, const unsigned nBad);
156
157 void findFailedPatterns(const LArOnOffIdMapping *cabling, const LArCalibLineMapping *clCont, const LArBadChannelCont *bcCont);
158
159 std::vector<std::string> m_gainMap;
160
161protected:
163 MSG::Level m_myMsgLvl;
165
166
167 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
168 SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"};
169 SG::ReadCondHandleKey<LArCalibLineMapping> m_CLKey{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"};
171 Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"};
172 Gaudi::Property<std::vector<unsigned int> > m_patchCBs{this, "PatchCBs", {}, "List of missing CalibBoards to patch using values from reference container."};
173 BooleanProperty m_isSC{this, "SuperCells", false, "Working on SuperCells ?"};
174
175 // Pointers to various identifier helper classes, not used her, but
176 // probably useful for deriving algorithm
179
180
182 const REFCONTAINER* m_reference=nullptr;
183
185 const CONDITIONSCONTAINER* m_validation=nullptr;
186
188 CONDITIONSCONTAINER* m_nc_validation=nullptr;
189
191 std::string m_validationKey;
192
194 SG::ReadCondHandleKey<REFCONTAINER> m_referenceKey{this,"ReferenceKey","", "SG key of the LArConditionsContainer used as reference"};
195
199
202
205
208
211
213 unsigned m_maxmessages;
214
215 //Count the various cases:
216
218 unsigned m_nChecked=0;
219
222
224 unsigned m_nValidated=0;
225
227 unsigned m_nBad=0;
228
230 unsigned m_nNoReference=0;
231
233 typedef std::vector<std::pair<HWIdentifier, bool > > CHECKEDID_t;
234 std::vector<CHECKEDID_t> m_checkedIds;
235
237 std::string m_chanFileName;
238
240 std::ofstream m_chanFile;
241
243 std::string m_febFileName;
244
246 std::ofstream m_febFile;
247
249
250};
251
253
254#endif
255
const boost::regex ref(r_ef)
LArBadXCont< LArBadChannel > LArBadChannelCont
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Helper base class for offline cell identifiers.
virtual StatusCode preLoop()
Method executed before the loop over all channels This method can be implemented by the deriving algo...
std::vector< std::pair< HWIdentifier, unsigned > > FEBANDGAIN_t
std::vector< std::pair< std::pair< HWIdentifier, unsigned >, unsigned > > CBANDCHANANDGAIN_t
void febOutput(const HWIdentifier &febid, const unsigned gain, const unsigned nGood, const unsigned nBad)
LArCalibValidationAlg(const std::string &name, ISvcLocator *pSvcLocator)
Regular algorithm constructor.
bool checkCoolChannelCompleteness(const LArOnOffIdMapping *cabling, const LArCalibLineMapping *clCont, const LArBadChannelCont *bcCont)
Verify if all FEBs of each Cool-Channel is present.
StatusCode execute()
Standard execute method This method has to be emtpy since all the job is done in stop()
virtual bool validateChannel(const LArCondObj &ref, const LArCondObj &val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)=0
Abstract method to validate a single readout channels.
StatusCode initialize()
Standard initialization method.
virtual StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Method executed after the loop over all channels The implementation in the base class writes out only...
bool patchMissingFEBs(const FEBANDGAIN_t &febAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Fills channels of missing FEBs.
StatusCode stop()
Standard finalize method Loops over all channels and all gains and calls the validateChannel method.
bool patchMissingCalibBoards(const CBANDCHANANDGAIN_t &CBAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Fills channels of missing calib boards.
const std::string channelDescription(const HWIdentifier &chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const
Textual representation of gain and location of a certain cell or FEB.
~LArCalibValidationAlg()
Destructor.
virtual LArCondObj getRefObj(const HWIdentifier chid, const int gain) const =0
Method implmented in derived class to get the reference object from ref-container.
void findFailedPatterns(const LArOnOffIdMapping *cabling, const LArCalibLineMapping *clCont, const LArBadChannelCont *bcCont)
Helper for the Liquid Argon Calorimeter cell identifiers.