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

#include <TileOFC2DBAlg.h>

Inheritance diagram for TileOFC2DBAlg:
Collaboration diagram for TileOFC2DBAlg:

Public Member Functions

 TileOFC2DBAlg (const std::string &name, ISvcLocator *pSvcLocator)
 ~TileOFC2DBAlg ()
StatusCode initialize ()
StatusCode execute (const EventContext &ctx)
 Execute method.
StatusCode finalize ()
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 registerCondObjects ()
StatusCode printCondObjects ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Gaudi::Property< unsigned int > m_runIOVSince {this, "RunIOVSince", IOVTime::MINRUN}
Gaudi::Property< unsigned int > m_runIOVUntil {this, "RunIOVUntil", IOVTime::MAXRUN}
Gaudi::Property< unsigned int > m_lbnIOVSince {this, "LbnIOVSince", IOVTime::MINEVENT}
Gaudi::Property< unsigned int > m_lbnIOVUntil {this, "LbnIOVUntil", IOVTime::MAXEVENT}
Gaudi::Property< unsigned int > m_maxChan {this, "MaxChan", 1, "Number of channels for which OFCs will be created with fixed phases"}
Gaudi::Property< bool > m_of2 {this, "OF2", true, "true => OF2, false => OF1"}
Gaudi::Property< bool > m_fixedPhases {this, "FixedPhases", true, "calculate OFCs for fixed phases"}
Gaudi::Property< std::string > m_runType {this, "RunType", "PHY", "PHY or LAS"}
ServiceHandle< IIOVRegistrationSvc > m_regSvc
ToolHandle< TileCondToolTiming > m_tileToolTiming
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
std::set< std::string > m_folders
Gaudi::Property< int > m_nFixedPhases {this, "FixedPhasesNumber", 100}
Gaudi::Property< double > m_phaseStep {this, "PhaseStep", 0.5}
Gaudi::Property< std::vector< std::string > > m_modules {this, "Modules", {"AUX01"}, "Modules for which OFC should be stored in DB"}
std::vector< unsigned int > m_drawerIdxs
Gaudi::Property< bool > m_creatAllModules {this, "CreateAllModules", true, "All missing modules is written to DB with zero size (empty)"}
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 35 of file TileOFC2DBAlg.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

◆ TileOFC2DBAlg()

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

Definition at line 23 of file TileOFC2DBAlg.cxx.

24 : AthAlgorithm(name, pSvcLocator)
25 , m_regSvc("IOVRegistrationSvc", name)
26{
27}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ServiceHandle< IIOVRegistrationSvc > m_regSvc

◆ ~TileOFC2DBAlg()

TileOFC2DBAlg::~TileOFC2DBAlg ( )

Definition at line 29 of file TileOFC2DBAlg.cxx.

29 {
30}

Member Function Documentation

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

Execute method.

Implements AthAlgorithm.

Definition at line 66 of file TileOFC2DBAlg.cxx.

