![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "CoralBase/Blob.h"
15 #include "CoralBase/AttributeListSpecification.h"
70 std::map<std::string, unsigned int> roses = { {
"AUX", 0}, {
"LBA", 1}, {
"LBC", 2}, {
"EBA", 3}, {
"EBC", 4} };
72 msg(MSG::INFO) <<
"OFC will be stored in DB for the following modules:";
81 return StatusCode::SUCCESS;
87 const EventContext &ctx = Gaudi::Hive::currentContext();
101 ATH_MSG_DEBUG(
"Event NOT selected for creating conditions objects " );
102 return StatusCode::SUCCESS;
114 std::string
folder(
"/TILE/ONL01/FILTER/");
120 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
121 spec->extend(
"TileCalibBlobOfc",
"blob");
126 float zeroPhase(0.0);
137 std::vector<float>
phases;
150 int nPhases =
phases.size();
154 coolChannelCreated[drawerIdx] =
true;
164 for (
int isam = 0; isam < ndig; isam++) {
179 <<
" drawerIdx " << drawerIdx
184 for (
int isam = 0; isam < ndig; ++isam)
189 for (
int isam = 0; isam < ndig; isam++)
195 for (
int isam = 0; isam < ndig; isam++)
201 for (
int isam = 0; isam < ndig; isam++)
214 attrListColl->
add(drawerIdx, ofcList);
217 attrListColl->
add(drawerIdx,
range);
226 if (coolChannelCreated[coolChannel])
continue;
230 attrListColl->
add(coolChannel, ofcList);
231 attrListColl->
add(coolChannel,
range);
260 <<
" drawerIdx " << drawerIdx
263 <<
" phase " <<
phase );
270 <<
" drawerIdx " << drawerIdx
272 <<
" phase = " <<
phase );
274 double w_a_sum = 0, w_b_sum = 0, w_c_sum = 0;
275 for (
int isam = 0; isam < ndig; isam++) {
278 <<
" w_a " << weights.
w_a[isam]
279 <<
" w_b " << weights.
w_b[isam]
280 <<
" w_c " << weights.
w_c[isam]
281 <<
" g " << weights.
g[isam] );
285 <<
" w_a " << weights.
w_a[isam]
286 <<
" w_b " << weights.
w_b[isam]
287 <<
" g " << weights.
g[isam] );
291 w_a_sum += weights.
w_a[isam];
292 w_b_sum += weights.
w_b[isam];
293 w_c_sum += weights.
w_c[isam];
305 if (
m_of2)
ATH_MSG_DEBUG(
" *** SUM: a,b,c " << w_a_sum <<
" " << w_b_sum <<
" " << w_c_sum );
311 attrListColl->
add(drawerIdx, ofcList);
314 attrListColl->
add(drawerIdx,
range);
344 return StatusCode::SUCCESS;
358 return StatusCode::SUCCESS;
368 for (std::set<std::string>::const_iterator iFolder =
m_folders.begin();
374 if (
nullptr == attrListColl) {
375 ATH_MSG_ERROR(
"Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
376 return (StatusCode::FAILURE);
378 ATH_MSG_DEBUG(
"Retrieved AttributeListCollection from " << *iFolder );
382 std::string
tag =
"";
389 return StatusCode::SUCCESS;
399 for (std::set<std::string>::const_iterator iFolder =
m_folders.begin();
405 std::string blobName(
"TileCalibBlob");
406 if (iFolder->find(
"/TILE/ONL01/FILTER") != std::string::npos) {
416 ATH_MSG_ERROR(
"Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
417 return StatusCode::FAILURE;
421 std::string generalComment(
"");
423 if (iComment != attrListColl->
end()) {
424 const coral::Blob&
blob = (iComment->second)[blobName].data<coral::Blob>();
426 generalComment =
cmt->getFullComment();
433 for (; iColl != last; ++iColl) {
436 if (iColl == iComment)
continue;
439 const coral::Blob&
blob = (iColl->second)[blobName].data<coral::Blob>();
446 std::ostringstream attrStr1;
447 (*iColl).second.toOutputStream(attrStr1);
448 ATH_MSG_DEBUG(
"ChanNum " << (*iColl).first <<
" Attribute list " << attrStr1.str() );
453 if (iovIt != attrListColl->
iov_end()) {
455 if (
range.start().isTimestamp()) {
457 <<
" since " <<
range.start().timestamp()
458 <<
" till " <<
range.stop().timestamp() );
462 <<
" since " <<
range.start().run() <<
" " <<
range.start().event()
463 <<
" till " <<
range.stop().run() <<
" " <<
range.stop().event() );
480 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
UnsignedIntegerProperty m_runIOVSince
const_iterator end() const
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Validity Range object. Holds two IOVTimes (start and stop)
static unsigned int getMaxDrawer(unsigned int ros)
Returns the maximal channel number for a given drawer.
iov_const_iterator iov_end() const
static constexpr uint32_t MAXRUN
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
StatusCode printCondObjects()
uint64_t eventNumber() const
The current event's event number.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
static const unsigned int MAX_DRAWERIDX
Maximal drawer index
bool msgLvl(const MSG::Level lvl) const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
This is an interface to a tool used to register conditions objects in the Interval of Validity (IOV) ...
This class is a collection of AttributeLists where each one is associated with a channel number....
virtual StatusCode registerIOV(const std::string &typeName) const =0
Register IOV DB for an object given its typeName - run/LB numbers interval or times interval and tag ...
UnsignedIntegerProperty m_lbnIOVUntil
ChanIOVMap::const_iterator iov_const_iterator
uint32_t runNumber() const
The current event's run number.
UnsignedIntegerProperty m_lbnIOVSince
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
static constexpr uint32_t MINRUN
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
UnsignedIntegerProperty m_runIOVUntil
std::vector< unsigned int > m_drawerIdxs
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode registerCondObjects()
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static const unsigned int MAX_ROS
Number of ROSs
virtual bool isValid() override final
Can the handle be successfully dereferenced?
static constexpr uint32_t MAXEVENT
std::vector< std::string > m_modules
UnsignedIntegerProperty m_maxChan
static unsigned int getCommentChannel()
Returns the COOL channel number for the comment channel.
Helpers for checking error return status codes and reporting errors.
static constexpr uint32_t MINEVENT
const_iterator chanAttrListPair(ChanNum chanNum) const
Access to Chan/AttributeList pairs via channel number: returns map iterator.
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.
std::string getenv(const std::string &variableName)
get an environment variable
ToolHandle< TileCondToolTiming > m_tileToolTiming
ChanAttrListMap::const_iterator const_iterator
static const TileCalibDrawerCmt * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerCmt.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
std::set< std::string > m_folders
Class to store comments in BLOB without any data.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
static const unsigned int MAX_CHAN
Number of channels in drawer.
iov_const_iterator chanIOVPair(ChanNum chanNum) const
Access to Chan/IOV pairs via channel number: returns map iterator.
TileOFC2DBAlg(const std::string &name, ISvcLocator *pSvcLocator)
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
IIOVRegistrationSvc * m_regSvc
static const unsigned int MAX_GAIN
Number of gains per channel