CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes
L1CaloRegionDetId Class Reference

#include <L1CaloRegionDetId.h>

Inheritance diagram for L1CaloRegionDetId:
DetId

Public Member Functions

unsigned ieta () const
 global eta index (0-21) More...
 
unsigned iphi () const
 global phi index (0-17) More...
 
bool isHf () const
 return central or forward type More...
 
 L1CaloRegionDetId ()
 create null id More...
 
 L1CaloRegionDetId (uint32_t rawid)
 create id from raw data (0=invalid code?) More...
 
 L1CaloRegionDetId (unsigned ieta, unsigned iphi)
 create id from global eta, phi indices (eta=0-21, phi=0-17) More...
 
 L1CaloRegionDetId (unsigned icrate, unsigned icard, unsigned irgn)
 
unsigned rctCard () const
 return RCT card number (0-6) More...
 
unsigned rctCrate () const
 return RCT crate number (0-17) More...
 
unsigned rctEta () const
 return local RCT eta index (0-10) More...
 
unsigned rctPhi () const
 return local RCT phi index (0-1) More...
 
unsigned rctRegion () const
 return RCT region index (0-1 for barrel, 0-7 for HF) More...
 
- Public Member Functions inherited from DetId
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Attributes

static const unsigned N_ETA = 22
 
static const unsigned N_PHI = 18
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5, Forward =6, VeryForward =7
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Stores eta value in bits 4-0, phi value in bits 9-5

Cell identifier class for L1 Calo Trigger Regions (4x4 trigger tower sums)

Author
Jim Brooke

Definition at line 18 of file L1CaloRegionDetId.h.

Constructor & Destructor Documentation

L1CaloRegionDetId::L1CaloRegionDetId ( )

create null id

Definition at line 6 of file L1CaloRegionDetId.cc.

6 : DetId() { }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
L1CaloRegionDetId::L1CaloRegionDetId ( uint32_t  rawid)

create id from raw data (0=invalid code?)

Definition at line 10 of file L1CaloRegionDetId.cc.

10 : DetId(rawid) { }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
L1CaloRegionDetId::L1CaloRegionDetId ( unsigned  ieta,
unsigned  iphi 
)

create id from global eta, phi indices (eta=0-21, phi=0-17)

Definition at line 15 of file L1CaloRegionDetId.cc.

References DetId::id_.

15  :
16  DetId(Calo, 2)
17 {
18  id_ |= (ieta & 0x1f) | ((iphi & 0x1f)<<5);
19 }
unsigned ieta() const
global eta index (0-21)
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
uint32_t id_
Definition: DetId.h:55
unsigned iphi() const
global phi index (0-17)
L1CaloRegionDetId::L1CaloRegionDetId ( unsigned  icrate,
unsigned  icard,
unsigned  irgn 
)

create id from RCT crate, RCT card, RCT region (within card) icard=999 is used to indicate HF regions

TODO - check calculation of ieta and iphi from RCT crate/card/region #

Definition at line 23 of file L1CaloRegionDetId.cc.

References DetId::id_, ieta(), and iphi().

23  :
24  DetId(Calo, 2)
25 {
26 
27  int ieta=0;
28  int iphi=0;
29 
30  // Calculate iphi
31  int phi_index = icrate % 9;
32  if ((icard == 0) || (icard == 2) || (icard == 4))
33  phi_index = phi_index * 2;
34  else if ((icard == 1) || (icard == 3) || (icard == 5))
35  phi_index = phi_index * 2 + 1;
36  else if (icard == 6)
37  phi_index = phi_index * 2 + irgn;
38  // for HF
39  else if (icard == 999)
40  phi_index = phi_index * 2 + (irgn/4);
41  iphi = (22 - phi_index) % 18;
42 
43  // Calculate ieta
44  int eta_index = 0;
45  if (icard < 6)
46  eta_index = (icard/2) * 2 + irgn;
47  else if (icard == 6)
48  eta_index = 6;
49  // HF
50  else if (icard == 999)
51  eta_index = (irgn % 4) + 7;
52 
53  if (icrate < 9)
54  ieta = 10 - eta_index;
55  else if (icrate >= 9)
56  ieta = 11 + eta_index;
57 
59  id_ |= (ieta & 0x1f) | ((iphi & 0x1f)<<5);
60 }
unsigned ieta() const
global eta index (0-21)
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
uint32_t id_
Definition: DetId.h:55
unsigned iphi() const
global phi index (0-17)

Member Function Documentation

unsigned L1CaloRegionDetId::ieta ( ) const
inline
unsigned L1CaloRegionDetId::iphi ( ) const
inline
bool L1CaloRegionDetId::isHf ( ) const
inline

