CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types
HcalZDCDetId Class Reference

#include <HcalZDCDetId.h>

Inheritance diagram for HcalZDCDetId:
DetId

Public Types

enum  { kSizeForDenseIndexing = 2*kDepRun1 }
 
enum  Section {
  Unknown =0, EM =1, HAD =2, LUM =3,
  RPD =4
}
 
- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5, Forward =6, VeryForward =7
}
 

Public Member Functions

int channel () const
 get the channel More...
 
uint32_t denseIndex () const
 
int depth () const
 get the depth (1 for EM, channel + 1 for HAD, 2 for RPD, not sure yet for LUM, leave as default) More...
 
 HcalZDCDetId ()
 
 HcalZDCDetId (uint32_t rawid)
 
 HcalZDCDetId (Section section, bool true_for_positive_eta, int channel)
 
 HcalZDCDetId (const DetId &id)
 
HcalZDCDetIdoperator= (const DetId &id)
 
Section section () const
 get the section More...
 
int zside () const
 get the z-side of the cell (1/-1) 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 Member Functions

static HcalZDCDetId detIdFromDenseIndex (uint32_t di)
 
static bool validDenseIndex (uint32_t di)
 
static bool validDetId (Section se, int dp)
 

Static Public Attributes

static const int kZDCChannelMask = 0xF
 
static const int kZDCRPDMask = 0x80
 
static const int kZDCSectionMask = 0x3
 
static const int kZDCSectionOffset = 4
 
static const int kZDCZsideMask = 0x40
 
static const int SubdetectorId = 2
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Private Types

enum  {
  kDepEM = 5, kDepHAD = 4, kDepLUM = 2, kDepRPD = 16,
  kDepRun1 = kDepEM + kDepHAD + kDepLUM, kDepTot = kDepRun1 + kDepRPD
}
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Contents of the HcalZDCDetId : [7] Set for RPD [6] Z position (true for positive) [5:4] Section (EM/HAD/Lumi) [3:0] Channel

Definition at line 16 of file HcalZDCDetId.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
kDepEM 
kDepHAD 
kDepLUM 
kDepRPD 
kDepRun1 
kDepTot 

Definition at line 57 of file HcalZDCDetId.h.

anonymous enum
Enumerator
kSizeForDenseIndexing 

Definition at line 66 of file HcalZDCDetId.h.

Enumerator
Unknown 
EM 
HAD 
LUM 
RPD 

Definition at line 23 of file HcalZDCDetId.h.

Constructor & Destructor Documentation

HcalZDCDetId::HcalZDCDetId ( )

Create a null cellid

Definition at line 11 of file HcalZDCDetId.cc.

Referenced by detIdFromDenseIndex().

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

Create cellid from raw id (0=invalid tower id)

Definition at line 15 of file HcalZDCDetId.cc.

