CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
12 class HcalCellType {
13 
14 public:
15 
16  struct HcalCell {
17  bool ok;
18  double eta, deta, phi, dphi, rz, drz;
19  bool flagrz;
20  HcalCell(bool fl=false, double et=0, double det=0, double fi=0,
21  double dfi=0, double rzv=0, double drzv=0, bool frz=true) :
22  ok(fl), eta(et), deta(det), phi(fi), dphi(dfi), rz(rzv), drz(drzv),
23  flagrz(frz) {}
24  };
25 
26  HcalCellType(HcalSubdetector detType, int etaBin, int phiBin,
27  int depthSegment, const HcalCell& cell, int readoutDirection=0,
28  double samplingFactor=0, int numberZ=0, int nmodule=0,
29  double halfSize=0, int units=0);
30  HcalCellType(const HcalCellType &right);
31  const HcalCellType& operator=(const HcalCellType &right);
32  ~HcalCellType();
33 
34  void setMissingPhi(std::vector<int>&, std::vector<int>&);
35 
39 
41  int etaBin() const {return theEtaBin;}
42  void setEta(int bin, double etamin, double etamax);
43 
47  int depthSegment() const {return theDepthSegment;}
48  void setDepth(int bin, double dmin, double dmax);
49 
51  int nPhiBins() const {return theNumberOfPhiBins;}
52  int nPhiModule() const {return static_cast<int>(20./thePhiBinWidth);}
53 
55  double phiBinWidth() const {return thePhiBinWidth;}
56 
58  double phiOffset() const {return thePhiOffset;}
59  int unitPhi() const {return theUnitPhi;}
60  void setPhi(int bins, int unit, double dphi, double phioff);
61 
63  int nHalves() const {return theNumberOfZ;}
64 
69 
71  double etaMin() const {return theEtaMin;}
72 
74  double etaMax() const {return theEtaMax;}
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 
87  std::vector<int> missingPhiPlus() const {return theMissingPhiPlus;}
88  std::vector<int> missingPhiMinus() const {return theMissingPhiMinus;}
89  int nPhiMissingBins() const;
90 
91 protected:
92 
93  HcalCellType();
94 
95 private:
96 
98  int theEtaBin;
104 
105  bool theRzFlag;
106 
107  double theEtaMin;
108  double theEtaMax;
109  double thePhiOffset;
111  double theDepthMin;
112  double theDepthMax;
113  double theHalfSize;
115 
116  std::vector<int> theMissingPhiPlus;
117  std::vector<int> theMissingPhiMinus;
118 };
119 
120 std::ostream& operator<<(std::ostream&, const HcalCellType&);
121 #endif
void setEta(int bin, double etamin, double etamax)
Definition: HcalCellType.cc:92
int etaBin() const
which eta ring it belongs to, starting from one
Definition: HcalCellType.h:41
double depthMax() const
Definition: HcalCellType.h:79
void setMissingPhi(std::vector< int > &, std::vector< int > &)
Definition: HcalCellType.cc:81
double depthMin() const
Definition: HcalCellType.h:78
int nPhiMissingBins() const
Definition: HcalCellType.cc:86
bool depthType() const
Definition: HcalCellType.h:80
int theNumberOfPhiBins
Definition: HcalCellType.h:100
std::vector< int > theMissingPhiPlus
Definition: HcalCellType.h:116
std::vector< int > theMissingPhiMinus
Definition: HcalCellType.h:117
int theDepthSegment
Definition: HcalCellType.h:99
double samplingFactor() const
ratio of real particle energy to deposited energy in the SimHi
Definition: HcalCellType.h:84
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
double phiBinWidth() const
phi bin width, in degrees
Definition: HcalCellType.h:55
double halfSize() const
Definition: HcalCellType.h:81
string unit
Definition: csvLumiCalc.py:46
int theActualReadoutDirection
Definition: HcalCellType.h:102
int nHalves() const
Number of halves (forward/backward)
Definition: HcalCellType.h:63
double theHalfSize
Definition: HcalCellType.h:113
HcalSubdetector theDetType
Definition: HcalCellType.h:97
HcalSubdetector detType() const
Definition: HcalCellType.h:38
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:107
const HcalCellType & operator=(const HcalCellType &right)
Definition: HcalCellType.cc:55
double theSamplingFactor
Definition: HcalCellType.h:114
double etaMax() const
cell edge, always positive &amp; greater than etaMin
Definition: HcalCellType.h:74
void setDepth(int bin, double dmin, double dmax)
Definition: HcalCellType.cc:98
std::vector< int > missingPhiMinus() const
Definition: HcalCellType.h:88
double etaMin() const
lower cell edge. Always positive
Definition: HcalCellType.h:71
void setPhi(int bins, int unit, double dphi, double phioff)
double theEtaMax
Definition: HcalCellType.h:108
double theDepthMin
Definition: HcalCellType.h:111
TString units(TString variable, Char_t axis)
int nPhiModule() const
Definition: HcalCellType.h:52
double thePhiOffset
Definition: HcalCellType.h:109
double phiOffset() const
phi offset in degrees
Definition: HcalCellType.h:58
double thePhiBinWidth
Definition: HcalCellType.h:110
int nPhiBins() const
the number of these cells in a ring
Definition: HcalCellType.h:51
int unitPhi() const
Definition: HcalCellType.h:59
std::vector< int > missingPhiPlus() const
missing phi rings
Definition: HcalCellType.h:87
int depthSegment() const
Definition: HcalCellType.h:47
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:20
double theDepthMax
Definition: HcalCellType.h:112
int actualReadoutDirection() const
Definition: HcalCellType.h:68