CMS 3D CMS Logo

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

#include <AHCalDetId.h>

Inheritance diagram for AHCalDetId:
DetId

Public Member Functions

 AHCalDetId ()
 
 AHCalDetId (uint32_t rawid)
 
 AHCalDetId (int row, int col, int depth)
 
 AHCalDetId (const DetId &id)
 
int depth () const
 
std::pair< double, double > getXY () const
 get the local coordinate in the plane and along depth More...
 
double getZ () const
 
int icol () const
 get the column number More...
 
int icolAbs () const
 
int irow () const
 get the row number More...
 
int irowAbs () const
 
AHCalDetIdoperator= (const DetId &id)
 
HcalSubdetector subdet () const
 get the subdetector 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...
 

Public Attributes

const double deltaX_ = 3.0
 
const double deltaY_ = 3.0
 
const double deltaZ_ = 8.1
 
const double zFirst_ = 1.76
 

Static Public Attributes

static const int MaxDepth =12
 get the layer number More...
 
static const AHCalDetId Undefined
 
- 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

Cell identifier class for the HCAL subdetectors, precision readout cells only

Definition at line 13 of file AHCalDetId.h.

Constructor & Destructor Documentation

AHCalDetId::AHCalDetId ( )

Create a null cellid

Definition at line 7 of file AHCalDetId.cc.

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

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

Definition at line 10 of file AHCalDetId.cc.

10  : DetId(rawid) {
11 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
AHCalDetId::AHCalDetId ( int  row,
int  col,
int  depth 
)

Constructor from subdetector, signed tower ieta,iphi,and depth

Definition at line 13 of file AHCalDetId.cc.

References icol(), DetId::id_, irow(), HcalDetId::kHcalDepthMask2, HcalDetId::kHcalDepthOffset2, HcalDetId::kHcalEtaMask2, HcalDetId::kHcalEtaOffset2, HcalDetId::kHcalIdFormat2, HcalDetId::kHcalPhiMask2, and HcalDetId::kHcalZsideMask2.

13  : DetId(Hcal,HcalOther) {
14  int icol = (col > 0) ? col : 10-col;
15  int irow = (row > 0) ? row : 10-row;
21 }
int irow() const
get the row number
Definition: AHCalDetId.cc:33
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:26
int depth() const
Definition: AHCalDetId.cc:45
static const int kHcalDepthMask2
Definition: HcalDetId.h:26
int icol() const
get the column number
Definition: AHCalDetId.cc:39
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
static const int kHcalIdFormat2
Definition: HcalDetId.h:29
uint32_t id_
Definition: DetId.h:55
static const int kHcalEtaOffset2
Definition: HcalDetId.h:18
static const int kHcalZsideMask2
Definition: HcalDetId.h:22
col
Definition: cuy.py:1008
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
static const int kHcalDepthOffset2
Definition: HcalDetId.h:24
AHCalDetId::AHCalDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 23 of file AHCalDetId.cc.

References TauDecayModes::dec, DetId::det(), Exception, DetId::Hcal, HcalOther, DetId::id_, DetId::null(), DetId::rawId(), subdet(), and DetId::subdetId().

23  {
24  if (!gen.null()) {
26  if (gen.det()!=Hcal || subdet!=HcalOther) {
27  throw cms::Exception("Invalid DetId") << "Cannot initialize AHCalDetId from " << std::hex << gen.rawId() << std::dec;
28  }
29  }
30  id_=gen.rawId();
31 }
HcalSubdetector subdet() const
get the subdetector
Definition: AHCalDetId.h:30
HcalSubdetector
Definition: HcalAssistant.h:31
uint32_t id_
Definition: DetId.h:55

Member Function Documentation

int AHCalDetId::depth ( void  ) const

Definition at line 45 of file AHCalDetId.cc.

References DetId::id_, HcalDetId::kHcalDepthMask2, and HcalDetId::kHcalDepthOffset2.

Referenced by HGCalTBAnalyzer::analyzeSimHits(), getZ(), and AHCalSD::unpackIndex().

45  {
47 }
static const int kHcalDepthMask2
Definition: HcalDetId.h:26
uint32_t id_
Definition: DetId.h:55
static const int kHcalDepthOffset2
Definition: HcalDetId.h:24
std::pair< double, double > AHCalDetId::getXY ( ) const

get the local coordinate in the plane and along depth

Definition at line 49 of file AHCalDetId.cc.

References cuy::col, deltaX_, deltaY_, icol(), and irow().

Referenced by HGCalTBAnalyzer::analyzeSimHits().

49  {
50  int row = irow();
51  int col = icol();
52  double shiftx = (col > 0) ? -0.5*deltaX_ : 0.5*deltaX_;
53  double shifty = (row > 0) ? -0.5*deltaY_ : 0.5*deltaY_;
54  return std::pair<double,double>(col*deltaX_+shiftx,row*deltaY_+shifty);
55 }
int irow() const
get the row number
Definition: AHCalDetId.cc:33
int icol() const
get the column number
Definition: AHCalDetId.cc:39
col
Definition: cuy.py:1008
const double deltaX_
Definition: AHCalDetId.h:48
const double deltaY_
Definition: AHCalDetId.h:49
double AHCalDetId::getZ ( ) const

Definition at line 57 of file AHCalDetId.cc.

References deltaZ_, depth(), and zFirst_.

Referenced by HGCalTBAnalyzer::analyzeSimHits().

57  {
58  int lay = depth();
59  return (zFirst_+(lay-1)*deltaZ_);
60 }
const double zFirst_
Definition: AHCalDetId.h:51
int depth() const
Definition: AHCalDetId.cc:45
const double deltaZ_
Definition: AHCalDetId.h:50
int AHCalDetId::icol ( ) const

get the column number

Definition at line 39 of file AHCalDetId.cc.

References DetId::id_, HcalDetId::kHcalPhiMask2, and relativeConstraints::value.

Referenced by AHCalDetId(), HGCalTBAnalyzer::analyzeSimHits(), getXY(), irowAbs(), and AHCalSD::unpackIndex().

39  {
41  if (value >= 10) value = -(value%10);
42  return value;
43 }
Definition: value.py:1
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
uint32_t id_
Definition: DetId.h:55
int AHCalDetId::icolAbs ( ) const
inline

Definition at line 39 of file AHCalDetId.h.

References DetId::id_, and HcalDetId::kHcalPhiMask2.

Referenced by HGCalTBAnalyzer::analyzeSimHits().

39 { return (id_&HcalDetId::kHcalPhiMask2); }
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
uint32_t id_
Definition: DetId.h:55
int AHCalDetId::irow ( ) const

get the row number

Definition at line 33 of file AHCalDetId.cc.

References DetId::id_, HcalDetId::kHcalEtaMask2, HcalDetId::kHcalEtaOffset2, and relativeConstraints::value.

Referenced by AHCalDetId(), HGCalTBAnalyzer::analyzeSimHits(), getXY(), AHCalSD::unpackIndex(), and zside().

33  {
35  if (value >= 10) value = -(value%10);
36  return value;
37 }
Definition: value.py:1
uint32_t id_
Definition: DetId.h:55
static const int kHcalEtaOffset2
Definition: HcalDetId.h:18
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
int AHCalDetId::irowAbs ( ) const
inline

Definition at line 35 of file AHCalDetId.h.

References icol(), DetId::id_, HcalDetId::kHcalEtaMask2, and HcalDetId::kHcalEtaOffset2.

Referenced by HGCalTBAnalyzer::analyzeSimHits().

35  {
uint32_t id_
Definition: DetId.h:55
static const int kHcalEtaOffset2
Definition: HcalDetId.h:18
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
AHCalDetId& AHCalDetId::operator= ( const DetId id)
inline

Assignment from a generic cell id

Definition at line 24 of file AHCalDetId.h.

References DetId::id_.

24  {
25  id_=id.rawId();
26  return *this;
27  }
uint32_t id_
Definition: DetId.h:55
HcalSubdetector AHCalDetId::subdet ( ) const
inline

get the subdetector

Definition at line 30 of file AHCalDetId.h.

References HcalOther.

Referenced by AHCalDetId().

30 { return HcalOther; }
int AHCalDetId::zside ( ) const
inline

get the z-side of the cell (1/-1)

Definition at line 32 of file AHCalDetId.h.

References irow().

Referenced by HGCalTBAnalyzer::analyzeSimHits().

32 { return 1; }

Member Data Documentation

const double AHCalDetId::deltaX_ = 3.0

Definition at line 48 of file AHCalDetId.h.

Referenced by getXY().

const double AHCalDetId::deltaY_ = 3.0

Definition at line 49 of file AHCalDetId.h.

Referenced by getXY().

const double AHCalDetId::deltaZ_ = 8.1

Definition at line 50 of file AHCalDetId.h.

Referenced by getZ().

const int AHCalDetId::MaxDepth =12
static

get the layer number

Definition at line 41 of file AHCalDetId.h.

Referenced by HGCalTBAnalyzer::analyze(), and HGCalTBAnalyzer::beginRun().

const AHCalDetId AHCalDetId::Undefined
static

Definition at line 47 of file AHCalDetId.h.

const double AHCalDetId::zFirst_ = 1.76

Definition at line 51 of file AHCalDetId.h.

Referenced by getZ().