test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalTriggerElectronicsId.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 
6 
8  EcalTriggerElectronicsId_=0xFFFFFFFFu;
9 }
10 
13 }
14 
15 EcalTriggerElectronicsId::EcalTriggerElectronicsId(int tccid, int ttid, int pseudostripid, int channelid){
16  if ( (tccid < MIN_TCCID) || (tccid > MAX_TCCID) ||
17  (ttid < MIN_TTID) || (ttid > MAX_TTID) ||
18  (pseudostripid < MIN_PSEUDOSTRIPID) || (pseudostripid > MAX_PSEUDOSTRIPID) ||
19  (channelid < MIN_CHANNELID) || (channelid > MAX_CHANNELID) )
20  throw cms::Exception("InvalidDetId") << "EcalTriggerElectronicsId: Cannot create object. Indexes out of bounds.";
21  EcalTriggerElectronicsId_= (channelid&0x7) | ( (pseudostripid&0x7) << 3) | ( (ttid&0x7F) << 6) | ((tccid&0x7F) << 13);
22 }
23 
25  int tcc = tccId();
26  if ( (tcc >= MIN_TCCID_EEM && tcc <= MAX_TCCID_EEM)) return -1;
27  if ( (tcc >= MIN_TCCID_EBM && tcc <= MAX_TCCID_EBM)) return -1;
28  if ( (tcc >= MIN_TCCID_EEP && tcc <= MAX_TCCID_EEP)) return +1;
29  if ( (tcc >= MIN_TCCID_EBP && tcc <= MAX_TCCID_EBP)) return +1;
30  return 0;
31 }
32 
33 
35  int tcc = tccId();
36  if ( (tcc >= MIN_TCCID_EBM && tcc <= MAX_TCCID_EBM) ||
37  (tcc >= MIN_TCCID_EBP && tcc <= MAX_TCCID_EBP) ) return EcalBarrel;
38  else return EcalEndcap;
39 }
40 
41 std::ostream& operator<<(std::ostream& os,const EcalTriggerElectronicsId& id)
42 {
43  return os << id.tccId() << ',' << id.ttId() << ',' << id.pseudoStripId() << ',' << id.channelId() ;
44 }
45 
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
int zside() const
get the zside() +1 / -1
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
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