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

virtual ~LArConditionsTestAlg ()
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
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< StoreGateSvc > StoreGateSvc_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< LArRampPTmp > m_rampCache
std::vector< LArRampPTmp > m_rampCorrections
const LArOnlineID * m_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 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~LArConditionsTestAlg()

LArConditionsTestAlg::~LArConditionsTestAlg ( )
virtual

Definition at line 32 of file LArConditionsTestAlg.cxx.

33{ }

Member Function Documentation

◆ AthAlgorithm()

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

Constructor.

Definition at line 31 of file AthAlgorithm.cxx.

11 :
12 AthCommonAlgorithm<Gaudi::Algorithm>( name, pSvcLocator )
13{
14 // default cardinality for non-reentrant algorithms
15 setProperty( "Cardinality", 1 ).orThrow("Unable to set property 'Cardinality'", name);
16}
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
AthCommonAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

◆ ATLAS_NOT_THREAD_SAFE()

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

◆ createCompareObjects()

StatusCode LArConditionsTestAlg::createCompareObjects ( )
private

Definition at line 99 of file LArConditionsTestAlg.cxx.

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

63{
64 if(m_testCondObjs){
65
66 // create cache
68 }
69
70
71 if(m_TB){
72 const ILArOFC* ofc = nullptr;
73 ATH_CHECK( detStore()->retrieve(ofc, "LArOFC") );
74
75 const ILArRamp* ramp = nullptr;
76 ATH_CHECK( detStore()->retrieve(ramp, "LArRamp") );
77 }
78
79 return StatusCode::SUCCESS;
80}
#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 89 of file LArConditionsTestAlg.cxx.

90{
92 return StatusCode::SUCCESS;
93}

◆ initialize()

StatusCode LArConditionsTestAlg::initialize ( )
overridevirtual

Definition at line 39 of file LArConditionsTestAlg.cxx.

40{
41 ATH_MSG_DEBUG ( " TestCondObjs flag = " << m_testCondObjs );
42 ATH_MSG_DEBUG ( " ReadCondObjs flag = " << m_readCondObjs );
43 ATH_MSG_DEBUG ( " WriteCondObjs flag = " << m_writeCondObjs );
44 ATH_MSG_DEBUG ( " WriteCorrections flag = " << m_writeCorrections );
45 ATH_MSG_DEBUG ( " ApplyCorrections flag = " << m_applyCorrections );
46 ATH_MSG_DEBUG ( " TestReadDBDirect flag = " << m_testReadDB );
47 ATH_MSG_DEBUG ( " Testbeam flag = " << m_TB );
48
49 ATH_CHECK( detStore()->retrieve(m_onlineID) );
50
51 const CaloCell_ID* calocell_id = nullptr;
52 ATH_CHECK( detStore()->retrieve(calocell_id) );
53
54 ATH_MSG_DEBUG ( "initialize done" );
55 return StatusCode::SUCCESS;
56}
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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

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

Set filter decision:

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, 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 1001 of file LArConditionsTestAlg.cxx.

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

