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

#include <SCT_ReadCalibDataCondAlg.h>

Inheritance diagram for SCT_ReadCalibDataCondAlg:
Collaboration diagram for SCT_ReadCalibDataCondAlg:

Public Member Functions

 SCT_ReadCalibDataCondAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~SCT_ReadCalibDataCondAlg ()=default
virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode finalize () override final
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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

enum  Feature { GAIN =0 , NOISE =1 , NFEATURES =2 }
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

SG::ReadCondHandleKey< CondAttrListCollectionm_readKeyGain {this, "ReadKeyGain", "/SCT/DAQ/Calibration/NPtGainDefects", "Key of input (raw) gain defect conditions folder"}
SG::ReadCondHandleKey< CondAttrListCollectionm_readKeyNoise {this, "ReadKeyNoise", "/SCT/DAQ/Calibration/NoiseOccupancyDefects", "Key of input (raw) noise defect conditions folder"}
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}
SG::WriteCondHandleKey< SCT_CalibDefectDatam_writeKeyGain {this, "WriteKeyGain", "SCT_CalibDefectNPtGain", "Key of output (derived) gain defect conditions data"}
SG::WriteCondHandleKey< SCT_CalibDefectDatam_writeKeyNoise {this, "WriteKeyNoise", "SCT_CalibDefectNPtNoise", "Key of output (derived) noise defect conditions data"}
SG::WriteCondHandleKey< SCT_AllGoodStripInfom_writeKeyInfo {this, "WriteKeyInfo", "SCT_AllGoodStripInfo", "Key of output (derived) good strip information conditions data"}
std::map< int, std::string > m_defectMapIntToString {}
StringArrayProperty m_ignoreDefects {this, "IgnoreDefects", {}, "Defects to ignore"}
FloatArrayProperty m_ignoreDefectParameters {this, "IgnoreDefectsParameters", {}, "Limit on defect to ignore parameters"}
const SCT_IDm_id_sct {nullptr}
 Handle to SCT ID helper.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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

Definition at line 28 of file SCT_ReadCalibDataCondAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ Feature

Constructor & Destructor Documentation

◆ SCT_ReadCalibDataCondAlg()

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

Definition at line 29 of file SCT_ReadCalibDataCondAlg.cxx.

30 : ::AthCondAlgorithm(name, pSvcLocator)
31{
32 m_ignoreDefects.value().push_back("NOISE_SLOPE");
33 m_ignoreDefectParameters.value().push_back(-1000.);
34
35 m_ignoreDefects.value().push_back("OFFSET_SLOPE");
36 m_ignoreDefectParameters.value().push_back(-1000.);
37
38 m_ignoreDefects.value().push_back("GAIN_SLOPE");
39 m_ignoreDefectParameters.value().push_back(-1000.);
40
41 m_ignoreDefects.value().push_back("BAD_OPE");
42 m_ignoreDefectParameters.value().push_back(-1000.);
43
44 m_ignoreDefects.value().push_back("NO_HI");
45 m_ignoreDefectParameters.value().push_back(1.);
46 // 1. means 100%. Only NO_HI defects with >100% are considered, i.e., all NO_HI defects are ignored.
47
48 m_ignoreDefects.value().push_back("LO_GAIN");
49 m_ignoreDefectParameters.value().push_back(-1000.);
50
51 m_ignoreDefects.value().push_back("HI_GAIN");
52 m_ignoreDefectParameters.value().push_back(-1000.);
53}
FloatArrayProperty m_ignoreDefectParameters

◆ ~SCT_ReadCalibDataCondAlg()

virtual SCT_ReadCalibDataCondAlg::~SCT_ReadCalibDataCondAlg ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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 SCT_ReadCalibDataCondAlg::execute ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 114 of file SCT_ReadCalibDataCondAlg.cxx.

