ATLAS Offline Software
Loading...
Searching...
No Matches
RpcCablingCondAlg Class Reference

#include <RpcCablingCondAlg.h>

Inheritance diagram for RpcCablingCondAlg:
Collaboration diagram for RpcCablingCondAlg:

Public Member Functions

 RpcCablingCondAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~RpcCablingCondAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef std::array< int, 64 > sectorMap_t
typedef std::map< int, RPC_CondCabling::SectorLogicSetup *, std::less< int > > SLmap_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode setup (const CondAttrListCollection *readCdoMap, const CondAttrListCollection *readCdoCorr, const CondAttrListCollection *readCdoEta, const CondAttrListCollection *readCdoPhi, RpcCablingCondData *writeCdo) const
std::list< Identifiergive_strip_id (const unsigned short int SubsystemId, const unsigned short int SectorId, const unsigned short int PADId, const unsigned short int CMAId, const unsigned short ijk, const unsigned short int Channel, const sectorMap_t &smap, const RpcCablingCondData::STvec &sType) const
bool BoardParamCheck (const unsigned short int SubId, const unsigned short int SecId, const unsigned short int PADId, const unsigned short int CMAId, const unsigned short int inputType, const unsigned int layer, const unsigned int type, const unsigned short int Channel1, const unsigned short int Channel2, const short int Number) const
bool CableParamCheck (const unsigned short int SubId, const unsigned short int SecId, const unsigned short int PADId, const unsigned short int CMAId, const unsigned short int ijk, const unsigned int type, const unsigned short int Channel1, const unsigned short int Channel2, const short int Number) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static bool correct (const unsigned short int SubsystemId, const unsigned short int SectorId, const unsigned short int PADId, const unsigned short int CMAId, const CMAinput it, const unsigned int layer, const unsigned short int Channel1, const unsigned short int Channel2, const short int number, const L1RPCcabCorrection type, const sectorMap_t &smap, const RpcCablingCondData::STvec &sType)

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_map_schema
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_map_schema_corr
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_cm_thr_eta
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_cm_thr_phi
SG::WriteCondHandleKey< RpcCablingCondDatam_writeKey
Gaudi::Property< std::string > m_database_repository {this, "DatabaseRepository", "MuonRPC_Cabling/ATLAS.data"}
Gaudi::Property< bool > m_cosmic_configuration {this, "CosmicConfiguration", false}
Gaudi::Property< bool > m_ApplyFeetPadThresholds
Gaudi::Property< bool > m_ForceFeetPadThresholdsFromJO {this, "ForceFeetPadThresholdsFromJO", false, "JO override db setting"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 21 of file RpcCablingCondAlg.h.

Member Typedef Documentation

◆ sectorMap_t

typedef std::array<int, 64> RpcCablingCondAlg::sectorMap_t
private

Definition at line 30 of file RpcCablingCondAlg.h.

◆ SLmap_t

typedef std::map<int, RPC_CondCabling::SectorLogicSetup*, std::less<int> > RpcCablingCondAlg::SLmap_t
private

Definition at line 31 of file RpcCablingCondAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ RpcCablingCondAlg()

RpcCablingCondAlg::RpcCablingCondAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 12 of file RpcCablingCondAlg.cxx.

12: AthCondAlgorithm(name, pSvcLocator) {}

◆ ~RpcCablingCondAlg()

virtual RpcCablingCondAlg::~RpcCablingCondAlg ( )
virtualdefault

Member Function Documentation

◆ BoardParamCheck()

bool RpcCablingCondAlg::BoardParamCheck ( const unsigned short int SubId,
const unsigned short int SecId,
const unsigned short int PADId,
const unsigned short int CMAId,
const unsigned short int inputType,
const unsigned int layer,
const unsigned int type,
const unsigned short int Channel1,
const unsigned short int Channel2,
const short int Number ) const
private

Definition at line 784 of file RpcCablingCondAlg.cxx.

787 {
788 if (SubId != 0x65 && SubId != 0x66) {
789 ATH_MSG_ERROR("Subsystem Id out of range: " << SubId << " not in [0x65,0x66].");
790 return false;
791 }
792 if (SecId > 31) {
793 ATH_MSG_ERROR("Sector Id out of range [0/31].");
794 return false;
795 }
796 if (PADId > 8) {
797 ATH_MSG_ERROR("Pad Id out of range [0/8].");
798 return false;
799 }
800 if (CMAId > 7) {
801 ATH_MSG_ERROR("CMA Id out of range [0/7].");
802 return false;
803 }
804 if (inputType > 2) {
805 ATH_MSG_ERROR("Board input out of range [0/2].");
806 return false;
807 }
808 if (layer > 1) {
809 ATH_MSG_ERROR("Board layer out of range [0/1].");
810 return false;
811 }
812 if (type > 3) {
813 ATH_MSG_ERROR("correction type out of range [0/3].");
814 return false;
815 }
816 if (Channel1 > 63) {
817 ATH_MSG_ERROR("ijk Channel 1 out of range [0/31].");
818 return false;
819 }
820 if (Channel2 > 63) {
821 ATH_MSG_ERROR("ijk Channel 2 out of range [0/31].");
822 return false;
823 }
824 if (Number > 64) {
825 ATH_MSG_ERROR("Number out of range [0/64].");
826 return false;
827 }
828 return true;
829}
#define ATH_MSG_ERROR(x)

◆ CableParamCheck()

bool RpcCablingCondAlg::CableParamCheck ( const unsigned short int SubId,
const unsigned short int SecId,
const unsigned short int PADId,
const unsigned short int CMAId,
const unsigned short int ijk,
const unsigned int type,
const unsigned short int Channel1,
const unsigned short int Channel2,
const short int Number ) const
private

Definition at line 831 of file RpcCablingCondAlg.cxx.

834 {
835 if (SubId != 0x65 && SubId != 0x66) {
836 ATH_MSG_ERROR("Subsystem Id out of range [0x65,0x66].");
837 return false;
838 }
839 if (SecId > 31) {
840 ATH_MSG_ERROR("Sector Id out of range [0/31].");
841 return false;
842 }
843 if (PADId > 8) {
844 ATH_MSG_ERROR("Pad Id out of range [0/8].");
845 return false;
846 }
847 if (CMAId > 7) {
848 ATH_MSG_ERROR("CMA Id out of range [0/7].");
849 return false;
850 }
851 if (ijk > 5) {
852 ATH_MSG_ERROR("ijk out of range [0/5].");
853 return false;
854 }
855 if (type > 3) {
856 ATH_MSG_ERROR("correction type out of range [0/3].");
857 return false;
858 }
859 if (Channel1 > 31) {
860 ATH_MSG_ERROR("ijk Channel 1 out of range [0/31].");
861 return false;
862 }
863 if (Channel2 > 31) {
864 ATH_MSG_ERROR("ijk Channel 2 out of range [0/31].");
865 return false;
866 }
867 if (Number > 32) {
868 ATH_MSG_ERROR("Number out of range [0/32].");
869 return false;
870 }
871 return true;
872}

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ correct()

bool RpcCablingCondAlg::correct ( const unsigned short int SubsystemId,
const unsigned short int SectorId,
const unsigned short int PADId,
const unsigned short int CMAId,
const CMAinput it,
const unsigned int layer,
const unsigned short int Channel1,
const unsigned short int Channel2,
const short int number,
const L1RPCcabCorrection type,
const sectorMap_t & smap,
const RpcCablingCondData::STvec & sType )
staticprivate

Definition at line 759 of file RpcCablingCondAlg.cxx.

762 {
763 int logic_sector = (SubsystemId == 0x65) ? SectorId + 32 : SectorId;
764 unsigned short int Ixx = CMAId & 1;
765 unsigned short int ep = (CMAId >> 1) & 1;
766
767 ep = (ep == 1) ? 0 : 1;
768
769 // retrieve the Sector Logic setup
770 const RPC_CondCabling::SectorLogicSetup& s = sType[smap[logic_sector] - 1];
771
772 // retrieve the CMAparameters associated to the identifiers
773 if (ep) {
774 CMAcoverage PhiCov = (logic_sector % 2) ? OddSectors : EvenSectors;
775 CMAidentity PHI(Phi, PhiCov, PADId, Ixx);
776 return s.correct(PHI, type, it, layer, Channel1, Channel2, number);
777 } else {
778 CMAidentity ETA(Eta, AllSectors, PADId, Ixx);
779 return s.correct(ETA, type, it, layer, Channel1, Channel2, number);
780 }
781 return false;
782}
CMAcoverage
Definition CMAidentity.h:14
@ OddSectors
Definition CMAidentity.h:14
@ AllSectors
Definition CMAidentity.h:14
@ EvenSectors
Definition CMAidentity.h:14
@ Phi
Definition RPCdef.h:8
@ Eta
Definition RPCdef.h:8
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode RpcCablingCondAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 25 of file RpcCablingCondAlg.cxx.

25 {
26
27 ATH_MSG_DEBUG("executing" << name());
28
29 SG::WriteCondHandle<RpcCablingCondData> writeHandle{m_writeKey, ctx};
30 if (writeHandle.isValid()) {
31 ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
32 << ". In theory this should not be called, but may happen"
33 << " if multiple concurrent events are being processed out of order.");
34 return StatusCode::SUCCESS;
35 }
36
37 // read in the 4 different cond objects:
38 // map
39 SG::ReadCondHandle<CondAttrListCollection> readHandle_map_schema{m_readKey_map_schema, ctx};
40 const CondAttrListCollection* readCdoMap{*readHandle_map_schema};
41 if (!readCdoMap) {
42 ATH_MSG_FATAL("Null pointer to the read conditions object");
43 return StatusCode::FAILURE;
44 }
45 writeHandle.addDependency(readHandle_map_schema);
46 ATH_MSG_DEBUG("Size of CondAttrListCollection readCdoMap->size()= " << readCdoMap->size());
47
48 // corr
49 SG::ReadCondHandle<CondAttrListCollection> readHandle_map_schema_corr{m_readKey_map_schema_corr, ctx};
50 const CondAttrListCollection* readCdoCorr{*readHandle_map_schema_corr};
51 if (!readCdoCorr) {
52 ATH_MSG_FATAL("Null pointer to the read conditions object");
53 return StatusCode::FAILURE;
54 }
55 ATH_MSG_DEBUG("Size of CondAttrListCollection readCdoMap_corr->size()= " << readCdoCorr->size());
56 writeHandle.addDependency(readHandle_map_schema_corr);
57
58 // EtaTable
59 SG::ReadCondHandle<CondAttrListCollection> readHandle_cm_thr_eta{m_readKey_cm_thr_eta, ctx};
60 const CondAttrListCollection* readCdoEta{*readHandle_cm_thr_eta};
61 if (!readCdoEta) {
62 ATH_MSG_FATAL("Null pointer to the read conditions object");
63 return StatusCode::FAILURE;
64 }
65 ATH_MSG_DEBUG("Size of CondAttrListCollection readCdo_cm_thr_eta->size()= " << readCdoEta->size());
66 writeHandle.addDependency(readHandle_cm_thr_eta);
67
68 // phiTable
69 SG::ReadCondHandle<CondAttrListCollection> readHandle_cm_thr_phi{m_readKey_cm_thr_phi, ctx};
70 const CondAttrListCollection* readCdoPhi{*readHandle_cm_thr_phi};
71 if (!readCdoPhi) {
72 ATH_MSG_FATAL("Null pointer to the read conditions object");
73 return StatusCode::FAILURE;
74 }
75 ATH_MSG_DEBUG("Size of CondAttrListCollection readCdo_cm_thr_phi->size()= " << readCdoPhi->size());
76 writeHandle.addDependency(readHandle_cm_thr_phi);
77
78 std::unique_ptr<RpcCablingCondData> writeCdo{std::make_unique<RpcCablingCondData>()};
79 ATH_CHECK(setup(readCdoMap, readCdoCorr, readCdoEta, readCdoPhi, writeCdo.get()));
80
81 if (writeHandle.record(std::move(writeCdo)).isFailure()) {
82 ATH_MSG_FATAL("Could not record RpcCondCablingData " << writeHandle.key() << " with EventRange " << writeHandle.getRange()
83 << " into Conditions Store");
84 return StatusCode::SUCCESS;
85 }
86
87 ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range " << writeHandle.getRange());
88 return StatusCode::SUCCESS;
89}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
size_type size() const
number of Chan/AttributeList pairs
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_map_schema_corr
StatusCode setup(const CondAttrListCollection *readCdoMap, const CondAttrListCollection *readCdoCorr, const CondAttrListCollection *readCdoEta, const CondAttrListCollection *readCdoPhi, RpcCablingCondData *writeCdo) const
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_cm_thr_eta
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_map_schema
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_cm_thr_phi
SG::WriteCondHandleKey< RpcCablingCondData > m_writeKey
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ give_strip_id()

