|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "CoralBase/Blob.h"
12 #include "CoralBase/AttributeListSpecification.h"
25 , m_regSvc(
"IOVRegistrationSvc",
name)
64 std::map<std::string, unsigned int> roses = { {
"AUX", 0}, {
"LBA", 1}, {
"LBC", 2}, {
"EBA", 3}, {
"EBC", 4} };
66 msg(MSG::INFO) <<
"OFC will be stored in DB for the following modules:";
75 return StatusCode::SUCCESS;
81 const EventContext &ctx = Gaudi::Hive::currentContext();
95 ATH_MSG_DEBUG(
"Event NOT selected for creating conditions objects " );
96 return StatusCode::SUCCESS;
108 std::string
folder(
"/TILE/ONL01/FILTER/");
114 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
115 spec->extend(
"TileCalibBlobOfc",
"blob");
120 float zeroPhase(0.0);
131 std::vector<float>
phases;
144 int nPhases =
phases.size();
148 coolChannelCreated[drawerIdx] =
true;
158 for (
int isam = 0; isam < ndig; isam++) {
173 <<
" drawerIdx " << drawerIdx
178 for (
int isam = 0; isam < ndig; ++isam)
183 for (
int isam = 0; isam < ndig; isam++)
189 for (
int isam = 0; isam < ndig; isam++)
195 for (
int isam = 0; isam < ndig; isam++)
208 attrListColl->
add(drawerIdx, ofcList);
211 attrListColl->
add(drawerIdx,
range);
220 if (coolChannelCreated[coolChannel])
continue;
224 attrListColl->
add(coolChannel, ofcList);
225 attrListColl->
add(coolChannel,
range);
254 <<
" drawerIdx " << drawerIdx
257 <<
" phase " <<
phase );
264 <<
" drawerIdx " << drawerIdx
266 <<
" phase = " <<
phase );
268 double w_a_sum = 0, w_b_sum = 0, w_c_sum = 0;
269 for (
int isam = 0; isam < ndig; isam++) {
272 <<
" w_a " <<
weights.w_a[isam]
273 <<
" w_b " <<
weights.w_b[isam]
274 <<
" w_c " <<
weights.w_c[isam]
279 <<
" w_a " <<
weights.w_a[isam]
280 <<
" w_b " <<
weights.w_b[isam]
299 if (
m_of2)
ATH_MSG_DEBUG(
" *** SUM: a,b,c " << w_a_sum <<
" " << w_b_sum <<
" " << w_c_sum );
305 attrListColl->
add(drawerIdx, ofcList);
308 attrListColl->
add(drawerIdx,
range);
338 return StatusCode::SUCCESS;
352 return StatusCode::SUCCESS;
362 for (std::set<std::string>::const_iterator iFolder =
m_folders.begin();
368 if (
nullptr == attrListColl) {
369 ATH_MSG_ERROR(
"Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
370 return (StatusCode::FAILURE);
372 ATH_MSG_DEBUG(
"Retrieved AttributeListCollection from " << *iFolder );
376 std::string
tag =
"";
383 return StatusCode::SUCCESS;
393 for (std::set<std::string>::const_iterator iFolder =
m_folders.begin();
399 std::string blobName(
"TileCalibBlob");
400 if (iFolder->find(
"/TILE/ONL01/FILTER") != std::string::npos) {
410 ATH_MSG_ERROR(
"Has not retrieved AttributeListCollection (ptr is 0) from " << *iFolder );
411 return StatusCode::FAILURE;
415 std::string generalComment(
"");
417 if (iComment != attrListColl->
end()) {
418 const coral::Blob&
blob = (iComment->second)[blobName].data<coral::Blob>();
420 generalComment =
cmt->getFullComment();
427 for (; iColl != last; ++iColl) {
430 if (iColl == iComment)
continue;
433 const coral::Blob&
blob = (iColl->second)[blobName].data<coral::Blob>();
440 std::ostringstream attrStr1;
441 (*iColl).second.toOutputStream(attrStr1);
442 ATH_MSG_DEBUG(
"ChanNum " << (*iColl).first <<
" Attribute list " << attrStr1.str() );
447 if (iovIt != attrListColl->
iov_end()) {
449 if (
range.start().isTimestamp()) {
451 <<
" since " <<
range.start().timestamp()
452 <<
" till " <<
range.stop().timestamp() );
456 <<
" since " <<
range.start().run() <<
" " <<
range.start().event()
457 <<
" till " <<
range.stop().run() <<
" " <<
range.stop().event() );
474 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 class is a collection of AttributeLists where each one is associated with a channel number....
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
ServiceHandle< IIOVRegistrationSvc > m_regSvc
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.
static const unsigned int MAX_GAIN
Number of gains per channel