ATLAS Offline Software
CSCcablingSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef CSCCABLING_CSCCABLINGSVC_H
6 #define CSCCABLING_CSCCABLINGSVC_H
7 
8 /*----------------------------------------------------
9  * Ketevi A. Assamagan - May 2007
10  * CSC Cabling service to decode online-offline maps
11  *---------------------------------------------------*/
12 
14 #include "GaudiKernel/IInterface.h"
15 
16 #include <inttypes.h>
17 #include <atomic>
18 
19 class MsgStream;
20 
21 const InterfaceID IID_ICSCcablingSvc("CSCcablingSvc", 1, 0);
22 
23 class CSCcablingSvc : public AthService, virtual public IInterface {
24 public:
25 
26  CSCcablingSvc(const std::string& name,ISvcLocator* sl);
27  virtual ~CSCcablingSvc()=default;
28 
29  static const InterfaceID& interfaceID() { return IID_ICSCcablingSvc; }
30  virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIF);
31 
32  virtual StatusCode initialize(void);
33 
35  bool onlineId(const uint16_t subdetectorID, const uint16_t offlineID, uint32_t& rodId) const;
36  bool onlineId(const uint16_t offlineID, uint16_t& rodId) const;
37 
39  bool offlineId(const uint32_t onlineIdentifier, uint16_t& rodId ) const;
40 
42  bool is_rodId (const uint16_t rodId ) const;
43 
45  bool is_offlineRodId (const uint16_t rodId ) const;
46 
48  uint16_t collectionId(const uint16_t subdetectorId, const uint16_t rodId) const;
49 
50  unsigned int nSide () const { return m_side; }
51  unsigned int nROD () const { return m_rod; }
52  unsigned int maxId() const { return m_max; }
53 
55  void hash2Rob(const unsigned int&, uint32_t&) const;
56 
58  void hash2RobFull(const unsigned int&, uint32_t&) const;
59 
61  void hash2Rod(const unsigned int&, uint32_t&) const;
62 
64  void hash2SubdetectorId(const unsigned int&, uint32_t&) const;
65 
67  void hash2CollectionId(const unsigned int&, uint16_t&) const;
68 
69  private:
70 
71  unsigned int m_side;
72  unsigned int m_rod;
73  unsigned int m_max;
74  bool m_run1;
75 };
76 
77 #endif
CSCcablingSvc::offlineId
bool offlineId(const uint32_t onlineIdentifier, uint16_t &rodId) const
reverse map of online ID into offline ROD ID
Definition: CSCcablingSvc.cxx:125
CSCcablingSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIF)
Definition: CSCcablingSvc.cxx:25
CSCcablingSvc::m_rod
unsigned int m_rod
Definition: CSCcablingSvc.h:72
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CSCcablingSvc::~CSCcablingSvc
virtual ~CSCcablingSvc()=default
CSCcablingSvc::nSide
unsigned int nSide() const
Definition: CSCcablingSvc.h:50
CSCcablingSvc::onlineId
bool onlineId(const uint16_t subdetectorID, const uint16_t offlineID, uint32_t &rodId) const
map offline ROD identifier to online ID
Definition: CSCcablingSvc.cxx:74
CSCcablingSvc::m_max
unsigned int m_max
Definition: CSCcablingSvc.h:73
CSCcablingSvc::hash2Rod
void hash2Rod(const unsigned int &, uint32_t &) const
map PRD collection ID into offline ROD ID
Definition: CSCcablingSvc.cxx:346
CSCcablingSvc::maxId
unsigned int maxId() const
Definition: CSCcablingSvc.h:52
CSCcablingSvc::nROD
unsigned int nROD() const
Definition: CSCcablingSvc.h:51
CSCcablingSvc::is_rodId
bool is_rodId(const uint16_t rodId) const
check that we have the correct online ROD id
Definition: CSCcablingSvc.cxx:177
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
CSCcablingSvc::initialize
virtual StatusCode initialize(void)
Definition: CSCcablingSvc.cxx:36
CSCcablingSvc
Definition: CSCcablingSvc.h:23
CSCcablingSvc::hash2Rob
void hash2Rob(const unsigned int &, uint32_t &) const
map PRD collection ID into short ROB ID, e.g.
Definition: CSCcablingSvc.cxx:216
CSCcablingSvc::collectionId
uint16_t collectionId(const uint16_t subdetectorId, const uint16_t rodId) const
calculate the collection Identifier
Definition: CSCcablingSvc.cxx:200
CSCcablingSvc::hash2SubdetectorId
void hash2SubdetectorId(const unsigned int &, uint32_t &) const
map PRD collection ID into subdetector ID, i.e.
Definition: CSCcablingSvc.cxx:360
CSCcablingSvc::hash2RobFull
void hash2RobFull(const unsigned int &, uint32_t &) const
map PRD collection ID into full ROB ID (with subdetector ID), e.g.
Definition: CSCcablingSvc.cxx:367
CSCcablingSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: CSCcablingSvc.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CSCcablingSvc::m_run1
bool m_run1
Definition: CSCcablingSvc.h:74
CSCcablingSvc::is_offlineRodId
bool is_offlineRodId(const uint16_t rodId) const
check that we have the correct offline ROD id
Definition: CSCcablingSvc.cxx:189
CSCcablingSvc::hash2CollectionId
void hash2CollectionId(const unsigned int &, uint16_t &) const
map PRD collection ID into RDO collection ID
Definition: CSCcablingSvc.cxx:377
AthService.h
CSCcablingSvc::m_side
unsigned int m_side
Definition: CSCcablingSvc.h:71
IID_ICSCcablingSvc
const InterfaceID IID_ICSCcablingSvc("CSCcablingSvc", 1, 0)
CSCcablingSvc::CSCcablingSvc
CSCcablingSvc(const std::string &name, ISvcLocator *sl)
Definition: CSCcablingSvc.cxx:18