std::list< Identifier > RpcCablingCondAlg::give_strip_id ( const unsigned short int SubsystemId,
const unsigned short int SectorId,
const unsigned short int PADId,
const unsigned short int CMAId,
const unsigned short ijk,
const unsigned short int Channel,
const sectorMap_t & smap,
const RpcCablingCondData::STvec & sType ) const
private

Definition at line 688 of file RpcCablingCondAlg.cxx.

691 {
692 std::list<unsigned int> CodeList;
693
694 int logic_sector = SectorId + SubsystemId * 32;
695 unsigned short int Ixx = CMAId & 1;
696 unsigned short int ep = (CMAId >> 1) & 1;
697 unsigned short int lh = (CMAId >> 2) & 1;
698
699 ep = (ep == 1) ? 0 : 1;
700
701 // retrieve the Sector Logic setup
702 const RPC_CondCabling::SectorLogicSetup& s = sType[smap[logic_sector] - 1];
703
704 // retrieve the CMAparameters associated to the identifiers
705 if (ep) {
706 CMAcoverage PhiCov = (logic_sector % 2) ? OddSectors : EvenSectors;
707 CMAidentity PHI(ViewType::Phi, PhiCov, PADId, Ixx);
708 CodeList = s.give_strip_code(PHI, logic_sector, lh, ijk, Channel);
709 } else {
710 CMAidentity ETA(ViewType::Eta, CMAcoverage::AllSectors, PADId, Ixx);
711 CodeList = s.give_strip_code(ETA, logic_sector, lh, ijk, Channel);
712 }
713
714 std::list<RPCofflineId> offlineIdList;
715 std::list<unsigned int>::const_iterator it = CodeList.begin();
716 while (it != CodeList.end()) {
717 RPCdecoder decode(*it);
718 if (!decode)
719 throw std::runtime_error("RpcCablingCondAlg::give_strip_id() - cannot decode LVL1 Id at " +
720 std::string(__FILE__) + ":" + std::to_string(__LINE__));
721 RPCofflineId rpcId;
722
723 int RPC_strip = decode.strip_number();
724 int RPC_chamber = decode.rpc_z_index();
725 int RPC_layer = decode.rpc_layer();
726 int RPC_station = decode.lvl1_station();
727 int sector = (decode.logic_sector()) % 32;
728
729 const RPC_CondCabling::RPCchamber* rpc = s.find_chamber(RPC_station, RPC_chamber);
730
731 rpcId.stationName = rpc->stationName();
732 rpcId.stationEta = (decode.half_barrel() == Positive) ? rpc->stationEta() : -rpc->stationEta();
733 rpcId.stationPhi = (sector == 31) ? 1 : (sector + 1) / 4 + 1;
734 rpcId.doubletR = rpc->doubletR();
735 rpcId.doubletZ = rpc->doubletZ();
736 rpcId.doubletPhi = (rpc->phiReadoutPannels() == 2) ? (sector + 1) % 2 + 1 : 1;
737 rpcId.gasGap = RPC_layer + 1;
738 rpcId.measuresPhi = static_cast<int>(decode.view());
739 rpcId.strip = RPC_strip + 1;
740
741 offlineIdList.push_back(std::move(rpcId));
742
743 ++it;
744 }
745
746 std::list<Identifier> id;
747 std::list<RPCofflineId>::const_iterator iterator = offlineIdList.begin();
748 while (iterator != offlineIdList.end()) {
749 Identifier rpcId = m_idHelperSvc->rpcIdHelper().channelID((*iterator).stationName, (*iterator).stationEta, (*iterator).stationPhi,
750 (*iterator).doubletR, (*iterator).doubletZ, (*iterator).doubletPhi,
751 (*iterator).gasGap, (*iterator).measuresPhi, (*iterator).strip);
752 id.push_back(rpcId);
753 ++iterator;
754 }
755
756 return id;
757}
@ Positive
Definition RPCdef.h:9
std::string stationName() const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
JetConstituentVector::iterator iterator
std::string stationName
Definition RPCofflineId.h:9

