CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalCellType.cc
Go to the documentation of this file.
1 // File: HcalCellType.cc
3 // Description: Individual readout cell description for hadron calorimeter
5 
7 
8 #include "CLHEP/Units/GlobalSystemOfUnits.h"
9 #include <iomanip>
10 
11 HcalCellType::HcalCellType(HcalSubdetector detType, int etaBin, int phiBin,
12  int depthSegment,const HcalCellType::HcalCell& cell,
13  int readoutDirection, double samplingFactor,
14  int numberZ, int nmodule, double halfSize,
15  int units) :
16  theDetType(detType), theEtaBin(etaBin), theDepthSegment(depthSegment),
17  theNumberOfZ(numberZ), theActualReadoutDirection(readoutDirection),
18  theUnitPhi(units), theSamplingFactor(samplingFactor){
19 
20  theEtaMin = cell.eta - cell.deta;
21  theEtaMax = cell.eta + cell.deta;
22  theRzFlag = cell.flagrz;
23  theDepthMin = (cell.rz - cell.drz)/CLHEP::cm;
24  theDepthMax = (cell.rz + cell.drz)/CLHEP::cm;
25  int nphi = (int)(10*CLHEP::deg/cell.dphi);
26  theNumberOfPhiBins = nphi*nmodule;
27  double phimin = cell.phi - cell.dphi;
28  thePhiOffset = (phimin - 2*(phiBin-1)*cell.dphi)/CLHEP::deg;
29  thePhiBinWidth = 2*(cell.dphi)/CLHEP::deg;
30  theHalfSize = halfSize/CLHEP::cm;
31 }
32 
34 
35  theDetType = right.theDetType;
36  theEtaBin = right.theEtaBin;
39  theNumberOfZ = right.theNumberOfZ;
41  theUnitPhi = right.theUnitPhi;
42  theRzFlag = right.theRzFlag;
43  theEtaMin = right.theEtaMin;
44  theEtaMax = right.theEtaMax;
45  thePhiOffset = right.thePhiOffset;
47  theDepthMin = right.theDepthMin;
48  theDepthMax = right.theDepthMax;
49  theHalfSize = right.theHalfSize;
53 }
54 
56 
57  theDetType = right.theDetType;
58  theEtaBin = right.theEtaBin;
61  theNumberOfZ = right.theNumberOfZ;
63  theUnitPhi = right.theUnitPhi;
64  theRzFlag = right.theRzFlag;
65  theEtaMin = right.theEtaMin;
66  theEtaMax = right.theEtaMax;
67  thePhiOffset = right.thePhiOffset;
69  theDepthMin = right.theDepthMin;
70  theDepthMax = right.theDepthMax;
71  theHalfSize = right.theHalfSize;
75 
76  return *this;
77 }
78 
80 
81 void HcalCellType::setMissingPhi(std::vector<int>& v1, std::vector<int>& v2) {
82  theMissingPhiPlus = v1;
83  theMissingPhiMinus = v2;
84 }
85 
87  int tmp = (int)(theMissingPhiPlus.size());
88  if (theNumberOfZ > 1) tmp += (int)(theMissingPhiMinus.size());
89  return tmp;
90 }
91 
92 void HcalCellType::setEta(int bin, double etamin, double etamax) {
93  theEtaBin = bin;
94  theEtaMin = etamin;
95  theEtaMax = etamax;
96 }
97 
98 void HcalCellType::setDepth(int bin, double dmin, double dmax) {
100  theDepthMin = dmin;
101  theDepthMax = dmax;
102 }
103 
104 void HcalCellType::setPhi(int bins, int unit, double dphi, double phioff) {
105  theNumberOfPhiBins = bins;
106  theUnitPhi = unit;
107  thePhiBinWidth = dphi;
108  thePhiOffset = phioff;
109 }
110 
111 std::ostream& operator<<(std::ostream& os, const HcalCellType& cell) {
112  os << "Detector " << cell.detType() << " Eta " << cell.etaBin() << " ("
113  << cell.etaMin() << ":" << cell.etaMax() << ") Depth "
114  << cell.depthSegment() << " (" << cell.depthMin() << ":"
115  << cell.depthMax() << "; " << cell.depthType() << ") Phi "
116  << cell.nPhiBins() << " (" << cell.phiOffset() << ", "
117  << cell.phiBinWidth() << ", " << cell.nPhiModule() << ", "
118  << cell.unitPhi() << ") Halves " << cell.nHalves() << " Direction "
119  << cell.actualReadoutDirection() << " Half size " << cell.halfSize()
120  << " Sampling Factor " << cell.samplingFactor() << " # of missing cells "
121  << cell.missingPhiPlus().size() << "/" << cell.missingPhiMinus().size();
122  return os;
123 }
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 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)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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
double theDepthMax
Definition: HcalCellType.h:112
int actualReadoutDirection() const
Definition: HcalCellType.h:68