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

#include <CscCondDbAlg.h>

Inheritance diagram for Muon::CscCondDbAlg:
Collaboration diagram for Muon::CscCondDbAlg:

Public Member Functions

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 28 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

Constructor & Destructor Documentation

◆ ~CscCondDbAlg()

virtual Muon::CscCondDbAlg::~CscCondDbAlg ( )
virtualdefault

Member Function Documentation

◆ cache()

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

Definition at line 285 of file CscCondDbAlg.cxx.

285 {
286 std::istringstream ss(data);
287 std::string valueStr;
288 unsigned int chanAddress = 0;
289
290 bool started = false;
291 while (ss.good()) {
292 ss >> valueStr;
293
294 if (valueStr == "<END_DATA>") break;
295
296 if (valueStr == "<BEGIN_DATA>") {
297 started = true;
298 continue;
299 }
300 if (!started) continue;
301 ATH_MSG_VERBOSE("cache() - current element " << valueStr);
302 std::istringstream iss(valueStr);
303
304 // use new iss to translate the hex
305 if (chanAddress == 0) {
306 iss >> std::hex >> chanAddress;
307 continue;
308 }
309
310 // record parameter
311 if (recordParameter(chanAddress, valueStr, writeCdo, parName).isFailure()) return StatusCode::FAILURE;
312
313 // reset the address
314 chanAddress = 0;
315 }
316
317 return StatusCode::SUCCESS;
318}
#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 Muon::CscCondDbAlg::cacheASM ( const std::string & data,
CscCondDbData * writeCdo,
const std::string & parName ) const
private

Definition at line 320 of file CscCondDbAlg.cxx.

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

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

Definition at line 47 of file CscCondDbAlg.cxx.

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

Definition at line 435 of file CscCondDbAlg.cxx.

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

◆ getParameter()

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

Definition at line 115 of file CscCondDbAlg.h.

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

◆ initialize()

StatusCode Muon::CscCondDbAlg::initialize ( )
overridevirtual

Definition at line 12 of file CscCondDbAlg.cxx.

12 {
13 ATH_MSG_DEBUG("initializing " << name());
14 ATH_CHECK(m_idHelperSvc.retrieve());
15 ATH_CHECK(m_writeKey.initialize());
16
17 if (m_pslopeFromDB) {
18 ATH_MSG_WARNING("You have activated the retrieval of the pslope per CSC channel from the COOL database. "
19 << "Please make sure that a correct PSLOPE database is in place which uses geometrical CSC hashes in hex format "
20 << "as keys and different values of the pslopes for the different CSC channels as values, otherwise please run "
21 << "with the ReadPSlopeFromDatabase property set to false");
22 } else {
23 float pslope = m_pslope; // Work around cppcheck false positive
24 if (!(pslope > 0 && pslope < 1)) {
25 ATH_MSG_FATAL("The Pslope cannot be set to a value <=0 or >=1");
26 return StatusCode::FAILURE;
27 } else if (m_pslope != m_DEFAULT_PSLOPE) {
28 ATH_MSG_WARNING("You have manually set the Pslope property (to " << m_pslope
29 << "). Please check whether this is really intended.");
30 }
31 }
32
42
43 return StatusCode::SUCCESS;
44}
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_pslope
Gaudi::Property< float > m_pslope
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_noise
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_hv
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_t0base
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_f001
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_status
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_ped
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_rms
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_folder_da_t0phase

◆ 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 Muon::CscCondDbAlg::loadData ( CscCondDbData * writeCdo,
const CondAttrListCollection * readCdo,
const std::string & parName,
bool parAsm = false ) const
private

Definition at line 228 of file CscCondDbAlg.cxx.

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

◆ loadDataF001()

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

Definition at line 172 of file CscCondDbAlg.cxx.

172 {
173 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_f001, ctx};
174 writeHandle.addDependency(readHandle);
175 return loadData(writeCdo, *readHandle, "f001");
176}
StatusCode loadData(CscCondDbData *, const CondAttrListCollection *, const std::string &, bool=false) const

◆ loadDataHv()

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

Definition at line 92 of file CscCondDbAlg.cxx.

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

Definition at line 179 of file CscCondDbAlg.cxx.

179 {
180 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_noise, ctx};
181 writeHandle.addDependency(readHandle);
182 return loadData(writeCdo, *readHandle, "noise");
183}

◆ loadDataPed()

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

Definition at line 186 of file CscCondDbAlg.cxx.

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

◆ loadDataPSlope()

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

Definition at line 193 of file CscCondDbAlg.cxx.

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

◆ loadDataRMS()

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

Definition at line 200 of file CscCondDbAlg.cxx.

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

◆ loadDataStatus()

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

Definition at line 207 of file CscCondDbAlg.cxx.

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

◆ loadDataT0Base()

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

Definition at line 214 of file CscCondDbAlg.cxx.

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

◆ loadDataT0Phase()

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

Definition at line 221 of file CscCondDbAlg.cxx.

