CMS 3D CMS Logo

EcalTriggerElectronicsId.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 
7 
9 
10 EcalTriggerElectronicsId::EcalTriggerElectronicsId(int tccid, int ttid, int pseudostripid, int channelid) {
11  if ((tccid < MIN_TCCID) || (tccid > MAX_TCCID) || (ttid < MIN_TTID) || (ttid > MAX_TTID) ||
12  (pseudostripid < MIN_PSEUDOSTRIPID) || (pseudostripid > MAX_PSEUDOSTRIPID) || (channelid < MIN_CHANNELID) ||
13  (channelid > MAX_CHANNELID))
14  throw cms::Exception("InvalidDetId") << "EcalTriggerElectronicsId: Cannot create object. Indexes out of bounds.";
16  (channelid & 0x7) | ((pseudostripid & 0x7) << 3) | ((ttid & 0x7F) << 6) | ((tccid & 0x7F) << 13);
17 }
18 
20  int tcc = tccId();
21  if ((tcc >= MIN_TCCID_EEM && tcc <= MAX_TCCID_EEM))
22  return -1;
23  if ((tcc >= MIN_TCCID_EBM && tcc <= MAX_TCCID_EBM))
24  return -1;
25  if ((tcc >= MIN_TCCID_EEP && tcc <= MAX_TCCID_EEP))
26  return +1;
27  if ((tcc >= MIN_TCCID_EBP && tcc <= MAX_TCCID_EBP))
28  return +1;
29  return 0;
30 }
31 
33  int tcc = tccId();
34  if ((tcc >= MIN_TCCID_EBM && tcc <= MAX_TCCID_EBM) || (tcc >= MIN_TCCID_EBP && tcc <= MAX_TCCID_EBP))
35  return EcalBarrel;
36  else
37  return EcalEndcap;
38 }
39 
40 std::ostream& operator<<(std::ostream& os, const EcalTriggerElectronicsId& id) {
41  return os << id.tccId() << ',' << id.ttId() << ',' << id.pseudoStripId() << ',' << id.channelId();
42 }
EcalTriggerElectronicsId::MIN_TCCID_EEM
static const int MIN_TCCID_EEM
Definition: EcalTriggerElectronicsId.h:56
EcalTriggerElectronicsId
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
Definition: EcalTriggerElectronicsId.h:18
EcalTriggerElectronicsId::MAX_TCCID_EBP
static const int MAX_TCCID_EBP
Definition: EcalTriggerElectronicsId.h:61
EcalTriggerElectronicsId::tccId
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
Definition: EcalTriggerElectronicsId.h:31
EcalTriggerElectronicsId::EcalTriggerElectronicsId_
uint32_t EcalTriggerElectronicsId_
Definition: EcalTriggerElectronicsId.h:86
EcalTriggerElectronicsId::MIN_TCCID_EBP
static const int MIN_TCCID_EBP
Definition: EcalTriggerElectronicsId.h:60
EcalTriggerElectronicsId::EcalTriggerElectronicsId
EcalTriggerElectronicsId()
Definition: EcalTriggerElectronicsId.cc:6
EcalSubdetector
EcalSubdetector
Definition: EcalSubdetector.h:10
EcalTriggerElectronicsId::MAX_CHANNELID
static const int MAX_CHANNELID
Definition: EcalTriggerElectronicsId.h:53
EcalBarrel
Definition: EcalSubdetector.h:10
EcalTriggerElectronicsId::MIN_TCCID_EEP
static const int MIN_TCCID_EEP
Definition: EcalTriggerElectronicsId.h:62
EcalTriggerElectronicsId::MAX_TCCID
static const int MAX_TCCID
Definition: EcalTriggerElectronicsId.h:47
EcalTriggerElectronicsId::MIN_CHANNELID
static const int MIN_CHANNELID
Definition: EcalTriggerElectronicsId.h:54
EcalTriggerElectronicsId::MAX_TCCID_EBM
static const int MAX_TCCID_EBM
Definition: EcalTriggerElectronicsId.h:59
EcalTriggerElectronicsId::zside
int zside() const
get the zside() +1 / -1
Definition: EcalTriggerElectronicsId.cc:19
EcalEndcap
Definition: EcalSubdetector.h:10
EcalTriggerElectronicsId::MIN_TCCID_EBM
static const int MIN_TCCID_EBM
Definition: EcalTriggerElectronicsId.h:58
EcalTriggerElectronicsId::MIN_TCCID
static const int MIN_TCCID
Definition: EcalTriggerElectronicsId.h:48
EcalTriggerElectronicsId.h
EcalTriggerElectronicsId::subdet
EcalSubdetector subdet() const
get the subdet
Definition: EcalTriggerElectronicsId.cc:32
EcalTriggerElectronicsId::MAX_TTID
static const int MAX_TTID
Definition: EcalTriggerElectronicsId.h:49
EcalTriggerElectronicsId::MIN_TTID
static const int MIN_TTID
Definition: EcalTriggerElectronicsId.h:50
EcalTriggerElectronicsId::MAX_PSEUDOSTRIPID
static const int MAX_PSEUDOSTRIPID
Definition: EcalTriggerElectronicsId.h:51
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EcalTriggerElectronicsId::MIN_PSEUDOSTRIPID
static const int MIN_PSEUDOSTRIPID
Definition: EcalTriggerElectronicsId.h:52
EcalTriggerElectronicsId::MAX_TCCID_EEM
static const int MAX_TCCID_EEM
Definition: EcalTriggerElectronicsId.h:57
Exception
Definition: hltDiff.cc:246
Exception.h
operator<<
std::ostream & operator<<(std::ostream &os, const EcalTriggerElectronicsId &id)
Definition: EcalTriggerElectronicsId.cc:40
EcalTriggerElectronicsId::MAX_TCCID_EEP
static const int MAX_TCCID_EEP
Definition: EcalTriggerElectronicsId.h:63