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

Athena algorithm used for testing LAr conditions data access. More...

#include <LArConditionsTestAlg.h>

Inheritance diagram for LArConditionsTestAlg:
Collaboration diagram for LArConditionsTestAlg:

Public Member Functions

 LArConditionsTestAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~LArConditionsTestAlg ()
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
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
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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 ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode createCompareObjects ()
StatusCode testCondObjects ()
StatusCode testEachCondObject ATLAS_NOT_THREAD_SAFE (const LArRampMC *ramps)
StatusCode testChannelSet ()
StatusCode testDbObjectRead ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< LArRampPTmpm_rampCache
std::vector< LArRampPTmpm_rampCorrections
const LArOnlineIDm_onlineID {}
BooleanProperty m_testCondObjs {this, "TestCondObjs", false}
BooleanProperty m_readCondObjs {this, "ReadCondObjs", false}
BooleanProperty m_writeCondObjs {this, "WriteCondObjs", false}
BooleanProperty m_writeCorrections {this, "WriteCorrections", false}
BooleanProperty m_applyCorrections {this, "ApplyCorrections", false}
BooleanProperty m_testReadDB {this, "TestReadDBDirect", false}
BooleanProperty m_TB {this, "Testbeam", false}
IntegerProperty m_tbin {this, "Tbin", 0}
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

Athena algorithm used for testing LAr conditions data access.

Definition at line 39 of file LArConditionsTestAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArConditionsTestAlg()

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

Definition at line 32 of file LArConditionsTestAlg.cxx.

32 :
33 AthAlgorithm(name,pSvcLocator)
34{
35}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

◆ ~LArConditionsTestAlg()

LArConditionsTestAlg::~LArConditionsTestAlg ( )
virtual

Definition at line 41 of file LArConditionsTestAlg.cxx.

42{ }

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode testEachCondObject LArConditionsTestAlg::ATLAS_NOT_THREAD_SAFE ( const LArRampMC * ramps)
private

◆ createCompareObjects()

StatusCode LArConditionsTestAlg::createCompareObjects ( )
private

Definition at line 108 of file LArConditionsTestAlg.cxx.

109{
110 // StatusCode sc;
111 ATH_MSG_INFO ("in createCompareObjects()" );
112
113 // Create set of ids, LArRampComplete::LArCondObj
114
115 std::vector<HWIdentifier>::const_iterator chanIt = m_onlineID->channel_begin();
116 std::vector<HWIdentifier>::const_iterator chanEnd = m_onlineID->channel_end();
117 int ichan = -1;
118 int icorr = 0;
119 float vramp = 0;
120 int gain = 0;
121 for (; chanIt != chanEnd; ++chanIt, ++ichan) {
122 // add channels with downscale factor
123 if (ichan % 1000 != 5) continue;
124
125 // Create ramp with 3 vRamp elements
126 LArRampPTmp ramp((*chanIt), gain);
127 ramp.m_vRamp.push_back(vramp);
128 vramp += 1.0;
129 ramp.m_vRamp.push_back(vramp);
130 vramp += 1.0;
131 ramp.m_vRamp.push_back(vramp);
132 vramp += 1.0;
133 // add to cache
134 m_rampCache.push_back(ramp);
135
136 // Change gain each time
137 gain = (gain == 2) ? 0 : gain + 1;
138
140 // Create downscaled corrections
141 ++icorr;
142 if (icorr % 10 != 5) continue;
143 // Just change sign of ramp values
144 for (unsigned int i = 0; i < 3; ++i)ramp.m_vRamp[i] = -ramp.m_vRamp[i];
145 m_rampCorrections.push_back(std::move(ramp));
146 }
147 }
148
149 // Print out cache and corrections
150 for (unsigned int i = 0; i < m_rampCache.size(); ++i) {
151 ATH_MSG_DEBUG ("Cache: chan, gain, ramps "
152 << m_onlineID->show_to_string(m_rampCache[i].m_channelID) << " "
153 << m_rampCache[i].m_gain << " "
154 << m_rampCache[i].m_vRamp[0] << " "
155 << m_rampCache[i].m_vRamp[1] << " "
156 << m_rampCache[i].m_vRamp[2] << " " );
157 }
158 for (unsigned int i = 0; i < m_rampCorrections.size(); ++i) {
159 ATH_MSG_DEBUG ("Corrections: chan, gain, ramps "
160 << m_onlineID->show_to_string(m_rampCorrections[i].m_channelID) << " "
161 << m_rampCorrections[i].m_gain << " "
162 << m_rampCorrections[i].m_vRamp[0] << " "
163 << m_rampCorrections[i].m_vRamp[1] << " "
164 << m_rampCorrections[i].m_vRamp[2] << " " );
165 }
166
167 ATH_MSG_DEBUG ( "End of create comparison objects " );
168 return StatusCode::SUCCESS;
169}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
BooleanProperty m_writeCorrections
std::vector< LArRampPTmp > m_rampCorrections
std::vector< LArRampPTmp > m_rampCache
const LArOnlineID * m_onlineID
BooleanProperty m_applyCorrections

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