221 {
222 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey_folder_da_t0phase, ctx};
223 writeHandle.addDependency(readHandle);
224 return loadData(writeCdo, *readHandle, "t0phase", true);
225}

◆ 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 Muon::CscCondDbAlg::recordParameter ( IdentifierHash chanHash,
const std::string & data,
CscCondDbData * writeCdo,
const std::string & parName ) const
private

Definition at line 500 of file CscCondDbAlg.cxx.

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

◆ recordParameter() [2/2]

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

Definition at line 477 of file CscCondDbAlg.cxx.

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

◆ recordParameterF001()

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

Definition at line 527 of file CscCondDbAlg.cxx.

527 {
528 float token;
529 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
530 writeCdo->setChannelF001(chanHash, token);
531 return StatusCode::SUCCESS;
532}
void setChannelF001(IdentifierHash, float)
StatusCode getParameter(IdentifierHash chanHash, std::string data, T &token) const

◆ recordParameterNoise()

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

Definition at line 535 of file CscCondDbAlg.cxx.

535 {
536 float token;
537 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
538 writeCdo->setChannelNoise(chanHash, token);
539 return StatusCode::SUCCESS;
540}
void setChannelNoise(IdentifierHash, float)

◆ recordParameterPed()

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

Definition at line 543 of file CscCondDbAlg.cxx.

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

◆ recordParameterPSlope()

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

Definition at line 551 of file CscCondDbAlg.cxx.

551 {
552 if (m_pslopeFromDB) {
553 float token;
554 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
555 writeCdo->setChannelPSlope(chanHash, token);
556 } else {
557 // just set plsope to m_pslope for every channel
558 writeCdo->setChannelPSlope(chanHash, m_pslope);
559 }
560 return StatusCode::SUCCESS;
561}
void setChannelPSlope(IdentifierHash, float)

◆ recordParameterRMS()

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

Definition at line 564 of file CscCondDbAlg.cxx.

564 {
565 float token;
566 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
567 writeCdo->setChannelRMS(chanHash, token);
568 return StatusCode::SUCCESS;
569}
void setChannelRMS(IdentifierHash, float)

◆ recordParameterStatus()

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

Definition at line 572 of file CscCondDbAlg.cxx.

572 {
573 int token{};
574 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
575 //setChannelStatus takes signed int token argument
576 writeCdo->setChannelStatus(chanHash, token);
577 return StatusCode::SUCCESS;
578}
void setChannelStatus(IdentifierHash, int)

◆ recordParameterT0Base()

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

Definition at line 581 of file CscCondDbAlg.cxx.

581 {
582 float token;
583 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
584 writeCdo->setChannelT0Base(chanHash, token);
585 return StatusCode::SUCCESS;
586}
void setChannelT0Base(IdentifierHash, float)

◆ recordParameterT0Phase()

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

Definition at line 589 of file CscCondDbAlg.cxx.

589 {
590 bool token;
591 if (getParameter(chanHash, std::move(data), token).isFailure()) return StatusCode::FAILURE;
592 writeCdo->setChannelT0Phase(chanHash, token);
593 return StatusCode::SUCCESS;
594}
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 Muon::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 110 of file CscCondDbAlg.h.

◆ m_defaultDatabaseReadVersion

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

Definition at line 71 of file CscCondDbAlg.h.

71{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> Muon::CscCondDbAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 73 of file CscCondDbAlg.h.

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

◆ m_isData

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

Definition at line 68 of file CscCondDbAlg.h.

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

◆ m_isOnline

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

Definition at line 67 of file CscCondDbAlg.h.

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

◆ m_isRun1

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

Definition at line 69 of file CscCondDbAlg.h.

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

◆ m_onlineOfflinePhiFlip

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

Definition at line 70 of file CscCondDbAlg.h.

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

◆ m_pslope

Gaudi::Property<float> Muon::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 111 of file CscCondDbAlg.h.

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

◆ m_pslopeFromDB

Gaudi::Property<bool> Muon::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 103 of file CscCondDbAlg.h.

103 {
104 this, "ReadPSlopeFromDatabase", false,
105 "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> Muon::CscCondDbAlg::m_readKey_folder_da_f001
private
Initial value:
{this, "ReadKey_FT", "/CSC/FTHOLD",
"Key of input CSC condition data F001"}

Definition at line 79 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_hv

SG::ReadCondHandleKey<CondAttrListCollection> Muon::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 77 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_noise

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

Definition at line 81 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_ped

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

Definition at line 83 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_pslope

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

Definition at line 85 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_rms

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

Definition at line 87 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_status

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

Definition at line 89 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_t0base

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

Definition at line 91 of file CscCondDbAlg.h.

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

◆ m_readKey_folder_da_t0phase

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

Definition at line 93 of file CscCondDbAlg.h.

93 {this, "ReadKey_TP", "/CSC/T0PHASE",
94 "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> Muon::CscCondDbAlg::m_writeKey {this, "WriteKey", "CscCondDbData", "Key of output CSC condition data"}
private

Definition at line 75 of file CscCondDbAlg.h.

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

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