66 {
67
68 //=== print run/evt/lbn/time info for each event
69 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey, ctx);
70 ATH_CHECK( eventInfo.isValid() );
71
72 ATH_MSG_DEBUG( "Event: ["
73 << eventInfo->runNumber() << ","
74 << eventInfo->eventNumber() << ":"
75 << eventInfo->timeStamp() << "]" );
76
77
78 //=== Create conditions objects only at run == ?, event == ?
79 if (1 != eventInfo->eventNumber()) {
80 ATH_MSG_DEBUG( "Event NOT selected for creating conditions objects " );
81 return StatusCode::SUCCESS;
82 } else {
83 ATH_MSG_DEBUG( "Creating conditions objects " );
84 }
85
86 //unsigned int objVersion = (m_of2) ? 3 : 1;
87 unsigned int objVersion = 3; // non efficient, but allows to keep dG also for OF1
88
89 //=== build the IOV range
90 IOVRange range(IOVTime(m_runIOVSince, m_lbnIOVSince), IOVTime(m_runIOVUntil, m_lbnIOVUntil));
91
92 //=== build COOL folder name based on ???????
93 std::string folder("/TILE/ONL01/FILTER/");
94 if (m_of2) folder += "OF2/" + m_runType.value();
95 else folder += "OF1/" + m_runType.value();
96 m_folders.insert(folder);
97
98 //=== create the folder layout
99 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
100 spec->extend("TileCalibBlobOfc", "blob");
101
102 //=== create the collection of attribute lists
103 CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
104
105 float zeroPhase(0.0);
106 TileOfcWeightsStruct weights;
107 ATH_CHECK( m_tileCondToolOfc->getOfcWeights(0, 0, 0, zeroPhase, true, weights, ctx) );
108 int ndig = weights.n_samples;
109
110 // ---------- create fixed phases
111 if (m_fixedPhases) {
112 ATH_MSG_DEBUG( "Fixed phases: " << m_fixedPhases.value()
113 << ", number of fixed phases: " << m_nFixedPhases.value()
114 << ", phase step: " << m_phaseStep.value());
115
116 std::vector<float> phases;
117 phases.reserve(m_nFixedPhases * 2 + 1);
118
119 //=== create attribute list
120 coral::AttributeList ofcList(*spec);
121 coral::Blob& blob = ofcList["TileCalibBlobOfc"].data<coral::Blob>();
122
123 std::vector<bool> coolChannelCreated(TileCalibUtils::MAX_DRAWERIDX, false);
124
125 for (int iPhase = - m_nFixedPhases; iPhase <= m_nFixedPhases; ++iPhase) {
126 phases.push_back(iPhase * m_phaseStep);
127 }
128
129 int nPhases = phases.size();
131
132 for (unsigned int drawerIdx : m_drawerIdxs) {
133 coolChannelCreated[drawerIdx] = true;
134 drawerOfc = TileCalibDrawerOfc::getInstance(blob, objVersion, ndig, -nPhases, m_maxChan, TileCalibUtils::MAX_GAIN); // nPhases, nChann, nGains
135
136 drawerOfc->setPhases(0, 0, phases);
137
138 for (unsigned int channel = 0; channel < m_maxChan; ++channel) {
139 for (unsigned int gain = 0; gain < TileCalibUtils::MAX_GAIN; ++gain) {
140
141 for (float phase : phases) {
142 ATH_CHECK( m_tileCondToolOfc->getOfcWeights(drawerIdx, channel, gain, phase, m_of2, weights, ctx) );
143 for (int isam = 0; isam < ndig; isam++) {
144 drawerOfc->setOfc(TileCalibDrawerOfc::FieldA, channel, gain, phase, isam, weights.w_a[isam]);
145 drawerOfc->setOfc(TileCalibDrawerOfc::FieldB, channel, gain, phase, isam, weights.w_b[isam]);
146 drawerOfc->setOfc(TileCalibDrawerOfc::FieldG, channel, gain, phase, isam, weights.g[isam]);
147 if (objVersion == 3) {
148 drawerOfc->setOfc(TileCalibDrawerOfc::FieldC, channel, gain, phase, isam, weights.w_c[isam]);
149 drawerOfc->setOfc(TileCalibDrawerOfc::FieldDG, channel, gain, phase, isam, weights.dg[isam]);
150 }
151 }
152
153
154 if (msgLvl(MSG::DEBUG)) {
155
156 msg(MSG::DEBUG) << " N Samples " << ndig
157 << " channel " << channel
158 << " drawerIdx " << drawerIdx
159 << " gain " << gain
160 << " phase = " << phase << endmsg;
161
162 msg(MSG::DEBUG) << "gain " << gain << " w_a, phase " << phase << " ";
163 for (int isam = 0; isam < ndig; ++isam)
164 msg(MSG::DEBUG) << " " << weights.w_a[isam];
165 msg(MSG::DEBUG) << endmsg;
166
167 msg(MSG::DEBUG) << "gain " << gain << " w_b, phase " << phase << " ";
168 for (int isam = 0; isam < ndig; isam++)
169 msg(MSG::DEBUG) << " " << weights.w_b[isam];
170 msg(MSG::DEBUG) << endmsg;
171
172 if (m_of2) {
173 msg(MSG::DEBUG) << "gain " << gain << " w_c, phase " << phase << " ";
174 for (int isam = 0; isam < ndig; isam++)
175 msg(MSG::DEBUG) << " " << weights.w_c[isam];
176 msg(MSG::DEBUG) << endmsg;
177 }
178
179 msg(MSG::DEBUG) << "gain " << gain << " g, phase " << phase << " ";
180 for (int isam = 0; isam < ndig; isam++)
181 msg(MSG::DEBUG) << " " << weights.g[isam];
182 msg(MSG::DEBUG) << endmsg;
183
184 }
185
186 }
187 }
188
189
190 }
191
192 //=== use DrawerHash as channel number
193 attrListColl->add(drawerIdx, ofcList);
194
195 //=== add the IOV range for this collection
196 attrListColl->add(drawerIdx, range);
197 // drawerOfc->dump();
198 delete drawerOfc;
199
200 }
201
202 //=== Create empty blobs for all COOL channels (for missing drawers)
203 if (m_creatAllModules) {
204 for (unsigned int coolChannel = 0; coolChannel < TileCalibUtils::MAX_DRAWERIDX; ++coolChannel) {
205 if (coolChannelCreated[coolChannel]) continue;
206 //=== create attribute list for this drawer
207 coral::AttributeList ofcList(*spec);
208 //coral::Blob& blob=ofcList["TileCalibBlobOfc"].data<coral::Blob>();
209 attrListColl->add(coolChannel, ofcList);
210 attrListColl->add(coolChannel, range);
211 }
212 }
213
214 } else { // take best phase from DB and calculate OFCs for each channel
215
216 std::vector<float> phases(TileCalibUtils::MAX_CHAN);
217
218 //=== create attribute list
219 coral::AttributeList ofcList(*spec);
220 coral::Blob& blob = ofcList["TileCalibBlobOfc"].data<coral::Blob>();
221
222 //=== create an OFC blob interpreter
223 TileCalibDrawerOfc* drawerOfc = TileCalibDrawerOfc::getInstance(blob, objVersion, ndig, -48, 256, 2); // nPhases, nChann, nGains
224
225 for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel)
226 phases[channel] = (float) channel;
227
228 for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) {
229 for (unsigned int drawer = 0; drawer < TileCalibUtils::getMaxDrawer(ros); ++drawer) {
230 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
231 drawerOfc->setPhases(drawerIdx, 0, phases);
232
233 for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) {
234
235 for (unsigned int gain = 0; gain < TileCalibUtils::MAX_GAIN; ++gain) {
236
237 float phase = m_tileToolTiming->getSignalPhase(drawerIdx, channel, gain);
238 ATH_MSG_DEBUG( "m_tileToolTiming:"
239 << " drawerIdx " << drawerIdx
240 << " channel " << channel
241 << " gain " << gain
242 << " phase " << phase );
243
244 ATH_CHECK( m_tileCondToolOfc->getOfcWeights(drawerIdx, channel, gain, phase, m_of2, weights, ctx) );
245 ATH_MSG_DEBUG( " N Samples " << ndig
246 << " ros " << ros
247 << " drawer " << drawer
248 << " channel " << channel
249 << " drawerIdx " << drawerIdx
250 << " gain " << gain
251 << " phase = " << phase );
252
253 double w_a_sum = 0, w_b_sum = 0, w_c_sum = 0;
254 for (int isam = 0; isam < ndig; isam++) {
255 if (m_of2) {
256 ATH_MSG_DEBUG( " sampling " << isam
257 << " w_a " << weights.w_a[isam]
258 << " w_b " << weights.w_b[isam]
259 << " w_c " << weights.w_c[isam]
260 << " g " << weights.g[isam] );
261
262 } else {
263 ATH_MSG_DEBUG( " sampling " << isam
264 << " w_a " << weights.w_a[isam]
265 << " w_b " << weights.w_b[isam]
266 << " g " << weights.g[isam] );
267
268 }
269
270 w_a_sum += weights.w_a[isam];
271 w_b_sum += weights.w_b[isam];
272 w_c_sum += weights.w_c[isam];
273
274 drawerOfc->setOfc(0, drawerIdx, gain, channel, isam, weights.w_a[isam]);
275 drawerOfc->setOfc(1, drawerIdx, gain, channel, isam, weights.w_b[isam]);
276 if (m_of2) {
277 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam, weights.w_c[isam]);
278 drawerOfc->setOfc(3, drawerIdx, gain, channel, isam, weights.g[isam]);
279 } else {
280 drawerOfc->setOfc(2, drawerIdx, gain, channel, isam, weights.g[isam]);
281 }
282 }
283
284 if (m_of2) ATH_MSG_DEBUG( " *** SUM: a,b,c " << w_a_sum << " " << w_b_sum << " " << w_c_sum );
285
286 } // for ... gain
287 } // for ... channel
288
289 //=== use DrawerHash as channel number
290 attrListColl->add(drawerIdx, ofcList);
291
292 //=== add the IOV range for this collection
293 attrListColl->add(drawerIdx, range);
294 // drawerOfc->dump();
295 } // for ... drawer
296 } // for ... ros
297 delete drawerOfc;
298 }
299
300 //=== add the comment in the comment channel
301 coral::AttributeList attrList(*spec);
302 coral::Blob& blob = attrList["TileCalibBlobOfc"].data<coral::Blob>();
303 const char* user = getenv("USER");
304 TileCalibDrawerCmt* comment = TileCalibDrawerCmt::getInstance(blob, (user ? user : "tilecomm"), "OFC weights calculated by TileCondToolOfc");
305 delete comment;
306 attrListColl->add(TileCalibUtils::getCommentChannel(), attrList);
307 attrListColl->add(TileCalibUtils::getCommentChannel(), range);
308
309 spec->release();
310 // cppcheck-suppress memleak
311 spec = nullptr;
312
313 //=== recored collection in store gate
314 CHECK( detStore()->record(attrListColl, folder) );
315
316 //=======================================
317 //=== Print conditions data in detector store
318 //=======================================
319 ATH_MSG_DEBUG( "Calling printCondObjects" );
320
322
323 return StatusCode::SUCCESS;
324}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
static const TileCalibDrawerCmt * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerCmt.
static TileCalibDrawerOfc * getInstance(coral::Blob &blob, uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, std::string_view author="", std::string_view comment="", uint64_t timeStamp=0)
Returns a pointer to a non-const TileCalibDrawerOfc.
static const unsigned int MAX_DRAWERIDX
Maximal drawer index.
static const unsigned int MAX_ROS
Number of ROSs.
static const unsigned int MAX_GAIN
Number of gains per channel.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
static unsigned int getMaxDrawer(unsigned int ros)
Returns the maximal channel number for a given drawer.
static unsigned int getCommentChannel()
Returns the COOL channel number for the comment channel.
static const unsigned int MAX_CHAN
Number of channels in drawer.
Gaudi::Property< unsigned int > m_maxChan
std::set< std::string > m_folders
Gaudi::Property< unsigned int > m_runIOVSince
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Gaudi::Property< int > m_nFixedPhases
ToolHandle< TileCondToolTiming > m_tileToolTiming
Gaudi::Property< bool > m_fixedPhases
Gaudi::Property< unsigned int > m_runIOVUntil
Gaudi::Property< bool > m_creatAllModules
Gaudi::Property< double > m_phaseStep
Gaudi::Property< bool > m_of2
std::vector< unsigned int > m_drawerIdxs
Gaudi::Property< std::string > m_runType
StatusCode printCondObjects()
Gaudi::Property< unsigned int > m_lbnIOVUntil
Gaudi::Property< unsigned int > m_lbnIOVSince
std::string getenv(const std::string &variableName)
get an environment variable