Execute method.

Implements AthAlgorithm.

Definition at line 71 of file LArConditionsTestAlg.cxx.

72{
73 if(m_testCondObjs){
74
75 // create cache
77 }
78
79
80 if(m_TB){
81 const ILArOFC* ofc = nullptr;
82 ATH_CHECK( detStore()->retrieve(ofc, "LArOFC") );
83
84 const ILArRamp* ramp = nullptr;
85 ATH_CHECK( detStore()->retrieve(ramp, "LArRamp") );
86 }
87
88 return StatusCode::SUCCESS;
89}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
BooleanProperty m_testCondObjs

◆ 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 & AthCommonAlgorithm< 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 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode LArConditionsTestAlg::finalize ( )
overridevirtual

Definition at line 98 of file LArConditionsTestAlg.cxx.

99{
101 return StatusCode::SUCCESS;
102}

◆ initialize()

StatusCode LArConditionsTestAlg::initialize ( )
overridevirtual

Definition at line 48 of file LArConditionsTestAlg.cxx.

49{
50 ATH_MSG_DEBUG ( " TestCondObjs flag = " << m_testCondObjs );
51 ATH_MSG_DEBUG ( " ReadCondObjs flag = " << m_readCondObjs );
52 ATH_MSG_DEBUG ( " WriteCondObjs flag = " << m_writeCondObjs );
53 ATH_MSG_DEBUG ( " WriteCorrections flag = " << m_writeCorrections );
54 ATH_MSG_DEBUG ( " ApplyCorrections flag = " << m_applyCorrections );
55 ATH_MSG_DEBUG ( " TestReadDBDirect flag = " << m_testReadDB );
56 ATH_MSG_DEBUG ( " Testbeam flag = " << m_TB );
57
58 ATH_CHECK( detStore()->retrieve(m_onlineID) );
59
60 const CaloCell_ID* calocell_id = nullptr;
61 ATH_CHECK( detStore()->retrieve(calocell_id) );
62
63 ATH_MSG_DEBUG ( "initialize done" );
64 return StatusCode::SUCCESS;
65}
BooleanProperty m_readCondObjs
BooleanProperty m_writeCondObjs

◆ 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()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< 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.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< 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 AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
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.

◆ testChannelSet()

StatusCode LArConditionsTestAlg::testChannelSet ( )
private

Definition at line 1010 of file LArConditionsTestAlg.cxx.

