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, 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 void HcalCellType::setMissingPhi(std::vector<int> v1, std::vector<int> v2) {
58  theMissingPhiPlus = v1;
59  theMissingPhiMinus = v2;
60 }
61 
63  int tmp = (int)(theMissingPhiPlus.size());
64  if (theNumberOfZ > 1) tmp += (int)(theMissingPhiMinus.size());
65  return tmp;
66 }
67 
68 std::ostream& operator<<(std::ostream& os, const HcalCellType& cell) {
69  os << "Detector " << cell.detType() << " Eta " << cell.etaBin() << " ("
70  << cell.etaMin() << ":" << cell.etaMax() << ") Depth "
71  << cell.depthSegment() << " (" << cell.depthMin() << ":"
72  << cell.depthMax() << "; " << cell.depthType() << ") Phi "
73  << cell.nPhiBins() << " (" << cell.phiOffset() << ", "
74  << cell.phiBinWidth() << ", " << cell.nPhiModule() << ", "
75  << cell.unitPhi() << ") Halves " << cell.nHalves() << " Direction "
76  << cell.actualReadoutDirection() << " Half size " << cell.halfSize()
77  << " Sampling Factor " << cell.samplingFactor() << " # of missing cells "
78  << cell.missingPhiPlus().size() << "/" << cell.missingPhiMinus().size();
79  return os;
80 }
int etaBin() const
which eta ring it belongs to, starting from one
Definition: HcalCellType.h:40
double depthMax() const
Definition: HcalCellType.h:75
double depthMin() const
Definition: HcalCellType.h:74
int nPhiMissingBins() const
Definition: HcalCellType.cc:62
bool depthType() const
Definition: HcalCellType.h:76
int theNumberOfPhiBins
Definition: HcalCellType.h:96
std::vector< int > theMissingPhiPlus
Definition: HcalCellType.h:112
void setMissingPhi(std::vector< int >, std::vector< int >)
Definition: HcalCellType.cc:57
std::vector< int > theMissingPhiMinus
Definition: HcalCellType.h:113
int theDepthSegment
Definition: HcalCellType.h:95
double samplingFactor() const
ratio of real particle energy to deposited energy in the SimHi
Definition: HcalCellType.h:80
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
double phiBinWidth() const
phi bin width, in degrees
Definition: HcalCellType.h:52
double halfSize() const
Definition: HcalCellType.h:77
int theActualReadoutDirection
Definition: HcalCellType.h:98
int nHalves() const
Number of halves (forward/backward)
Definition: HcalCellType.h:59
double theHalfSize
Definition: HcalCellType.h:109
HcalSubdetector theDetType
Definition: HcalCellType.h:93
HcalSubdetector detType() const
Definition: HcalCellType.h:37
HcalSubdetector
Definition: HcalAssistant.h:32
double theEtaMin
Definition: HcalCellType.h:103
double theSamplingFactor
Definition: HcalCellType.h:110
double etaMax() const
cell edge, always positive &amp; greater than etaMin
Definition: HcalCellType.h:70
std::vector< int > missingPhiMinus() const
Definition: HcalCellType.h:84
double etaMin() const
lower cell edge. Always positive
Definition: HcalCellType.h:67
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double theEtaMax
Definition: HcalCellType.h:104
double theDepthMin
Definition: HcalCellType.h:107
TString units(TString variable, Char_t axis)
int nPhiModule() const
Definition: HcalCellType.h:49
double thePhiOffset
Definition: HcalCellType.h:105
double phiOffset() const
phi offset in degrees
Definition: HcalCellType.h:55
double thePhiBinWidth
Definition: HcalCellType.h:106
int nPhiBins() const
the number of these cells in a ring
Definition: HcalCellType.h:48
int unitPhi() const
Definition: HcalCellType.h:56
std::vector< int > missingPhiPlus() const
missing phi rings
Definition: HcalCellType.h:83
int depthSegment() const
Definition: HcalCellType.h:45
double theDepthMax
Definition: HcalCellType.h:108
int actualReadoutDirection() const
Definition: HcalCellType.h:64