15  : DetId(rawid) {
16 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
HcalZDCDetId::HcalZDCDetId ( Section  section,
bool  true_for_positive_eta,
int  channel 
)

Constructor from section, eta sign, and channel

Definition at line 18 of file HcalZDCDetId.cc.

References DetId::id_, kZDCChannelMask, kZDCRPDMask, kZDCSectionMask, kZDCSectionOffset, kZDCZsideMask, RPD, and Unknown.

19  if (section == RPD) {
21  id_ |= kZDCRPDMask;
22  id_ |= ((channel-1)&kZDCChannelMask);
23  } else {
26  }
27  if (true_for_positive_eta) id_ |= kZDCZsideMask;
28 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
static const int kZDCSectionOffset
Definition: HcalZDCDetId.h:20
static const int kZDCZsideMask
Definition: HcalZDCDetId.h:21
static const int kZDCChannelMask
Definition: HcalZDCDetId.h:18
static const int kZDCSectionMask
Definition: HcalZDCDetId.h:19
static const int kZDCRPDMask
Definition: HcalZDCDetId.h:22
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
uint32_t id_
Definition: DetId.h:55
int channel() const
get the channel
Definition: HcalZDCDetId.cc:62
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
HcalZDCDetId::HcalZDCDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 30 of file HcalZDCDetId.cc.

References DetId::Calo, TauDecayModes::dec, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().

30  {
31  if (!gen.null() && (gen.det()!=Calo || gen.subdetId()!=SubdetectorId)) {
32  throw cms::Exception("Invalid DetId")
33  << "Cannot initialize ZDCDetId from " << std::hex << gen.rawId() << std::dec;
34  }
35  id_ = gen.rawId();
36 }
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

int HcalZDCDetId::channel ( ) const

get the channel

Definition at line 62 of file HcalZDCDetId.cc.

References DetId::id_, kZDCChannelMask, RPD, and section().

Referenced by ZDCDigiStudy::analyze(), ZdcTBAnalysis::analyze(), denseIndex(), depth(), hcalTransformedId(), HcalCondObjectContainerBase::indexFor(), HcalText2DetIdConverter::init(), ZdcTopology::longitudinal(), ZdcHardcodeGeometryLoader::makeCell(), ZDCLogicalMapEntry::printLMapLine(), ZdcTopology::transverse(), and CaloGenericDetId::validDetId().

62  {
63  const int se ( section() ) ;
64  if (se == RPD) return (1+(id_&kZDCChannelMask));
65  else return (id_&kZDCChannelMask);
66 }
static const int kZDCChannelMask
Definition: HcalZDCDetId.h:18
uint32_t id_
Definition: DetId.h:55
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
uint32_t HcalZDCDetId::denseIndex ( ) const

Definition at line 68 of file HcalZDCDetId.cc.

References channel(), HAD, kDepEM, kDepHAD, kDepRPD, kDepRun1, LUM, RPD, section(), and zside().

Referenced by HcalCondObjectContainerBase::indexFor().

68  {
69  const int se ( section() ) ;
70  uint32_t di = (channel() - 1 +
71  ( se == RPD ? 2*kDepRun1 + ( zside()<0 ? 0 : kDepRPD ) :
72  ( ( zside()<0 ? 0 : kDepRun1 ) +
73  ( se == HAD ? kDepEM :
74  ( se == LUM ? kDepEM + kDepHAD : 0 ) ) ) ) );
75  return di;
76 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
int channel() const
get the channel
Definition: HcalZDCDetId.cc:62
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
int HcalZDCDetId::depth ( ) const

get the depth (1 for EM, channel + 1 for HAD, 2 for RPD, not sure yet for LUM, leave as default)

Definition at line 54 of file HcalZDCDetId.cc.

References channel(), EM, HAD, RPD, and section().

Referenced by ZdcTBAnalysis::analyze(), and ZDCLogicalMapEntry::printLMapLine().

54  {
55  const int se ( section() ) ;
56  if (se == EM) return 1;
57  else if (se == HAD) return (channel()+2);
58  else if (se == RPD) return 2;
59  else return channel();
60 }
int channel() const
get the channel
Definition: HcalZDCDetId.cc:62
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
HcalZDCDetId HcalZDCDetId::detIdFromDenseIndex ( uint32_t  di)
static

Definition at line 78 of file HcalZDCDetId.cc.

References reco::dp, EM, HAD, HcalZDCDetId(), recoMuon::in, kDepEM, kDepHAD, kDepRPD, kDepRun1, kDepTot, LUM, RPD, Unknown, and validDenseIndex().

Referenced by CaloGenericDetId::CaloGenericDetId().

78  {
79  if ( validDenseIndex( di ) ) {
80  bool lz (false);
81  uint32_t dp(0);
82  Section se(Unknown);
83  if (di >= 2*kDepRun1) {
84  lz = (di >= (kDepRun1+kDepTot));
85  se = RPD;
86  dp = 1 + ((di-2*kDepRun1) % kDepRPD);
87  } else {
88  lz = (di >= kDepRun1);
89  uint32_t in = (di%kDepRun1) ;
90  se = (in<kDepEM ? EM :
91  (in<kDepEM+kDepHAD ? HAD : LUM) );
92  dp = (EM == se ? in+1 :
93  (HAD == se ? in-kDepEM+1 : in-kDepEM-kDepHAD+1) );
94  }
95  return HcalZDCDetId( se, lz, dp ) ;
96  } else{
97  return HcalZDCDetId() ;
98  }
99 }
static bool validDenseIndex(uint32_t di)
Definition: HcalZDCDetId.h:49
auto dp
Definition: deltaR.h:22
HcalZDCDetId & HcalZDCDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 38 of file HcalZDCDetId.cc.

References DetId::Calo, TauDecayModes::dec, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().

38  {
39  if (!gen.null() && (gen.det()!=Calo || gen.subdetId()!=SubdetectorId)) {
40  throw cms::Exception("Invalid DetId")
41  << "Cannot assign ZDCDetId from " << std::hex << gen.rawId() << std::dec;
42  }
43  id_=gen.rawId();
44  return *this;
45 }
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
uint32_t id_
Definition: DetId.h:55
HcalZDCDetId::Section HcalZDCDetId::section ( ) const
static bool HcalZDCDetId::validDenseIndex ( uint32_t  di)
inlinestatic

Definition at line 49 of file HcalZDCDetId.h.

References kSizeForDenseIndexing.

Referenced by detIdFromDenseIndex().

bool HcalZDCDetId::validDetId ( Section  se,
int  dp 
)
static

Definition at line 101 of file HcalZDCDetId.cc.

References EM, HAD, kDepEM, kDepHAD, kDepLUM, kDepRPD, LUM, and RPD.

Referenced by CaloGenericDetId::validDetId().

101  {
102  bool flag = (dp >= 1 && (
103  ( ( se == EM ) &&
104  ( dp <= kDepEM ) ) ||
105  ( ( se == HAD ) &&
106  ( dp <= kDepHAD ) ) ||
107  ( ( se == LUM ) &&
108  ( dp <= kDepLUM ) ) ||
109  ( ( se == RPD ) &&
110  ( dp <= kDepRPD ) )
111  )
112  );
113  return flag;
114 }
auto dp
Definition: deltaR.h:22
int HcalZDCDetId::zside ( ) const
inline

Member Data Documentation

const int HcalZDCDetId::kZDCChannelMask = 0xF
static

Definition at line 18 of file HcalZDCDetId.h.

Referenced by channel(), and HcalZDCDetId().

const int HcalZDCDetId::kZDCRPDMask = 0x80
static

Definition at line 22 of file HcalZDCDetId.h.

Referenced by HcalZDCDetId(), and section().

const int HcalZDCDetId::kZDCSectionMask = 0x3
static

Definition at line 19 of file HcalZDCDetId.h.

Referenced by HcalZDCDetId(), and section().

const int HcalZDCDetId::kZDCSectionOffset = 4
static

Definition at line 20 of file HcalZDCDetId.h.

Referenced by HcalZDCDetId(), and section().

const int HcalZDCDetId::kZDCZsideMask = 0x40
static

Definition at line 21 of file HcalZDCDetId.h.

Referenced by HcalZDCDetId(), and zside().

const int HcalZDCDetId::SubdetectorId = 2
static