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

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode 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< Gaudi::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(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
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< 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 }

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

Provides access to the EventContext if needed but is non-const as opposed to AthReentrantAlgorithm.

Implements AthAlgorithm.

Definition at line 80 of file TileOFC2DBAlg.cxx.

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

◆ filterPassed() [1/2]

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return filterPassed( Gaudi::Hive::currentContext() );
96}
bool filterPassed() const

◆ filterPassed() [2/2]

bool AthAlgorithm::filterPassed ( const EventContext & ctx) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 return execState( ctx ).filterPassed();
100}

◆ finalize()

StatusCode TileOFC2DBAlg::finalize ( )

Definition at line 342 of file TileOFC2DBAlg.cxx.

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

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

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

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 111 of file AthAlgorithm.h.

111{ 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 387 of file TileOFC2DBAlg.cxx.

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

◆ registerCondObjects()

StatusCode TileOFC2DBAlg::registerCondObjects ( )
private

Definition at line 357 of file TileOFC2DBAlg.cxx.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed() [1/2]

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 102 of file AthAlgorithm.cxx.

102 {
103 setFilterPassed( state, Gaudi::Hive::currentContext() );
104}
void setFilterPassed(bool state) const

◆ setFilterPassed() [2/2]

void AthAlgorithm::setFilterPassed ( bool state,
const EventContext & ctx ) const
inherited

Definition at line 106 of file AthAlgorithm.cxx.

106 {
107 execState( ctx ).setFilterPassed(state);
108}

◆ 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< Gaudi::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< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_creatAllModules

bool TileOFC2DBAlg::m_creatAllModules
private

Definition at line 77 of file TileOFC2DBAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_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< Gaudi::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 114 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< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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