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 ()
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_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::EventInfom_eventInfoKey
UnsignedIntegerProperty m_runIOVSince
UnsignedIntegerProperty m_runIOVUntil
UnsignedIntegerProperty m_lbnIOVSince
UnsignedIntegerProperty m_lbnIOVUntil
UnsignedIntegerProperty m_maxChan
bool m_of2
bool m_fixedPhases
std::string m_runType
ServiceHandle< IIOVRegistrationSvcm_regSvc
ToolHandle< TileCondToolTimingm_tileToolTiming
ToolHandle< ITileCondToolOfcm_tileCondToolOfc
std::set< std::string > m_folders
int m_nFixedPhases
double m_phaseStep
std::vector< std::string > m_modules
std::vector< unsigned int > m_drawerIdxs
bool m_creatAllModules
DataObjIDColl m_extendedExtraObjects
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 34 of file TileOFC2DBAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 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{
28 declareProperty("OF2", m_of2 = true,"true => OF2, false => OF1");
33 declareProperty("FixedPhases", m_fixedPhases = true, "calculate OFCs for fixed phases" );
34 declareProperty("RunType", m_runType = "PHY", "PHY or LAS");
35
36 declareProperty("FixedPhasesNumber", m_nFixedPhases = 100);
37 declareProperty("PhaseStep", m_phaseStep = 0.5);
38 declareProperty("MaxChan", m_maxChan = 1, "Number of channels for which OFCs will be created with fixed phases");
39 declareProperty("Modules", m_modules = {"AUX01"}, "Modules for which OFC should be stored in DB");
40 declareProperty("CreateAllModules", m_creatAllModules = true, "All missing modules is written to DB with zero size (empty)");
41}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
static constexpr uint32_t MAXRUN
Definition IOVTime.h:48
static constexpr uint32_t MINEVENT
Definition IOVTime.h:50
static constexpr uint32_t MAXEVENT
Definition IOVTime.h:51
static constexpr uint32_t MINRUN
Definition IOVTime.h:44
std::string m_runType
UnsignedIntegerProperty m_runIOVUntil
UnsignedIntegerProperty m_lbnIOVUntil
UnsignedIntegerProperty m_maxChan
ServiceHandle< IIOVRegistrationSvc > m_regSvc
UnsignedIntegerProperty m_runIOVSince
UnsignedIntegerProperty m_lbnIOVSince
std::vector< std::string > m_modules

◆ ~TileOFC2DBAlg()

TileOFC2DBAlg::~TileOFC2DBAlg ( )

Definition at line 43 of file TileOFC2DBAlg.cxx.

43 {
44}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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< 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 ( )

Definition at line 80 of file TileOFC2DBAlg.cxx.

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

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode TileOFC2DBAlg::finalize ( )

Definition at line 343 of file TileOFC2DBAlg.cxx.

343 {
344
345 ATH_MSG_INFO( "in finalize()" );
346
347 //=== Register objects in DB
349
350 ATH_MSG_DEBUG( "Register OK " );
351
352 return StatusCode::SUCCESS;
353}
#define ATH_MSG_INFO(x)
StatusCode registerCondObjects()

◆ initialize()

StatusCode TileOFC2DBAlg::initialize ( )

Definition at line 48 of file TileOFC2DBAlg.cxx.

48 {
49
50 ATH_MSG_INFO( "Initializing for " << m_runType );
51
52 //=== EventInfo key
53 ATH_CHECK( m_eventInfoKey.initialize() );
54
55 //=== get TileToolTiming
56 CHECK( m_tileToolTiming.retrieve() );
57
58 //=== get TileCondToolOfc
59 CHECK( m_tileCondToolOfc.retrieve() );
60
61 //=== IOVRegistrationSvc
62 CHECK( m_regSvc.retrieve() );
63
64 std::map<std::string, unsigned int> roses = { {"AUX", 0}, {"LBA", 1}, {"LBC", 2}, {"EBA", 3}, {"EBC", 4} };
65
66 msg(MSG::INFO) << "OFC will be stored in DB for the following modules:";
67 for (const std::string& module : m_modules) {
68 msg(MSG::INFO) << " " << module;
69 m_drawerIdxs.push_back( TileCalibUtils::getDrawerIdx(roses[module.substr(0, 3)], std::stoi(module.substr(3, 2)) - 1) );
70 }
71 msg(MSG::INFO) << endmsg;
72
73 if (m_creatAllModules) ATH_MSG_INFO("All other missing modules will be stored in DB with zero size");
74
75 return StatusCode::SUCCESS;
76}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< 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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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 388 of file TileOFC2DBAlg.cxx.

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