1011{
1012
1013 typedef LArConditionsChannelSet<LArRampComplete::LArCondObj> ChanSet;
1014 typedef ChanSet::ConstChannelIt ConstChannelIt;
1015
1016 ATH_MSG_INFO ("in testChannelSet" );
1017
1018 ChanSet chanSet;
1019
1020 // corrections not always available:
1022 // add corrections to channel set
1023 for (unsigned int i = 0; i < m_rampCorrections.size(); ++i) {
1024 // Must copy LArRampPTmp into a LArRampComplete::LArCondObj
1026 ramp.m_vRamp = m_rampCorrections[i].m_vRamp;
1027 chanSet.insert(m_rampCorrections[i].m_channelID.get_identifier32().get_compact(), ramp);
1028 }
1029 // Now loop over corrections and check that they agree
1030 bool error = false;
1031 if (m_rampCorrections.size() != chanSet.size()) {
1032 ATH_MSG_ERROR ("Corrections not the same size as channel set: "
1033 << m_rampCorrections.size() << " " << chanSet.size() );
1034 return (StatusCode::FAILURE);
1035 }
1036 else {
1037 ATH_MSG_DEBUG ("Sizes OK: " << chanSet.size() );
1038 }
1039
1040 ConstChannelIt it = chanSet.begin();
1041 ConstChannelIt itEnd = chanSet.end();
1042
1043
1044 unsigned int i = 0;
1045 for (; it != itEnd; ++it, ++i) {
1046
1047 HWIdentifier id = m_rampCorrections[i].m_channelID;
1048 HWIdentifier id1((*it).first);
1049 LArRampComplete::LArCondObj rampP = (*it).second;
1050 if (id != id1 || rampP != m_rampCorrections[i]) {
1051 ATH_MSG_ERROR ("Correction retrieved with iterator does not match: "
1052 << " i = " << i );
1053 error = true;
1054 }
1055 ATH_MSG_DEBUG ("New : chan id, gain, ramps "
1056 << m_onlineID->show_to_string(id1) << " "
1057 << m_rampCorrections[i].m_gain << " "
1058 << rampP.m_vRamp[0] << " "
1059 << rampP.m_vRamp[1] << " "
1060 << rampP.m_vRamp[2] << " "
1061 );
1062 ATH_MSG_DEBUG ("Corrections: chan id, gain, ramps "
1063 << m_onlineID->show_to_string(m_rampCorrections[i].m_channelID) << " "
1064 << m_rampCorrections[i].m_gain << " "
1065 << m_rampCorrections[i].m_vRamp[0] << " "
1066 << m_rampCorrections[i].m_vRamp[1] << " "
1067 << m_rampCorrections[i].m_vRamp[2] << " "
1068 << " Compare = " << (rampP == m_rampCorrections[i])
1069 );
1070 }
1071 if (!error) {
1072 ATH_MSG_DEBUG ("Iteration check OK " );
1073 }
1074
1075 i = 0;
1076 for (; i < m_rampCorrections.size(); ++i) {
1077
1078 unsigned int id = m_rampCorrections[i].m_channelID.get_identifier32().get_compact();
1079 it = chanSet.find(id);
1080 if (it == itEnd) {
1081 ATH_MSG_ERROR ("Could not find correction: "
1082 << " i = " << i );
1083 error = true;
1084 ATH_MSG_DEBUG ("Corrections: cool chan, chan id, gain, ramps "
1085 << m_onlineID->show_to_string(m_rampCorrections[i].m_channelID) << " "
1086 << m_rampCorrections[i].m_gain << " "
1087 << m_rampCorrections[i].m_vRamp[0] << " "
1088 << m_rampCorrections[i].m_vRamp[1] << " "
1089 << m_rampCorrections[i].m_vRamp[2] << " "
1090 );
1091 }
1092 }
1093 if (!error) {
1094 ATH_MSG_DEBUG ("Find check OK " );
1095 }
1096
1097 if (error) {
1098 ATH_MSG_ERROR ("Failing check of channel set - see above" );
1099 return (StatusCode::FAILURE);
1100 }
1101 }
1102
1103 return StatusCode::SUCCESS;
1104
1105}
std::vector< float > m_vRamp
Definition LArRampP1.h:30

◆ testCondObjects()

StatusCode LArConditionsTestAlg::testCondObjects ( )
private

Statistics: total number of conditions

Statistics: total number of conditions

Statistics: total number of conditions

Definition at line 207 of file LArConditionsTestAlg.cxx.