◆ 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 TileOFC2DBAlg::finalize ( )

Definition at line 328 of file TileOFC2DBAlg.cxx.

328 {
329
330 ATH_MSG_INFO( "in finalize()" );
331
332 //=== Register objects in DB
334
335 ATH_MSG_DEBUG( "Register OK " );
336
337 return StatusCode::SUCCESS;
338}
#define ATH_MSG_INFO(x,...)
StatusCode registerCondObjects()

◆ initialize()

StatusCode TileOFC2DBAlg::initialize ( )

Definition at line 34 of file TileOFC2DBAlg.cxx.

34 {
35
36 ATH_MSG_INFO( "Initializing for " << m_runType.value() );
37
38 //=== EventInfo key
39 ATH_CHECK( m_eventInfoKey.initialize() );
40
41 //=== get TileToolTiming
42 CHECK( m_tileToolTiming.retrieve() );
43
44 //=== get TileCondToolOfc
45 CHECK( m_tileCondToolOfc.retrieve() );
46
47 //=== IOVRegistrationSvc
48 CHECK( m_regSvc.retrieve() );
49
50 std::map<std::string, unsigned int> roses = { {"AUX", 0}, {"LBA", 1}, {"LBC", 2}, {"EBA", 3}, {"EBC", 4} };
51
52 msg(MSG::INFO) << "OFC will be stored in DB for the following modules:";
53 for (const std::string& module : m_modules) {
54 msg(MSG::INFO) << " " << module;
55 m_drawerIdxs.push_back( TileCalibUtils::getDrawerIdx(roses[module.substr(0, 3)], std::stoi(module.substr(3, 2)) - 1) );
56 }
57 msg(MSG::INFO) << endmsg;
58
59 if (m_creatAllModules) ATH_MSG_INFO("All other missing modules will be stored in DB with zero size");
60
61 return StatusCode::SUCCESS;
62}
Gaudi::Property< std::vector< std::string > > m_modules

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

