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 * > 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

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 15 of file RpcCablingCondAlg.cxx.

15: 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 787 of file RpcCablingCondAlg.cxx.

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

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

◆ 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.

62{
63 return 0;
64}

◆ 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 762 of file RpcCablingCondAlg.cxx.

765 {
766 int logic_sector = (SubsystemId == 0x65) ? SectorId + 32 : SectorId;
767 unsigned short int Ixx = CMAId & 1;
768 unsigned short int ep = (CMAId >> 1) & 1;
769
770 ep = (ep == 1) ? 0 : 1;
771
772 // retrieve the Sector Logic setup
773 const RPC_CondCabling::SectorLogicSetup& s = sType[smap[logic_sector] - 1];
774
775 // retrieve the CMAparameters associated to the identifiers
776 if (ep) {
777 CMAcoverage PhiCov = (logic_sector % 2) ? OddSectors : EvenSectors;
778 CMAidentity PHI(Phi, PhiCov, PADId, Ixx);
779 return s.correct(PHI, type, it, layer, Channel1, Channel2, number);
780 } else {
781 CMAidentity ETA(Eta, AllSectors, PADId, Ixx);
782 return s.correct(ETA, type, it, layer, Channel1, Channel2, number);
783 }
784 return false;
785}
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 28 of file RpcCablingCondAlg.cxx.

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

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
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 691 of file RpcCablingCondAlg.cxx.

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

◆ initialize()

StatusCode RpcCablingCondAlg::initialize ( )
overridevirtual

Definition at line 17 of file RpcCablingCondAlg.cxx.

17 {
18 ATH_MSG_DEBUG("initializing" << name());
19 ATH_CHECK(m_readKey_map_schema.initialize());
21 ATH_CHECK(m_readKey_cm_thr_eta.initialize());
22 ATH_CHECK(m_readKey_cm_thr_phi.initialize());
23 ATH_CHECK(m_writeKey.initialize());
24 ATH_CHECK(m_idHelperSvc.retrieve());
25 return StatusCode::SUCCESS;
26}

◆ 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 94 of file RpcCablingCondAlg.cxx.

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

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ 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.

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