CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CastorElectronicsMap.h
Go to the documentation of this file.
1 #ifndef CastorElectronicsMap_h
2 #define CastorElectronicsMap_h
3 
14 #include <vector>
15 #include <algorithm>
16 #include <boost/cstdint.hpp>
17 
24 //
26  public:
29 
31  //return Null item if no such mapping
32  const DetId lookup(CastorElectronicsId fId) const;
33 
35  //return Null item if no such mapping
36  const CastorElectronicsId lookup(DetId fId) const;
37 
39  //return Null item if no such mapping
40  const DetId lookupTrigger(CastorElectronicsId fId) const;
41 
43  //return Null item if no such mapping
44  const CastorElectronicsId lookupTrigger(DetId fId) const;
45 
47  bool lookup(const CastorElectronicsId pId, CastorElectronicsId& eid, HcalGenericDetId& did) const;
49  bool lookup(const CastorElectronicsId pId, CastorElectronicsId& eid, HcalTrigTowerDetId& did) const;
50 
51  std::vector <CastorElectronicsId> allElectronicsId () const;
52  std::vector <CastorElectronicsId> allElectronicsIdPrecision() const;
53  std::vector <CastorElectronicsId> allElectronicsIdTrigger() const;
54  std::vector <HcalGenericDetId> allPrecisionId () const;
55  std::vector <HcalTrigTowerDetId> allTriggerId () const;
56 
57  // map channels
58  bool mapEId2tId (CastorElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId);
59  bool mapEId2chId (CastorElectronicsId fElectronicsId, DetId fId);
60  // sorting
61  void sortById () const;
62  void sortByTriggerId () const;
63  void sort() {}
64 
65  class PrecisionItem {
66  public:
67  PrecisionItem () {mId = mElId = 0;}
68  PrecisionItem (uint32_t fId, uint32_t fElId)
69  : mId (fId), mElId (fElId) {}
70  uint32_t mId;
71  uint32_t mElId;
72  };
73  class TriggerItem {
74  public:
76  TriggerItem (uint32_t fTrigId, uint32_t fElId)
77  : mTrigId (fTrigId), mElId (fElId) { }
78  uint32_t mTrigId;
79  uint32_t mElId;
80  };
81  protected:
82  const PrecisionItem* findById (unsigned long fId) const;
83  const PrecisionItem* findPByElId (unsigned long fElId) const;
84  const TriggerItem* findTByElId (unsigned long fElId) const;
85  const TriggerItem* findByTrigId (unsigned long fTrigId) const;
86 
87  std::vector<PrecisionItem> mPItems;
88  std::vector<TriggerItem> mTItems;
89  mutable std::vector<const PrecisionItem*> mPItemsById;
90  mutable bool sortedByPId;
91  mutable std::vector<const TriggerItem*> mTItemsByTrigId;
92  mutable bool sortedByTId;
93 };
94 
95 #endif
std::vector< PrecisionItem > mPItems
const DetId lookupTrigger(CastorElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
std::vector< const TriggerItem * > mTItemsByTrigId
std::vector< CastorElectronicsId > allElectronicsIdTrigger() const
std::vector< CastorElectronicsId > allElectronicsIdPrecision() const
PrecisionItem(uint32_t fId, uint32_t fElId)
bool mapEId2tId(CastorElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
const PrecisionItem * findById(unsigned long fId) const
const DetId lookup(CastorElectronicsId fId) const
lookup the logical detid associated with the given electronics id
const TriggerItem * findTByElId(unsigned long fElId) const
std::vector< HcalTrigTowerDetId > allTriggerId() const
TriggerItem(uint32_t fTrigId, uint32_t fElId)
std::vector< const PrecisionItem * > mPItemsById
const PrecisionItem * findPByElId(unsigned long fElId) const
const TriggerItem * findByTrigId(unsigned long fTrigId) const
Definition: DetId.h:20
std::vector< HcalGenericDetId > allPrecisionId() const
std::vector< CastorElectronicsId > allElectronicsId() const
std::vector< TriggerItem > mTItems
bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId)
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...