208{
209 ATH_MSG_INFO ("in testCondObjects()" );
210
211 static std::atomic<bool> first = true;
212 if (!first) {
213 ATH_MSG_INFO ("Multiple entries - returning" );
214 return StatusCode::SUCCESS;
215 }
216 first = false;
217
218 typedef LArRampMC::CONTAINER CONTAINER;
219 typedef CONTAINER::chan_const_iterator chan_const_iterator;
220 typedef CONTAINER::iov_const_iterator iov_const_iterator;
221
224
225 const LArRampMC* ramps = 0;
226
227 // Create SingleGroup
228 if (m_readCondObjs) {
229 const ILArRamp* iramps = 0;
230 ATH_CHECK( detStore()->retrieve(iramps, "/LArCalorimeter/LArTests/LArRampsSingleGroup") );
231 ATH_MSG_INFO ( "Retrieved ramps for LArRampsSingleGroup " );
232 ramps = dynamic_cast<const LArRampMC*>(iramps);
233 if (!ramps) {
234 ATH_MSG_ERROR ("Could not dynamic cast ILArRamp to LArRampMC" );
235 return( StatusCode::FAILURE);
236 }
237 }
238 else {
239 LArRampMC* ramps_rw = new LArRampMC;
240 ramps = ramps_rw;
241 ATH_MSG_INFO ( "Created ramps for LArRampsSingleGroup " );
243 ATH_CHECK( ramps_rw->initialize() );
244 }
245
246 ATH_CHECK( testEachCondObject(ramps) );
247 ATH_MSG_INFO ( "Succeeded SingleGroup test " );
248
249 if (!m_readCondObjs) {
250 // Save in DetectorStore
251 ATH_CHECK( detStore()->record(ramps, "/LArCalorimeter/LArTests/LArRampsSingleGroup") );
252
254 if (ramps) {
255 ATH_MSG_DEBUG ( "Total number of conditions objects"
256 << ramps->totalNumberOfConditions() );
257 }
258 if (!m_writeCondObjs) {
259 // Remove conditions objects if not writing out
260 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
261 if (!ramps_rw) {
262 ATH_MSG_ERROR ( "Could not const cast to LArRampMC " );
263 return StatusCode::FAILURE;
264 }
265 ramps_rw->removeConditions();
266 ATH_MSG_DEBUG ( "Removed conditions objects" );
267 }
268 ATH_MSG_DEBUG ( "Total number of conditions objects "
269 << ramps->totalNumberOfConditions() );
270 ATH_MSG_DEBUG ( "Total number of correction objects"
271 << ramps->totalNumberOfCorrections() );
272 }
273
274 // Create SubDetectorGrouping
275 if (m_readCondObjs) {
276 const ILArRamp* iramps = 0;
277 ATH_CHECK( detStore()->retrieve(iramps, "/LArCalorimeter/LArTests/LArRampsSubDetectorGrouping") );
278 ATH_MSG_INFO ( "Retrieved ramps for LArRampsSubDetectorGrouping " );
279 ramps = dynamic_cast<const LArRampMC*>(iramps);
280 if (!ramps) {
281 ATH_MSG_ERROR ("Could not dynamic cast ILArRamp to LArRampMC" );
282 return( StatusCode::FAILURE);
283 }
284 }
285 else {
286 LArRampMC* ramps_rw = new LArRampMC;
287 ramps = ramps_rw;
288 //ramps_rw->setGroupingType(LArConditionsContainerBase::SubDetectorGrouping);
289 ATH_CHECK( ramps_rw->initialize() );
290 }
291
292 ATH_CHECK( testEachCondObject(ramps) );
293 ATH_MSG_INFO ( "Succeeded SubDetectorGrouping test " );
294
295 if (!m_readCondObjs) {
296 // Save in DetectorStore
297 ATH_CHECK( detStore()->record(ramps, "/LArCalorimeter/LArTests/LArRampsSubDetectorGrouping") );
299 if (ramps) {
300 ATH_MSG_DEBUG ( "Total number of conditions objects"
301 << ramps->totalNumberOfConditions() );
302 }
303 if (!m_writeCondObjs) {
304 // Remove conditions objects if not writing out
305 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
306 if (!ramps_rw) {
307 ATH_MSG_ERROR ( "Could not const cast to LArRampMC " );
308 return StatusCode::FAILURE;
309 }
310 ramps_rw->removeConditions();
311 ATH_MSG_DEBUG ( "Removed conditions objects" );
312 }
313 ATH_MSG_DEBUG ( "Total number of conditions objects "
314 << ramps->totalNumberOfConditions() );
315 ATH_MSG_DEBUG ( "Total number of correction objects"
316 << ramps->totalNumberOfConditions() );
317 }
318
319 // Create FeedThroughGrouping
320 if (m_readCondObjs) {
321 const ILArRamp* iramps = 0;
322 ATH_CHECK( detStore()->retrieve(iramps, "/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping") );
323 ATH_MSG_INFO ( "Retrieved ramps for LArRampsFeedThroughGrouping " );
324 ramps = dynamic_cast<const LArRampMC*>(iramps);
325 if (!ramps) {
326 ATH_MSG_ERROR ("Could not dynamic cast ILArRamp to LArRampMC" );
327 return( StatusCode::FAILURE);
328 }
329 }
330 else {
331 LArRampMC* ramps_rw = new LArRampMC;
332 ramps = ramps_rw;
334 ATH_CHECK( ramps_rw->initialize() );
335 }
336
337 ATH_CHECK( testEachCondObject(ramps) );
338 ATH_MSG_INFO ( "Succeeded FeedThroughGrouping test " );
339
340 if (!m_readCondObjs) {
341 // Save in DetectorStore
342 ATH_CHECK( detStore()->record(ramps, "/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping") );
344 if (ramps) {
345 ATH_MSG_DEBUG ( "Total number of conditions objects"
346 << ramps->totalNumberOfConditions() );
347 }
348 if (!m_writeCondObjs) {
349 // Remove conditions objects if not writing out
350 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
351 if (!ramps_rw) {
352 ATH_MSG_ERROR ( "Could not const cast to LArRampMC " );
353 return StatusCode::FAILURE;
354 }
355 ramps_rw->removeConditions();
356 ATH_MSG_DEBUG ( "Removed conditions objects" );
357 }
358 ATH_MSG_DEBUG ( "Total number of conditions objects "
359 << ramps->totalNumberOfConditions() );
360 ATH_MSG_DEBUG ( "Total number of correction objects"
361 << ramps->totalNumberOfCorrections() );
362 }
363
364 ATH_MSG_DEBUG ( "Statistics for LArRampsFeedThroughGrouping " );
365 ATH_MSG_DEBUG ( "Number of channels, iovs "
366 << ramps->chan_size() << " " << ramps->iov_size() );
367
368 iov_const_iterator iovIt = ramps->iov_begin();
369 iov_const_iterator iovEnd = ramps->iov_end ();
370 msg() << MSG::DEBUG << "IOVs found: ";
371 for (; iovIt != iovEnd; ++iovIt) {
372 msg() << MSG::DEBUG << (*iovIt) << ", ";
373 }
374 msg() << MSG::DEBUG << endmsg;
375
376 chan_const_iterator chIt = ramps->chan_begin();
377 chan_const_iterator chEnd = ramps->chan_end ();
378 for (; chIt != chEnd; ++chIt) {
379 ATH_MSG_DEBUG ( "Channel: " << (*chIt)
380 << " number of conditions: " << ramps->conditionsPerChannel((*chIt)) );
381 }
382
383 for (unsigned int i = 0; i < ramps->nGroups(); ++i) {
384 ATH_MSG_DEBUG ( "Group: " << i
385 << " number of conditions: " << ramps->conditionsPerGroup(i) );
386 }
387 ATH_MSG_DEBUG ("");
388
389 for (unsigned int i = 0; i < ramps->nGains(); ++i) {
390 ATH_MSG_DEBUG ( "Gain: " << i
391 << " number of conditions: " << ramps->conditionsPerGain(i) );
392 }
393 ATH_MSG_DEBUG ( "Total number of conditions objects "
394 << ramps->totalNumberOfConditions() );
395 ATH_MSG_DEBUG ( "Total number of correction objects "
396 << ramps->totalNumberOfCorrections() );
397
398
399 ATH_MSG_DEBUG ( "End of testCondObjects " );
400
401 return StatusCode::SUCCESS;
402}
#define endmsg
void setGroupingType(GroupingType type)
allow group type to be set externally - need to (re)initialize after setting grouping type
void removeConditions()
Remove conditions leaving the corrections - may be needed to only write out the corrections when both...
iov_const_iterator iov_begin() const
Access to IOVs via iterators - from MultChanCollection.
unsigned int nGroups() const
Number of groups - minimum is 2 (1 correction group, 1 FEB ID group).
chan_const_iterator chan_begin() const
Access to Channel numbers via iterators - from MultChanCollection.
iov_const_iterator iov_end() const
unsigned int conditionsPerGain(unsigned int gain) const
Statistics: number of conditions per gain.
unsigned int conditionsPerChannel(unsigned int coolChannel) const
Statistics: number of conditions per COOL channel.
chan_size_type chan_size() const
number of channels - from MultChanCollection
unsigned int conditionsPerGroup(unsigned int group) const
Statistics: number of conditions per group.
iov_size_type iov_size() const
number of IOVs - from MultChanCollection
unsigned int totalNumberOfCorrections() const
Statistics: total number of corrections.
unsigned int totalNumberOfConditions() const
Statistics: total number of conditions.
chan_const_iterator chan_end() const
unsigned int nGains() const
Number of gain values.
LArRampComplete::CONTAINER CONTAINER
Definition LArRampMC.h:26
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
Definition LArRampMC.cxx:10
bool first
Definition DeMoScan.py:534