◆ registerCondObjects()

StatusCode TileOFC2DBAlg::registerCondObjects ( )
private

Definition at line 358 of file TileOFC2DBAlg.cxx.

358 {
359
360 ATH_MSG_DEBUG( "entering registerCondObject " );
361
362 for (std::set<std::string>::const_iterator iFolder = m_folders.begin();
363 iFolder != m_folders.end(); ++iFolder) {
364
365 const CondAttrListCollection* attrListColl = nullptr;
366 CHECK( detStore()->retrieve(attrListColl, *iFolder) );
367
368 if (nullptr == attrListColl) {
369 ATH_MSG_ERROR( "Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
370 return (StatusCode::FAILURE);
371 } else {
372 ATH_MSG_DEBUG( "Retrieved AttributeListCollection from " << *iFolder );
373 }
374
375 //=== register in COOL
376 std::string tag = "";
377 CHECK( m_regSvc->registerIOV("CondAttrListCollection", *iFolder, tag) );
378
379 ATH_MSG_DEBUG( "Registered folder " << *iFolder << " with tag " << tag );
380
381 } //end iFolder
382
383 return StatusCode::SUCCESS;
384}

◆ 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< 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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_creatAllModules

bool TileOFC2DBAlg::m_creatAllModules
private

Definition at line 77 of file TileOFC2DBAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_drawerIdxs

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

Definition at line 76 of file TileOFC2DBAlg.h.

◆ m_eventInfoKey

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

Definition at line 50 of file TileOFC2DBAlg.h.

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

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fixedPhases

bool TileOFC2DBAlg::m_fixedPhases
private

Definition at line 60 of file TileOFC2DBAlg.h.

◆ m_folders

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

Definition at line 71 of file TileOFC2DBAlg.h.

◆ m_lbnIOVSince

UnsignedIntegerProperty TileOFC2DBAlg::m_lbnIOVSince
private

Definition at line 56 of file TileOFC2DBAlg.h.

◆ m_lbnIOVUntil

UnsignedIntegerProperty TileOFC2DBAlg::m_lbnIOVUntil
private

Definition at line 57 of file TileOFC2DBAlg.h.

◆ m_maxChan

UnsignedIntegerProperty TileOFC2DBAlg::m_maxChan
private

Definition at line 58 of file TileOFC2DBAlg.h.

◆ m_modules

std::vector<std::string> TileOFC2DBAlg::m_modules
private

Definition at line 75 of file TileOFC2DBAlg.h.

◆ m_nFixedPhases

int TileOFC2DBAlg::m_nFixedPhases
private

Definition at line 73 of file TileOFC2DBAlg.h.

◆ m_of2

bool TileOFC2DBAlg::m_of2
private

Definition at line 59 of file TileOFC2DBAlg.h.

◆ m_phaseStep

double TileOFC2DBAlg::m_phaseStep
private

Definition at line 74 of file TileOFC2DBAlg.h.

◆ m_regSvc

ServiceHandle<IIOVRegistrationSvc> TileOFC2DBAlg::m_regSvc
private

Definition at line 64 of file TileOFC2DBAlg.h.

◆ m_runIOVSince

UnsignedIntegerProperty TileOFC2DBAlg::m_runIOVSince
private

Definition at line 54 of file TileOFC2DBAlg.h.

◆ m_runIOVUntil

UnsignedIntegerProperty TileOFC2DBAlg::m_runIOVUntil
private

Definition at line 55 of file TileOFC2DBAlg.h.

◆ m_runType

std::string TileOFC2DBAlg::m_runType
private

Definition at line 61 of file TileOFC2DBAlg.h.

◆ m_tileCondToolOfc

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

Definition at line 67 of file TileOFC2DBAlg.h.

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

◆ m_tileToolTiming

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

Definition at line 65 of file TileOFC2DBAlg.h.

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

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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