 |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "CoralBase/Blob.h"
18 #include "GeoModelKernel/throwExcept.h"
58 return StatusCode::SUCCESS;
72 return StatusCode::SUCCESS;
82 if (wrHdl.isValid()) {
83 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
84 <<
" In theory this should not be called, but may happen"
85 <<
" if multiple concurrent events are being processed out of order.");
86 return StatusCode::SUCCESS;
88 ATH_MSG_DEBUG(
"Range of time/charge output is " << wrHdl.getRange());
89 std::unique_ptr<NswCalibDbTimeChargeData> wrCdo{std::make_unique<NswCalibDbTimeChargeData>(
m_idHelperSvc.get())};
120 if (wrHdl.record(std::move(wrCdo)).isFailure()) {
122 <<
" with EventRange " << wrHdl.getRange()
123 <<
" into Conditions Store");
124 return StatusCode::FAILURE;
126 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
128 return StatusCode::SUCCESS;
141 if (wrHdl.isValid()) {
142 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
143 <<
" In theory this should not be called, but may happen"
144 <<
" if multiple concurrent events are being processed out of order.");
145 return StatusCode::SUCCESS;
147 ATH_MSG_DEBUG(
"Range of threshold output is " << wrHdl.getRange());
148 std::unique_ptr<NswCalibDbThresholdData> wrCdo{std::make_unique<NswCalibDbThresholdData>(
m_idHelperSvc.get())};
164 if (wrHdl.record(std::move(wrCdo)).isFailure()) {
166 <<
" with EventRange " << wrHdl.getRange()
167 <<
" into Conditions Store");
168 return StatusCode::FAILURE;
170 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
172 return StatusCode::SUCCESS;
180 if (wrHdl.isValid()) {
181 ATH_MSG_DEBUG(
"CondHandle " << wrHdl.fullKey() <<
" is already valid."
182 <<
" In theory this should not be called, but may happen"
183 <<
" if multiple concurrent events are being processed out of order.");
184 return StatusCode::SUCCESS;
186 ATH_MSG_DEBUG(
"Range of MmT0 output is " << wrHdl.getRange());
187 std::unique_ptr<NswT0Data> wrCdo{std::make_unique<NswT0Data>(
m_idHelperSvc.get())};
195 return StatusCode::FAILURE;
197 std::unique_ptr<TTree>
tree{(TTree*)
file->Get(
"tree_ch")};
199 ATH_MSG_FATAL(
"Failed to load tree containing the NswT0Data.");
200 return StatusCode::FAILURE;
206 std::unique_ptr<TTree>
tree;
211 ATH_MSG_ERROR(
"Neither a database folder nor a file have been provided to read the MM T0 constants");
212 return StatusCode::FAILURE;
222 return StatusCode::FAILURE;
224 std::unique_ptr<TTree>
tree{(TTree*)
file->Get(
"tree_ch")};
226 ATH_MSG_FATAL(
"Failed to load tree containing the NswT0Data.");
227 return StatusCode::FAILURE;
233 std::unique_ptr<TTree>
tree;
238 ATH_MSG_ERROR(
"Neither a database folder nor a file have been provided to read the sTGC T0 constants");
239 return StatusCode::FAILURE;
244 ATH_CHECK(wrHdl.record(std::move(wrCdo)));
245 ATH_MSG_DEBUG(
"Recorded new " << wrHdl.key() <<
" with range " << wrHdl.getRange() <<
" into Conditions Store");
247 return StatusCode::SUCCESS;
256 return StatusCode::FAILURE;
259 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
260 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
264 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
270 return StatusCode::FAILURE;
275 return StatusCode::FAILURE;
278 return StatusCode::SUCCESS;
284 tree->SetBranchAddress(
"sector" , §or );
285 tree->SetBranchAddress(
"layer" , &
layer );
287 tree->SetBranchAddress(
"mean" , &
time );
289 tree->SetBranchAddress(
"channel_type", &channelType);
296 for(
uint i_channel=0; i_channel<
tree->GetEntries(); i_channel++){
297 tree->GetEntry(i_channel);
306 std::string
stationName = (sector%2==1 ?
"MML" :
"MMS");
318 return StatusCode::FAILURE;
321 std::string
stationName = (sector%2==1 ?
"STL" :
"STS");
332 return StatusCode::FAILURE;
338 return StatusCode::SUCCESS;
352 return StatusCode::FAILURE;
355 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
356 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
360 unsigned int nObjs = 0;
361 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
367 return StatusCode::FAILURE;
370 std::unique_ptr<TTree>
tree;
373 return StatusCode::FAILURE;
377 unsigned int elinkId{0}, vmm{0},
channel{0};
379 tree->SetBranchAddress(
"vmm" , &vmm );
381 tree->SetBranchAddress(
"elinkId" , &elinkId );
385 unsigned int nChns = 0;
386 for(
unsigned int iEvt=0; iEvt<
tree->GetEntries(); ++iEvt){
387 tree->GetEntry(iEvt);
390 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");
406 return StatusCode::SUCCESS;
420 return StatusCode::FAILURE;
423 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
424 ATH_MSG_DEBUG(
"Range of input is " << readHandle.getRange() <<
", range of output is " << writeHandle.
getRange());
428 unsigned int nObjs = 0;
429 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
435 return StatusCode::FAILURE;
438 std::unique_ptr<TTree>
tree;
441 return StatusCode::FAILURE;
444 unsigned int elinkId{0}, vmm{0},
channel{0};
445 float slope{0}, intercept{0};
448 tree->SetBranchAddress(
"vmm" , &vmm );
450 tree->SetBranchAddress(
"elinkId" , &elinkId );
451 tree->SetBranchAddress(
"slope" , &slope );
453 tree->SetBranchAddress(
"intercept" , &intercept );
458 unsigned int nChns = 0;
459 for(
unsigned int iEvt=0; iEvt<
tree->GetEntries(); ++iEvt){
460 tree->GetEntry(iEvt);
463 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");
468 calib_data.
slope = slope;
470 calib_data.intercept = intercept;
487 return StatusCode::SUCCESS;
502 std::unique_ptr<Muon::nsw::NSWResourceId> resId = std::make_unique<Muon::nsw::NSWResourceId>((
uint32_t) elinkId);
506 if(resId->
detId() == eformat::MUON_MMEGA_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_MMEGA_ENDCAP_C_SIDE) {
508 }
else if(resId->
detId() == eformat::MUON_STGC_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_STGC_ENDCAP_C_SIDE) {
511 ATH_MSG_ERROR(
"NSWResource Id "<< elinkId <<
" does not yield detID that is either sTGC or MMG");
512 THROW_EXCEPTION(
"NSWCalibDbAlg buildChannelId called with detID that is neither sTGC or MMG");
524 <<
" Station eta=" <<
static_cast <int> (
stationEta)
525 <<
" Station phi=" <<
static_cast <unsigned int> (
stationPhi)
526 <<
" Multilayer=" <<
static_cast <unsigned int> (
multiLayer)
527 <<
" Gas gap=" <<
static_cast <unsigned int> (
gasGap)
528 <<
" Channel type=" <<
static_cast <unsigned int> (channelType)
529 <<
" Channel Number=" << channelNumber );
533 if(resId->
detId() == eformat::MUON_MMEGA_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_MMEGA_ENDCAP_C_SIDE){
537 ATH_MSG_DEBUG(
"Could not extract valid channelId for MM elink "<<elinkId);
543 else if(resId->
detId() == eformat::MUON_STGC_ENDCAP_A_SIDE || resId->
detId() == eformat::MUON_STGC_ENDCAP_C_SIDE){
547 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 isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
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
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
Gaudi::Property< bool > m_processThresholds
StatusCode initialize(bool used=true)
#define THROW_EXCEPTION(MESSAGE)
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
bool readBlobAsTTree(const coral::Blob &blob, std::unique_ptr< TTree > &tree, const std::string_view name="tree")
Interprets the coral::Blob as a TTree instance.
readKey_t m_readKey_mm_sidec_pdo
void addDependency(const EventIDRange &range)