CMS 3D CMS Logo

CastorElectronicsMap.h
Go to the documentation of this file.
1 #ifndef CastorElectronicsMap_h
2 #define CastorElectronicsMap_h
3 
15 
16 #include <vector>
17 #include <algorithm>
18 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
19 #include <atomic>
20 #endif
21 
28 #include <cstdint>
29 //
31 public:
34 
35  // swap function
37  // copy-ctor
38  CastorElectronicsMap(const CastorElectronicsMap& src); // copy assignment operator
40  // move constructor
41 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
43 #endif
44 
46  //return Null item if no such mapping
47  const DetId lookup(CastorElectronicsId fId) const;
48 
50  //return Null item if no such mapping
51  const CastorElectronicsId lookup(DetId fId) const;
52 
54  //return Null item if no such mapping
55  const DetId lookupTrigger(CastorElectronicsId fId) const;
56 
58  //return Null item if no such mapping
59  const CastorElectronicsId lookupTrigger(DetId fId) const;
60 
65 
66  std::vector<CastorElectronicsId> allElectronicsId() const;
67  std::vector<CastorElectronicsId> allElectronicsIdPrecision() const;
68  std::vector<CastorElectronicsId> allElectronicsIdTrigger() const;
69  std::vector<HcalGenericDetId> allPrecisionId() const;
70  std::vector<HcalTrigTowerDetId> allTriggerId() const;
71 
72  // map channels
73  bool mapEId2tId(CastorElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId);
74  bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId);
75  // sorting
76  void sortById() const;
77  void sortByTriggerId() const;
78  void sort() {}
79 
80  class PrecisionItem {
81  public:
82  PrecisionItem() { mId = mElId = 0; }
83  PrecisionItem(uint32_t fId, uint32_t fElId) : mId(fId), mElId(fElId) {}
84  uint32_t mId;
85  uint32_t mElId;
86 
88  };
89  class TriggerItem {
90  public:
91  TriggerItem() { mElId = mTrigId = 0; }
92  TriggerItem(uint32_t fTrigId, uint32_t fElId) : mTrigId(fTrigId), mElId(fElId) {}
93  uint32_t mTrigId;
94  uint32_t mElId;
95 
97  };
98 
99 protected:
100  const PrecisionItem* findById(unsigned long fId) const;
101  const PrecisionItem* findPByElId(unsigned long fElId) const;
102  const TriggerItem* findTByElId(unsigned long fElId) const;
103  const TriggerItem* findByTrigId(unsigned long fTrigId) const;
104 
105  std::vector<PrecisionItem> mPItems;
106  std::vector<TriggerItem> mTItems;
107 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
108  mutable std::atomic<std::vector<const PrecisionItem*>*> mPItemsById COND_TRANSIENT;
109  mutable std::atomic<std::vector<const TriggerItem*>*> mTItemsByTrigId COND_TRANSIENT;
110 #else
111  mutable std::vector<const PrecisionItem*>* mPItemsById COND_TRANSIENT;
112  mutable std::vector<const TriggerItem*>* mTItemsByTrigId COND_TRANSIENT;
113 #endif
114 
116 };
117 
118 #endif
CastorElectronicsMap::operator=
CastorElectronicsMap & operator=(const CastorElectronicsMap &rhs)
Definition: CastorElectronicsMap.cc:46
HcalGenericDetId
Definition: HcalGenericDetId.h:15
CastorElectronicsMap::PrecisionItem::PrecisionItem
PrecisionItem(uint32_t fId, uint32_t fElId)
Definition: CastorElectronicsMap.h:83
CastorElectronicsMap::sortById
void sortById() const
Definition: CastorElectronicsMap.cc:232
CastorElectronicsMap::findByTrigId
const TriggerItem * findByTrigId(unsigned long fTrigId) const
Definition: CastorElectronicsMap.cc:92
CastorElectronicsMap::TriggerItem::TriggerItem
TriggerItem(uint32_t fTrigId, uint32_t fElId)
Definition: CastorElectronicsMap.h:92
CastorElectronicsMap::allTriggerId
std::vector< HcalTrigTowerDetId > allTriggerId() const
Definition: CastorElectronicsMap.cc:190
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
CastorElectronicsMap::findById
const PrecisionItem * findById(unsigned long fId) const
Definition: CastorElectronicsMap.cc:61
HcalGenericDetId.h
CastorElectronicsMap::TriggerItem
Definition: CastorElectronicsMap.h:89
CastorElectronicsMap::findPByElId
const PrecisionItem * findPByElId(unsigned long fElId) const
Definition: CastorElectronicsMap.cc:74
CastorElectronicsMap::PrecisionItem::mId
uint32_t mId
Definition: CastorElectronicsMap.h:84
CastorElectronicsId
Readout chain identification for Castor Bits for the readout chain : some names need change!...
Definition: CastorElectronicsId.h:20
CastorElectronicsMap::PrecisionItem::mElId
uint32_t mElId
Definition: CastorElectronicsMap.h:85
CastorElectronicsMap::TriggerItem::mTrigId
uint32_t mTrigId
Definition: CastorElectronicsMap.h:93
CastorElectronicsMap::CastorElectronicsMap
CastorElectronicsMap()
Definition: CastorElectronicsMap.cc:17
DetId
Definition: DetId.h:17
CastorElectronicsMap::swap
void swap(CastorElectronicsMap &other)
Definition: CastorElectronicsMap.cc:52
CastorElectronicsMap::sort
void sort()
Definition: CastorElectronicsMap.h:78
CastorElectronicsMap::TriggerItem::mElId
uint32_t mElId
Definition: CastorElectronicsMap.h:94
CastorElectronicsMap::mapEId2tId
bool mapEId2tId(CastorElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
Definition: CastorElectronicsMap.cc:201
CastorElectronicsMap::~CastorElectronicsMap
~CastorElectronicsMap()
Definition: CastorElectronicsMap.cc:38
HcalCalibDetId.h
trackingPlots.other
other
Definition: trackingPlots.py:1467
CastorElectronicsMap::TriggerItem::TriggerItem
TriggerItem()
Definition: CastorElectronicsMap.h:91
HcalTrigTowerDetId.h
CastorElectronicsId.h
CastorElectronicsMap::mTItems
std::vector< TriggerItem > mTItems
Definition: CastorElectronicsMap.h:106
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
HcalDetId.h
Serializable.h
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
CastorElectronicsMap::allElectronicsIdPrecision
std::vector< CastorElectronicsId > allElectronicsIdPrecision() const
Definition: CastorElectronicsMap.cc:161
CastorElectronicsMap::findTByElId
const TriggerItem * findTByElId(unsigned long fElId) const
Definition: CastorElectronicsMap.cc:83
DetId.h
CastorElectronicsMap::lookup
const DetId lookup(CastorElectronicsId fId) const
lookup the logical detid associated with the given electronics id
Definition: CastorElectronicsMap.cc:105
CastorElectronicsMap::allElectronicsIdTrigger
std::vector< CastorElectronicsId > allElectronicsIdTrigger() const
Definition: CastorElectronicsMap.cc:169
CastorElectronicsMap::lookupTrigger
const DetId lookupTrigger(CastorElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
Definition: CastorElectronicsMap.cc:115
CastorElectronicsMap::mapEId2chId
bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId)
Definition: CastorElectronicsMap.cc:216
CastorElectronicsMap
Definition: CastorElectronicsMap.h:30
CastorElectronicsMap::mPItemsById
std::atomic< std::vector< const PrecisionItem * > * > mPItemsById
Definition: CastorElectronicsMap.h:108
CastorElectronicsMap::sortByTriggerId
void sortByTriggerId() const
Definition: CastorElectronicsMap.cc:249
CastorElectronicsMap::mPItems
std::vector< PrecisionItem > mPItems
Definition: CastorElectronicsMap.h:105
CastorElectronicsMap::PrecisionItem::PrecisionItem
PrecisionItem()
Definition: CastorElectronicsMap.h:82
CastorElectronicsMap::allPrecisionId
std::vector< HcalGenericDetId > allPrecisionId() const
Definition: CastorElectronicsMap.cc:178
CastorElectronicsMap::allElectronicsId
std::vector< CastorElectronicsId > allElectronicsId() const
Definition: CastorElectronicsMap.cc:149
CastorElectronicsMap::PrecisionItem
Definition: CastorElectronicsMap.h:80
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14
CastorElectronicsMap::mTItemsByTrigId
std::atomic< std::vector< const TriggerItem * > * > mTItemsByTrigId
Definition: CastorElectronicsMap.h:109