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
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr 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 kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
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, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 
- 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() [1/4]

L1CaloRegionDetId::L1CaloRegionDetId ( )

create null id

Definition at line 6 of file L1CaloRegionDetId.cc.

6 : DetId() {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ L1CaloRegionDetId() [2/4]

L1CaloRegionDetId::L1CaloRegionDetId ( uint32_t  rawid)

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

Definition at line 9 of file L1CaloRegionDetId.cc.

9 : DetId(rawid) {}
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ L1CaloRegionDetId() [3/4]

L1CaloRegionDetId::L1CaloRegionDetId ( unsigned  ieta,
unsigned  iphi 
)

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

Definition at line 13 of file L1CaloRegionDetId.cc.

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

13  : DetId(Calo, 2) {
14  id_ |= (ieta & 0x1f) | ((iphi & 0x1f) << 5);
15 }
unsigned ieta() const
global eta index (0-21)
uint32_t id_
Definition: DetId.h:69
unsigned iphi() const
global phi index (0-17)
constexpr DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:38

◆ L1CaloRegionDetId() [4/4]

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 18 of file L1CaloRegionDetId.cc.

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

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

Member Function Documentation

◆ ieta()

unsigned L1CaloRegionDetId::ieta ( ) const
inline

global eta index (0-21)

Definition at line 37 of file L1CaloRegionDetId.h.

References DetId::id_.

Referenced by L1CaloMipQuietRegion::gctEta(), L1CaloRegion::gctEta(), L1GctJet::globalEta(), L1GctJet::hwEta(), isHf(), L1CaloRegionDetId(), rctCard(), rctCrate(), rctEta(), and rctRegion().

37 { return id_ & 0x1f; }
uint32_t id_
Definition: DetId.h:69

◆ iphi()

unsigned L1CaloRegionDetId::iphi ( ) const
inline

global phi index (0-17)

Definition at line 40 of file L1CaloRegionDetId.h.

References DetId::id_.

Referenced by L1CaloMipQuietRegion::gctPhi(), L1CaloRegion::gctPhi(), L1GctJet::globalPhi(), L1GctJet::hwPhi(), L1CaloRegionDetId(), rctCard(), rctCrate(), rctPhi(), and rctRegion().

40 { return (id_ >> 5) & 0x1f; }
uint32_t id_
Definition: DetId.h:69

◆ isHf()

bool L1CaloRegionDetId::isHf ( ) const
inline

return central or forward type

Definition at line 43 of file L1CaloRegionDetId.h.

References ieta().

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

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

◆ rctCard()

unsigned L1CaloRegionDetId::rctCard ( ) const

return RCT card number (0-6)

Definition at line 61 of file L1CaloRegionDetId.cc.

References ieta(), and iphi().

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

61  {
62  unsigned card = 999;
63  unsigned rct_phi_index = (22 - iphi()) % 18;
64  if ((ieta() == 4) || (ieta() == 17)) {
65  card = 6;
66  } else if ((ieta() > 4) && (ieta() <= 10)) {
67  unsigned index = (ieta() - 5) / 2;
68  card = ((2 - index) * 2) + (rct_phi_index % 2);
69  } else if ((ieta() >= 11) && (ieta() < 17)) {
70  unsigned index = (ieta() - 11) / 2;
71  card = (index * 2) + (rct_phi_index % 2);
72  }
73  return card;
74 }
unsigned ieta() const
global eta index (0-21)
unsigned iphi() const
global phi index (0-17)

◆ rctCrate()

unsigned L1CaloRegionDetId::rctCrate ( ) const

return RCT crate number (0-17)

Definition at line 55 of file L1CaloRegionDetId.cc.

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

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

55  { // TODO - check this is correct!
56  unsigned phiCrate = ((N_PHI + 4 - iphi()) % N_PHI) / 2;
57  return (ieta() < (N_ETA / 2) ? phiCrate : phiCrate + N_PHI / 2);
58 }
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

◆ rctEta()

unsigned L1CaloRegionDetId::rctEta ( ) const
inline

return local RCT eta index (0-10)

Definition at line 55 of file L1CaloRegionDetId.h.

References ieta().

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

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

◆ rctPhi()

unsigned L1CaloRegionDetId::rctPhi ( ) const
inline

return local RCT phi index (0-1)

Definition at line 58 of file L1CaloRegionDetId.h.

References iphi().

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

58 { return (iphi() % 2); }
unsigned iphi() const
global phi index (0-17)

◆ rctRegion()

unsigned L1CaloRegionDetId::rctRegion ( ) const

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

Definition at line 77 of file L1CaloRegionDetId.cc.

References ieta(), and iphi().

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

77  {
78  unsigned rgn = 999;
79  unsigned rct_phi_index = (22 - iphi()) % 18;
80  if (ieta() < 4) {
81  rgn = (3 - ieta()) + 4 * (rct_phi_index % 2);
82  } else if (ieta() > 17) {
83  rgn = (ieta() - 18) + 4 * (rct_phi_index % 2);
84  } else if ((ieta() == 4) || (ieta() == 17)) {
85  rgn = (rct_phi_index % 2);
86  } else if ((ieta() > 4) && (ieta() <= 10)) {
87  rgn = (ieta() % 2);
88  } else if ((ieta() >= 11) && (ieta() < 17)) {
89  rgn = ((ieta() - 1) % 2);
90  }
91  return rgn;
92 }
unsigned ieta() const
global eta index (0-21)
unsigned iphi() const
global phi index (0-17)

Member Data Documentation

◆ N_ETA

const unsigned L1CaloRegionDetId::N_ETA = 22
static

◆ N_PHI

const unsigned L1CaloRegionDetId::N_PHI = 18
static