114 {
115 ATH_MSG_DEBUG("execute " << name());
116
117 // Write Cond Handle
118 bool validWriteCondHandle{true};
119 // Do we have a valid Write Cond Handle for current time?
120 SG::WriteCondHandle<SCT_CalibDefectData> writeHandleData[NFEATURES]{{m_writeKeyGain, ctx}, {m_writeKeyNoise, ctx}};
121 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
122 if (writeHandleData[i].isValid()) {
123 ATH_MSG_DEBUG("CondHandle " << writeHandleData[i].fullKey() << " is already valid."
124 << ". In theory this should not be called, but may happen"
125 << " if multiple concurrent events are being processed out of order.");
126 } else {
127 validWriteCondHandle = false;
128 }
129 }
130 SG::WriteCondHandle<SCT_AllGoodStripInfo> writeHandleInfo{m_writeKeyInfo, ctx};
131 if (writeHandleInfo.isValid()) {
132 ATH_MSG_DEBUG("CondHandle " << writeHandleInfo.fullKey() << " is already valid."
133 << ". In theory this should not be called, but may happen"
134 << " if multiple concurrent events are being processed out of order.");
135 } else {
136 validWriteCondHandle = false;
137 }
138 if (validWriteCondHandle) return StatusCode::SUCCESS;
139
140 // Read Cond Handle
141 SG::ReadCondHandle<CondAttrListCollection> readHandle[NFEATURES]{{m_readKeyGain, ctx}, {m_readKeyNoise, ctx}};
142 const CondAttrListCollection* readCdo[NFEATURES]{*readHandle[GAIN], *readHandle[NOISE]};
143 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
144 if (readCdo[i]==nullptr) {
145 ATH_MSG_FATAL("Null pointer to the read conditions object " << readHandle[i].key());
146 return StatusCode::FAILURE;
147 }
148 // Add dependency
149 writeHandleData[i].addDependency(readHandle[i]);
150 writeHandleInfo.addDependency(readHandle[i]);
151 ATH_MSG_INFO("Size of CondAttrListCollection " << readHandle[i].fullKey() << " readCdo->size()= " << readCdo[i]->size());
152 ATH_MSG_INFO("Range of input is " << readHandle[i].getRange());
153 }
154
155 // Get SCT_DetectorElementCollection
156 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle{m_SCTDetEleCollKey, ctx};
157 const InDetDD::SiDetectorElementCollection* elements{sctDetEle.retrieve()};
158 if (elements==nullptr) {
159 ATH_MSG_FATAL(m_SCTDetEleCollKey.fullKey() << " could not be retrieved");
160 return StatusCode::FAILURE;
161 }
162 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
163 writeHandleData[i].addDependency(sctDetEle);
164 }
165 writeHandleInfo.addDependency(sctDetEle);
166
167 // Construct the output Cond Object and fill it in
168 std::unique_ptr<SCT_CalibDefectData> writeCdoData[NFEATURES]{nullptr, nullptr};
169 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
170 writeCdoData[i] = std::make_unique<SCT_CalibDefectData>();
171 }
172 std::unique_ptr<SCT_AllGoodStripInfo> writeCdoInfo{std::make_unique<SCT_AllGoodStripInfo>()};
173 // Initialize arrays and all strips to True
174 for (int w{0}; w!=NUMBER_OF_WAFERS; ++w) {
175 for (int s{0}; s!=STRIPS_PER_WAFER; ++s) {
176 (*writeCdoInfo)[w][s]=true;
177 }
178 }
179
180
181 // Create pointer to CalibDataDefect object
182 SCT_CalibDefectData::CalibModuleDefects theseDefects;
183
184 // loop over collection
185 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
187 CondAttrListCollection::const_iterator itLoop_end{readCdo[i]->end()};
188 for (; itLoop!=itLoop_end; ++itLoop) {
190 const coral::AttributeList &anAttrList{(*itLoop).second};
191
192 // Convert chanNum=offlineID into identifier
193 Identifier moduleId{chanNum};
194 IdentifierHash hashId0{m_id_sct->wafer_hash(moduleId)};
195 IdentifierHash hashId1;
196 m_id_sct->get_other_side(hashId0, hashId1);
197
198 // Check for PhiSwap readout
199 const InDetDD::SiDetectorElement* p_element{elements->getDetectorElement(hashId0)};
200 bool phiSwap0Present{p_element->swapPhiReadoutDirection()};
201 p_element = (elements->getDetectorElement(hashId1));
202 bool phiSwap1Present{p_element->swapPhiReadoutDirection()};
203
204 // Clear theseDefects
205 theseDefects.begDefects.clear();
206 theseDefects.endDefects.clear();
207 theseDefects.typeOfDefect.clear();
208 theseDefects.parValue.clear();
209
210 // Get all defect parameters from COOL attrib list
211 const std::string &gaindefectb{(anAttrList["defectBeginChannel"]).data<std::string>()};
212 const std::string &gaindefecte{(anAttrList["defectEndChannel"]).data<std::string>()};
213 const std::string &defectType{(anAttrList["defectType"]).data<std::string>()};
214 const std::string &parValue{(anAttrList["defectParameter"]).data<std::string>()};
215
216 // Convert the defect strings to vectors
217 std::vector<unsigned int> gaindefectbvec;
218 fillEmptyVectorFromString(gaindefectb, gaindefectbvec);
219 std::vector<unsigned int> gaindefectevec;
220 fillEmptyVectorFromString(gaindefecte, gaindefectevec);
221 std::vector<unsigned int> defectTypevec;
222 fillEmptyVectorFromString(defectType, defectTypevec);
223 std::vector<double> parValuevec;
224 fillEmptyVectorFromString(parValue, parValuevec);
225
226 // Fill the Calib defect objects
227 long unsigned int gainvec_size{gaindefectbvec.size()};
228 for (long unsigned int i{0}; i<gainvec_size; ++i) {
229 // Check existence of the defect index to avoid failure when a new defect is added in SCT DAQ.
230 if (m_defectMapIntToString.find(defectTypevec[i]) == m_defectMapIntToString.end()) {
231 ATH_MSG_DEBUG("Defect type " << defectTypevec[i] << " is not defined! This defect is ignored.");
232 } else {
233 theseDefects.typeOfDefect.push_back(m_defectMapIntToString.at(defectTypevec[i]));
234 theseDefects.begDefects.push_back(gaindefectbvec[i]);
235 theseDefects.endDefects.push_back(gaindefectevec[i]);
236 theseDefects.parValue.push_back(coerceToFloatRange(parValuevec[i]));
237 }
238 }
239 // Fill the isGoodWaferArray
240 if (not theseDefects.begDefects.empty()) {
241 for (unsigned int i{0}; i<theseDefects.begDefects.size(); ++i) { // loop over all defects
242 // Check for defects and their limits not to take into account in isGood
243 bool ignoreDefect{false};
244 unsigned int ig{0};
245 while (ig<m_ignoreDefects.value().size()) { //loop until found defect or end of ignoredefects
246 if (m_ignoreDefects.value()[ig] == theseDefects.typeOfDefect[i]) {
247 if ( m_ignoreDefectParameters.value()[ig]<-999. ) ignoreDefect = true; //no check on parameter value, defect ignored
248 else if (theseDefects.typeOfDefect[i]=="NO_HI" and m_ignoreDefectParameters.value()[ig]>theseDefects.parValue[i]) ignoreDefect = true; //noise below threshold, > 0.0005 (in DB, so default values printed here)
249 else if (theseDefects.typeOfDefect[i]=="NOISY" and m_ignoreDefectParameters.value()[ig]>theseDefects.parValue[i]) ignoreDefect = true; //noise below threshold, > 1.15* av chip average
250 else if (theseDefects.typeOfDefect[i]=="V_NOISY" and m_ignoreDefectParameters.value()[ig]>theseDefects.parValue[i]) ignoreDefect = true; //noise below threshold, > 1.25* av chip average
251 else if (theseDefects.typeOfDefect[i]=="VLO_GAIN" and m_ignoreDefectParameters.value()[ig]<theseDefects.parValue[i]) ignoreDefect = true; // gain to low, < 0.3 * chip average
252 else if (theseDefects.typeOfDefect[i]=="LO_GAIN" and m_ignoreDefectParameters.value()[ig]<theseDefects.parValue[i]) ignoreDefect = true; // gain to low < 0.75 * chip average
253 else if (theseDefects.typeOfDefect[i]=="HI_GAIN" and m_ignoreDefectParameters.value()[ig]>theseDefects.parValue[i]) ignoreDefect = true; // gain to high > 1.25 * chip average
254 else if (theseDefects.typeOfDefect[i]=="LO_OFFSET" and m_ignoreDefectParameters.value()[ig]>theseDefects.parValue[i]) ignoreDefect = true; // offset to low < -100
255 else if (theseDefects.typeOfDefect[i]=="HI_OFFSET" and m_ignoreDefectParameters.value()[ig]<theseDefects.parValue[i]) ignoreDefect = true; // offset to high > 200
256 }
257 ig++;
258 }
259 if (not ignoreDefect) {
260 //set the isGoodBool value for all strips for this defect
261 for (unsigned int strip = theseDefects.begDefects[i]; strip <= theseDefects.endDefects[i]; ++strip) {
262 // Check for phiSwap and which wafer side before filling isGood vector
263 if (strip < STRIPS_PER_WAFER) { //side 0 0->767
264 const unsigned int waferId0{hashId0};
265 SCT_WaferGoodStripInfo& thisWaferIsGoodData0{(*writeCdoInfo)[waferId0]};
266 const unsigned int side0StripNumber{phiSwap0Present ? ( STRIPS_PER_WAFER-1-strip) : strip};
267 thisWaferIsGoodData0[side0StripNumber] = false;
268 } else { // side 1 768->1535 => 0->767
269 const unsigned int waferId1{hashId1};
270 SCT_WaferGoodStripInfo& thisWaferIsGoodData1{(*writeCdoInfo)[waferId1]};
271 const unsigned int side1StripNumber{phiSwap1Present ? (2*STRIPS_PER_WAFER-1-strip) : (strip-STRIPS_PER_WAFER)};
272 thisWaferIsGoodData1[side1StripNumber] = false;
273 }
274 }
275 }
276 }
277 }
278
279 // Fill the CalibDefectData maps with the Calib defect objects
280 if (i==GAIN) {
281 if (theseDefects.begDefects.empty()) {
282 ATH_MSG_DEBUG("No NPtGain defects for module " << moduleId);
283 continue;
284 }
285 if (not (writeCdoData[i]->addModule(moduleId, theseDefects))) {
286 ATH_MSG_ERROR("Unable to add module " << moduleId << " to NPtGain defect map");
287 return StatusCode::RECOVERABLE;
288 } else {
289 ATH_MSG_DEBUG("Defects for module " << moduleId << " added to NPG defect map");
290 }
291 } else if (i==NOISE) {
292 if (theseDefects.begDefects.empty()) {
293 ATH_MSG_DEBUG("No NoiseOccupancy defects for module " << moduleId);
294 continue;
295 }
296 if (not (writeCdoData[i]->addModule(moduleId, theseDefects))) {
297 ATH_MSG_ERROR("Unable to add module " << moduleId << " to NoiseOccupancy defect map");
298 return StatusCode::RECOVERABLE;
299 } else {
300 ATH_MSG_DEBUG("Defects for module " << moduleId << " added to NoiseOccupancy defect map");
301 }
302 }
303 }
304 }
305
306 // Record the output cond objects
307 ATH_MSG_DEBUG("There are " << writeCdoInfo->size() << " elements in " << writeHandleInfo.key());
308 if (writeHandleInfo.record(std::move(writeCdoInfo)).isFailure()) {
309 ATH_MSG_FATAL("Could not record SCT_AllGoodStripInfo " << writeHandleInfo.key()
310 << " with EventRange " << writeHandleInfo.getRange() << " into Conditions Store");
311 return StatusCode::FAILURE;
312 }
313 ATH_MSG_INFO("recorded new CDO " << writeHandleInfo.key() << " with range " << writeHandleInfo.getRange() << " into Conditions Store");
314 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
315 ATH_MSG_DEBUG("There are " << writeCdoData[i]->size() << " elements in " << writeHandleData[i].key());
316 if (writeHandleData[i].record(std::move(writeCdoData[i])).isFailure()) {
317 ATH_MSG_FATAL("Could not record SCT_CalibDefectData " << writeHandleData[i].key()
318 << " with EventRange " << writeHandleData[i].getRange() << " into Conditions Store");
319 return StatusCode::FAILURE;
320 }
321 ATH_MSG_INFO("recorded new CDO " << writeHandleData[i].key() << " with range " << writeHandleData[i].getRange() << " into Conditions Store");
322 }
323
324 return StatusCode::SUCCESS;
325}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::array< bool, SCT_ConditionsData::STRIPS_PER_WAFER > SCT_WaferGoodStripInfo
Class for data object used in SCT_ReadCalibDataCondAlg and SCT_AllGoodStripInfo.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
bool swapPhiReadoutDirection() const
Determine if readout direction between online and offline needs swapping.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyNoise
SG::WriteCondHandleKey< SCT_AllGoodStripInfo > m_writeKeyInfo
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
SG::WriteCondHandleKey< SCT_CalibDefectData > m_writeKeyNoise
const SCT_ID * m_id_sct
Handle to SCT ID helper.
SG::WriteCondHandleKey< SCT_CalibDefectData > m_writeKeyGain
std::map< int, std::string > m_defectMapIntToString
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyGain
const_pointer_type retrieve()
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
void getRange(TH1D *s, int imax, double frac, int &lowerbin, int &upperbin, double &lowerfrac, double &upperfrac)
Definition rmsFrac.cxx:32

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode SCT_ReadCalibDataCondAlg::finalize ( )
finaloverridevirtual

