![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "CoralBase/Blob.h"
54 return StatusCode::SUCCESS;
68 return StatusCode::SUCCESS;
78 if (wrHdl.isValid()) {
79 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
80 <<
" In theory this should not be called, but may happen"
81 <<
" if multiple concurrent events are being processed out of order.");
82 return StatusCode::SUCCESS;
84 ATH_MSG_DEBUG(
"Range of time/charge output is " << wrHdl.getRange());
85 std::unique_ptr<NswCalibDbTimeChargeData> wrCdo{std::make_unique<NswCalibDbTimeChargeData>(
m_idHelperSvc.get())};
100 if (wrHdl.record(std::move(wrCdo)).isFailure()) {
102 <<
" with EventRange " << wrHdl.getRange()
103 <<
" into Conditions Store");
104 return StatusCode::FAILURE;
106 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
108 return StatusCode::SUCCESS;
117 if(
m_isData)
return StatusCode::SUCCESS;
121 if (wrHdl.isValid()) {
122 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
123 <<
" In theory this should not be called, but may happen"
124 <<
" if multiple concurrent events are being processed out of order.");
125 return StatusCode::SUCCESS;
127 ATH_MSG_DEBUG(
"Range of threshold output is " << wrHdl.getRange());
128 std::unique_ptr<NswCalibDbThresholdData> wrCdo{std::make_unique<NswCalibDbThresholdData>(
m_idHelperSvc->mmIdHelper(),
m_idHelperSvc->stgcIdHelper())};
136 if (wrHdl.record(std::move(wrCdo)).isFailure()) {
138 <<
" with EventRange " << wrHdl.getRange()
139 <<
" into Conditions Store");
140 return StatusCode::FAILURE;
142 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
144 return StatusCode::SUCCESS;
152 if (wrHdl.isValid()) {
153 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
154 <<
" In theory this should not be called, but may happen"
155 <<
" if multiple concurrent events are being processed out of order.");
156 return StatusCode::SUCCESS;
158 ATH_MSG_DEBUG(
"Range of MmT0 output is " << wrHdl.getRange());
159 std::unique_ptr<NswT0Data> wrCdo{std::make_unique<NswT0Data>(
m_idHelperSvc.get())};
166 return StatusCode::FAILURE;
168 std::unique_ptr<TTree>
tree{(TTree*)
file->Get(
"tree_ch")};
170 ATH_MSG_FATAL(
"Failed to load tree containing the NswT0Data.");
171 return StatusCode::FAILURE;
177 std::unique_ptr<TTree>
tree;
182 ATH_MSG_ERROR(
"Neither a database folder nor a file have been provided to read the MM T0 constants");
183 return StatusCode::FAILURE;
192 return StatusCode::FAILURE;
194 std::unique_ptr<TTree>
tree{(TTree*)
file->Get(
"tree_ch")};
196 ATH_MSG_FATAL(
"Failed to load tree containing the NswT0Data.");
197 return StatusCode::FAILURE;
203 std::unique_ptr<TTree>
tree;
208 ATH_MSG_ERROR(
"Neither a database folder nor a file have been provided to read the sTGC T0 constants");
209 return StatusCode::FAILURE;
214 ATH_CHECK(wrHdl.record(std::move(wrCdo)));
215 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
217 return StatusCode::SUCCESS;
226 return StatusCode::FAILURE;
229 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
230 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
234 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
240 return StatusCode::FAILURE;
245 return StatusCode::FAILURE;
248 return StatusCode::SUCCESS;
254 tree->SetBranchAddress(
"sector" , §or );
255 tree->SetBranchAddress(
"layer" , &
layer );
257 tree->SetBranchAddress(
"mean" , &
time );
259 tree->SetBranchAddress(
"channel_type", &channelType);
266 for(
uint i_channel=0; i_channel<
tree->GetEntries(); i_channel++){
267 tree->GetEntry(i_channel);
276 std::string
stationName = (sector%2==1 ?
"MML" :
"MMS");
288 return StatusCode::FAILURE;
291 std::string
stationName = (sector%2==1 ?
"STL" :
"STS");
302 return StatusCode::FAILURE;
308 return StatusCode::SUCCESS;
322 return StatusCode::FAILURE;
325 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
326 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
330 unsigned int nObjs = 0;
331 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
337 return StatusCode::FAILURE;
340 std::unique_ptr<TTree>
tree;
343 return StatusCode::FAILURE;
347 unsigned int elinkId{0}, vmm{0},
channel{0};
349 tree->SetBranchAddress(
"vmm" , &vmm );
351 tree->SetBranchAddress(
"elinkId" , &elinkId );
355 unsigned int nChns = 0;
356 for(
unsigned int iEvt=0; iEvt<
tree->GetEntries(); ++iEvt){
357 tree->GetEntry(iEvt);
360 ATH_MSG_DEBUG(
"Could not find valid channelId for elink "<<elinkId<<
" This is either caused by calibration data of a channel that is known to be not connected to the detector or might point to some issues in the identifier used for the calibration constants");
376 return StatusCode::SUCCESS;
390 return StatusCode::FAILURE;
393 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
394 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
398 unsigned int nObjs = 0;
399 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
405 return StatusCode::FAILURE;
408 std::unique_ptr<TTree>
tree;
411 return StatusCode::FAILURE;
414 unsigned int elinkId{0}, vmm{0},
channel{0};
415 float slope{0}, intercept{0};
418 tree->SetBranchAddress(
"vmm" , &vmm );
420 tree->SetBranchAddress(
"elinkId" , &elinkId );
421 tree->SetBranchAddress(
"slope" , &slope );
423 tree->SetBranchAddress(
"intercept" , &intercept );
428 unsigned int nChns = 0;
429 for(
unsigned int iEvt=0; iEvt<
tree->GetEntries(); ++iEvt){
430 tree->GetEntry(iEvt);
433 ATH_MSG_DEBUG(
"Could not find valid channelId for elink "<<elinkId<<
" This is either caused by calibration data of a channel that is known to be not connected to the detector or might point to some issues in the identifier used for the calibration constants");
438 calib_data.
slope = slope;
440 calib_data.intercept = intercept;
457 return StatusCode::SUCCESS;
472 std::unique_ptr<Muon::nsw::NSWResourceId> resId = std::make_unique<Muon::nsw::NSWResourceId>((
uint32_t) elinkId);
476 if(resId->
detId() == eformat::MUON_MMEGA_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_MMEGA_ENDCAP_C_SIDE) {
478 }
else if(resId->
detId() == eformat::MUON_STGC_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_STGC_ENDCAP_C_SIDE) {
481 ATH_MSG_ERROR(
"NSWResource Id "<< elinkId <<
" does not yield detID that is either sTGC or MMG");
482 throw std::runtime_error(
"NSWCalibDbAlg buildChannelId called with detID that is neither sTGC or MMG");
494 <<
" Station eta=" <<
static_cast <int> (
stationEta)
495 <<
" Station phi=" <<
static_cast <unsigned int> (
stationPhi)
496 <<
" Multilayer=" <<
static_cast <unsigned int> (
multiLayer)
497 <<
" Gas gap=" <<
static_cast <unsigned int> (
gasGap)
498 <<
" Channel type=" <<
static_cast <unsigned int> (channelType)
499 <<
" Channel Number=" << channelNumber );
503 if(resId->
detId() == eformat::MUON_MMEGA_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_MMEGA_ENDCAP_C_SIDE){
507 ATH_MSG_DEBUG(
"Could not extract valid channelId for MM elink "<<elinkId);
513 else if(resId->
detId() == eformat::MUON_STGC_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_STGC_ENDCAP_C_SIDE){
517 ATH_MSG_DEBUG(
"Could not extract valid channelId for STGC elink "<<elinkId);
def retrieve(aClass, aKey=None)
void setData(CalibDataType type, const Identifier &chnlId, CalibConstants constants)
constexpr uint8_t stationPhi
station Phi 1 to 8
StatusCode loadThresholdData(const EventContext &, const readKey_t &, const ThresholdTech, writeHandleThr_t &, NswCalibDbThresholdData *) const
Helper struct to cache all calibration constants in a common place of the memory.
uint8_t multi_layer() const
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
readKey_t m_readKey_stgc_sidea_tdo
virtual StatusCode initialize() override
StatusCode processTdoPdoData(const EventContext &ctx) const
const EventIDRange & getRange() const
readKey_t m_readKey_stgc_sidea_pdo
Gaudi::Property< std::string > m_stgcT0FilePath
bool msgLvl(const MSG::Level lvl) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
readKey_t m_readKey_mm_sidec_tdo
Gaudi::Property< bool > m_loadsTgcT0Data
int8_t station_eta() const
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
This class is a collection of AttributeLists where each one is associated with a channel number....
bool buildChannelId(Identifier &channelId, unsigned int elinkId, unsigned int vmm, unsigned int channel) const
void setZero(CalibDataType type, MuonCond::CalibTechType tech, CalibConstants constants)
readKey_t m_readKey_stgc_t0
writeKeyMmT0_t m_writeKey_nswT0
void setData(const Identifier &, const float)
StatusCode loadT0ToTree(const EventContext &ctx, const readKey_t &readKey, writeHandleT0_t &writeHandle, std::unique_ptr< TTree > &tree) const
writeKeyThr_t m_writeKey_thr
::StatusCode StatusCode
StatusCode definition for legacy code.
bool is_large_station() const
uint8_t station_phi() const
readKey_t m_readKey_stgc_sidec_tdo
readKey_t m_readKey_mm_sidea_tdo
readKey_t m_readKey_mm_sidec_thr
bool readBlobAsTTree(const coral::Blob &, std::unique_ptr< TTree > &)
readKey_t m_readKey_stgc_sidec_pdo
Gaudi::Property< bool > m_isData
StatusCode loadTimeChargeData(const EventContext &ctx, const readKey_t &readKey, const TimeChargeTech, const TimeChargeType type, writeHandleTdoPdo_t &writeHandle, NswCalibDbTimeChargeData *writeCdo) const
virtual StatusCode execute(const EventContext &) const override
Gaudi::Property< bool > m_loadMmT0Data
StatusCode initialize(bool used=true)
Gaudi::Property< std::string > m_mmT0FilePath
readKey_t m_readKey_mm_t0
readKey_t m_readKey_mm_sidea_pdo
def time(flags, cells_name, *args, **kw)
writeKeyTdoPdo_t m_writeKey_tdopdo
readKey_t m_readKey_stgc_sidec_thr
ChanAttrListMap::const_iterator const_iterator
void setData(const Identifier &channelId, const float channelT0)
void setZero(ThrsldTechType, const float)
StatusCode processNSWT0Data(const EventContext &ctx) const
readKey_t m_readKey_stgc_sidea_thr
StatusCode processThrData(const EventContext &ctx) const
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
constexpr uint8_t stationEta
1 to 3
readKey_t m_readKey_mm_sidea_thr
ServiceHandle< ICondSvc > m_condSvc
StatusCode loadT0Data(const std::unique_ptr< TTree > &tree, NswT0Data *writeCdo, const T0Tech tech) const
readKey_t m_readKey_mm_sidec_pdo
void addDependency(const EventIDRange &range)