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*kDepTot }
 
enum  Section { Unknown =0, EM =1, HAD =2, LUM =3 }
 
- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5, Forward =6
}
 

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, 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 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, kDepTot = kDepEM + kDepHAD + kDepLUM }
 

Additional Inherited Members

- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

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

Author
J. Mans - Minnesota

Definition at line 16 of file HcalZDCDetId.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
kDepEM 
kDepHAD 
kDepLUM 
kDepTot 

Definition at line 52 of file HcalZDCDetId.h.

anonymous enum
Enumerator
kSizeForDenseIndexing 

Definition at line 59 of file HcalZDCDetId.h.

Enumerator
Unknown 
EM 
HAD 
LUM 

Definition at line 18 of file HcalZDCDetId.h.

Constructor & Destructor Documentation

HcalZDCDetId::HcalZDCDetId ( )

Create a null cellid

Definition at line 4 of file HcalZDCDetId.cc.

Referenced by detIdFromDenseIndex().

4  : DetId() {
5 }
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 8 of file HcalZDCDetId.cc.

8  : DetId(rawid) {
9 }
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 11 of file HcalZDCDetId.cc.

References DetId::id_.

12  id_|=(section&0x3)<<4;
13  if (true_for_positive_eta) id_|=0x40;
14  id_|=channel&0xF;
15 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
Section section() const
get the section
Definition: HcalZDCDetId.h:36
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
uint32_t id_
Definition: DetId.h:55
int channel() const
get the channel
Definition: HcalZDCDetId.h:40
HcalZDCDetId::HcalZDCDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 17 of file HcalZDCDetId.cc.

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

17  {
18  if (!gen.null() && (gen.det()!=Calo || gen.subdetId()!=SubdetectorId)) {
19  throw cms::Exception("Invalid DetId") << "Cannot initialize ZDCDetId from " << std::hex << gen.rawId() << std::dec;
20  }
21  id_=gen.rawId();
22 }
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

int HcalZDCDetId::channel ( ) const
inline
uint32_t HcalZDCDetId::denseIndex ( ) const

Definition at line 33 of file HcalZDCDetId.cc.

References channel(), HAD, kDepEM, kDepHAD, kDepTot, LUM, section(), and zside().

Referenced by HcalCondObjectContainerBase::indexFor().

34 {
35  const int se ( section() ) ;
36  return ( ( zside()<0 ? 0 : kDepTot ) + channel() - 1 +
37  ( se == HAD ? kDepEM :
38  ( se == LUM ? kDepEM + kDepHAD : 0 ) ) ) ;
39 }
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:34
Section section() const
get the section
Definition: HcalZDCDetId.h:36
int channel() const
get the channel
Definition: HcalZDCDetId.h:40
int HcalZDCDetId::depth ( ) const
inline

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

Definition at line 38 of file HcalZDCDetId.h.

References DetId::id_.

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

38 { return (((id_>>4)&0x3)==1)?(1):((((id_>>4)&0x3)==2)?((id_&0xF)+1):(id_&0xF)); }
uint32_t id_
Definition: DetId.h:55
HcalZDCDetId HcalZDCDetId::detIdFromDenseIndex ( uint32_t  di)
static

Definition at line 42 of file HcalZDCDetId.cc.

References EM, HAD, HcalZDCDetId(), recoMuon::in, kDepEM, kDepHAD, kDepTot, LUM, and validDenseIndex().

Referenced by CaloGenericDetId::CaloGenericDetId().

43 {
44  if( validDenseIndex( di ) )
45  {
46  const bool lz ( di >= kDepTot ) ;
47  const uint32_t in ( di%kDepTot ) ;
48  const Section se ( in<kDepEM ? EM :
49  ( in<kDepEM+kDepHAD ? HAD : LUM ) ) ;
50  const uint32_t dp ( EM == se ? in+1 :
51  ( HAD == se ? in - kDepEM + 1 : in - kDepEM - kDepHAD + 1 ) ) ;
52  return HcalZDCDetId( se, lz, dp ) ;
53  }
54  else
55  {
56  return HcalZDCDetId() ;
57  }
58 }
static bool validDenseIndex(uint32_t di)
Definition: HcalZDCDetId.h:44
HcalZDCDetId & HcalZDCDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 24 of file HcalZDCDetId.cc.

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

24  {
25  if (!gen.null() && (gen.det()!=Calo || gen.subdetId()!=SubdetectorId)) {
26  throw cms::Exception("Invalid DetId") << "Cannot assign ZDCDetId from " << std::hex << gen.rawId() << std::dec;
27  }
28  id_=gen.rawId();
29  return *this;
30 }
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
uint32_t id_
Definition: DetId.h:55
Section HcalZDCDetId::section ( ) const
inline
static bool HcalZDCDetId::validDenseIndex ( uint32_t  di)
inlinestatic

Definition at line 44 of file HcalZDCDetId.h.

References kSizeForDenseIndexing.

Referenced by detIdFromDenseIndex().

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

Definition at line 61 of file HcalZDCDetId.cc.

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

Referenced by CaloGenericDetId::validDetId().

63 {
64  return ( dp >= 1 && (
65  ( ( se == EM ) &&
66  ( dp <= kDepEM ) ) ||
67  ( ( se == HAD ) &&
68  ( dp <= kDepHAD ) ) ||
69  ( ( se == LUM ) &&
70  ( dp <= kDepLUM ) )
71  )
72  ) ;
73 }
int HcalZDCDetId::zside ( ) const
inline

Member Data Documentation

const int HcalZDCDetId::SubdetectorId = 2
static