Definition at line 327 of file SCT_ReadCalibDataCondAlg.cxx.

327 {
328 ATH_MSG_DEBUG("finalize " << name());
329 return StatusCode::SUCCESS;
330}

◆ initialize()

StatusCode SCT_ReadCalibDataCondAlg::initialize ( )
finaloverridevirtual

Definition at line 55 of file SCT_ReadCalibDataCondAlg.cxx.

55 {
56 ATH_MSG_DEBUG("initialize " << name());
57
58 // Get SCT helper
59 ATH_CHECK(detStore()->retrieve(m_id_sct, "SCT_ID"));
60
61 // Read Cond Handle
62 ATH_CHECK(m_readKeyGain.initialize());
63 ATH_CHECK(m_readKeyNoise.initialize());
64 ATH_CHECK(m_SCTDetEleCollKey.initialize());
65
66 // Write Cond Handles
67 for (unsigned int i{GAIN}; i<NFEATURES; i++) {
68 SG::WriteCondHandleKey<SCT_CalibDefectData>* writeKeyData{nullptr};
69 if ( i==GAIN) writeKeyData = &m_writeKeyGain;
70 else if (i==NOISE) writeKeyData = &m_writeKeyNoise;
71 if (writeKeyData==nullptr) continue;
72 ATH_CHECK(writeKeyData->initialize());
73 }
74 ATH_CHECK(m_writeKeyInfo.initialize());
75
76 // Fit Defects
77 m_defectMapIntToString[0] = "UNKNOWN"; //<! Defect type not in this map, add!
78 m_defectMapIntToString[1] = "DEAD"; //<! Output always < 1%
79 m_defectMapIntToString[2] = "STUCKON"; //<! Output always > 98%
80 m_defectMapIntToString[3] = "UNDER"; //<! Occupancy never reaches max, always less than 95%
81 m_defectMapIntToString[4] = "OVER"; //<! Occcupancy greater than 100%
82 m_defectMapIntToString[5] = "BADFIT"; //<! The fit was not good for some reason - parameter is a chi2 cut
83 // NPt Gain Defects
84 m_defectMapIntToString[32] = "VLO_GAIN"; //<! Gain < 0.3 * chip average
85 m_defectMapIntToString[9] = "LO_GAIN"; //<! Gain < 0.75 * chip average
86 m_defectMapIntToString[10] = "HI_GAIN"; //<! Gain > 1.25 * chip average
87 m_defectMapIntToString[11] = "LO_OFFSET"; //<! Offset < -100
88 m_defectMapIntToString[12] = "HI_OFFSET"; //<! Offset > 200
89 m_defectMapIntToString[13] = "UNBONDED"; //<! Noise <= 750
90 m_defectMapIntToString[14] = "PARTBONDED"; //<! Noise <= 1100
91 m_defectMapIntToString[15] = "NOISY"; //<! Noise > 1.15* av chip noise
92 m_defectMapIntToString[33] = "V_NOISY"; //<! Noise > 1.25* av chip noise
93 m_defectMapIntToString[34] = "NOISE_SLOPE"; //<! Slope in noise across module, slope/chan > 1.
94 m_defectMapIntToString[35] = "OFFSET_SLOPE"; //<! Slope in offset across module, slope/chan > 0.07
95 m_defectMapIntToString[36] = "GAIN_SLOPE"; //<! Slope in gain across module, slope/chan > 0.04
96 // Noise Occupancy Defects
97 m_defectMapIntToString[19] = "NO_HI"; //<! High noise occupancy, 0.0005
98 m_defectMapIntToString[37] = "BAD_OPE"; //<! Bad occupancy per event variance/binomial variance > 2.0)
99 m_defectMapIntToString[38] = "DOUBTR_HI"; //<! High double trigger noise occupancy, > 5
100 m_defectMapIntToString[41] = "LO_GAIN_ABSOLUTE"; // <! Gain < 15 mV/fC, newly added for Run 3
101 m_defectMapIntToString[42] = "LO_NOISE"; // <! Noise < 0.75 * chip average, newly added for Run 3
102 m_defectMapIntToString[43] = "VLO_NOISE"; // <! Noise < 0.5 * chip average, newly added for Run 3
103 m_defectMapIntToString[44] = "VLO_NOISE_SHORT"; // <! Noise < 0.7 * chip average, newly added for Run 3
104
105 //Check ignoreDefects vectors are the same size
106 if (m_ignoreDefects.value().size() != m_ignoreDefectParameters.value().size()) {
107 ATH_MSG_FATAL("IgnoreDefect != IgnoreDefectsParameters, check job options!");
108 return StatusCode::FAILURE;
109 }
110
111 return StatusCode::SUCCESS;
112}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
StatusCode initialize(bool used=true)
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::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.

