CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
uint16_t *__restrict__ id
int zside() const
get the zside() +1 / -1
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
EcalSubdetector
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
EcalSubdetector subdet() const
get the subdet