CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
}
 
- 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)

Date:
2007/07/09 09:47:22
Revision:
1.14
Author
Jim Brooke

Definition at line 20 of file L1CaloRegionDetId.h.

Constructor & Destructor Documentation

L1CaloRegionDetId::L1CaloRegionDetId ( )

create null id

Definition at line 10 of file L1CaloRegionDetId.cc.

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

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

Definition at line 14 of file L1CaloRegionDetId.cc.

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

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

Definition at line 19 of file L1CaloRegionDetId.cc.

References DetId::id_.

19  :
20  DetId(Calo, 2)
21 {
22  id_ |= (ieta & 0x1f) | ((iphi & 0x1f)<<5);
23 }
unsigned ieta() const
global eta index (0-21)
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
uint32_t id_
Definition: DetId.h:57
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 27 of file L1CaloRegionDetId.cc.

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

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

References ieta().

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

47 { 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 73 of file L1CaloRegionDetId.cc.

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

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

73  {
74  unsigned card = 999;
75  unsigned rct_phi_index = (22 - iphi()) % 18;
76  if ((ieta() == 4) || (ieta() == 17)){
77  card = 6;
78  }
79  else if ((ieta() > 4) && (ieta() <= 10)){
80  unsigned index = (ieta() - 5)/2;
81  card = ((2 - index) * 2) + (rct_phi_index % 2);
82  }
83  else if ((ieta() >= 11) && (ieta() < 17)){
84  unsigned index = (ieta() - 11)/2;
85  card = (index * 2) + (rct_phi_index % 2);
86  }
87  return card;
88 }
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 67 of file L1CaloRegionDetId.cc.

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

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

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

return local RCT eta index (0-10)

Definition at line 59 of file L1CaloRegionDetId.h.

References ieta().

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

59 { 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 62 of file L1CaloRegionDetId.h.

References iphi().

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

62 { 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 91 of file L1CaloRegionDetId.cc.

References ieta(), and iphi().

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

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

Member Data Documentation

unsigned const L1CaloRegionDetId::N_ETA =22
static

Definition at line 25 of file L1CaloRegionDetId.h.

Referenced by L1GctHardwareJetFinder::makeProtoJet(), and rctCrate().

unsigned const L1CaloRegionDetId::N_PHI =18
static