49 ATH_MSG_FATAL(
"List of class names does not match foreseen number of classes, cannot go on!" ) ;
50 return StatusCode::FAILURE ;
52 for (
unsigned i=0 ; i<
m_keylist.size() ; i++ ) {
58 return StatusCode::FAILURE ;
67 ATH_MSG_INFO(
"All parameters will be accessed through abstract interface" ) ;
69 ATH_MSG_WARNING(
"This will force dumping to Ntuple all foreseen online channels!" ) ;
73 ATH_MSG_INFO(
"All parameters will be accessed through their Complete/VsCalib class" ) ;
76 ATH_MSG_INFO(
"All foreseen online channels will be written to Ntuple" ) ;
78 ATH_MSG_INFO(
"Only channels with sensible parameters will be written to Ntuple (default)" ) ;
90 NTuple::Item<long> ntcellIndex;
91 NTuple::Item<long> ntflag, ntgain;
94 NTuple::Item<double> ntTcal, ntFstep, ntOffset, ntdTimeCal ;
95 NTuple::Item<long> ntnCB ;
97 NTuple::Item<double> ntOmega0, ntTaur ;
99 NTuple::Item<double> ntTdiff, ntTdrift ;
101 NTuple::Item<double> ntMphysOverMcal ;
103 NTuple::Item<double> ntRinj, ntTshaper ;
105 NTuple::Item<double> ntEMEC_Cphi, ntEMEC_HValpha, ntEMEC_HVbeta ;
107 NTuple::Item<double> ntCableLength, ntCableAttenuation ;
109 NTuple::Item<long> ntbin;
111 StatusCode
sc=
m_nt->addItem(
"cellIndex",ntcellIndex,0,2000);
112 if (
sc!=StatusCode::SUCCESS) {
114 return StatusCode::FAILURE;
116 sc=
m_nt->addItem(
"gain",ntgain,-1,2);
117 if (
sc!=StatusCode::SUCCESS) {
119 return StatusCode::FAILURE;
123 sc=
m_nt->addItem(
"Tcal",ntTcal);
124 if (
sc!=StatusCode::SUCCESS) {
126 return StatusCode::FAILURE;
128 sc=
m_nt->addItem(
"Fstep",ntFstep);
129 if (
sc!=StatusCode::SUCCESS) {
131 return StatusCode::FAILURE;
133 sc=
m_nt->addItem(
"Offset",ntOffset);
134 if (
sc!=StatusCode::SUCCESS) {
136 return StatusCode::FAILURE;
138 sc=
m_nt->addItem(
"dTimeCal",ntdTimeCal);
139 if (
sc!=StatusCode::SUCCESS) {
141 return StatusCode::FAILURE;
143 sc=
m_nt->addItem(
"nCB",ntnCB);
144 if (
sc!=StatusCode::SUCCESS) {
146 return StatusCode::FAILURE;
151 sc=
m_nt->addItem(
"Omega0",ntOmega0);
152 if (
sc!=StatusCode::SUCCESS) {
154 return StatusCode::FAILURE;
156 sc=
m_nt->addItem(
"Taur",ntTaur);
157 if (
sc!=StatusCode::SUCCESS) {
159 return StatusCode::FAILURE;
164 sc=
m_nt->addItem(
"Tdiff",ntTdiff);
165 if (
sc!=StatusCode::SUCCESS) {
167 return StatusCode::FAILURE;
172 sc=
m_nt->addItem(
"Tdrift",ntTdrift);
173 if (
sc!=StatusCode::SUCCESS) {
175 return StatusCode::FAILURE;
180 sc=
m_nt->addItem(
"MphysOverMcal",ntMphysOverMcal);
181 if (
sc!=StatusCode::SUCCESS) {
183 return StatusCode::FAILURE;
188 sc=
m_nt->addItem(
"Rinj",ntRinj);
189 if (
sc!=StatusCode::SUCCESS) {
191 return StatusCode::FAILURE;
196 sc=
m_nt->addItem(
"Tshaper",ntTshaper);
197 if (
sc!=StatusCode::SUCCESS) {
199 return StatusCode::FAILURE;
204 sc=
m_nt->addItem(
"EMEC_Cphi",ntEMEC_Cphi);
205 if (
sc!=StatusCode::SUCCESS) {
207 return StatusCode::FAILURE;
212 sc=
m_nt->addItem(
"EMEC_HValpha",ntEMEC_HValpha);
213 if (
sc!=StatusCode::SUCCESS) {
215 return StatusCode::FAILURE;
220 sc=
m_nt->addItem(
"EMEC_HVbeta",ntEMEC_HVbeta);
221 if (
sc!=StatusCode::SUCCESS) {
223 return StatusCode::FAILURE;
228 sc=
m_nt->addItem(
"CableLength",ntCableLength);
229 if (
sc!=StatusCode::SUCCESS) {
231 return StatusCode::FAILURE;
236 sc=
m_nt->addItem(
"CableAttenuation",ntCableAttenuation);
237 if (
sc!=StatusCode::SUCCESS) {
239 return StatusCode::FAILURE;
244 sc=
m_nt->addItem(
"OFCBin",ntbin);
245 if (
sc!=StatusCode::SUCCESS) {
247 return StatusCode::FAILURE;
325 for (
unsigned gain=0 ; (int)gain<nGains ; ++gain ) {
332 for (
unsigned gain=0 ; (int)gain<nGains ; ++gain ) {
414 for (
unsigned gain=0 ; (int)gain<nGains ; gain++) {
416 for (
const std::pair<const HWIdentifier, DumpFlags>& p :
m_dump_flags_map[gain]) {
419 const std::vector<bool> & flags = (p.second).flags() ;
420 if ( flags.empty() ) continue ;
483 if (
sc!=StatusCode::SUCCESS) {
485 return StatusCode::FAILURE;
492 return StatusCode::SUCCESS;
496template <
class DATA >
504 return StatusCode::FAILURE ;
507 std::string detStoreKey;
517 if ( dataName.substr(dataName.length()-8,8) != std::string(
"Complete") ) {
518 ATH_MSG_ERROR(
"Function scanReadoutChannels cannot be called for data class " << dataName ) ;
519 return StatusCode::FAILURE ;
522 ATH_MSG_VERBOSE(
"Trying to retrieve " << dataName <<
" from detector store with key="<< detStoreKey <<
" ...");
524 StatusCode
sc =
m_detStore->retrieve(data_object,detStoreKey) ;
525 if (
sc == StatusCode::FAILURE ) {
530 if (
sc == StatusCode::FAILURE ) {
531 ATH_MSG_ERROR(
"Could not retrieve " << dataName <<
" from detector store!" ) ;
540 if ( ! useGain ) nGains = 1 ;
542 for (
unsigned gain=0 ; gain<nGains ; gain++) {
544 typename DATA::ConstConditionsMapIterator it = data_object->begin(gain) ;
545 typename DATA::ConstConditionsMapIterator it_e = data_object->end(gain) ;
546 for ( ; it!=it_e ; it++ ) {
552 flags.set(classIndex) ;
554 for (
unsigned g=0 ; g<3 ; g++ ) {
556 flags.set(classIndex) ;
568template <
class DATA >
575 return StatusCode::FAILURE ;
581 if ( dataName.substr(dataName.length()-7,7) != std::string(
"VsCalib") ) {
582 ATH_MSG_ERROR(
"Function scanCalibChannels cannot be called for data class " << dataName ) ;
583 return StatusCode::FAILURE ;
586 ATH_MSG_VERBOSE(
"Trying to retrieve " << dataName <<
" from detector store with key="<< detStoreKey <<
" ...");
588 StatusCode
sc =
m_detStore->retrieve(data_object,detStoreKey) ;
589 if (
sc == StatusCode::FAILURE ) {
594 if (
sc == StatusCode::FAILURE ) {
595 ATH_MSG_ERROR(
"Could not retrieve " << dataName <<
" from detector store!" ) ;
605 typename DATA::Const_CB_It cb_it = data_object->begin() ;
606 typename DATA::Const_CB_It cb_it_e = data_object->end() ;
607 for ( ; cb_it!=cb_it_e ; cb_it++ ) {
608 const typename DATA::CB_Tvec_pair & cb_params_set = *cb_it ;
609 const typename DATA::CB_Id & cb_identifier = cb_params_set.first ;
610 const typename DATA::T_vector & cb_params = cb_params_set.second ;
612 unsigned nchan = cb_params.size() ;
613 if (
msgLvl(MSG::VERBOSE)) {
614 unsigned b_ec =
m_onlineId->barrel_ec(cb_HWid) ;
616 unsigned ft =
m_onlineId->feedthrough(cb_HWid) ;
618 ATH_MSG_VERBOSE(
" ... B/EC=" << b_ec <<
" P/N=" << p_n <<
" FT=" << ft <<
" slot=" << slot
619 <<
" nchan=" << nchan ) ;
622 for (
unsigned ichan=0 ; ichan<nchan ; ichan++ ) {
627 for (
unsigned g=0 ; g<3 ; g++ ) {
629 flags.set(classIndex) ;
640template <
class DATA >
649 return StatusCode::FAILURE ;
655 ATH_MSG_VERBOSE(
"Trying to retrieve " << dataName <<
" from detector store through abstract interface I" << detStoreKey <<
" ...");
657 if (
sc == StatusCode::FAILURE ) {
658 ATH_MSG_WARNING(
"Could not retrieve " << dataName <<
" from detector store!" ) ;
664 ATH_MSG_VERBOSE(
"Trying to retrieve "<<dataName<<
" from detector store with key="<<detStoreKey<<
" ...");
665 StatusCode
sc =
m_detStore->retrieve(data_object,detStoreKey) ;
666 if (
sc == StatusCode::FAILURE ) {
670 if (
sc == StatusCode::FAILURE ) {
671 ATH_MSG_WARNING(
"Could not retrieve " << dataName <<
" from detector store!" ) ;
676 ATH_MSG_INFO(dataName <<
" retrieved successfully from det store");
677 return StatusCode::SUCCESS ;
718 const ILArRinj* abstract_object =
nullptr;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
value_type get_compact() const
Get the compact id.
This class implements the ILArCableAttenuation interface.
This class implements the ILArCableLength interface.
This class implements the ILArCaliPulseParams interface.
Gaudi::Property< bool > m_isSC
StoreGateSvc * m_detStore
const LArOnlineID_Base * m_onlineId
bool fillFromIdentifier(const HWIdentifier &id)
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
This class implements the ILArDetCellParams interface.
This class implements the ILArEMEC_Cphi interface.
This class implements the ILArEMEC_HValpha interface.
This class implements the ILArEMEC_HVbeta interface.
This class implements the ILArMphysOverMcal interface.
const LArEMEC_HVbetaComplete * m_completeEMEC_HVbeta
const LArTdriftComplete * m_completeTdrift
bool m_allChannels2Ntuple
StatusCode scanReadoutChannels(const DATA *&data_object)
const LArPhysCaliTdiffComplete * m_completePhysCaliTdiff
std::vector< std::map< HWIdentifier, DumpFlags > > m_dump_flags_map
const LArDetCellParamsComplete * m_completeDetCellParams
const LArEMEC_HValphaComplete * m_completeEMEC_HValpha
LArParams2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::string > m_detStoreJo
const LArEMEC_CphiComplete * m_completeEMEC_Cphi
StatusCode retrieveAbstractInterface(const LArCaliPulseParamsComplete *&data_object)
virtual StatusCode stop()
std::vector< std::string > m_detStoreKeys
const LArCaliPulseParamsComplete * m_completeCaliPulseParams
std::vector< std::string > m_keylist
StatusCode retrieveFromDetStore(const DATA *&data_object)
const LArOFCBinComplete * m_completeOFCBin
const LArMphysOverMcalComplete * m_completeMphysOverMcal
static const unsigned m_nClasses
StatusCode scanCalibChannels(const DATA *&data_object)
const LArRinjComplete * m_completeRinj
bool m_useAbstractInterface
const LArTshaperComplete * m_completeTshaper
const LArCableLengthComplete * m_completeCableLength
const LArCableAttenuationComplete * m_completeCableAttenuation
std::vector< std::string > m_classNames
This class implements the ILArPhysCaliTdiff interface ` *.
This class implements the ILArRinj interface.
This class implements the ILArTdrift interface.
This class implements the ILArTshaper interface.
This include file contains inline functions describing LAr Parameters properties used in LArReadParam...
std::string keyword(const std::string &classname)
unsigned getClassIndex(const LArCaliPulseParamsComplete *)
bool isGainDependent(unsigned index)
bool isValid(const LArCaliPulseParamsP &p)
@ CaliPulseParamsComplete
@ CableAttenuationComplete
const std::vector< std::string > & ClassNames()