◆ isClonable()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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 }

Member Data Documentation

◆ m_defectMapIntToString

std::map<int, std::string> SCT_ReadCalibDataCondAlg::m_defectMapIntToString {}
private

Definition at line 48 of file SCT_ReadCalibDataCondAlg.h.

48{};

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_id_sct

const SCT_ID* SCT_ReadCalibDataCondAlg::m_id_sct {nullptr}
private

Handle to SCT ID helper.

Definition at line 53 of file SCT_ReadCalibDataCondAlg.h.

53{nullptr};

◆ m_ignoreDefectParameters

FloatArrayProperty SCT_ReadCalibDataCondAlg::m_ignoreDefectParameters {this, "IgnoreDefectsParameters", {}, "Limit on defect to ignore parameters"}
private

Definition at line 51 of file SCT_ReadCalibDataCondAlg.h.

51{this, "IgnoreDefectsParameters", {}, "Limit on defect to ignore parameters"};

◆ m_ignoreDefects

StringArrayProperty SCT_ReadCalibDataCondAlg::m_ignoreDefects {this, "IgnoreDefects", {}, "Defects to ignore"}
private

Definition at line 50 of file SCT_ReadCalibDataCondAlg.h.

50{this, "IgnoreDefects", {}, "Defects to ignore"};