◆ testDbObjectRead()

StatusCode LArConditionsTestAlg::testDbObjectRead ( )
private

Definition at line 1108 of file LArConditionsTestAlg.cxx.

1109{
1110
1111 typedef LArRampMC::CONTAINER CONTAINER;
1112 typedef CONTAINER::Subset Subset;
1113
1114 const LArRampMC* ramp = 0 ;
1115 ATH_CHECK( detStore()->retrieve(ramp, "LArRamp") );
1116
1117 ATH_MSG_DEBUG ( " Found LArRampMC, key LArRamp." );
1118
1119 // Print out channels
1120 ATH_MSG_DEBUG ( " Number of channels " << ramp->chan_size() );
1121
1122 // Print out first 10 elements of each gain for subset
1123 CONTAINER::chan_const_iterator chanIt = ramp->chan_begin();
1124 CONTAINER::chan_const_iterator endChan = ramp->chan_end ();
1125 for (unsigned int i = 0; chanIt != endChan; ++chanIt, ++i) {
1126 unsigned int coolChan = *chanIt;
1127 const Subset* subset = ramp->at(i);
1128
1129 ATH_MSG_DEBUG ( " Channel " << coolChan << " "
1130 << " Subset size " << subset->subsetSize()
1131 << " gain, channel, grouping type " << subset->gain() << " "
1132 << MSG::hex << subset->channel() << " " << MSG::dec
1133 << subset->groupingType() << " "
1134 );
1135
1136 Subset::ConstSubsetIt first = subset->subsetBegin();
1137 Subset::ConstSubsetIt last = subset->subsetEnd();
1138 //for (int i = 0; i < 10 && first != last; ++i, ++first) {
1139 for (; first != last; ++first) {
1140
1141 // select non-zero subsets
1142 if ((*first).second.size()) {
1143
1144 ATH_MSG_DEBUG ( " FEB id "
1145 << m_onlineID->show_to_string(HWIdentifier((*first).first)) << " "
1146 );
1147 for (unsigned int k = 0; k < 5; ++k) {
1148 msg() << MSG::DEBUG << " vramp " ;
1149// << m_onlineID->show_to_string((*first).second[k].m_channelID) << " "
1150// << (*first).second[k].m_gain << " ";
1151 for (unsigned int j = 0; j < (*first).second[k].m_vRamp.size(); ++j) {
1152 msg() << MSG::DEBUG << (*first).second[k].m_vRamp[j] << " ";
1153 }
1154 msg() << MSG::DEBUG << endmsg;
1155 }
1156
1157 }
1158
1159 }
1160 }
1161
1162
1163 /*
1164
1165 // Print out first 10 elements of each gain for corrections
1166 for (unsigned int gain = 0; gain < 3; ++gain) {
1167 log << MSG::DEBUG << " Gain, size "
1168 << gain << " "
1169 << ramp->correctionsSize(gain) << endmsg;
1170 CONTAINER::ConstCorrectionIt first = ramp->correctionsBegin(gain);
1171 CONTAINER::ConstCorrectionIt last = ramp->correctionsEnd(gain);
1172 for (int i = 0; i < 10 && first != last; ++i, ++first) {
1173 log << MSG::DEBUG << " id, vramp "
1174 << m_onlineID->show_to_string(HWIdentifier((*first).first)) << " ";
1175// << m_onlineID->show_to_string((*first).second.m_channelID) << " "
1176// << (*first).second.m_gain << " ";
1177 for (unsigned int j = 0; j < (*first).second.m_vRamp.size(); ++j) {
1178 log << MSG::DEBUG << (*first).second.m_vRamp[j] << " ";
1179 }
1180 log << MSG::DEBUG << endmsg;
1181 }
1182 }
1183
1184 */
1185
1186 return StatusCode::SUCCESS;
1187
1188}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

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

