CMS 3D CMS Logo

HcalDDDRecConstants.h
Go to the documentation of this file.
1 #ifndef Geometry_HcalTowerAlgo_HcalDDDRecConstants_h
2 #define Geometry_HcalTowerAlgo_HcalDDDRecConstants_h
3 
13 #include<map>
14 #include<string>
15 #include<vector>
16 #include<iostream>
17 
22 
24 
25 public:
26 
29 
30  struct HcalID {
31  int subdet, eta, phi, depth;
32  HcalID(int sub=0, int et=0, int fi=0, int d=0) : subdet(sub), eta(et),
33  phi(fi), depth(d) {}
34  };
35  struct HcalEtaBin {
36  int ieta, zside, depthStart;
37  double dphi, etaMin, etaMax;
38  std::vector<std::pair<int, int> > layer;
39  std::vector<std::pair<int,double> > phis;
40  HcalEtaBin(int eta=0, int zs=1, double dfi=0, double et1=0,
41  double et2=0) : ieta(eta), zside(zs), depthStart(0), dphi(dfi),
42  etaMin(et1), etaMax(et2) {}
43  };
45  int ieta, depth, zside, stype;
46  double eta, thick;
47  std::vector<int> iphis;
48  HcalActiveLength(int ie=0, int d=0, int z=0, int s=0, double et=0,
49  double t=0) : ieta(ie), depth(d), zside(z), stype(s),
50  eta(et), thick(t) {}
51  };
53  int ieta, depth, firstPhi, stepPhi, nPhi;
54  double rMin, rMax;
55  HFCellParameters(int ie=0, int d=1, int ffi=1, int sfi=2, int nfi=36,
56  double r1=0, double r2=0) : ieta(ie), depth(d),
57  firstPhi(ffi), stepPhi(sfi),
58  nPhi(nfi), rMin(r1), rMax(r2) {}
59  };
60 
61  std::vector<std::pair<double,double> > getConstHBHE(const int& type) const {
62  if (type == 0) return gconsHB;
63  else if (type == 1) return gconsHE;
64  else {std::vector<std::pair<double,double> > gcons; return gcons;}
65  }
66  std::vector<int> getDepth(const int& det, const int& phi,
67  const int& zside, const unsigned int& eta) const;
68  std::vector<int> getDepth(const unsigned int& eta, const bool& extra) const;
69  int getDepthEta16(const int& det, const int& iphi,
70  const int& zside) const {return hcons.getDepthEta16(det,iphi,zside);}
71  std::vector<HcalEtaBin> getEtaBins(const int& itype) const;
72  std::pair<double,double> getEtaPhi(const int& subdet, const int& ieta, const int& iphi) const;
73  std::pair<int,int> getEtaRange(const int& i) const
74  {return std::pair<int,int>(iEtaMin[i],iEtaMax[i]);}
75  const std::vector<double> & getEtaTable() const {return etaTable;}
76  const std::vector<double> & getEtaTableHF() const {return hpar->etaTableHF;}
77  std::pair<double,double> getEtaLimit(const int& i) const
78  {return std::pair<double,double>(etaTable[i],etaTable[i+1]);}
79  HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const;
80  std::vector<HFCellParameters> getHFCellParameters() const;
81  void getLayerDepth(const int& ieta, std::map<int,int>& layers) const;
82  int getLayerFront(const int& det, const int& eta, const int& phi,
83  const int& depth) const;
84  double getLayer0Wt(const int& det, const int& phi,
85  const int& zside) const {return hcons.getLayer0Wt(det,phi,zside);}
86  int getMaxDepth(const int& type) const {return maxDepth[type];}
87  int getMaxDepth(const int& itype, const int& ieta,
88  const int& iphi, const int& zside) const;
89  int getMinDepth(const int& itype, const int& ieta,
90  const int& iphi, const int& zside) const;
91  int getNEta() const {return hpar->etagroup.size();}
92  int getNoff(const int& i) const {return hpar->noff[i];}
93  int getNPhi(const int& type) const {return nPhiBins[type];}
94  double getPhiBin(const int& i) const {return phibin[i];}
95  double getPhiOff(const int& i) const {return hpar->phioff[i];}
96  const std::vector<double> & getPhiOffs() const {return hpar->phioff;}
97  std::vector<std::pair<int,double> > getPhis(const int& subdet, const int& ieta) const;
98  const std::vector<double> & getPhiTable() const {return phibin;}
99  const std::vector<double> & getPhiTableHF() const {return hpar->phitable;}
100  int getPhiZOne(std::vector<std::pair<int,int> >& phiz) const;
101  double getRZ(const int& subdet, const int& ieta, const int& depth) const;
102  double getRZ(const int& subdet, const int& ieta, const int& iphi,
103  const int& depth) const;
104  double getRZ(const int& subdet, const int& layer) const;
105  std::vector<HcalActiveLength> getThickActive(const int& type) const;
106  int getTopoMode() const {return ((hpar->topologyMode)&0xFF);}
107  int getTriggerMode() const {return (((hpar->topologyMode)>>8)&0xFF);}
108  std::vector<HcalCellType> HcalCellTypes(HcalSubdetector) const;
109  bool isBH() const {return hcons.isBH();}
110  bool isPlan1(const HcalDetId& id) const { return detIdSp_.find(id) != detIdSp_.end(); };
111  int maxHFDepth(int ieta, int iphi) const {return hcons.maxHFDepth(ieta,iphi);}
112  unsigned int numberOfCells(HcalSubdetector) const;
113  unsigned int nCells(HcalSubdetector) const;
114  unsigned int nCells() const;
115  HcalDetId mergedDepthDetId(const HcalDetId& id) const;
116  HcalDetId idFront(const HcalDetId& id) const;
117  HcalDetId idBack (const HcalDetId& id) const;
118  void unmergeDepthDetId(const HcalDetId& id,
119  std::vector<HcalDetId>& ids) const;
120  void specialRBXHBHE(const std::vector<HcalDetId>&,
121  std::vector<HcalDetId> &) const;
122  bool specialRBXHBHE(bool flag,
123  std::vector<HcalDetId> &) const;
124  bool withSpecialRBXHBHE() const {return (hcons.ldMap()->getSubdet() != 0);}
125  bool isPlan1ToBeMergedId(const HcalDetId& id) const { return detIdSp_.find(id) != detIdSp_.end(); };
126  bool isPlan1MergedId(const HcalDetId& id) const { return detIdSpR_.find(id) != detIdSpR_.end(); };
127  const HcalDDDSimConstants* dddConstants() const {return &hcons;}
128 
129 private:
130 
131  void getOneEtaBin(HcalSubdetector subdet, int ieta, int zside,
132  std::vector<std::pair<int,double>>& phis,
133  std::map<int,int>& layers, bool planOne,
134  std::vector<HcalDDDRecConstants::HcalEtaBin>& bins) const;
135  void initialize(void);
136  unsigned int layerGroupSize(int eta) const;
137  unsigned int layerGroup(int eta, int i) const;
138 
139  static const int maxLayer_=18;
140  static const int maxLayerHB_=16;
143  std::vector<std::pair<int,int> > etaSimValu; // eta ranges at Sim stage
144  std::vector<double> etaTable; // Eta table (HB+HE)
145  std::vector<int> ietaMap; // Map Sim level ieta to Rec level ieta
146  std::vector<int> iEtaMin, iEtaMax; // Minimum and maximum eta
147  std::vector<int> maxDepth; // Maximum depth in HB/HE/HF/HO
148  std::vector<int> nPhiBins; // Number of phi bis for HB/HE/HF/HO
149  std::vector<double> phibin; // Phi step for all eta bins (HB, HE, HO)
150  std::vector<int> phiUnitS; // Phi unit at SIM stage
151  std::vector<std::pair<double,double> > gconsHB; // Geometry constatnts HB
152  std::vector<std::pair<double,double> > gconsHE; // Geometry constatnts HE
153  int nModule[2], nHalves[2]; // Modules, Halves for HB/HE
154  std::pair<int,int> depthMaxDf_, depthMaxSp_; // (subdet,maximum depth) default,special
155  std::map<HcalDetId,HcalDetId> detIdSp_; // Map of Id's for special RBX
156  std::map<HcalDetId,std::vector<HcalDetId>> detIdSpR_; // Reverse map for RBX
157 };
158 
159 #endif
type
Definition: HCALResponse.h:21
std::vector< int > getDepth(const int &det, const int &phi, const int &zside, const unsigned int &eta) const
std::vector< std::pair< double, double > > getConstHBHE(const int &type) const
std::vector< int > iEtaMin
std::vector< int > etagroup
std::pair< int, int > depthMaxSp_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
std::pair< double, double > getEtaPhi(const int &subdet, const int &ieta, const int &iphi) const
std::vector< std::pair< int, int > > etaSimValu
HcalDetId mergedDepthDetId(const HcalDetId &id) const
const std::vector< double > & getEtaTableHF() const
double getPhiOff(const int &i) const
unsigned int layerGroup(int eta, int i) const
void getOneEtaBin(HcalSubdetector subdet, int ieta, int zside, std::vector< std::pair< int, double >> &phis, std::map< int, int > &layers, bool planOne, std::vector< HcalDDDRecConstants::HcalEtaBin > &bins) const
static const int maxLayer_
int getSubdet() const
std::vector< int > maxDepth
std::vector< double > etaTableHF
HcalEtaBin(int eta=0, int zs=1, double dfi=0, double et1=0, double et2=0)
const std::vector< double > & getPhiOffs() const
std::pair< int, int > getEtaRange(const int &i) const
std::vector< int > phiUnitS
const HcalParameters * hpar
std::vector< std::pair< double, double > > gconsHE
std::vector< HcalEtaBin > getEtaBins(const int &itype) const
std::vector< double > phibin
bool isPlan1MergedId(const HcalDetId &id) const
HFCellParameters(int ie=0, int d=1, int ffi=1, int sfi=2, int nfi=36, double r1=0, double r2=0)
void specialRBXHBHE(const std::vector< HcalDetId > &, std::vector< HcalDetId > &) const
unsigned int numberOfCells(HcalSubdetector) const
HcalDetId idFront(const HcalDetId &id) const
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
double getRZ(const int &subdet, const int &ieta, const int &depth) const
HcalActiveLength(int ie=0, int d=0, int z=0, int s=0, double et=0, double t=0)
std::vector< HFCellParameters > getHFCellParameters() const
std::vector< int > iEtaMax
int getDepthEta16(const int &det, const int &iphi, const int &zside) const
HcalSubdetector
Definition: HcalAssistant.h:31
std::map< HcalDetId, HcalDetId > detIdSp_
std::vector< int > ietaMap
std::vector< int > nPhiBins
std::vector< std::pair< int, int > > layer
double getLayer0Wt(const int &det, const int &phi, const int &zside) const
void getLayerDepth(const int &ieta, std::map< int, int > &layers) const
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
int getLayerFront(const int &det, const int &eta, const int &phi, const int &depth) const
double getLayer0Wt(const int &det, const int &phi, const int &zside) const
std::vector< std::pair< int, double > > getPhis(const int &subdet, const int &ieta) const
HcalDetId idBack(const HcalDetId &id) const
double getPhiBin(const int &i) const
std::vector< double > phioff
unsigned int layerGroupSize(int eta) const
const std::vector< double > & getPhiTable() const
std::pair< double, double > getEtaLimit(const int &i) const
int getNoff(const int &i) const
std::vector< double > etaTable
HcalDDDRecConstants(const HcalParameters *hp, const HcalDDDSimConstants &hc)
HcalID(int sub=0, int et=0, int fi=0, int d=0)
int getMaxDepth(const int &type) const
void unmergeDepthDetId(const HcalDetId &id, std::vector< HcalDetId > &ids) const
const std::vector< double > & getEtaTable() const
et
define resolution functions of each parameter
std::vector< double > phitable
const std::vector< double > & getPhiTableHF() const
const HcalDDDSimConstants & hcons
susybsm::HSCParticleCollection hc
Definition: classes.h:25
std::pair< int, int > depthMaxDf_
std::vector< int > noff
bool isPlan1ToBeMergedId(const HcalDetId &id) const
const HcalDDDSimConstants * dddConstants() const
std::vector< HcalActiveLength > getThickActive(const int &type) const
bool isPlan1(const HcalDetId &id) const
std::vector< std::pair< double, double > > gconsHB
int maxHFDepth(int ieta, int iphi) const
bool withSpecialRBXHBHE() const
int maxHFDepth(const int &ieta, const int &iphi) const
static const int maxLayerHB_
std::vector< std::pair< int, double > > phis
unsigned int nCells() const
int getNPhi(const int &type) const
int getPhiZOne(std::vector< std::pair< int, int > > &phiz) const
int getDepthEta16(const int &det, const int &phi, const int &zside) const
const HcalLayerDepthMap * ldMap() const