◆ m_readKeyGain

SG::ReadCondHandleKey<CondAttrListCollection> SCT_ReadCalibDataCondAlg::m_readKeyGain {this, "ReadKeyGain", "/SCT/DAQ/Calibration/NPtGainDefects", "Key of input (raw) gain defect conditions folder"}
private

Definition at line 40 of file SCT_ReadCalibDataCondAlg.h.

40{this, "ReadKeyGain", "/SCT/DAQ/Calibration/NPtGainDefects", "Key of input (raw) gain defect conditions folder"};

◆ m_readKeyNoise

SG::ReadCondHandleKey<CondAttrListCollection> SCT_ReadCalibDataCondAlg::m_readKeyNoise {this, "ReadKeyNoise", "/SCT/DAQ/Calibration/NoiseOccupancyDefects", "Key of input (raw) noise defect conditions folder"}
private

Definition at line 41 of file SCT_ReadCalibDataCondAlg.h.

41{this, "ReadKeyNoise", "/SCT/DAQ/Calibration/NoiseOccupancyDefects", "Key of input (raw) noise defect conditions folder"};

◆ m_SCTDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> SCT_ReadCalibDataCondAlg::m_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}
private

Definition at line 42 of file SCT_ReadCalibDataCondAlg.h.

42{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKeyGain

SG::WriteCondHandleKey<SCT_CalibDefectData> SCT_ReadCalibDataCondAlg::m_writeKeyGain {this, "WriteKeyGain", "SCT_CalibDefectNPtGain", "Key of output (derived) gain defect conditions data"}
private

Definition at line 43 of file SCT_ReadCalibDataCondAlg.h.

43{this, "WriteKeyGain", "SCT_CalibDefectNPtGain", "Key of output (derived) gain defect conditions data"};

◆ m_writeKeyInfo

SG::WriteCondHandleKey<SCT_AllGoodStripInfo> SCT_ReadCalibDataCondAlg::m_writeKeyInfo {this, "WriteKeyInfo", "SCT_AllGoodStripInfo", "Key of output (derived) good strip information conditions data"}
private

Definition at line 45 of file SCT_ReadCalibDataCondAlg.h.

45{this, "WriteKeyInfo", "SCT_AllGoodStripInfo", "Key of output (derived) good strip information conditions data"};

◆ m_writeKeyNoise

SG::WriteCondHandleKey<SCT_CalibDefectData> SCT_ReadCalibDataCondAlg::m_writeKeyNoise {this, "WriteKeyNoise", "SCT_CalibDefectNPtNoise", "Key of output (derived) noise defect conditions data"}
private

Definition at line 44 of file SCT_ReadCalibDataCondAlg.h.

44{this, "WriteKeyNoise", "SCT_CalibDefectNPtNoise", "Key of output (derived) noise defect conditions data"};

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