BooleanProperty LArConditionsTestAlg::m_applyCorrections {this, "ApplyCorrections", false}
private

Definition at line 68 of file LArConditionsTestAlg.h.

68{this, "ApplyCorrections", false};

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_onlineID

const LArOnlineID* LArConditionsTestAlg::m_onlineID {}
private

Definition at line 63 of file LArConditionsTestAlg.h.

63{};

◆ m_rampCache

std::vector<LArRampPTmp> LArConditionsTestAlg::m_rampCache
private

Definition at line 60 of file LArConditionsTestAlg.h.

◆ m_rampCorrections

std::vector<LArRampPTmp> LArConditionsTestAlg::m_rampCorrections
private

Definition at line 61 of file LArConditionsTestAlg.h.

◆ m_readCondObjs

BooleanProperty LArConditionsTestAlg::m_readCondObjs {this, "ReadCondObjs", false}
private

Definition at line 65 of file LArConditionsTestAlg.h.

65{this, "ReadCondObjs", false};

◆ m_TB

BooleanProperty LArConditionsTestAlg::m_TB {this, "Testbeam", false}
private

Definition at line 70 of file LArConditionsTestAlg.h.

70{this, "Testbeam", false};

◆ m_tbin

IntegerProperty LArConditionsTestAlg::m_tbin {this, "Tbin", 0}
private

Definition at line 71 of file LArConditionsTestAlg.h.

71{this, "Tbin", 0};

◆ m_testCondObjs

BooleanProperty LArConditionsTestAlg::m_testCondObjs {this, "TestCondObjs", false}
private

Definition at line 64 of file LArConditionsTestAlg.h.

64{this, "TestCondObjs", false};

◆ m_testReadDB

BooleanProperty LArConditionsTestAlg::m_testReadDB {this, "TestReadDBDirect", false}
private

Definition at line 69 of file LArConditionsTestAlg.h.

69{this, "TestReadDBDirect", false};

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

BooleanProperty LArConditionsTestAlg::m_writeCondObjs {this, "WriteCondObjs", false}
private

Definition at line 66 of file LArConditionsTestAlg.h.

66{this, "WriteCondObjs", false};

◆ m_writeCorrections

BooleanProperty LArConditionsTestAlg::m_writeCorrections {this, "WriteCorrections", false}
private

Definition at line 67 of file LArConditionsTestAlg.h.

67{this, "WriteCorrections", false};

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