199{
200 ATH_MSG_INFO ("in testCondObjects()" );
201
202 static std::atomic<bool> first = true;
203 if (!first) {
204 ATH_MSG_INFO ("Multiple entries - returning" );
205 return StatusCode::SUCCESS;
206 }
207 first = false;
208
209 typedef LArRampMC::CONTAINER CONTAINER;
210 typedef CONTAINER::chan_const_iterator chan_const_iterator;
211 typedef CONTAINER::iov_const_iterator iov_const_iterator;
212
215
216 const LArRampMC* ramps = 0;
217
218 // Create SingleGroup
219 if (m_readCondObjs) {
220 const ILArRamp* iramps = 0;
221 ATH_CHECK( detStore()->retrieve(iramps, "/LArCalorimeter/LArTests/LArRampsSingleGroup") );
222 ATH_MSG_INFO ( "Retrieved ramps for LArRampsSingleGroup " );
223 ramps = dynamic_cast<const LArRampMC*>(iramps);
224 if (!ramps) {
225 ATH_MSG_ERROR ("Could not dynamic cast ILArRamp to LArRampMC" );
226 return( StatusCode::FAILURE);
227 }
228 }
229 else {
230 LArRampMC* ramps_rw = new LArRampMC;
231 ramps = ramps_rw;
232 ATH_MSG_INFO ( "Created ramps for LArRampsSingleGroup " );
234 ATH_CHECK( ramps_rw->initialize() );
235 }
236
237 ATH_CHECK( testEachCondObject(ramps) );
238 ATH_MSG_INFO ( "Succeeded SingleGroup test " );
239
240 if (!m_readCondObjs) {
241 // Save in DetectorStore
242 ATH_CHECK( detStore()->record(ramps, "/LArCalorimeter/LArTests/LArRampsSingleGroup") );
243
245 if (ramps) {
246 ATH_MSG_DEBUG ( "Total number of conditions objects"
247 << ramps->totalNumberOfConditions() );
248 }
249 if (!m_writeCondObjs) {
250 // Remove conditions objects if not writing out
251 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
252 if (!ramps_rw) {
253 ATH_MSG_ERROR ( "Could not const cast to LArRampMC " );
254 return StatusCode::FAILURE;
255 }
256 ramps_rw->removeConditions();
257 ATH_MSG_DEBUG ( "Removed conditions objects" );
258 }
259 ATH_MSG_DEBUG ( "Total number of conditions objects "
260 << ramps->totalNumberOfConditions() );
261 ATH_MSG_DEBUG ( "Total number of correction objects"
262 << ramps->totalNumberOfCorrections() );
263 }
264
265 // Create SubDetectorGrouping
266 if (m_readCondObjs) {
267 const ILArRamp* iramps = 0;
268 ATH_CHECK( detStore()->retrieve(iramps, "/LArCalorimeter/LArTests/LArRampsSubDetectorGrouping") );
269 ATH_MSG_INFO ( "Retrieved ramps for LArRampsSubDetectorGrouping " );
270 ramps = dynamic_cast<const LArRampMC*>(iramps);
271 if (!ramps) {
272 ATH_MSG_ERROR ("Could not dynamic cast ILArRamp to LArRampMC" );
273 return( StatusCode::FAILURE);
274 }
275 }
276 else {
277 LArRampMC* ramps_rw = new LArRampMC;
278 ramps = ramps_rw;
279 //ramps_rw->setGroupingType(LArConditionsContainerBase::SubDetectorGrouping);
280 ATH_CHECK( ramps_rw->initialize() );
281 }
282
283 ATH_CHECK( testEachCondObject(ramps) );
284 ATH_MSG_INFO ( "Succeeded SubDetectorGrouping test " );
285
286 if (!m_readCondObjs) {
287 // Save in DetectorStore
288 ATH_CHECK( detStore()->record(ramps, "/LArCalorimeter/LArTests/LArRampsSubDetectorGrouping") );
290 if (ramps) {
291 ATH_MSG_DEBUG ( "Total number of conditions objects"
292 << ramps->totalNumberOfConditions() );
293 }
294 if (!m_writeCondObjs) {
295 // Remove conditions objects if not writing out
296 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
297 if (!ramps_rw) {
298 ATH_MSG_ERROR ( "Could not const cast to LArRampMC " );
299 return StatusCode::FAILURE;
300 }
301 ramps_rw->removeConditions();
302 ATH_MSG_DEBUG ( "Removed conditions objects" );
303 }
304 ATH_MSG_DEBUG ( "Total number of conditions objects "
305 << ramps->totalNumberOfConditions() );
306 ATH_MSG_DEBUG ( "Total number of correction objects"
307 << ramps->totalNumberOfConditions() );
308 }
309
310 // Create FeedThroughGrouping
311 if (m_readCondObjs) {
312 const ILArRamp* iramps = 0;
313 ATH_CHECK( detStore()->retrieve(iramps, "/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping") );
314 ATH_MSG_INFO ( "Retrieved ramps for LArRampsFeedThroughGrouping " );
315 ramps = dynamic_cast<const LArRampMC*>(iramps);
316 if (!ramps) {
317 ATH_MSG_ERROR ("Could not dynamic cast ILArRamp to LArRampMC" );
318 return( StatusCode::FAILURE);
319 }
320 }
321 else {
322 LArRampMC* ramps_rw = new LArRampMC;
323 ramps = ramps_rw;
325 ATH_CHECK( ramps_rw->initialize() );
326 }
327
328 ATH_CHECK( testEachCondObject(ramps) );
329 ATH_MSG_INFO ( "Succeeded FeedThroughGrouping test " );
330
331 if (!m_readCondObjs) {
332 // Save in DetectorStore
333 ATH_CHECK( detStore()->record(ramps, "/LArCalorimeter/LArTests/LArRampsFeedThroughGrouping") );
335 if (ramps) {
336 ATH_MSG_DEBUG ( "Total number of conditions objects"
337 << ramps->totalNumberOfConditions() );
338 }
339 if (!m_writeCondObjs) {
340 // Remove conditions objects if not writing out
341 LArRampMC* ramps_rw = const_cast<LArRampMC*>(ramps);
342 if (!ramps_rw) {
343 ATH_MSG_ERROR ( "Could not const cast to LArRampMC " );
344 return StatusCode::FAILURE;
345 }
346 ramps_rw->removeConditions();
347 ATH_MSG_DEBUG ( "Removed conditions objects" );
348 }
349 ATH_MSG_DEBUG ( "Total number of conditions objects "
350 << ramps->totalNumberOfConditions() );
351 ATH_MSG_DEBUG ( "Total number of correction objects"
352 << ramps->totalNumberOfCorrections() );
353 }
354
355 ATH_MSG_DEBUG ( "Statistics for LArRampsFeedThroughGrouping " );
356 ATH_MSG_DEBUG ( "Number of channels, iovs "
357 << ramps->chan_size() << " " << ramps->iov_size() );
358
359 iov_const_iterator iovIt = ramps->iov_begin();
360 iov_const_iterator iovEnd = ramps->iov_end ();
361 msg() << MSG::DEBUG << "IOVs found: ";
362 for (; iovIt != iovEnd; ++iovIt) {
363 msg() << MSG::DEBUG << (*iovIt) << ", ";
364 }
365 msg() << MSG::DEBUG << endmsg;
366
367 chan_const_iterator chIt = ramps->chan_begin();
368 chan_const_iterator chEnd = ramps->chan_end ();
369 for (; chIt != chEnd; ++chIt) {
370 ATH_MSG_DEBUG ( "Channel: " << (*chIt)
371 << " number of conditions: " << ramps->conditionsPerChannel((*chIt)) );
372 }
373
374 for (unsigned int i = 0; i < ramps->nGroups(); ++i) {
375 ATH_MSG_DEBUG ( "Group: " << i
376 << " number of conditions: " << ramps->conditionsPerGroup(i) );
377 }
378 ATH_MSG_DEBUG ("");
379
380 for (unsigned int i = 0; i < ramps->nGains(); ++i) {
381 ATH_MSG_DEBUG ( "Gain: " << i
382 << " number of conditions: " << ramps->conditionsPerGain(i) );
383 }
384 ATH_MSG_DEBUG ( "Total number of conditions objects "
385 << ramps->totalNumberOfConditions() );
386 ATH_MSG_DEBUG ( "Total number of correction objects "
387 << ramps->totalNumberOfCorrections() );
388
389
390 ATH_MSG_DEBUG ( "End of testCondObjects " );
391
392 return StatusCode::SUCCESS;
393}
#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 1099 of file LArConditionsTestAlg.cxx.

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

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

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 381 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 378 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 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 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: