ATLAS Offline Software
LArCalibPatchingAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //Dear emacs, this is -*-c++-*-
6 
15 #ifndef LARCALIBPATCHINGALG_H
16 #define LARCALIBPATCHINGALG_H
17 
18 #include <vector>
19 #include <string>
20 
31 
32 
33 
51 template<class CONDITIONSCONTAINER>
53 
54 public:
58  LArCalibPatchingAlg (const std::string& name, ISvcLocator* pSvcLocator);
59 
64 
71 
75  StatusCode execute() {return StatusCode::SUCCESS;}
76 
83  StatusCode finalize(){return StatusCode::SUCCESS;}
84 
85 private:
86 
87  typedef typename CONDITIONSCONTAINER::ConstConditionsMapIterator CONTIT;
88  typedef typename CONDITIONSCONTAINER::LArCondObj LArCondObj;
89 
95  bool patch(const HWIdentifier chid, const int gain, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, const LArCalibLineMapping *clCont);
96 
97 
104  bool getAverage(const HWIdentifier chid, const int gain, LArRampP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true);
105 
112  bool getAverage(const HWIdentifier chid, const int gain, LArOFCP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true);
113 
114  bool setZero(const HWIdentifier chid, const int gain, LArRampP1& patch);
115  bool setZero(const HWIdentifier chid, const int gain, LArOFCP1& patch);
116  bool setZero(const HWIdentifier chid, const int gain, LArCaliWaveVec& patch);
117 
118 
119 
120 
121  //The following #ifdef-logic is to make this package compile against 13.2.0. as well as 14.X.0
122  //since the payload object of LArMphysOverMcal has changed from LArMphysOverMcalP1 to LArSingleFloatP
123 
124 
125 #ifdef LARRAWCONDITIONS_LARMPHYSOVERMCALP
126 
133  //For backward compatiblity only!!! Will be removed at some point
134  bool getAverage(const HWIdentifier chid, const int gain, LArMphysOverMcalP1& patch, const LArBadChannelCont* bcCont, bool isphi=true);
135 #endif
136 
137 
138 #ifdef LARRAWCONDITIONS_LARSINGLEFLOATP
139 
145  bool getAverage(const HWIdentifier chid, const int gain, LArSingleFloatP& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true);
146  bool setZero(LArSingleFloatP& patch);
147 #endif
148 
149 
150 
151 
152  bool getAverage(const HWIdentifier,const int, LArCaliWaveVec&, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true) ;
153 
161  std::vector<HWIdentifier>& getPhiRing(const HWIdentifier chid, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, unsigned distance=1);
162 
163  /* Get list of channels in the same FEB. Used for FEBAverage method */
164  std::vector<HWIdentifier>& getFEBChans(const HWIdentifier chid, const LArBadChannelCont* bcCont);
165 
170  {return StatusCode::SUCCESS;};
171 
177  SetZero
178  };
179 
180  SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};
181  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"};
182  SG::ReadCondHandleKey<LArCalibLineMapping> m_CLKey{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"};
184  Gaudi::Property<std::vector<std::string> > m_problemsToPatch{this,"ProblemsToPatch",{}, "Bad-Channel categories to patch"};
185  Gaudi::Property<std::vector<unsigned int> > m_doNotPatchCBs{this, "DoNotPatchCBs", {}, "Do not patch channels from this CalibBoard"};
186 
187 
188  BooleanProperty m_useCorrChannel{this, "UseCorrChannels", true, "True: Use separate correction COOL channel, False: Correction + data in the same channel"};
189  BooleanProperty m_patchAllMissing{this, "PatchAllMissing", false, "True: Patch missing calibration constants regardless of their bad-channel status"};
190  BooleanProperty m_unlock{this, "Unlock", false, "Modify input container"};
191  BooleanProperty m_isSC{this, "SuperCells", false, "Working on the SuperCells ?"};
192 
195 
196  const CONDITIONSCONTAINER* m_contIn;
197  CONDITIONSCONTAINER* m_contOut;
198 
200  StringProperty m_containerKey{this, "ContainerKey", "", "SG key of the LArConditionsContainer to be patched"};
201  StringProperty m_newContainerKey{this, "NewContainerKey", "", "If the corrections go in a separate container put SG key here"};
202  StringProperty m_patchMethodProp{this, "PatchMethod", "FEBNeighbor", "Method to patch conditions for channels with broken calibration line"};
203 
204  std::vector<HWIdentifier> m_idList;
205 
206 };
207 
208 #include "LArCalibPatchingAlg.icc"
209 
210 #endif
211 
LArCalibPatchingAlg::FEBNeighbor
@ FEBNeighbor
Definition: LArCalibPatchingAlg.h:173
LArCalibPatchingAlg::m_patchMethod
patchMethod m_patchMethod
Definition: LArCalibPatchingAlg.h:199
LArCalibPatchingAlg::setSymlink
StatusCode setSymlink(const LArOFCComplete *ofc) const
LArCalibPatchingAlg::setZero
bool setZero(const HWIdentifier chid, const int gain, LArOFCP1 &patch)
LArCalibPatchingAlg::LArCalibPatchingAlg
LArCalibPatchingAlg(const std::string &name, ISvcLocator *pSvcLocator)
regular Algorithm constructor
LArCalibPatchingAlg::getAverage
bool getAverage(const HWIdentifier, const int, LArCaliWaveVec &, const LArBadChannelCont *bcCont, const LArOnOffIdMapping *cabling, bool isphi=true)
LArOFCP1
c-struct reproducing the structure of the persistent data
Definition: LArOFCP1.h:22
LArCalibPatchingAlg::finalize
StatusCode finalize()
Definition: LArCalibPatchingAlg.h:83
LArCalibPatchingAlg::patchMethod
patchMethod
Definition: LArCalibPatchingAlg.h:172
LArCalibPatchingAlg::setZero
bool setZero(const HWIdentifier chid, const int gain, LArCaliWaveVec &patch)
LArRampComplete.h
LArCalibPatchingAlg::getAverage
bool getAverage(const HWIdentifier chid, const int gain, LArRampP1 &patch, const LArBadChannelCont *bcCont, const LArOnOffIdMapping *cabling, bool isphi=true)
Specialized method to average Ramps over a phi-ring.
LArRampComplete
Definition: LArRampComplete.h:50
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
LArCalibPatchingAlg::m_bcMask
LArBadChannelMask m_bcMask
Definition: LArCalibPatchingAlg.h:183
LArMphysOverMcalP1
c-struct reproducing the structure of the persistent data
Definition: LArMphysOverMcalP1.h:19
LArSingleFloatP
Definition: LArSingleFloatP.h:11
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArCalibPatchingAlg::m_onlineHelper
const LArOnlineID_Base * m_onlineHelper
Definition: LArCalibPatchingAlg.h:193
LArRampP1
Persistent data for LArRamp Copied from LAr.
Definition: LArRampP1.h:24
LArCalibLineMapping
Definition: LArCalibLineMapping.h:17
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArCalibPatchingAlg.icc
LArCalibPatchingAlg::m_contOut
CONDITIONSCONTAINER * m_contOut
Definition: LArCalibPatchingAlg.h:197
LArCalibPatchingAlg
Definition: LArCalibPatchingAlg.h:52
HWIdentifier
Definition: HWIdentifier.h:13
LArCalibPatchingAlg::getFEBChans
std::vector< HWIdentifier > & getFEBChans(const HWIdentifier chid, const LArBadChannelCont *bcCont)
LArCalibPatchingAlg::stop
StatusCode stop()
Finalize method.
LArCalibPatchingAlg::m_caloId
const CaloCell_Base_ID * m_caloId
Definition: LArCalibPatchingAlg.h:194
LArCaliWaveContainer
Liquid Argon Cumulative Wave Container.
Definition: LArCaliWaveContainer.h:33
LArCalibPatchingAlg::getPhiRing
std::vector< HWIdentifier > & getPhiRing(const HWIdentifier chid, const LArBadChannelCont *bcCont, const LArOnOffIdMapping *cabling, unsigned distance=1)
Helper method to get a phi-ring.
AthAlgorithm.h
LArBadChannelCont.h
LArCalibPatchingAlg::FEBAverage
@ FEBAverage
Definition: LArCalibPatchingAlg.h:176
LArOnOffIdMapping.h
LArMphysOverMcalComplete
This class implements the ILArMphysOverMcal interface.
Definition: LArMphysOverMcalComplete.h:29
LArOFCComplete.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArCalibPatchingAlg::getAverage
bool getAverage(const HWIdentifier chid, const int gain, LArOFCP1 &patch, const LArBadChannelCont *bcCont, const LArOnOffIdMapping *cabling, bool isphi=true)
Specialized method to average OFCs over a phi-ring.
LArCalibPatchingAlg::m_contIn
const CONDITIONSCONTAINER * m_contIn
Definition: LArCalibPatchingAlg.h:196
LArCalibPatchingAlg::PhiAverage
@ PhiAverage
Definition: LArCalibPatchingAlg.h:175
LArCalibPatchingAlg::m_idList
std::vector< HWIdentifier > m_idList
Definition: LArCalibPatchingAlg.h:204
CaloCell_SuperCell_ID.h
Helper class for offline supercell identifiers.
LArCaliWaveVec
Definition: LArCaliWave.h:91
LArCalibPatchingAlg::execute
StatusCode execute()
Empty Execute method.
Definition: LArCalibPatchingAlg.h:75
LArCalibPatchingAlg::setSymlink
StatusCode setSymlink(const LArCaliWaveContainer *) const
Definition: LArCalibPatchingAlg.h:169
AthAlgorithm
Definition: AthAlgorithm.h:47
LArCalibPatchingAlg::~LArCalibPatchingAlg
~LArCalibPatchingAlg()
Destructor.
Definition: LArCalibPatchingAlg.h:63
ReadCondHandleKey.h
LArCalibPatchingAlg::setSymlink
StatusCode setSymlink(const LArRampComplete *ramp) const
LArCalibPatchingAlg::CONTIT
CONDITIONSCONTAINER::ConstConditionsMapIterator CONTIT
Definition: LArCalibPatchingAlg.h:87
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArCalibPatchingAlg::patch
bool patch(const HWIdentifier chid, const int gain, const LArBadChannelCont *bcCont, const LArOnOffIdMapping *cabling, const LArCalibLineMapping *clCont)
patch method
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
LArCalibPatchingAlg::initialize
StatusCode initialize()
Initialize method.
LArCalibPatchingAlg::setZero
bool setZero(const HWIdentifier chid, const int gain, LArRampP1 &patch)
LArCalibPatchingAlg::PhiNeighbor
@ PhiNeighbor
Definition: LArCalibPatchingAlg.h:174
LArCalibPatchingAlg::LArCondObj
CONDITIONSCONTAINER::LArCondObj LArCondObj
Definition: LArCalibPatchingAlg.h:88
LArMphysOverMcalComplete.h
LArCalibPatchingAlg::setSymlink
StatusCode setSymlink(const LArMphysOverMcalComplete *ramp) const
LArCalibLineMapping.h
CaloCell_Base_ID
Helper base class for offline cell identifiers.
Definition: CaloCell_Base_ID.h:41
LArBadChannelMask.h
ReadOfcFromCool.ofc
ofc
Definition: ReadOfcFromCool.py:110
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
LArOFCComplete
This class implements the ILArOFC interface.
Definition: LArOFCComplete.h:25
LArBadChannelMask
Definition: LArBadChannelMask.h:18
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20