return central or forward type

Definition at line 45 of file L1CaloRegionDetId.h.

References ieta(), rctCard(), rctCrate(), and rctRegion().

Referenced by L1CaloRegion::isHbHe(), and L1CaloRegion::isHf().

45 { return (ieta()<4 || ieta()>17); }
unsigned ieta() const
global eta index (0-21)
unsigned L1CaloRegionDetId::rctCard ( ) const

return RCT card number (0-6)

Definition at line 69 of file L1CaloRegionDetId.cc.

References ieta(), diffTreeTool::index, and iphi().

Referenced by isHf(), L1CaloMipQuietRegion::rctCard(), and L1CaloRegion::rctCard().

69  {
70  unsigned card = 999;
71  unsigned rct_phi_index = (22 - iphi()) % 18;
72  if ((ieta() == 4) || (ieta() == 17)){
73  card = 6;
74  }
75  else if ((ieta() > 4) && (ieta() <= 10)){
76  unsigned index = (ieta() - 5)/2;
77  card = ((2 - index) * 2) + (rct_phi_index % 2);
78  }
79  else if ((ieta() >= 11) && (ieta() < 17)){
80  unsigned index = (ieta() - 11)/2;
81  card = (index * 2) + (rct_phi_index % 2);
82  }
83  return card;
84 }
unsigned ieta() const
global eta index (0-21)
unsigned iphi() const
global phi index (0-17)
unsigned L1CaloRegionDetId::rctCrate ( ) const

return RCT crate number (0-17)

Definition at line 63 of file L1CaloRegionDetId.cc.

References ieta(), iphi(), N_ETA, and N_PHI.

Referenced by isHf(), L1CaloMipQuietRegion::rctCrate(), and L1CaloRegion::rctCrate().

63  { // TODO - check this is correct!
64  unsigned phiCrate = ((N_PHI + 4 - iphi()) % N_PHI) / 2;
65  return (ieta()<(N_ETA/2) ? phiCrate : phiCrate + N_PHI/2) ;
66 }
unsigned ieta() const
global eta index (0-21)
static const unsigned N_ETA
unsigned iphi() const
global phi index (0-17)
static const unsigned N_PHI
unsigned L1CaloRegionDetId::rctEta ( ) const
inline

return local RCT eta index (0-10)

Definition at line 57 of file L1CaloRegionDetId.h.

References ieta().

Referenced by L1GctJet::hwEta(), L1GctEmCand::L1GctEmCand(), L1CaloMipQuietRegion::rctEta(), L1GctJet::rctEta(), and L1CaloRegion::rctEta().

57 { return (ieta()<11 ? 10-ieta() : ieta()-11); }
unsigned ieta() const
global eta index (0-21)
unsigned L1CaloRegionDetId::rctPhi ( ) const
inline

return local RCT phi index (0-1)

Definition at line 60 of file L1CaloRegionDetId.h.

References iphi().

Referenced by L1CaloMipQuietRegion::rctPhi(), L1GctJet::rctPhi(), and L1CaloRegion::rctPhi().

60 { return (iphi()%2); }
unsigned iphi() const
global phi index (0-17)
unsigned L1CaloRegionDetId::rctRegion ( ) const

return RCT region index (0-1 for barrel, 0-7 for HF)

Definition at line 87 of file L1CaloRegionDetId.cc.

References ieta(), and iphi().

Referenced by isHf(), L1CaloMipQuietRegion::rctRegionIndex(), and L1CaloRegion::rctRegionIndex().

87  {
88  unsigned rgn = 999;
89  unsigned rct_phi_index = (22 - iphi()) % 18;
90  if (ieta() < 4){
91  rgn = (3 - ieta()) + 4 * (rct_phi_index % 2);
92  }
93  else if (ieta() > 17){
94  rgn = (ieta() - 18) + 4 * (rct_phi_index % 2);
95  }
96  else if ((ieta() == 4) || (ieta() == 17)){
97  rgn = (rct_phi_index % 2);
98  }
99  else if ((ieta() > 4) && (ieta() <= 10)){
100  rgn = (ieta() % 2);
101  }
102  else if ((ieta() >= 11) && (ieta() < 17)){
103  rgn = ((ieta() - 1) % 2);
104  }
105  return rgn;
106 }
unsigned ieta() const
global eta index (0-21)
unsigned iphi() const
global phi index (0-17)

Member Data Documentation

const unsigned L1CaloRegionDetId::N_ETA = 22
static
const unsigned L1CaloRegionDetId::N_PHI = 18
static