CMS 3D CMS Logo

HcalCellType.h
Go to the documentation of this file.
1 // File: HcalCellType.h
3 // Description: Hcal readout cell definition given by eta boundary and depth
5 #ifndef HcalCellType_h
6 #define HcalCellType_h
7 
8 #include <vector>
9 #include <iostream>
11 #include "CLHEP/Units/GlobalSystemOfUnits.h"
12 
13 class HcalCellType {
14 
15 public:
16 
17  struct HcalCell {
18  bool ok;
19  double eta, deta, phi, dphi, rz, drz;
20  bool flagrz;
21  HcalCell(bool fl=false, double et=0, double det=0, double fi=0,
22  double dfi=0, double rzv=0, double drzv=0, bool frz=true) :
23  ok(fl), eta(et), deta(det), phi(fi), dphi(dfi), rz(rzv), drz(drzv),
24  flagrz(frz) {}
25  };
26 
28  int depthSegment, const HcalCell& cell, int readoutDirection=0,
29  double samplingFactor=0, double halfSize=0);
30  HcalCellType(const HcalCellType &right);
31  const HcalCellType& operator=(const HcalCellType &right);
32  ~HcalCellType();
33 
37 
39  int etaBin() const {return theEtaBin;}
40  int zside() const {return theSide;}
41  void setEta(int bin, double etamin, double etamax);
42 
46  int depthSegment() const {return theDepthSegment;}
47  void setDepth(int bin, double dmin, double dmax);
48 
50  int nPhiBins() const {return (int)(thePhis.size());}
51  int nPhiModule() const {return static_cast<int>(20.*CLHEP::deg/thePhiBinWidth);}
52 
54  double phiBinWidth() const {return thePhiBinWidth;}
55  double phiOffset() const {return thePhiOffset;}
56  int unitPhi() const {return theUnitPhi;}
57  void setPhi(const std::vector<std::pair<int,double>>& phis,
58  const std::vector<int>& iphiMiss, double foff, double dphi,
59  int unit);
60  void setPhi(const std::vector<std::pair<int,double>>& phis) {thePhis = phis;}
61 
66 
68  double etaMin() const {return theEtaMin;}
69 
71  double etaMax() const {return theEtaMax;}
72 
74  std::vector<std::pair<int,double>> phis() const {return thePhis;}
75 
77  double depth() const {return (theDepthMin+theDepthMax)/2;}
78  double depthMin() const {return theDepthMin;}
79  double depthMax() const {return theDepthMax;}
80  bool depthType() const {return theRzFlag;}
81  double halfSize() const {return theHalfSize;}
82 
84  double samplingFactor() const {return theSamplingFactor;}
85 
86 protected:
87 
88  HcalCellType();
89 
90 private:
91 
93  int theEtaBin;
94  int theSide;
98 
99  bool theRzFlag;
100 
101  double theEtaMin;
102  double theEtaMax;
103  double theDepthMin;
104  double theDepthMax;
105  double thePhiOffset;
107  double theHalfSize;
109 
110  std::vector<std::pair<int,double> > thePhis;
111 };
112 
113 std::ostream& operator<<(std::ostream&, const HcalCellType&);
114 #endif
void setEta(int bin, double etamin, double etamax)
Definition: HcalCellType.cc:75
int etaBin() const
which eta ring it belongs to, starting from one
Definition: HcalCellType.h:39
double depthMax() const
Definition: HcalCellType.h:79
double depthMin() const
Definition: HcalCellType.h:78
void setPhi(const std::vector< std::pair< int, double >> &phis)
Definition: HcalCellType.h:60
bool depthType() const
Definition: HcalCellType.h:80
int theDepthSegment
Definition: HcalCellType.h:95
std::ostream & operator<<(std::ostream &, const HcalCellType &)
double samplingFactor() const
ratio of real particle energy to deposited energy in the SimHi
Definition: HcalCellType.h:84
std::vector< std::pair< int, double > > phis() const
Phi modules and the central phi values.
Definition: HcalCellType.h:74
double phiBinWidth() const
phi bin width
Definition: HcalCellType.h:54
double halfSize() const
Definition: HcalCellType.h:81
void setPhi(const std::vector< std::pair< int, double >> &phis, const std::vector< int > &iphiMiss, double foff, double dphi, int unit)
int theActualReadoutDirection
Definition: HcalCellType.h:97
double theHalfSize
Definition: HcalCellType.h:107
HcalSubdetector theDetType
Definition: HcalCellType.h:92
HcalSubdetector detType() const
Definition: HcalCellType.h:36
HcalSubdetector
Definition: HcalAssistant.h:31
double depth() const
z or r position, depending on whether it&#39;s barrel or endcap
Definition: HcalCellType.h:77
double theEtaMin
Definition: HcalCellType.h:101
const HcalCellType & operator=(const HcalCellType &right)
Definition: HcalCellType.cc:51
bin
set the eta bin as selection string.
double theSamplingFactor
Definition: HcalCellType.h:108
double etaMax() const
cell edge, always positive & greater than etaMin
Definition: HcalCellType.h:71
void setDepth(int bin, double dmin, double dmax)
Definition: HcalCellType.cc:81
int zside() const
Definition: HcalCellType.h:40
double etaMin() const
lower cell edge. Always positive
Definition: HcalCellType.h:68
et
define resolution functions of each parameter
double theEtaMax
Definition: HcalCellType.h:102
double theDepthMin
Definition: HcalCellType.h:103
int nPhiModule() const
Definition: HcalCellType.h:51
double thePhiOffset
Definition: HcalCellType.h:105
double phiOffset() const
Definition: HcalCellType.h:55
double thePhiBinWidth
Definition: HcalCellType.h:106
int nPhiBins() const
the number of these cells in a ring
Definition: HcalCellType.h:50
int unitPhi() const
Definition: HcalCellType.h:56
int depthSegment() const
Definition: HcalCellType.h:46
HcalCell(bool fl=false, double et=0, double det=0, double fi=0, double dfi=0, double rzv=0, double drzv=0, bool frz=true)
Definition: HcalCellType.h:21
double theDepthMax
Definition: HcalCellType.h:104
std::vector< std::pair< int, double > > thePhis
Definition: HcalCellType.h:110
int actualReadoutDirection() const
Definition: HcalCellType.h:65