◆ initialize()

StatusCode RpcCablingCondAlg::initialize ( )
overridevirtual

Definition at line 14 of file RpcCablingCondAlg.cxx.

14 {
15 ATH_MSG_DEBUG("initializing" << name());
16 ATH_CHECK(m_readKey_map_schema.initialize());
18 ATH_CHECK(m_readKey_cm_thr_eta.initialize());
19 ATH_CHECK(m_readKey_cm_thr_phi.initialize());
20 ATH_CHECK(m_writeKey.initialize());
21 ATH_CHECK(m_idHelperSvc.retrieve());
22 return StatusCode::SUCCESS;
23}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ setup()

StatusCode RpcCablingCondAlg::setup ( const CondAttrListCollection * readCdoMap,
const CondAttrListCollection * readCdoCorr,
const CondAttrListCollection * readCdoEta,
const CondAttrListCollection * readCdoPhi,
RpcCablingCondData * writeCdo ) const
private

Definition at line 91 of file RpcCablingCondAlg.cxx.

93 {
94 ATH_MSG_DEBUG("starting setup()");
95
96 int maxType = 0;
97 sectorMap_t sectorMap;
99 std::vector<unsigned short int> feedPadThresholds;
100 std::map<std::string, std::string> trigroads;
101 SLmap_t sectorLogic;
102
103 // ------------------------------
104 // readCdoMap
105 // ------------------------------
106 ATH_MSG_INFO("setup() - Reading " << m_readKey_map_schema.key());
107 const coral::AttributeList& atr_map = readCdoMap->attributeList(1); // All data sits in cool channel 1
108 std::stringstream MAP(atr_map["Map"].data<std::string>());
109
110 // ------------------------------
111 // readCdoCorr
112 // ------------------------------
113 ATH_MSG_INFO("setup() - Reading " << m_readKey_map_schema_corr.key());
114 const coral::AttributeList& atr_map_corr = readCdoCorr->attributeList(1); // All data sits in cool channel 1
115 std::stringstream MAP_corr(atr_map_corr["Map"].data<std::string>());
116
117 // ------------------------------
118 // readCdoEta
119 // ------------------------------
120 ATH_MSG_INFO("setup() - Reading " << m_readKey_cm_thr_eta.key());
121 std::string etaCM_File;
122 std::string etaTh0;
124 for (itr_eta = readCdoEta->begin(); itr_eta != readCdoEta->end(); ++itr_eta) {
125 const coral::AttributeList& atr = itr_eta->second;
126 etaCM_File = *(static_cast<const std::string*>((atr["CM_File"]).addressOfData()));
127 etaTh0 = *(static_cast<const std::string*>((atr["Th0"]).addressOfData()));
128 trigroads[etaCM_File] = etaTh0;
129 }
130
131 // ------------------------------
132 // readCdoPhi
133 // ------------------------------
134 ATH_MSG_INFO("setup() - Reading " << m_readKey_cm_thr_phi.key());
135 std::string phiCM_File;
136 std::string phiTh0;
138 for (itr = readCdoPhi->begin(); itr != readCdoPhi->end(); ++itr) {
139 const coral::AttributeList& atr = itr->second;
140 phiCM_File = *(static_cast<const std::string*>((atr["CM_File"]).addressOfData()));
141 phiTh0 = *(static_cast<const std::string*>((atr["Th0"]).addressOfData()));
142 trigroads[phiCM_File] = phiTh0;
143 }
144 // ------------------------------
145
146 DBline data(MAP);
147 // store the setup environment
148 std::string version, setup, layout;
149
150 // Start reading routine
151 unsigned int nlines = 0;
152
153 std::string dataName = PathResolver::find_directory(m_database_repository, "DATAPATH");
154
155 // Start reading routine
156 while (++data) {
157 ATH_MSG_DEBUG("setup() - Reading routine. nlines = " << nlines);
158 ++nlines;
159 data("Version") >> version >> setup >> layout;
160
161 // Read the Sector Type enumeration
162 int start = 0;
163 int stop = 0;
164 if (data("SECTOR TYPES (") >> start >> "-" >> stop >> "):") {
165 for (int i = start; i <= stop; ++i) { data >> sectorMap[i]; }
166 }
167
168 // Set the maxType variable and the type of SectorMap objects
169 if (stop == 63 || stop == 8) {
170 for (int i = 0; i < 64; ++i) { maxType = std::max(sectorMap[i], maxType); }
171 sectorType.clear();
172 //sectorType.reserve(maxType); // this would require a copy-constructor
173 ATH_MSG_DEBUG("setup() - Loop over " << maxType << " sector-types");
174
175 for (int i = 1; i <= maxType; ++i) {
176 sectorType.emplace_back(i, dataName, layout, m_cosmic_configuration);
177 RPC_CondCabling::SectorLogicSetup& sec = sectorType[i - 1];
178 sec.SetPtoTrigRoads(&trigroads);
179 for (int j = 0; j < 64; ++j) {
180 if (sectorMap[j] == i) {
181 sec << j;
182 sectorLogic.insert(SLmap_t::value_type(j, &sec));
183 ATH_MSG_DEBUG("setup() - filling sectorLogicSetup Map for type " << i << " sector " << j);
184 }
185 }
186 }
187 }
188
189 // Loop on GEOMETRY TYPES
190 for (int i = 1; i <= maxType; ++i) {
191 // Read the RPC geometry
192 if (data("RPC GEOM # :", i)) {
193 RPC_CondCabling::RPCchamberdata RPCdata(data, i);
194 if (!(sectorType[i - 1] += RPCdata)) return StatusCode::FAILURE;
195 }
196 // Read the Wired OR geometry
197 if (data("WIRED OR # :", i)) {
198 RPC_CondCabling::WiredORdata WORdata(data, i);
199 if (!(sectorType[i - 1] += WORdata)) return StatusCode::FAILURE;
200 }
201 // Read the CMAs segmentation
202 if (data("CMAs # : pivot segmentation", i)) {
203 RPC_CondCabling::CMApivotdata CMAdata(data, i, layout);
204 if (!(sectorType[i - 1] += CMAdata)) return StatusCode::FAILURE;
205 }
206 // Read the CMAs cabling
207 if (data("CMAs # : eta cabling", i)) {
208 RPC_CondCabling::CMAcablingdata CMAdata(data, i);
209 if (!(sectorType[i - 1] += CMAdata)) return StatusCode::FAILURE;
210 }
211 }
212 }
213 ATH_MSG_DEBUG("setup() - map n. of lines read is " << nlines);
214 ATH_MSG_INFO("setup() - version is " << version << " " << setup << " " << layout << " (cosmic=" << (int)m_cosmic_configuration << ")");
215
216 for (int i = 1; i <= maxType; ++i) {
217 if (!sectorType[i - 1].setup(msg())) return StatusCode::FAILURE;
218 if (!sectorType[i - 1].check()) return StatusCode::FAILURE;
219 if (msgLvl(MSG::DEBUG)) {
220 ATH_MSG_DEBUG("calling get_cabling for i=" << i);
221 const RPC_CondCabling::SectorLogicSetup::EtaCMAmap& CMAs = sectorType[i - 1].giveEtaCMA();
222 for (const auto& cma : CMAs) {
223 unsigned int cabling = UINT_MAX;
224 if (cma.second.get_cabling(CMAinput::Pivot, 0, 0, 0, cabling)) {
225 ATH_MSG_DEBUG("got pivot cabling=" << cabling);
226 } else {
227 ATH_MSG_DEBUG("failed to get cabling");
228 }
229 }
230 }
231 }
232
233 ATH_MSG_DEBUG("setup() - " << m_readKey_map_schema.key() << " maps have been parsed");
234
235 for (int sector = 0; sector < 64; ++sector) {
236 unsigned int nRDOentries = 0;
237 int side = (sector < 32) ? 0 : 1;
238 int logic_sector = sector % 32;
239
240 if (sectorMap[sector]) {
241 // get the Sector Logic Setup
242 const RPC_CondCabling::SectorLogicSetup& Sector = sectorType[sectorMap[sector] - 1];
243
244 // get the Eta CMA map from the Sector Logic Setup
246 RPC_CondCabling::SectorLogicSetup::EtaCMAmap::const_iterator it = CMAs.begin();
247
248 bool isFirst = false;
249
250 // loop over the whole set of Eta CMAs
251 while (it != CMAs.end()) {
252 // get the set of parameters for idenfying the first RPC strip
253 unsigned int ID = (*it).second.id().Ixx_index();
254 bool inversion = (*it).second.inversion();
255 isFirst = (ID == 1 && inversion) || (ID == 0 && !inversion);
256 unsigned int PADid = (*it).first.PAD_index();
257 unsigned int cabling = UINT_MAX;
258 if ((*it).second.get_cabling(CMAinput::Pivot, 0, 0, 0, cabling)) {
259 unsigned int RPC_strip = cabling % 100;
260 unsigned int RPC_chamber = (cabling / 100) % 100;
261 unsigned int RPC_layer = 0;
262 unsigned int RPC_station = (*it).second.whichCMAstation(CMAinput::Pivot);
263 unsigned int lvl1_sector = sector;
264
265 const RPC_CondCabling::RPCchamber* rpc = Sector.find_chamber(RPC_station, RPC_chamber);
266 std::string name = rpc->stationName();
267 int sEta = (side) ? rpc->stationEta() : -rpc->stationEta();
268 int sPhi = (logic_sector == 31) ? 1 : (logic_sector + 1) / 4 + 1;
269 int dR = rpc->doubletR();
270 int dZ = rpc->doubletZ();
271 int dP = (rpc->phiReadoutPannels() == 2) ? (logic_sector + 1) % 2 + 1 : 1;
272
273 // build the Level-1 code index
274 RPCdecoder decode(Eta, lvl1_sector, RPC_station, RPC_layer, RPC_chamber, RPC_strip);
275
276 // instanciate the corresponding RDO index
277 RDOindex rdo(PADid, decode.code(), name, sEta, sPhi, dR, dZ, dP, m_idHelperSvc->rpcIdHelper());
278
279 // compute the key for retrieving RDO into the map
280 int key = side * 10000 + logic_sector * 100 + PADid;
281 // insert the RDO into the map
282 std::pair<RpcCablingCondData::RDOmap::iterator, bool> ins =
283 writeCdo->m_RDOs.insert(RpcCablingCondData::RDOmap::value_type(key, rdo));
284
285 if (!ins.second) {
286 ATH_MSG_ERROR("RpcCablingCondData::RDOmap is false for stationName="
287 << name << ", stationEta=" << sEta << ", stationPhi=" << sPhi << ", doubletR=" << dR
288 << ", doubletZ=" << dZ << ", doubletPhi=" << dP);
289 return StatusCode::FAILURE;
290 }
291
292 ++nRDOentries;
293 }
294
295 else if (!(*it).second.get_cabling(CMAinput::Pivot, 0, 0, 0, cabling) && isFirst) {
296 // try to catch configrm cabling
297 bool existLow = false;
298 bool existHigh = false;
299
300 if (!(existLow = (*it).second.get_cabling(CMAinput::LowPt, 0, 0, 0, cabling)))
301 existHigh = (*it).second.get_cabling(CMAinput::HighPt, 0, 0, 0, cabling);
302
303 if (!existLow && !existHigh) {
304 ATH_MSG_ERROR("Error while configuring the RDO map");
305 return StatusCode::FAILURE;
306 }
307
308 unsigned int RPC_strip = cabling % 100;
309 unsigned int RPC_chamber = (cabling / 100) % 100;
310 unsigned int RPC_layer = 0;
311 unsigned int RPC_station = 0;
312 if (existLow)
313 RPC_station = (*it).second.whichCMAstation(CMAinput::LowPt);
314 else
315 RPC_station = (*it).second.whichCMAstation(CMAinput::HighPt);
316 unsigned int lvl1_sector = sector;
317
318 const RPC_CondCabling::RPCchamber* rpc = Sector.find_chamber(RPC_station, RPC_chamber);
319 std::string name = rpc->stationName();
320 int sEta = (side) ? rpc->stationEta() : -rpc->stationEta();
321 int sPhi = (logic_sector == 31) ? 1 : (logic_sector + 1) / 4 + 1;
322 int dR = rpc->doubletR();
323 int dZ = rpc->doubletZ();
324 int dP = (rpc->phiReadoutPannels() == 2) ? (logic_sector + 1) % 2 + 1 : 1;
325
326 // build the Level-1 code index
327 RPCdecoder decode(Eta, lvl1_sector, RPC_station, RPC_layer, RPC_chamber, RPC_strip);
328
329 // instanciate the corresponding RDO index
330 RDOindex rdo(PADid, decode.code(), name, sEta, sPhi, dR, dZ, dP, m_idHelperSvc->rpcIdHelper());
331
332 // compute the key for retrieving RDO into the map
333 int key = side * 10000 + logic_sector * 100 + PADid;
334
335 // insert the RDO into the map
336 std::pair<RpcCablingCondData::RDOmap::iterator, bool> ins =
337 writeCdo->m_RDOs.insert(RpcCablingCondData::RDOmap::value_type(key, rdo));
338
339 if (!ins.second) {
340 ATH_MSG_ERROR("RpcCablingCondData::RDOmap is false for stationName="
341 << name << ", stationEta=" << sEta << ", stationPhi=" << sPhi << ", doubletR=" << dR
342 << ", doubletZ=" << dZ << ", doubletPhi=" << dP);
343 return StatusCode::FAILURE;
344 }
345
346 ++nRDOentries;
347 }
348
349 // increase the iterator
350 while (it != CMAs.end() && (unsigned int)(*it).first.PAD_index() == PADid) { ++it; }
351 }
352 }
353 ATH_MSG_DEBUG("setup() - sector " << sector << ", number of associated RDO (i.e. Pads) = " << nRDOentries);
354 }
355
356 DBline data_corr(MAP_corr);
357 nlines = 0;
358 while (++data_corr) {
359 ++nlines;
360 unsigned short int SubId;
361 unsigned short int SecId;
362 unsigned short int PADId;
363 unsigned short int CMAId;
364 unsigned short int ijk;
365 unsigned short int inputType;
366 unsigned int layer;
367 unsigned int type;
368 unsigned short int Channel1;
369 unsigned short int Channel2;
370 int Number;
371
372 if (data_corr("CABLE") >> data_corr.dbhex() >> SubId >> SecId >> PADId >> CMAId >> ijk >> data_corr.dbdec() >> type >> Channel1 >>
373 Channel2 >> Number) {
374 bool ok = CableParamCheck(SubId, SecId, PADId, CMAId, ijk, type, Channel1, Channel2, Number);
375
376 layer = (ijk == 0 || ijk == 2 || ijk == 3) ? 0 : 1;
377
378 if (ijk > 1) {
379 Channel1 += 32 * (ijk % 2);
380 Channel2 += 32 * (ijk % 2);
381 }
382
383 unsigned short int lh = (CMAId >> 2) & 1;
384
385 if (ijk == 0 || ijk == 1)
386 inputType = 1;
387 else
388 inputType = (lh) ? 2 : 0;
389
390 if (ijk > 5) inputType = 3;
391 if (type > 3) type = 4;
392
393 if (ok && !correct(SubId, SecId, PADId, CMAId, static_cast<CMAinput>(inputType), layer, Channel1, Channel2, Number,
394 static_cast<L1RPCcabCorrection>(type), sectorMap, sectorType)) {
395 ATH_MSG_WARNING("Cannot apply correction: "
396 << std::hex << std::setw(4) << std::showbase << SubId << " " << std::setw(4) << std::showbase << SecId
397 << " " << std::setw(3) << std::showbase << PADId << " " << std::setw(3) << std::showbase << CMAId << " "
398 << std::setw(3) << std::showbase << ijk << " " << std::dec << std::setw(1) << std::showbase << type << " "
399 << std::setw(2) << std::showbase << Channel1 << " " << std::setw(2) << std::showbase << Channel2 << " "
400 << std::setw(2) << std::showbase << Number);
401 }
402 }
403 if (data_corr("BOARD") >> data_corr.dbhex() >> SubId >> SecId >> PADId >> CMAId >> data_corr.dbdec() >> inputType >> layer >>
404 type >> Channel1 >> Channel2 >> Number) {
405 bool ok = BoardParamCheck(SubId, SecId, PADId, CMAId, inputType, layer, type, Channel1, Channel2, Number);
406
407 if (inputType > 2) inputType = 3;
408 if (type > 3) type = 4;
409
410 if (ok && !correct(SubId, SecId, PADId, CMAId, static_cast<CMAinput>(inputType), layer, Channel1, Channel2, Number,
411 static_cast<L1RPCcabCorrection>(type), sectorMap, sectorType)) {
412 ATH_MSG_WARNING("Cannot apply correction: "
413 << std::hex << std::setw(4) << std::showbase << SubId << " " << std::setw(4) << std::showbase << SecId
414 << " " << std::setw(3) << std::showbase << PADId << " " << std::setw(3) << std::showbase << CMAId << " "
415 << std::dec << std::setw(1) << inputType << " " << std::setw(1) << layer << " " << std::dec << std::setw(1)
416 << std::showbase << type << " " << std::setw(2) << std::showbase << Channel1 << " " << std::setw(2)
417 << std::showbase << Channel2 << " " << std::setw(2) << std::showbase << Number);
418 }
419 }
420 }
421 ATH_MSG_DEBUG("setup() - corrected map n. of lines read is " << nlines);
422 ATH_MSG_DEBUG("setup() - " << m_readKey_map_schema_corr.key() << " maps have been parsed");
423
424 for (int side = 0; side < 2; ++side) {
425 for (int rod = 0; rod < 16; ++rod) { (writeCdo->m_rod2hash[side][rod]).clear(); }
426 }
427
428 int hashID = 0;
429 std::set<uint32_t> ROBid;
430 IdContext rpcModuleContext = m_idHelperSvc->rpcIdHelper().module_context();
431
432 // reserve enough space in the hash-vector
433 writeCdo->m_HashVec.reserve(writeCdo->m_RDOs.size());
434
435 ATH_MSG_INFO("setup() - start building OfflineOnlineMap for " << writeCdo->m_RDOs.size() << " RDOs");
436
437 RpcCablingCondData::RDOmap::iterator pad_beg = writeCdo->m_RDOs.begin();
438 RpcCablingCondData::RDOmap::iterator pad_end = writeCdo->m_RDOs.end();
439 for (; pad_beg != pad_end; ++pad_beg) {
440 const RDOindex* pRDOindex = &((*pad_beg).second);
441 (*pad_beg).second.set_hash(hashID);
442
443 // get pointer to RDOindex class
444 writeCdo->m_HashVec.push_back(pRDOindex);
445
446 if (writeCdo->m_HashVec.size() != pRDOindex->hash() + 1) {
447 ATH_MSG_ERROR("Size of hash vector and RDO hash does not match");
448 return StatusCode::FAILURE;
449 }
450
451 // calculate m_fullListOfRobIds
452 const unsigned short int rob_id = pRDOindex->ROBid();
453 const unsigned short int rod_id = pRDOindex->RODid();
454 const unsigned short int sub_id = pRDOindex->side();
455 const unsigned short int sec_id = pRDOindex->SLid();
456 const unsigned short int pad_id = pRDOindex->PADid();
457
458 uint32_t ROD_ID = (sub_id << 16) | rod_id;
459 uint32_t ROB_ID = (sub_id << 16) | rob_id;
460
461 ROBid.insert(ROB_ID);
462 unsigned short int sub_id_index = ((sub_id == 0x65) ? 1 : 0); // convert 0x65 -> 1 (side A) and 0x66 -> 0 (side C)
463
464 Identifier id;
465 pRDOindex->pad_identifier(id);
466
467 ATH_MSG_DEBUG(hashID << "-th entry has sub_id_index=" << sub_id_index << ", ROBid=" << rob_id << ", RODid=" << rod_id << ", side="
468 << sub_id << ", SLid=" << sec_id << ", PADid=" << pad_id << ", pad_identifier=" << id.get_compact());
469
470 // build the offline_id vector
471 writeCdo->m_offline_id[sub_id_index][sec_id][pad_id] = id;
472
473 // build the map
474 std::pair<RpcCablingCondData::OfflineOnlineMap::iterator, bool> ins =
475 writeCdo->m_RDOmap.insert(RpcCablingCondData::OfflineOnlineMap::value_type(id, pRDOindex));
476 ATH_MSG_DEBUG("OfflineOnlineMap new entry: Identifier with technology="
477 << m_idHelperSvc->rpcIdHelper().technology(id) << ", stationName=" << m_idHelperSvc->rpcIdHelper().stationName(id)
478 << ", stationEta=" << m_idHelperSvc->rpcIdHelper().stationEta(id) << ", stationPhi="
479 << m_idHelperSvc->rpcIdHelper().stationPhi(id) << ", doubletR=" << m_idHelperSvc->rpcIdHelper().doubletR(id)
480 << ", doubletZ=" << m_idHelperSvc->rpcIdHelper().doubletZ(id) << ", doubletPhi="
481 << m_idHelperSvc->rpcIdHelper().doubletPhi(id) << " and hash of the RDOindex(key)= " << pRDOindex->hash());
482 if (!ins.second) {
483 ATH_MSG_ERROR("RpcCablingCondData::OfflineOnlineMap is false for technology="
484 << m_idHelperSvc->rpcIdHelper().technology(id) << ", stationName=" << m_idHelperSvc->rpcIdHelper().stationName(id)
485 << ", stationEta=" << m_idHelperSvc->rpcIdHelper().stationEta(id) << ", stationPhi="
486 << m_idHelperSvc->rpcIdHelper().stationPhi(id) << ", doubletR=" << m_idHelperSvc->rpcIdHelper().doubletR(id)
487 << ", doubletZ=" << m_idHelperSvc->rpcIdHelper().doubletZ(id) << ", doubletPhi="
488 << m_idHelperSvc->rpcIdHelper().doubletPhi(id) << " and hash of the RDOindex(key)= " << pRDOindex->hash());
489 return StatusCode::FAILURE;
490 }
491
492 // build the ROB->RDO map
493 std::pair<std::set<IdentifierHash>::iterator, bool> insert_ROB_RDO_returnVal =
494 writeCdo->m_ROB_RDO_map[ROB_ID].insert(IdentifierHash(pRDOindex->hash()));
495 if (insert_ROB_RDO_returnVal.second)
496 ATH_MSG_DEBUG("A new RDO HashId = " << pRDOindex->hash() << " registered for ROB Id = " << ROB_ID);
497 else
498 ATH_MSG_VERBOSE("The RDO HashId = " << pRDOindex->hash() << " was already registered for ROB Id = " << ROB_ID);
499
500 // build the PRD->RDO and PRD->ROB maps
501 ATH_MSG_VERBOSE("Looking for PRDs corresponding to this RDO");
502 std::list<Identifier> strip_id_list;
503 IdentifierHash rdoHashId((IdentifierHash::value_type)pRDOindex->hash());
504 ATH_MSG_DEBUG("RDO HashId = " << (int)rdoHashId << " RDO Id = " << id.get_compact() << " ROB Id = " << MSG::hex << ROB_ID
505 << MSG::dec << " ROD Id = " << MSG::hex << ROD_ID << MSG::dec);
506
507 for (unsigned short int CMAId : {2, 3, 6, 7}) { // loop over phi CMA IDs
508 for (unsigned short int ijk : {1, 2, 3}) { // loop over IJK identifiers
509 strip_id_list.clear();
510 for (unsigned short int channel : {0, 31}) { // check for the first and the last channel
511 strip_id_list.splice(strip_id_list.end(),
512 give_strip_id(sub_id_index, sec_id, pad_id, CMAId, ijk, channel, sectorMap, sectorType));
513 }
514 for (Identifier strip_id : strip_id_list) {
515 Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(strip_id);
516 IdentifierHash prdHashId;
517 int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(idp, prdHashId, &rpcModuleContext);
518 if (gethash_code != 0) {
519 ATH_MSG_DEBUG("Unable to get the PRD HashId! parentID(strip_id)=" << idp.getString());
520 continue;
521 }
522
523 // fill the PRD->RDO map
524 std::pair<std::set<IdentifierHash>::iterator, bool> insertRDO_returnVal =
525 writeCdo->m_PRD_RDO_map[prdHashId].insert(rdoHashId);
526 if (insertRDO_returnVal.second) {
527 ATH_MSG_DEBUG("A new RDO HashId = " << (int)rdoHashId << " registered for PRD HashId = " << (int)prdHashId);
528 } else {
529 ATH_MSG_VERBOSE("The RDO HashId = " << (int)rdoHashId
530 << " was already registered for PRD HashId = " << (int)prdHashId);
531 }
532
533 // fill the PRD->ROB map
534 std::pair<std::set<uint32_t>::iterator, bool> insertROB_returnVal = writeCdo->m_PRD_ROB_map[prdHashId].insert(ROB_ID);
535 if (insertROB_returnVal.second) {
536 ATH_MSG_DEBUG("A new ROB Id = " << MSG::hex << ROB_ID << MSG::dec
537 << " registered for PRD HashId = " << (int)prdHashId);
538 } else {
539 ATH_MSG_VERBOSE("The ROB Id = " << MSG::hex << ROB_ID << MSG::dec
540 << " was already registered for PRD HashId = " << (int)prdHashId);
541 }
542 }
543 }
544 }
545
546 // Trigger Roads Header
547 std::map<std::string, std::string>::const_iterator it;
548 it = trigroads.find("infos.txt");
549 if (it == trigroads.end()) {
550 ATH_MSG_WARNING("Missing HEADER FILE infos.txt");
551 } else {
552 ATH_MSG_VERBOSE("======== RPC Trigger Roads from COOL - Header infos ========");
553 ATH_MSG_VERBOSE("\n" + it->second + "\n");
554 // Read FeetPadThresholds from infos.txt
556 std::stringstream ss;
557 ss << it->second;
558 std::string word;
559 while (ss >> word) {
560 if (word == "FeetPadThresholds") {
561 feedPadThresholds.assign(3, 0);
562 ss >> feedPadThresholds.at(0);
563 ss >> feedPadThresholds.at(1);
564 ss >> feedPadThresholds.at(2);
565 ATH_MSG_VERBOSE("FeetPadThresholds set from COOL to: " << feedPadThresholds.at(0) << "," << feedPadThresholds.at(1)
566 << "," << feedPadThresholds.at(2));
567 }
568 }
569 }
570 }
571
572 // ------ begin like PCcablingInterface::RpcPadIdHash::RpcPadIdHash()
573 RDOindex index = (*pad_beg).second;
574 index.pad_identifier(id);
575
576 writeCdo->m_int2id.push_back(id);
577
578 if (writeCdo->m_int2id.size() != index.hash() + 1) {
579 ATH_MSG_ERROR("Inconsistence between PAD hash and RpcPadIdHash");
580 ATH_MSG_ERROR(index);
581 ATH_MSG_ERROR("Position into RpcPadIdHash map is " << writeCdo->m_int2id.size() - 1);
582 return StatusCode::FAILURE;
583 }
584
585 unsigned short int side = index.side();
586 unsigned short int rod = index.RODid();
587
588 if (rod > 15) {
589 ATH_MSG_ERROR("RPC ROD greater than 15");
590 return StatusCode::FAILURE;
591 }
592
593 IdentifierHash HashID = index.hash();
594
595 (writeCdo->m_rod2hash[(side == 0x66) ? 0 : 1][rod]).push_back(HashID);
596
597 writeCdo->m_lookup[id] = index.hash();
598
599 ATH_MSG_DEBUG("RDO loop entry " << hashID << " done");
600 ++hashID;
601 }
602 ATH_MSG_DEBUG("setup() - start recording RpcCablingCondData");
603
604 // this must be done both in case of source = COOL or ASCII
605 // ----- Initialization of Pad configuration ------ //
607 if (feedPadThresholds.size() != 3) {
608 // if thresholds vector empty, set it to default
609 feedPadThresholds.assign(3, 0);
610 feedPadThresholds.at(0) = 0;
611 feedPadThresholds.at(1) = 2;
612 feedPadThresholds.at(2) = 5;
613 }
614 ATH_MSG_INFO("Applying FeetPadThresholds : " << feedPadThresholds.at(0) << "," << feedPadThresholds.at(1) << ","
615 << feedPadThresholds.at(2));
616
617 const unsigned int NumFeetSectors = 8;
618 unsigned int FeetSectors[NumFeetSectors] = {21, 22, 25, 26, 53, 54, 57, 58};
619 const unsigned int NumSpecialFeetPads = 4;
620 unsigned int SpecialFeetPads[NumSpecialFeetPads] = {2, 4, 5, 7};
621
622 for (unsigned int is = 0; is < NumFeetSectors; is++) {
623 for (unsigned int it = 0; it < NumSpecialFeetPads; it++) {
624 writeCdo->m_RPCPadParameters_array[FeetSectors[is]][SpecialFeetPads[it]].set_feet_on(true);
625 for (unsigned int th = 0; th < 3; th++) {
626 writeCdo->m_RPCPadParameters_array[FeetSectors[is]][SpecialFeetPads[it]].set_feet_threshold(th,
627 feedPadThresholds.at(th));
628 }
629 }
630 }
631 }
632
633 // reserve enough space
634 writeCdo->m_fullListOfRobIds.reserve(ROBid.size());
635 for (uint32_t robid : ROBid) writeCdo->m_fullListOfRobIds.push_back(robid);
636
637 ATH_MSG_DEBUG("Number of valid RPC Pad IDs " << writeCdo->m_int2id.size());
638
639 for (int i = 0; i < 64; i++) writeCdo->m_SectorMap[i] = sectorMap[i];
640 writeCdo->m_SectorType = std::move(sectorType);
641 writeCdo->m_MaxType = maxType;
642
643 if (msgLvl(MSG::DEBUG)) {
644 std::stringstream ss1;
645 ss1 << "Level-1 configuration database " << std::endl;
646 ss1 << "Contains " << maxType << " Trigger Sector Types:" << std::endl;
647 ss1 << "negative sectors 0 - 15 ==> ";
648 for (int i = 0; i < 16; i++) ss1 << std::setw(2) << sectorMap[i] << " ";
649 ss1 << std::endl << "negative sectors 16 - 31 ==> ";
650 for (int i = 16; i < 32; i++) ss1 << std::setw(2) << sectorMap[i] << " ";
651 ss1 << std::endl << "positive sectors 32 - 47 ==> ";
652 for (int i = 32; i < 48; i++) ss1 << std::setw(2) << sectorMap[i] << " ";
653 ss1 << std::endl << "positive sectors 48 - 63 ==> ";
654 for (int i = 48; i < 64; i++) ss1 << std::setw(2) << sectorMap[i] << " ";
655 ss1 << std::endl;
656 ATH_MSG_DEBUG(ss1.str());
657 }
658
659 // record
660 if (writeCdo->m_RDOs.empty()) {
661 ATH_MSG_ERROR("Could not read any map configuration");
662 return StatusCode::FAILURE;
663 }
664 if (writeCdo->m_HashVec.empty()) {
665 ATH_MSG_ERROR("Could not read any HashID");
666 return StatusCode::FAILURE;
667 }
668 if (writeCdo->m_SectorType.empty()) {
669 ATH_MSG_ERROR("Could not read any sectorMap");
670 return StatusCode::FAILURE;
671 }
672 if (writeCdo->m_int2id.empty()) {
673 ATH_MSG_ERROR("Could not read any HashID");
674 return StatusCode::FAILURE;
675 }
676 if (writeCdo->m_lookup.empty()) {
677 ATH_MSG_ERROR("Could not read any HashID");
678 return StatusCode::FAILURE;
679 }
680 if (writeCdo->m_fullListOfRobIds.empty()) {
681 ATH_MSG_ERROR("Could not read any HashID");
682 return StatusCode::FAILURE;
683 }
684 ATH_MSG_DEBUG("setup() - RpcCablingCondData recorded");
685 return StatusCode::SUCCESS;
686}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
CMAinput
@ LowPt
@ HighPt
@ Pivot
L1RPCcabCorrection
std::vector< Identifier > ID
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t ss
bool msgLvl(const MSG::Level lvl) const
const AttributeList & attributeList(ChanNum chanNum) const
attribute list for a given channel number
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
unsigned int value_type
std::string getString() const
Provide a string form of the identifier - hexadecimal.
static std::string find_directory(const std::string &logical_file_name, const std::string &search_path)
unsigned short int SLid(void) const
Definition RDOindex.h:129
unsigned int hash(void) const
Definition RDOindex.h:142
unsigned short int ROBid(void) const
Definition RDOindex.h:125
unsigned short int RODid(void) const
Definition RDOindex.h:126
unsigned short int side(void) const
Definition RDOindex.h:127
void pad_identifier(Identifier &id) const
Definition RDOindex.cxx:69
unsigned short int PADid(void) const
Definition RDOindex.h:131
bool set_feet_threshold(unsigned short int it, unsigned short int th)
void set_feet_on(bool feet_on)
const EtaCMAmap & giveEtaCMA() const
void SetPtoTrigRoads(const std::map< std::string, std::string > *)
std::map< CMAidentity, EtaCMA, std::less< CMAidentity > > EtaCMAmap
const RPCchamber * find_chamber(int, int) const
std::array< int, 64 > sectorMap_t
Gaudi::Property< bool > m_cosmic_configuration
Gaudi::Property< bool > m_ApplyFeetPadThresholds
Gaudi::Property< bool > m_ForceFeetPadThresholdsFromJO
std::list< Identifier > give_strip_id(const unsigned short int SubsystemId, const unsigned short int SectorId, const unsigned short int PADId, const unsigned short int CMAId, const unsigned short ijk, const unsigned short int Channel, const sectorMap_t &smap, const RpcCablingCondData::STvec &sType) const
bool BoardParamCheck(const unsigned short int SubId, const unsigned short int SecId, const unsigned short int PADId, const unsigned short int CMAId, const unsigned short int inputType, const unsigned int layer, const unsigned int type, const unsigned short int Channel1, const unsigned short int Channel2, const short int Number) const
std::map< int, RPC_CondCabling::SectorLogicSetup *, std::less< int > > SLmap_t
static bool correct(const unsigned short int SubsystemId, const unsigned short int SectorId, const unsigned short int PADId, const unsigned short int CMAId, const CMAinput it, const unsigned int layer, const unsigned short int Channel1, const unsigned short int Channel2, const short int number, const L1RPCcabCorrection type, const sectorMap_t &smap, const RpcCablingCondData::STvec &sType)
Gaudi::Property< std::string > m_database_repository
bool CableParamCheck(const unsigned short int SubId, const unsigned short int SecId, const unsigned short int PADId, const unsigned short int CMAId, const unsigned short int ijk, const unsigned int type, const unsigned short int Channel1, const unsigned short int Channel2, const short int Number) const
std::vector< IdentifierHash > m_rod2hash[2][16]
std::vector< Identifier > m_int2id
RPCPadParameters m_RPCPadParameters_array[MAX_LOGICSECTOR][MAX_PADID]
std::map< Identifier, int > m_lookup
std::vector< RPC_CondCabling::SectorLogicSetup > STvec
Identifier m_offline_id[2][32][10]
OfflineOnlineHashMap m_HashVec
OfflineOnlineMap m_RDOmap
std::vector< uint32_t > m_fullListOfRobIds
str index
Definition DeMoScan.py:362
int HashID(const std::string &ID)
@ layer
Definition HitInfo.h:79
str layout
Definition TileTB.py:76
setEventNumber uint32_t

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_ApplyFeetPadThresholds