◆ printCondObjects()

StatusCode TileOFC2DBAlg::printCondObjects ( )
private

Definition at line 373 of file TileOFC2DBAlg.cxx.

373 {
374
375 ATH_MSG_INFO( "in printCondObjects()" );
376
377 //=== loop over all folders
378 for (std::set<std::string>::const_iterator iFolder = m_folders.begin();
379 iFolder != m_folders.end(); ++iFolder) {
380
381 ATH_MSG_DEBUG( "Printing content of folder: " << *iFolder );
382
383 //=== determine blob name
384 std::string blobName("TileCalibBlob");
385 if (iFolder->find("/TILE/ONL01/FILTER") != std::string::npos) {
386 blobName += "Ofc";
387 }
388
389 ATH_MSG_DEBUG( "The blob name is: " << blobName );
390
391 const CondAttrListCollection* attrListColl(nullptr);
392 CHECK( detStore()->retrieve(attrListColl, *iFolder) );
393
394 if (!attrListColl) {
395 ATH_MSG_ERROR("Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
396 return StatusCode::FAILURE;
397 }
398
399 //=== find the general comment
400 std::string generalComment("");
401 CondAttrListCollection::const_iterator iComment = attrListColl->chanAttrListPair( TileCalibUtils::getCommentChannel());
402 if (iComment != attrListColl->end()) {
403 const coral::Blob& blob = (iComment->second)[blobName].data<coral::Blob>();
405 generalComment = cmt->getFullComment();
406 delete cmt;
407 }
408
409 //=== loop over collection
410 CondAttrListCollection::const_iterator iColl = attrListColl->begin();
411 CondAttrListCollection::const_iterator last = attrListColl->end();
412 for (; iColl != last; ++iColl) {
413
414 //=== do not print comment channel
415 if (iColl == iComment) continue;
416
417 //=== try to find comment for this drawer
418 const coral::Blob& blob = (iColl->second)[blobName].data<coral::Blob>();
419 //=== do not print empty blobs
420 if (!blob.size()) {
421 continue;
422 }
423
425 std::ostringstream attrStr1;
426 (*iColl).second.toOutputStream(attrStr1);
427 ATH_MSG_DEBUG( "ChanNum " << (*iColl).first << " Attribute list " << attrStr1.str() );
428
429 // Print out range if it exits
431 CondAttrListCollection::iov_const_iterator iovIt = attrListColl->chanIOVPair(chanNum);
432 if (iovIt != attrListColl->iov_end()) {
433 const IOVRange& range = (*iovIt).second;
434 if (range.start().isTimestamp()) {
435 ATH_MSG_DEBUG( "Range timestamp :"
436 << " since " << range.start().timestamp()
437 << " till " << range.stop().timestamp() );
438
439 } else {
440 ATH_MSG_DEBUG( "Range R/LB :"
441 << " since " << range.start().run() << " " << range.start().event()
442 << " till " << range.stop().run() << " " << range.stop().event() );
443 }
444 } else {
445 ATH_MSG_DEBUG( "No range found " );
446 }
447
448 //=== print the comment
449 std::string comment = cmt->getFullComment();
450 if (comment.empty()) {
451 comment = generalComment;
452 }
453 ATH_MSG_DEBUG( "Comment: " << comment );
454 delete cmt;
455
456 }
457 } //end iFolder
458
459 return StatusCode::SUCCESS;
460}
#define ATH_MSG_ERROR(x,...)
ChanAttrListMap::const_iterator const_iterator
ChanIOVMap::const_iterator iov_const_iterator

◆ registerCondObjects()

StatusCode TileOFC2DBAlg::registerCondObjects ( )
private

Definition at line 343 of file TileOFC2DBAlg.cxx.

343 {
344
345 ATH_MSG_DEBUG( "entering registerCondObject " );
346
347 for (std::set<std::string>::const_iterator iFolder = m_folders.begin();
348 iFolder != m_folders.end(); ++iFolder) {
349
350 const CondAttrListCollection* attrListColl = nullptr;
351 CHECK( detStore()->retrieve(attrListColl, *iFolder) );
352
353 if (nullptr == attrListColl) {
354 ATH_MSG_ERROR( "Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
355 return (StatusCode::FAILURE);
356 } else {
357 ATH_MSG_DEBUG( "Retrieved AttributeListCollection from " << *iFolder );
358 }
359
360 //=== register in COOL
361 std::string tag = "";
362 CHECK( m_regSvc->registerIOV("CondAttrListCollection", *iFolder, tag) );
363
364 ATH_MSG_DEBUG( "Registered folder " << *iFolder << " with tag " << tag );
365
366 } //end iFolder
367
368 return StatusCode::SUCCESS;
369}

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

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

Gaudi::Property<bool> TileOFC2DBAlg::m_creatAllModules {this, "CreateAllModules", true, "All missing modules is written to DB with zero size (empty)"}
private

Definition at line 78 of file TileOFC2DBAlg.h.

78{this, "CreateAllModules", true, "All missing modules is written to DB with zero size (empty)"};

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

std::vector<unsigned int> TileOFC2DBAlg::m_drawerIdxs
private

Definition at line 77 of file TileOFC2DBAlg.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> TileOFC2DBAlg::m_eventInfoKey
private
Initial value:
{this,
"EventInfo", "EventInfo", "EventInfo key"}

Definition at line 51 of file TileOFC2DBAlg.h.

51 {this,
52 "EventInfo", "EventInfo", "EventInfo key"};

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

Gaudi::Property<bool> TileOFC2DBAlg::m_fixedPhases {this, "FixedPhases", true, "calculate OFCs for fixed phases"}
private

Definition at line 61 of file TileOFC2DBAlg.h.

61{this, "FixedPhases", true, "calculate OFCs for fixed phases"};

◆ m_folders

std::set<std::string> TileOFC2DBAlg::m_folders
private

Definition at line 72 of file TileOFC2DBAlg.h.

◆ m_lbnIOVSince

Gaudi::Property<unsigned int> TileOFC2DBAlg::m_lbnIOVSince {this, "LbnIOVSince", IOVTime::MINEVENT}
private

Definition at line 57 of file TileOFC2DBAlg.h.

57{this, "LbnIOVSince", IOVTime::MINEVENT};
static constexpr uint32_t MINEVENT
Definition IOVTime.h:51

◆ m_lbnIOVUntil

Gaudi::Property<unsigned int> TileOFC2DBAlg::m_lbnIOVUntil {this, "LbnIOVUntil", IOVTime::MAXEVENT}
private

Definition at line 58 of file TileOFC2DBAlg.h.

58{this, "LbnIOVUntil", IOVTime::MAXEVENT};
static constexpr uint32_t MAXEVENT
Definition IOVTime.h:52

◆ m_maxChan

Gaudi::Property<unsigned int> TileOFC2DBAlg::m_maxChan {this, "MaxChan", 1, "Number of channels for which OFCs will be created with fixed phases"}
private

Definition at line 59 of file TileOFC2DBAlg.h.

59{this, "MaxChan", 1, "Number of channels for which OFCs will be created with fixed phases"};

◆ m_modules

Gaudi::Property<std::vector<std::string> > TileOFC2DBAlg::m_modules {this, "Modules", {"AUX01"}, "Modules for which OFC should be stored in DB"}
private

Definition at line 76 of file TileOFC2DBAlg.h.

76{this, "Modules", {"AUX01"}, "Modules for which OFC should be stored in DB"};

◆ m_nFixedPhases

Gaudi::Property<int> TileOFC2DBAlg::m_nFixedPhases {this, "FixedPhasesNumber", 100}
private

Definition at line 74 of file TileOFC2DBAlg.h.

74{this, "FixedPhasesNumber", 100};

◆ m_of2

Gaudi::Property<bool> TileOFC2DBAlg::m_of2 {this, "OF2", true, "true => OF2, false => OF1"}
private

Definition at line 60 of file TileOFC2DBAlg.h.

60{this, "OF2", true, "true => OF2, false => OF1"};

◆ m_phaseStep

Gaudi::Property<double> TileOFC2DBAlg::m_phaseStep {this, "PhaseStep", 0.5}
private

Definition at line 75 of file TileOFC2DBAlg.h.

75{this, "PhaseStep", 0.5};

◆ m_regSvc

ServiceHandle<IIOVRegistrationSvc> TileOFC2DBAlg::m_regSvc
private

Definition at line 65 of file TileOFC2DBAlg.h.

◆ m_runIOVSince

Gaudi::Property<unsigned int> TileOFC2DBAlg::m_runIOVSince {this, "RunIOVSince", IOVTime::MINRUN}
private

Definition at line 55 of file TileOFC2DBAlg.h.

55{this, "RunIOVSince", IOVTime::MINRUN};
static constexpr uint32_t MINRUN
Definition IOVTime.h:45

◆ m_runIOVUntil

Gaudi::Property<unsigned int> TileOFC2DBAlg::m_runIOVUntil {this, "RunIOVUntil", IOVTime::MAXRUN}
private

Definition at line 56 of file TileOFC2DBAlg.h.

56{this, "RunIOVUntil", IOVTime::MAXRUN};
static constexpr uint32_t MAXRUN
Definition IOVTime.h:49

◆ m_runType

Gaudi::Property<std::string> TileOFC2DBAlg::m_runType {this, "RunType", "PHY", "PHY or LAS"}
private

Definition at line 62 of file TileOFC2DBAlg.h.

62{this, "RunType", "PHY", "PHY or LAS"};

◆ m_tileCondToolOfc

ToolHandle<ITileCondToolOfc> TileOFC2DBAlg::m_tileCondToolOfc
private
Initial value:
{this,
"TileCondToolOfc", "TileCondToolOfc", "Tile OFC tool"}

Definition at line 68 of file TileOFC2DBAlg.h.

68 {this,
69 "TileCondToolOfc", "TileCondToolOfc", "Tile OFC tool"};

◆ m_tileToolTiming

ToolHandle<TileCondToolTiming> TileOFC2DBAlg::m_tileToolTiming
private
Initial value:
{this,
"TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"}

Definition at line 66 of file TileOFC2DBAlg.h.

66 {this,
67 "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};

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


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