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

#include <CscCondDbAlg.h>

Inheritance diagram for CscCondDbAlg:
Collaboration diagram for CscCondDbAlg:

Public Member Functions

 CscCondDbAlg (const std::string &name, ISvcLocator *svc)
virtual ~CscCondDbAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &) const override
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

typedef SG::WriteCondHandle< CscCondDbDatawriteHandle_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode loadDataHv (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadData (CscCondDbData *, const CondAttrListCollection *, const std::string &, bool=false) const
StatusCode loadDataF001 (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataNoise (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataPed (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataPSlope (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataRMS (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataStatus (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataT0Base (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataT0Phase (writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode cache (const std::string &, CscCondDbData *, const std::string &) const
StatusCode cacheASM (const std::string &, CscCondDbData *, const std::string &) const
StatusCode getAsmScope (int, int &, int &, int &, int &, int &) const
StatusCode recordParameter (unsigned int, const std::string &, CscCondDbData *, const std::string &) const
StatusCode recordParameter (IdentifierHash, const std::string &, CscCondDbData *, const std::string &) const
StatusCode recordParameterF001 (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterNoise (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterPed (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterPSlope (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterRMS (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterStatus (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterT0Base (IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterT0Phase (IdentifierHash, std::string, CscCondDbData *) const
template<typename T>
StatusCode getParameter (IdentifierHash chanHash, std::string data, T &token) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_isOnline {this, "isOnline", false, ""}
Gaudi::Property< bool > m_isData {this, "isData", false, ""}
Gaudi::Property< bool > m_isRun1 {this, "isRun1", false, ""}
Gaudi::Property< bool > m_onlineOfflinePhiFlip {this, "onlineOfflinePhiFlip", true, ""}
Gaudi::Property< std::string > m_defaultDatabaseReadVersion {this, "defaultDatabaseReadVersion", "02-00", ""}
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::WriteCondHandleKey< CscCondDbDatam_writeKey {this, "WriteKey", "CscCondDbData", "Key of output CSC condition data"}
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_hv
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_f001
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_noise
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_ped
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_pslope
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_rms
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_status
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_t0base
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_folder_da_t0phase
Gaudi::Property< bool > m_pslopeFromDB
 The pslope is the gain of each CSC channel.
const float m_DEFAULT_PSLOPE = 0.175
 The CSC gain was originally 5.304 ADC counts per fC, but later increased to 5.7 ADC counts per fC, so the pslope equals 1/5.7 = 0.175438.
Gaudi::Property< float > m_pslope
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 27 of file CscCondDbAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ writeHandle_t

Definition at line 35 of file CscCondDbAlg.h.

Constructor & Destructor Documentation

◆ CscCondDbAlg()

CscCondDbAlg::CscCondDbAlg ( const std::string & name,
ISvcLocator * svc )

Definition at line 14 of file CscCondDbAlg.cxx.

14 :
15 AthCondAlgorithm(name, pSvcLocator) {}

◆ ~CscCondDbAlg()

virtual CscCondDbAlg::~CscCondDbAlg ( )
virtualdefault

Member Function Documentation

◆ cache()

StatusCode CscCondDbAlg::cache ( const std::string & data,
CscCondDbData * writeCdo,
const std::string & parName ) const
private

Definition at line 291 of file CscCondDbAlg.cxx.

291 {
292 std::istringstream ss(data);
293 std::string valueStr;
294 unsigned int chanAddress = 0;
295
296 bool started = false;
297 while (ss.good()) {
298 ss >> valueStr;
299
300 if (valueStr == "<END_DATA>") break;
301
302 if (valueStr == "<BEGIN_DATA>") {
303 started = true;
304 continue;
305 }
306 if (!started) continue;
307 ATH_MSG_VERBOSE("cache() - current element " << valueStr);
308 std::istringstream iss(valueStr);
309
310 // use new iss to translate the hex
311 if (chanAddress == 0) {
312 iss >> std::hex >> chanAddress;
313 continue;
314 }
315
316 // record parameter
317 if (recordParameter(chanAddress, valueStr, writeCdo, parName).isFailure()) return StatusCode::FAILURE;
318
319 // reset the address
320 chanAddress = 0;
321 }
322
323 return StatusCode::SUCCESS;
324}
#define ATH_MSG_VERBOSE(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t ss
StatusCode recordParameter(unsigned int, const std::string &, CscCondDbData *, const std::string &) const

◆ cacheASM()

StatusCode CscCondDbAlg::cacheASM ( const std::string & data,
CscCondDbData * writeCdo,
const std::string & parName ) const
private

Definition at line 326 of file CscCondDbAlg.cxx.

326 {
327 std::istringstream ss(data);
328 std::string valueStr;
329 std::string chanAddress;
330 bool setAddress = false;
331
332 bool started = false;
333 while (ss.good()) {
334 ss >> valueStr;
335
336 if (valueStr == "<END_DATA>") break;
337
338 if (valueStr == "<BEGIN_DATA>") {
339 started = true;
340 continue;
341 }
342 if (!started) continue;
343 ATH_MSG_VERBOSE("cacheASM() - current element " << valueStr);
344 std::istringstream iss(valueStr);
345
346 // use new iss to translate the hex
347 if (!setAddress) {
348 iss >> chanAddress;
349 setAddress = true;
350 continue;
351 }
352
353 // chanAddress is the ASM tag, need to do something with it
354 // format: ASM[#:1-5]_[StationEtaString:AorC][stationPhi:1-8]_[stationName:50-51]
355 // xxx 3 x 5 6 x x9
356 int asmNum = atoi(chanAddress.substr(3, 1).c_str());
357
358 int stationEta = 0;
359 if (chanAddress[5] == 'A')
360 stationEta = 1;
361 else if (chanAddress[5] == 'C')
362 stationEta = -1;
363 else {
364 ATH_MSG_FATAL("Bad ASMID String in CSC COOL database \"" << chanAddress << "\" (wheel " << chanAddress[5] << " doesn't exist!");
365 return StatusCode::FAILURE;
366 }
367
368 int stationPhi = atoi(chanAddress.substr(6, 1).c_str());
369 int stationName = atoi(chanAddress.substr(8, 2).c_str());
370
371 if (stationPhi < 1 || stationPhi > 8 || stationName < 50 || stationName > 51) {
372 ATH_MSG_FATAL("Bad ASMID String in CSC COOL database: \"" << chanAddress << "\"");
373 ATH_MSG_FATAL("Read station phi: " << stationPhi << ", stationName " << stationName);
374 return StatusCode::FAILURE;
375 }
376
377 int chamberLayer = 2; // chamberLayer1 was never built.
378
379 int measuresPhi = 0;
380 int layerSince = 0;
381 int layerUntil = 0;
382 int stripSince = 0;
383 int stripUntil = 0;
384 if (!getAsmScope(asmNum, measuresPhi, layerSince, layerUntil, stripSince, stripUntil).isSuccess()) {
385 ATH_MSG_FATAL("Failure of getAsmScope in cacheASM.");
386 return StatusCode::FAILURE;
387 }
388
389 // Now for given asmID, loop over strip and layer
390 unsigned int index = 0;
391 Identifier chanId;
392 IdentifierHash hashIdentifier;
393 for (int iStrip = stripSince; iStrip < stripUntil; iStrip++) {
394 for (int iLayer = layerSince; iLayer < layerUntil; iLayer++) {
395 // The following call of channelID with check=true ensures that the identifier is checked to be physically valid.
396 // This is currently required to be checked when running with layouts which do not contain all CSCs anymore, since the
397 // CSCCool database contains still all CSCs. A clean fix would be to have a dedicated database for every layout.
398 bool isValid = true;
399 chanId = m_idHelperSvc->cscIdHelper().channelID(stationName, stationEta, stationPhi, chamberLayer, iLayer, measuresPhi,
400 iStrip, isValid);
401
402 static std::atomic<bool> conversionFailPrinted = false;
403 if (!isValid) {
404 if (!conversionFailPrinted.load()) {
406 "Failed to retrieve offline identifier from ASM cool "
407 "string "
408 << chanAddress
409 << ". This is likely due to the fact that the CSCCool "
410 "database contains "
411 << "more entries than the detector layout.");
412 conversionFailPrinted.store(true);
413 }
414 continue;
415 }
416 if (m_idHelperSvc->cscIdHelper().get_channel_hash(chanId, hashIdentifier)) {
417 ATH_MSG_WARNING("Failed to retrieve channel hash for Identifier " << chanId.get_compact());
418 }
419 index = (int)hashIdentifier;
420 if (index == UINT_MAX) continue;
421
422 ATH_MSG_VERBOSE("[cache version 2 (ASM)] Recording " << valueStr << " at index " << index << "\nstationName " << stationName
423 << "\nstationEta " << stationEta << "\nstationPhi " << stationPhi
424 << "\nchamberLayer " << chamberLayer << "\niLayer " << iLayer
425 << "\nmeasuresPhi " << measuresPhi << "\niStrip " << iStrip);
426
427 // record parameter
428 if (recordParameter(hashIdentifier, valueStr, writeCdo, parName).isFailure()) return StatusCode::FAILURE;
429 }
430 }
431
432 // reset the address
433 setAddress = false;
434 chanAddress = "";
435 }
436
437 return StatusCode::SUCCESS;
438}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(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
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode getAsmScope(int, int &, int &, int &, int &, int &) const
value_type get_compact() const
Get the compact id.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
str index
Definition DeMoScan.py:362
constexpr uint8_t stationPhi
station Phi 1 to 8

◆ 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 CscCondDbAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 53 of file CscCondDbAlg.cxx.

53 {
54 ATH_MSG_DEBUG("execute " << name());
55
56 // launching Write Cond Handle
57 SG::WriteCondHandle<CscCondDbData> writeHandle{m_writeKey, ctx};
58 if (writeHandle.isValid()) {
59 ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
60 << " In theory this should not be called, but may happen"
61 << " if multiple concurrent events are being processed out of order.");
62 return StatusCode::SUCCESS;
63 }
64 std::unique_ptr<CscCondDbData> writeCdo{std::make_unique<CscCondDbData>()};
65
66 writeCdo->loadParameters(&m_idHelperSvc->cscIdHelper());
67 writeCdo->setParameters(m_onlineOfflinePhiFlip);
68
69 // data only
70 if (m_isData) {
71 // ATH_CHECK(loadDataHv(writeHandle, writeCdo.get(), ctx)); // keep for future development
72 }
73
74 // both data and MC
75 ATH_CHECK(loadDataF001(writeHandle, writeCdo.get(), ctx));
76 ATH_CHECK(loadDataNoise(writeHandle, writeCdo.get(), ctx));
77 ATH_CHECK(loadDataPed(writeHandle, writeCdo.get(), ctx));
78 if (m_pslopeFromDB) ATH_CHECK(loadDataPSlope(writeHandle, writeCdo.get(), ctx));
79 ATH_CHECK(loadDataRMS(writeHandle, writeCdo.get(), ctx));
80 ATH_CHECK(loadDataStatus(writeHandle, writeCdo.get(), ctx));
81
82 if (!m_isOnline) {
83 ATH_CHECK(loadDataT0Base(writeHandle, writeCdo.get(), ctx));
84 ATH_CHECK(loadDataT0Phase(writeHandle, writeCdo.get(), ctx));
85 }
86
87 if (writeHandle.record(std::move(writeCdo)).isFailure()) {
88 ATH_MSG_FATAL("Could not record CscCondDbData " << writeHandle.key() << " with EventRange " << writeHandle.getRange()
89 << " into Conditions Store");
90 return StatusCode::FAILURE;
91 }
92 ATH_MSG_DEBUG("Recorded new " << writeHandle.key() << " with range " << writeHandle.getRange() << " into Conditions Store");
93
94 return StatusCode::SUCCESS;
95}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
StatusCode loadDataPSlope(writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataT0Base(writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataStatus(writeHandle_t &, CscCondDbData *, const EventContext &) const
Gaudi::Property< bool > m_pslopeFromDB
The pslope is the gain of each CSC channel.
SG::WriteCondHandleKey< CscCondDbData > m_writeKey
Gaudi::Property< bool > m_onlineOfflinePhiFlip
Gaudi::Property< bool > m_isData
StatusCode loadDataF001(writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataNoise(writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataT0Phase(writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataPed(writeHandle_t &, CscCondDbData *, const EventContext &) const
StatusCode loadDataRMS(writeHandle_t &, CscCondDbData *, const EventContext &) const
Gaudi::Property< bool > m_isOnline
const std::string & key() const
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const

◆ 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

◆ getAsmScope()

StatusCode CscCondDbAlg::getAsmScope ( int asmNum,
int & measuresPhi,
int & layerSince,
int & layerUntil,
int & stripSince,
int & stripUntil ) const
private

Definition at line 441 of file CscCondDbAlg.cxx.

442 {
443 // copy-paste from CscCoolStrSvc
444
445 if (asmNum == 1) {
446 stripSince = 1; // inclusive
447 stripUntil = 97; // exclusive
448 layerSince = 1; // inclusive
449 layerUntil = 3; // exclusive
450 measuresPhi = 0;
451 } else if (asmNum == 2) {
452 stripSince = 1; // inclusive
453 stripUntil = 97; // exclusive
454 layerSince = 3; // inclusive
455 layerUntil = 5; // exclusive
456 measuresPhi = 0;
457 } else if (asmNum == 3) {
458 stripSince = 97;
459 stripUntil = 193;
460 layerSince = 1;
461 layerUntil = 3;
462 measuresPhi = 0;
463 } else if (asmNum == 4) {
464 stripSince = 97;
465 stripUntil = 193;
466 layerSince = 3;
467 layerUntil = 5;
468 measuresPhi = 0;
469 } else if (asmNum == 5) {
470 stripSince = 1;
471 stripUntil = 49;
472 layerSince = 1;
473 layerUntil = 5;
474 measuresPhi = 1;
475 } else {
476 ATH_MSG_FATAL("ASM number \"" << asmNum << "\" is invalid. It needs to end in a number from 1-5.");
477 return StatusCode::FAILURE;
478 }
479 return StatusCode::SUCCESS;
480}

◆ getParameter()

template<typename T>
StatusCode CscCondDbAlg::getParameter ( IdentifierHash chanHash,
std::string data,
T & token ) const
inlineprivate

Definition at line 114 of file CscCondDbAlg.h.

114 {
115 // next element is the status bit
116 std::istringstream iss(data);
117 iss >> token;
118
119 ATH_MSG_VERBOSE("Recorded token " << token << " for channelHash " << chanHash);
120 return StatusCode::SUCCESS;
121 }

◆ initialize()

StatusCode CscCondDbAlg::initialize ( )
overridevirtual

Definition at line 18 of file CscCondDbAlg.cxx.

18 {
19 ATH_MSG_DEBUG("initializing " << name());
20 ATH_CHECK(m_idHelperSvc.retrieve());
21 ATH_CHECK(m_writeKey.initialize());
22
23 if (m_pslopeFromDB) {
24 ATH_MSG_WARNING("You have activated the retrieval of the pslope per CSC channel from the COOL database. "
25 << "Please make sure that a correct PSLOPE database is in place which uses geometrical CSC hashes in hex format "
26 << "as keys and different values of the pslopes for the different CSC channels as values, otherwise please run "
27 << "with the ReadPSlopeFromDatabase property set to false");
28 } else {
29 float pslope = m_pslope; // Work around cppcheck false positive
30 if (!(pslope > 0 && pslope < 1)) {
31 ATH_MSG_FATAL("The Pslope cannot be set to a value <=0 or >=1");
32 return StatusCode::FAILURE;
33 } else if (m_pslope != m_DEFAULT_PSLOPE) {
34 ATH_MSG_WARNING("You have manually set the Pslope property (to " << m_pslope
35 << "). Please check whether this is really intended.");
36 }
37 }
38
48
49 return StatusCode::SUCCESS;
50}
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_rms
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_status
Gaudi::Property< float > m_pslope
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_t0base
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_noise
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_t0phase
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_ped
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_pslope
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_hv
const float m_DEFAULT_PSLOPE
The CSC gain was originally 5.304 ADC counts per fC, but later increased to 5.7 ADC counts per fC,...
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_f001

◆ 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; }

◆ loadData()

StatusCode CscCondDbAlg::loadData ( CscCondDbData * writeCdo,
const CondAttrListCollection * readCdo,
const std::string & parName,
bool parAsm = false ) const
private

Definition at line 234 of file CscCondDbAlg.cxx.

235 {
237
238 for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
239 const coral::AttributeList& atr = itr->second;
240 std::string data = atr["Data"].data<std::string>();
241 ATH_MSG_DEBUG("Data is: " << data);
242
243 std::istringstream ss(data);
244
245 if (!ss.good()) {
246 ATH_MSG_WARNING("Failed forming stringstream during caching");
247 continue;
248 }
249
250 std::string version;
251 ss >> version;
252
253 if (version == "02-00" && parAsm) {
254 if (!cacheASM(data, writeCdo, parName).isSuccess()) {
255 ATH_MSG_ERROR("Failed caching from COOL string version 02-00 in ASM format");
256 return StatusCode::FAILURE;
257 }
258 } else if (version == "02-00") {
259 if (!cache(data, writeCdo, parName).isSuccess()) {
260 ATH_MSG_ERROR("Failed caching from COOL string version 02-00");
261 return StatusCode::FAILURE;
262 }
263 } else {
264 // Old version was treated as an actual number rather than string. It was always
265 // set to 1 or sometimes 1.00000, so we convert to integer here and check
266 ATH_MSG_WARNING("Don't recognize CSC COOL string version " << version << ". Will treat as default version "
268 if (m_defaultDatabaseReadVersion == "02-00" && parAsm) {
269 if (!cacheASM(data, writeCdo, parName).isSuccess()) {
270 ATH_MSG_ERROR("Failed caching from COOL string version 02-00 in ASM format");
271 return StatusCode::FAILURE;
272 }
273 } else if (m_defaultDatabaseReadVersion == "02-00") {
274 if (!cache(data, writeCdo, parName).isSuccess()) {
275 ATH_MSG_ERROR("Failed caching from COOL string version 02-00");
276 return StatusCode::FAILURE;
277 }
278 } else {
279 ATH_MSG_FATAL("Did not recognize CSC COOL string version "
280 << version
281 << ". Currently, only version 02-00 is supported. The keys of the database have to be geometrical CSC hashes "
282 "in hex format.");
283 return StatusCode::FAILURE;
284 }
285 }
286 }
287
288 return StatusCode::SUCCESS;
289}
#define ATH_MSG_ERROR(x)
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
StatusCode cacheASM(const std::string &, CscCondDbData *, const std::string &) const
StatusCode cache(const std::string &, CscCondDbData *, const std::string &) const
Gaudi::Property< std::string > m_defaultDatabaseReadVersion

◆ loadDataF001()

StatusCode CscCondDbAlg::loadDataF001 ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 178 of file CscCondDbAlg.cxx.

178 {
179 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_f001, ctx};
180 writeHandle.addDependency(readHandle);
181 return loadData(writeCdo, *readHandle, "f001");
182}
StatusCode loadData(CscCondDbData *, const CondAttrListCollection *, const std::string &, bool=false) const

◆ loadDataHv()

StatusCode CscCondDbAlg::loadDataHv ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 98 of file CscCondDbAlg.cxx.

98 {
99 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_hv, ctx};
100 const CondAttrListCollection* readCdo{*readHandle};
101 if (readCdo == nullptr) {
102 ATH_MSG_ERROR("Null pointer to the read conditions object");
103 return StatusCode::FAILURE;
104 }
105 writeHandle.addDependency(readHandle);
106
107 ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size());
108 ATH_MSG_DEBUG("Range of input is " << readHandle.getRange() << ", range of output is " << writeHandle.getRange());
109
111 std::map<Identifier, int> layerMap;
112 int hv_state, lv_state, hv_setpoint0, hv_setpoint1;
113 unsigned int chan_index = 0;
114 for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
115 unsigned int chanNum = readCdo->chanNum(chan_index);
116 const std::string& csc_chan_name = readCdo->chanName(chanNum);
117
118 const coral::AttributeList& atr = itr->second;
119
120 if (atr.size()) {
121 hv_state = *(static_cast<const int*>((atr["HVState"]).addressOfData()));
122 lv_state = *(static_cast<const int*>((atr["LVState"]).addressOfData()));
123 hv_setpoint0 = *(static_cast<const int*>((atr["HVSetpoint0"]).addressOfData()));
124 hv_setpoint1 = *(static_cast<const int*>((atr["HVSetpoint1"]).addressOfData()));
125
126 std::string_view delimiter{"_"};
127 auto tokens = CxxUtils::tokenize(csc_chan_name, delimiter);
128
129 if ((hv_state != 1 or lv_state != 1 or hv_setpoint0 < 1000 or hv_setpoint1 < 1000) && !tokens.empty()) {
130 std::string_view layer = tokens[1];
131 std::string number_layer = tokens[1].substr(1, 2);
132 int wirelayer = CxxUtils::atoi(number_layer);
133
134 int eta = 0;
135 char eta_side = tokens[0][0];
136 if (eta_side == 'A') eta = +1;
137 if (eta_side == 'C') eta = -1;
138
139 std::string chamber_name;
140 char size_side = tokens[0][1];
141 if (size_side == 'L') chamber_name = "CSL";
142 else if (size_side == 'S') chamber_name = "CSS";
143
144 int phi = 0;
145 std::string sector_side = tokens[0].substr(2, 4);
146 if (sector_side == "01" || sector_side == "02") phi = 1;
147 else if (sector_side == "03" || sector_side == "04") phi = 2;
148 else if (sector_side == "05" || sector_side == "06") phi = 3;
149 else if (sector_side == "07" || sector_side == "08") phi = 4;
150 else if (sector_side == "09" || sector_side == "10") phi = 5;
151 else if (sector_side == "11" || sector_side == "12") phi = 6;
152 else if (sector_side == "13" || sector_side == "14") phi = 7;
153 else if (sector_side == "15" || sector_side == "16") phi = 8;
154
155 Identifier ChamberId = m_idHelperSvc->cscIdHelper().elementID(chamber_name, eta, phi);
156 Identifier WireLayerId = m_idHelperSvc->cscIdHelper().channelID(ChamberId, 1, wirelayer, 1, 1);
157 std::string WireLayerstring = std::string(chamber_name);
158 WireLayerstring += '_';
159 WireLayerstring += eta_side;
160 WireLayerstring += '_';
161 WireLayerstring += sector_side;
162 WireLayerstring += '_';
163 WireLayerstring += layer;
164
165 writeCdo->setDeadLayer(WireLayerstring, WireLayerId);
166 int& mapval = layerMap[ChamberId];
167 ++mapval;
168 if (mapval == 3) writeCdo->setDeadStation(chamber_name, ChamberId);
169 }
170 }
171 chan_index++;
172 }
173
174 return StatusCode::SUCCESS;
175}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
ChanNum chanNum(unsigned int index) const
channel number for index: (index = 0 to size-1)
const std::string & chanName(ChanNum chanNum) const
find name for particular channel
size_type size() const
number of Chan/AttributeList pairs
void setDeadLayer(std::string_view, Identifier)
void setDeadStation(std::string_view, Identifier)
const DataObjID & fullKey() const
const EventIDRange & getRange()
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
@ layer
Definition HitInfo.h:79

◆ loadDataNoise()

StatusCode CscCondDbAlg::loadDataNoise ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 185 of file CscCondDbAlg.cxx.

185 {
186 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_noise, ctx};
187 writeHandle.addDependency(readHandle);
188 return loadData(writeCdo, *readHandle, "noise");
189}

◆ loadDataPed()

StatusCode CscCondDbAlg::loadDataPed ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 192 of file CscCondDbAlg.cxx.

192 {
193 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_ped, ctx};
194 writeHandle.addDependency(readHandle);
195 return loadData(writeCdo, *readHandle, "ped");
196}

◆ loadDataPSlope()

StatusCode CscCondDbAlg::loadDataPSlope ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 199 of file CscCondDbAlg.cxx.

199 {
200 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_pslope, ctx};
201 writeHandle.addDependency(readHandle);
202 return loadData(writeCdo, *readHandle, "pslope");
203}

◆ loadDataRMS()

StatusCode CscCondDbAlg::loadDataRMS ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 206 of file CscCondDbAlg.cxx.

206 {
207 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_rms, ctx};
208 writeHandle.addDependency(readHandle);
209 return loadData(writeCdo, *readHandle, "rms");
210}

◆ loadDataStatus()

StatusCode CscCondDbAlg::loadDataStatus ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 213 of file CscCondDbAlg.cxx.

213 {
214 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_status, ctx};
215 writeHandle.addDependency(readHandle);
216 return loadData(writeCdo, *readHandle, "status");
217}

◆ loadDataT0Base()

StatusCode CscCondDbAlg::loadDataT0Base ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 220 of file CscCondDbAlg.cxx.

220 {
221 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_t0base, ctx};
222 writeHandle.addDependency(readHandle);
223 return loadData(writeCdo, *readHandle, "t0base");
224}

◆ loadDataT0Phase()

StatusCode CscCondDbAlg::loadDataT0Phase ( writeHandle_t & writeHandle,
CscCondDbData * writeCdo,
const EventContext & ctx ) const
private

Definition at line 227 of file CscCondDbAlg.cxx.

227 {
228 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_t0phase, ctx};
229 writeHandle.addDependency(readHandle);
230 return loadData(writeCdo, *readHandle, "t0phase", true);
231}

◆ 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.

◆ recordParameter() [1/2]

StatusCode CscCondDbAlg::recordParameter ( IdentifierHash chanHash,
const std::string & data,
CscCondDbData * writeCdo,
const std::string & parName ) const
private

Definition at line 506 of file CscCondDbAlg.cxx.

507 {
508 // record parameter
509 StatusCode sc = StatusCode::FAILURE;
510 if (parName == "f001")
511 sc = recordParameterF001(chanHash, data, writeCdo);
512 else if (parName == "noise")
513 sc = recordParameterNoise(chanHash, data, writeCdo);
514 else if (parName == "ped")
515 sc = recordParameterPed(chanHash, data, writeCdo);
516 else if (parName == "pslope")
517 sc = recordParameterPSlope(chanHash, data, writeCdo);
518 else if (parName == "rms")
519 sc = recordParameterRMS(chanHash, data, writeCdo);
520 else if (parName == "status")
521 sc = recordParameterStatus(chanHash, data, writeCdo);
522 else if (parName == "t0base")
523 sc = recordParameterT0Base(chanHash, data, writeCdo);
524 else if (parName == "t0phase")
525 sc = recordParameterT0Phase(chanHash, data, writeCdo);
526
527 if (!sc.isSuccess())
528 ATH_MSG_ERROR("Cannot extract parameter " << parName << " for channel hash " << chanHash << " from data string '" << data << "'");
529 return sc;
530}
static Double_t sc
StatusCode recordParameterT0Phase(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterRMS(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterPed(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterF001(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterT0Base(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterStatus(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterNoise(IdentifierHash, std::string, CscCondDbData *) const
StatusCode recordParameterPSlope(IdentifierHash, std::string, CscCondDbData *) const
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ recordParameter() [2/2]

StatusCode CscCondDbAlg::recordParameter ( unsigned int chanAddress,
const std::string & data,
CscCondDbData * writeCdo,
const std::string & parName ) const
private

Definition at line 483 of file CscCondDbAlg.cxx.

484 {
485 // retrieve channel hash
486 Identifier chamberId;
487 Identifier channelId;
488 if (!writeCdo->onlineToOfflineIds(&m_idHelperSvc->cscIdHelper(), chanAddress, chamberId, channelId).isSuccess()) {
489 // if onlineToOfflineIds does not return SUCCESS, the underlying reason was alrady printed there, so no need to also print a WARNING
490 // here
491 return StatusCode::SUCCESS;
492 }
493
494 IdentifierHash chanHash;
495 if (m_idHelperSvc->cscIdHelper().get_channel_hash(channelId, chanHash)) {
496 ATH_MSG_WARNING("recordParameter(): Failed to retrieve channel Identifier hash for Identifier " << channelId.get_compact()
497 << ". Not recording parameter...");
498 return StatusCode::SUCCESS;
499 }
500
501 // record parameter
502 return recordParameter(chanHash, data, writeCdo, parName);
503}
StatusCode onlineToOfflineIds(const CscIdHelper *, const unsigned int &, Identifier &, Identifier &) const

◆ recordParameterF001()

StatusCode CscCondDbAlg::recordParameterF001 ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 533 of file CscCondDbAlg.cxx.

533 {
534 float token;
535 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
536 writeCdo->setChannelF001(chanHash, token);
537 return StatusCode::SUCCESS;
538}
StatusCode getParameter(IdentifierHash chanHash, std::string data, T &token) const
void setChannelF001(IdentifierHash, float)

◆ recordParameterNoise()

StatusCode CscCondDbAlg::recordParameterNoise ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 541 of file CscCondDbAlg.cxx.

541 {
542 float token;
543 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
544 writeCdo->setChannelNoise(chanHash, token);
545 return StatusCode::SUCCESS;
546}
void setChannelNoise(IdentifierHash, float)

◆ recordParameterPed()

StatusCode CscCondDbAlg::recordParameterPed ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 549 of file CscCondDbAlg.cxx.

549 {
550 float token;
551 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
552 writeCdo->setChannelPed(chanHash, token);
553 return StatusCode::SUCCESS;
554}
void setChannelPed(IdentifierHash, float)

◆ recordParameterPSlope()

StatusCode CscCondDbAlg::recordParameterPSlope ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 557 of file CscCondDbAlg.cxx.

557 {
558 if (m_pslopeFromDB) {
559 float token;
560 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
561 writeCdo->setChannelPSlope(chanHash, token);
562 } else {
563 // just set plsope to m_pslope for every channel
564 writeCdo->setChannelPSlope(chanHash, m_pslope);
565 }
566 return StatusCode::SUCCESS;
567}
void setChannelPSlope(IdentifierHash, float)

◆ recordParameterRMS()

StatusCode CscCondDbAlg::recordParameterRMS ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 570 of file CscCondDbAlg.cxx.

570 {
571 float token;
572 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
573 writeCdo->setChannelRMS(chanHash, token);
574 return StatusCode::SUCCESS;
575}
void setChannelRMS(IdentifierHash, float)

◆ recordParameterStatus()

StatusCode CscCondDbAlg::recordParameterStatus ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 578 of file CscCondDbAlg.cxx.

578 {
579 int token{};
580 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
581 //setChannelStatus takes signed int token argument
582 writeCdo->setChannelStatus(chanHash, token);
583 return StatusCode::SUCCESS;
584}
void setChannelStatus(IdentifierHash, int)

◆ recordParameterT0Base()

StatusCode CscCondDbAlg::recordParameterT0Base ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 587 of file CscCondDbAlg.cxx.

587 {
588 float token;
589 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
590 writeCdo->setChannelT0Base(chanHash, token);
591 return StatusCode::SUCCESS;
592}
void setChannelT0Base(IdentifierHash, float)

◆ recordParameterT0Phase()

StatusCode CscCondDbAlg::recordParameterT0Phase ( IdentifierHash chanHash,
std::string data,
CscCondDbData * writeCdo ) const
private

Definition at line 595 of file CscCondDbAlg.cxx.

595 {
596 bool token;
597 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
598 writeCdo->setChannelT0Phase(chanHash, token);
599 return StatusCode::SUCCESS;
600}
void setChannelT0Phase(IdentifierHash, bool)

◆ 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}
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_DEFAULT_PSLOPE

const float CscCondDbAlg::m_DEFAULT_PSLOPE = 0.175
private

The CSC gain was originally 5.304 ADC counts per fC, but later increased to 5.7 ADC counts per fC, so the pslope equals 1/5.7 = 0.175438.

Definition at line 109 of file CscCondDbAlg.h.

◆ m_defaultDatabaseReadVersion

Gaudi::Property<std::string> CscCondDbAlg::m_defaultDatabaseReadVersion {this, "defaultDatabaseReadVersion", "02-00", ""}
private

Definition at line 70 of file CscCondDbAlg.h.

70{this, "defaultDatabaseReadVersion", "02-00", ""};

◆ 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_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> CscCondDbAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 72 of file CscCondDbAlg.h.

72{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_isData

Gaudi::Property<bool> CscCondDbAlg::m_isData {this, "isData", false, ""}
private

Definition at line 67 of file CscCondDbAlg.h.

67{this, "isData", false, ""};

◆ m_isOnline

Gaudi::Property<bool> CscCondDbAlg::m_isOnline {this, "isOnline", false, ""}
private

Definition at line 66 of file CscCondDbAlg.h.

66{this, "isOnline", false, ""};

◆ m_isRun1

Gaudi::Property<bool> CscCondDbAlg::m_isRun1 {this, "isRun1", false, ""}
private

Definition at line 68 of file CscCondDbAlg.h.

68{this, "isRun1", false, ""};

◆ m_onlineOfflinePhiFlip

Gaudi::Property<bool> CscCondDbAlg::m_onlineOfflinePhiFlip {this, "onlineOfflinePhiFlip", true, ""}
private

Definition at line 69 of file CscCondDbAlg.h.

69{this, "onlineOfflinePhiFlip", true, ""};

◆ m_pslope

Gaudi::Property<float> CscCondDbAlg::m_pslope
private
Initial value:
{this, "PSlope", m_DEFAULT_PSLOPE,
"in case someone comes up with a new default value for pslope in the future"}

Definition at line 110 of file CscCondDbAlg.h.

110 {this, "PSlope", m_DEFAULT_PSLOPE,
111 "in case someone comes up with a new default value for pslope in the future"};

◆ m_pslopeFromDB

Gaudi::Property<bool> CscCondDbAlg::m_pslopeFromDB
private
Initial value:
{
this, "ReadPSlopeFromDatabase", false,
"read the pslope parameter from the conditions database (if it is not the same value for all channels)"}

The pslope is the gain of each CSC channel.

It was intended to be retrieved by calibration with the pulser runs, but the pulses caused overload in the amplifiers because every channel fires at once. This leads to errors that are larger than the variation between channels. Consequently, the pslope is the same for all channels. In the future, one could try to calibrate from data. The support for the pslope in the database is maintained by having a boolean property ReadPSlopeFromDatabase. If it is set to false, the value of the property PSlope is used for all channels.

Definition at line 102 of file CscCondDbAlg.h.

102 {
103 this, "ReadPSlopeFromDatabase", false,
104 "read the pslope parameter from the conditions database (if it is not the same value for all channels)"};

◆ m_readKey_folder_da_f001

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_f001
private
Initial value:
{this, "ReadKey_FT", "/CSC/FTHOLD",
"Key of input CSC condition data F001"}

Definition at line 78 of file CscCondDbAlg.h.

78 {this, "ReadKey_FT", "/CSC/FTHOLD",
79 "Key of input CSC condition data F001"};

◆ m_readKey_folder_da_hv

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_hv
private
Initial value:
{this, "ReadKey_HV", "/CSC/DCS/LAYERSTATE",
"Key of input CSC condition data HV"}

Definition at line 76 of file CscCondDbAlg.h.

76 {this, "ReadKey_HV", "/CSC/DCS/LAYERSTATE",
77 "Key of input CSC condition data HV"};

◆ m_readKey_folder_da_noise

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_noise
private
Initial value:
{this, "ReadKey_NO", "/CSC/NOISE",
"Key of input CSC condition data NOISE"}

Definition at line 80 of file CscCondDbAlg.h.

80 {this, "ReadKey_NO", "/CSC/NOISE",
81 "Key of input CSC condition data NOISE"};

◆ m_readKey_folder_da_ped

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_ped
private
Initial value:
{this, "ReadKey_PD", "/CSC/PED",
"Key of input CSC condition data PEDESTALS"}

Definition at line 82 of file CscCondDbAlg.h.

82 {this, "ReadKey_PD", "/CSC/PED",
83 "Key of input CSC condition data PEDESTALS"};

◆ m_readKey_folder_da_pslope

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_pslope
private
Initial value:
{this, "ReadKey_PS", "/CSC/PSLOPE",
"Key of input CSC condition data PSLOPE"}

Definition at line 84 of file CscCondDbAlg.h.

84 {this, "ReadKey_PS", "/CSC/PSLOPE",
85 "Key of input CSC condition data PSLOPE"};

◆ m_readKey_folder_da_rms

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_rms
private
Initial value:
{this, "ReadKey_RM", "/CSC/RMS",
"Key of input CSC condition data RMS"}

Definition at line 86 of file CscCondDbAlg.h.

86 {this, "ReadKey_RM", "/CSC/RMS",
87 "Key of input CSC condition data RMS"};

◆ m_readKey_folder_da_status

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_status
private
Initial value:
{this, "ReadKey_ST", "/CSC/STAT",
"Key of input CSC condition data STATUS"}

Definition at line 88 of file CscCondDbAlg.h.

88 {this, "ReadKey_ST", "/CSC/STAT",
89 "Key of input CSC condition data STATUS"};

◆ m_readKey_folder_da_t0base

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_t0base
private
Initial value:
{this, "ReadKey_TB", "/CSC/T0BASE",
"Key of input CSC condition data T0BASE"}

Definition at line 90 of file CscCondDbAlg.h.

90 {this, "ReadKey_TB", "/CSC/T0BASE",
91 "Key of input CSC condition data T0BASE"};

◆ m_readKey_folder_da_t0phase

SG::ReadCondHandleKey<CondAttrListCollection> CscCondDbAlg::m_readKey_folder_da_t0phase
private
Initial value:
{this, "ReadKey_TP", "/CSC/T0PHASE",
"Key of input CSC condition data T0PHASE"}

Definition at line 92 of file CscCondDbAlg.h.

92 {this, "ReadKey_TP", "/CSC/T0PHASE",
93 "Key of input CSC condition data T0PHASE"};

◆ 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_writeKey

SG::WriteCondHandleKey<CscCondDbData> CscCondDbAlg::m_writeKey {this, "WriteKey", "CscCondDbData", "Key of output CSC condition data"}
private

Definition at line 74 of file CscCondDbAlg.h.

74{this, "WriteKey", "CscCondDbData", "Key of output CSC condition data"};

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