Gaudi::Property<bool> RpcCablingCondAlg::m_ApplyFeetPadThresholds
private
Initial value:
{this, "ApplyFeetPadThresholds", true,
"map 3 low pt thresholds from special feet pads on standard 6 (3low+3high)"}

Definition at line 49 of file RpcCablingCondAlg.h.

49 {this, "ApplyFeetPadThresholds", true,
50 "map 3 low pt thresholds from special feet pads on standard 6 (3low+3high)"};

◆ m_cosmic_configuration

Gaudi::Property<bool> RpcCablingCondAlg::m_cosmic_configuration {this, "CosmicConfiguration", false}
private

Definition at line 48 of file RpcCablingCondAlg.h.

48{this, "CosmicConfiguration", false};

◆ m_database_repository

Gaudi::Property<std::string> RpcCablingCondAlg::m_database_repository {this, "DatabaseRepository", "MuonRPC_Cabling/ATLAS.data"}
private

Definition at line 47 of file RpcCablingCondAlg.h.

47{this, "DatabaseRepository", "MuonRPC_Cabling/ATLAS.data"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_ForceFeetPadThresholdsFromJO

Gaudi::Property<bool> RpcCablingCondAlg::m_ForceFeetPadThresholdsFromJO {this, "ForceFeetPadThresholdsFromJO", false, "JO override db setting"}
private

Definition at line 51 of file RpcCablingCondAlg.h.

51{this, "ForceFeetPadThresholdsFromJO", false, "JO override db setting"};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> RpcCablingCondAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 33 of file RpcCablingCondAlg.h.

33{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_readKey_cm_thr_eta

SG::ReadCondHandleKey<CondAttrListCollection> RpcCablingCondAlg::m_readKey_cm_thr_eta
private
Initial value:
{this, "ReadKeyThrEta", "/RPC/TRIGGER/CM_THR_ETA",
"Key of input muon rpc trigger eta condition data"}

Definition at line 39 of file RpcCablingCondAlg.h.

39 {this, "ReadKeyThrEta", "/RPC/TRIGGER/CM_THR_ETA",
40 "Key of input muon rpc trigger eta condition data"};

◆ m_readKey_cm_thr_phi

SG::ReadCondHandleKey<CondAttrListCollection> RpcCablingCondAlg::m_readKey_cm_thr_phi
private
Initial value:
{this, "ReadKeyThrPhi", "/RPC/TRIGGER/CM_THR_PHI",
"Key of input muon rpc trigger phi condition data"}

Definition at line 41 of file RpcCablingCondAlg.h.

41 {this, "ReadKeyThrPhi", "/RPC/TRIGGER/CM_THR_PHI",
42 "Key of input muon rpc trigger phi condition data"};

◆ m_readKey_map_schema

SG::ReadCondHandleKey<CondAttrListCollection> RpcCablingCondAlg::m_readKey_map_schema
private
Initial value:
{this, "ReadKeySchema", "/RPC/CABLING/MAP_SCHEMA",
"Key of input muon rpc map schema condition data"}

Definition at line 35 of file RpcCablingCondAlg.h.

35 {this, "ReadKeySchema", "/RPC/CABLING/MAP_SCHEMA",
36 "Key of input muon rpc map schema condition data"};

◆ m_readKey_map_schema_corr

SG::ReadCondHandleKey<CondAttrListCollection> RpcCablingCondAlg::m_readKey_map_schema_corr
private
Initial value:
{this, "ReadKeySchemaCorr", "/RPC/CABLING/MAP_SCHEMA_CORR",
"Key of input muon rpc map correction schema condition data"}

Definition at line 37 of file RpcCablingCondAlg.h.

37 {this, "ReadKeySchemaCorr", "/RPC/CABLING/MAP_SCHEMA_CORR",
38 "Key of input muon rpc map correction schema condition data"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKey

SG::WriteCondHandleKey<RpcCablingCondData> RpcCablingCondAlg::m_writeKey
private
Initial value:
{this, "WriteKey", "RpcCablingCondData",
"Key of output RPC cabling condition data"}

Definition at line 44 of file RpcCablingCondAlg.h.

44 {this, "WriteKey", "RpcCablingCondData",
45 "Key of output RPC cabling condition data"};

The documentation for this class was generated from the following files: