CMS 3D CMS Logo

AHCalDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 
6 
8 }
9 
10 AHCalDetId::AHCalDetId(uint32_t rawid) : DetId(rawid) {
11 }
12 
14  int icol = (col > 0) ? col : 10-col;
15  int irow = (row > 0) ? row : 10-row;
21 }
22 
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 }
32 
33 int AHCalDetId::irow() const {
35  if (value >= 10) value = -(value%10);
36  return value;
37 }
38 
39 int AHCalDetId::icol() const {
41  if (value >= 10) value = -(value%10);
42  return value;
43 }
44 
45 int AHCalDetId::depth() const {
47 }
48 
49 std::pair<double,double> AHCalDetId::getXY() const {
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 }
56 
57 double AHCalDetId::getZ() const {
58  int lay = depth();
59  return (zFirst_+(lay-1)*deltaZ_);
60 }
61 
62 std::ostream& operator<<(std::ostream& s,const AHCalDetId& id) {
63  return s << "(AHCal " << id.irow() << ',' << id.icol() << ',' << id.depth() << ')';
64 }
65 
66 
constexpr bool null() const
is this a null id ?
Definition: DetId.h:49
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
double getZ() const
Definition: AHCalDetId.cc:57
int irow() const
get the row number
Definition: AHCalDetId.cc:33
const double zFirst_
Definition: AHCalDetId.h:51
HcalSubdetector subdet() const
get the subdetector
Definition: AHCalDetId.h:30
int depth() const
Definition: AHCalDetId.cc:45
static const int kHcalDepthMask2
Definition: HcalDetId.h:27
int icol() const
get the column number
Definition: AHCalDetId.cc:39
std::pair< double, double > getXY() const
get the local coordinate in the plane and along depth
Definition: AHCalDetId.cc:49
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
HcalSubdetector
Definition: HcalAssistant.h:31
Definition: value.py:1
const double deltaZ_
Definition: AHCalDetId.h:50
std::ostream & operator<<(std::ostream &s, const AHCalDetId &id)
Definition: AHCalDetId.cc:62
static const int kHcalPhiMask2
Definition: HcalDetId.h:17
Definition: DetId.h:18
static const AHCalDetId Undefined
Definition: AHCalDetId.h:47
static const int kHcalIdFormat2
Definition: HcalDetId.h:30
uint32_t id_
Definition: DetId.h:59
static const int kHcalEtaOffset2
Definition: HcalDetId.h:19
static const int kHcalZsideMask2
Definition: HcalDetId.h:23
col
Definition: cuy.py:1010
static const int kHcalEtaMask2
Definition: HcalDetId.h:21
const double deltaX_
Definition: AHCalDetId.h:48
static const int kHcalDepthOffset2
Definition: HcalDetId.h:25
const double deltaY_
Definition: AHCalDetId.h:49
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39