CMS 3D CMS Logo

HGCalDDDConstants.h
Go to the documentation of this file.
1 #ifndef HGCalCommonData_HGCalDDDConstants_h
2 #define HGCalCommonData_HGCalDDDConstants_h
3 
14 #include <string>
15 #include <vector>
16 #include <iostream>
21 
22 #include <unordered_map>
23 
25 
26 public:
27 
30 
31  std::pair<int,int> assignCell(float x, float y, int lay, int subSec,
32  bool reco) const;
33  std::array<int,5> assignCellHex(float x, float y, int lay,
34  bool reco) const;
35  std::array<int,3> assignCellTrap(float x, float y, float z, int lay,
36  bool reco) const;
37  bool cellInLayer(int waferU, int waferV, int cellU, int cellV,
38  int lay, bool reco) const;
39  double cellSizeHex(int type) const;
40  double cellThickness(int layer, int waferU, int waferV) const;
41  double distFromEdgeHex(double x, double y, double z) const;
42  double distFromEdgeTrap(double x, double y, double z) const;
43  void etaPhiFromPosition(const double x, const double y,
44  const double z, const int layer,
45  int& ieta, int& iphi, int& type,
46  double& wt) const;
47  int firstLayer() const {return hgpar_->firstLayer_;}
49  int getLayer(double z, bool reco) const;
50  HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const;
51  std::vector<HGCalParameters::hgtrap> getModules() const;
52  const HGCalParameters* getParameter() const {return hgpar_;}
53  HGCalParameters::hgtrform getTrForm(unsigned int k) const {return hgpar_->getTrForm(k);}
54  unsigned int getTrFormN() const {return hgpar_->trformIndex_.size();}
55  std::vector<HGCalParameters::hgtrform> getTrForms() const ;
56  int getTypeTrap(int layer) const;
57  int getTypeHex(int layer, int waferU, int waferV) const;
58  bool isHalfCell(int waferType, int cell) const;
59  bool isValidHex(int lay, int mod, int cell, bool reco) const;
60  bool isValidHex8(int lay, int modU, int modV, int cellU,
61  int cellV) const;
62  bool isValidTrap(int lay, int ieta, int iphi) const;
63  int layerIndex(int lay, bool reco) const;
64  unsigned int layers(bool reco) const;
65  unsigned int layersInit(bool reco) const;
66  std::pair<float,float> locateCell(int cell, int lay, int type,
67  bool reco) const;
68  std::pair<float,float> locateCell(int lay, int waferU, int waferV, int cellU,
69  int cellV, bool reco, bool all,
70  bool debug=false) const;
71  std::pair<float,float> locateCellHex(int cell, int wafer, bool reco) const;
72  std::pair<float,float> locateCellTrap(int lay, int ieta, int iphi,
73  bool reco) const;
74  int levelTop(int ind=0) const {return hgpar_->levelT_[ind];}
75  int maxCellUV() const {
77  2*hgpar_->nCellsFine_);}
78  int maxCells(bool reco) const;
79  int maxCells(int lay, bool reco) const;
80  int maxModules() const {return modHalf_;}
81  int maxMoudlesPerLayer() const {return maxWafersPerLayer_;}
82  int maxRows(int lay, bool reco) const;
83  double minSlope() const {return hgpar_->slopeMin_[0];}
84  int modules(int lay, bool reco) const;
85  int modulesInit(int lay, bool reco) const;
86  double mouseBite(bool reco) const;
87  int numberCells(bool reco) const;
88  std::vector<int> numberCells(int lay, bool reco) const;
89  int numberCellsHexagon(int wafer) const;
90  int numberCellsHexagon(int lay, int waferU, int waferV,
91  bool flag) const;
92  std::pair<double,double> rangeR(double z, bool reco) const;
93  std::pair<double,double> rangeZ(bool reco) const;
94  std::pair<int,int> rowColumnWafer(const int wafer) const;
95  int sectors() const {return hgpar_->nSectors_;}
96  std::pair<int,int> simToReco(int cell, int layer, int mod, bool half) const;
97  unsigned int volumes() const {return hgpar_->moduleLayR_.size();}
98  int waferFromCopy(int copy) const;
99  void waferFromPosition(const double x, const double y,
100  int& wafer, int& icell,
101  int& celltyp) const;
102  void waferFromPosition(const double x, const double y,
103  const int layer, int& waferU,
104  int& waferV, int& cellU, int& cellV,
105  int& celltype, double& wt,
106  bool debug=false) const;
107  bool waferInLayer(int wafer, int lay, bool reco) const;
108  bool waferFullInLayer(int wafer, int lay, bool reco) const;
109  int waferCount(const int type) const {return ((type == 0) ? waferMax_[2] : waferMax_[3]);}
110  int waferMax() const {return waferMax_[1];}
111  int waferMin() const {return waferMax_[0];}
112  std::pair<double,double> waferPosition(int wafer, bool reco) const;
113  std::pair<double,double> waferPosition(int waferU, int waferV, bool reco) const;
115  double waferSize(bool reco) const {return (reco ? hgpar_->waferSize_ : HGCalParameters::k_ScaleToDDD*hgpar_->waferSize_);}
116  int wafers() const;
117  int wafers(int layer, int type) const;
118  int waferToCopy(int wafer) const {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
119  // wafer transverse thickness classification (2 = coarse, 1 = fine)
120  int waferTypeT(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;}
121  // wafer longitudinal thickness classification (1 = 100um, 2 = 200um, 3=300um)
122  int waferTypeL(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;}
123  int waferType(DetId const& id) const;
124  int waferUVMax() const {return hgpar_->waferUVMax_;}
125  double waferZ(int layer, bool reco) const;
126 
127 private:
128  int cellHex(double xx, double yy, const double& cellR,
129  const std::vector<double>& posX,
130  const std::vector<double>& posY) const;
131  void cellHex(double xloc, double yloc, int cellType, int& cellU,
132  int& cellV, bool debug=false) const;
133  std::pair<int,float> getIndex(int lay, bool reco) const;
134  bool isValidCell(int layindex, int wafer, int cell) const;
135  bool waferInLayerTest(int wafer, int lay, bool full) const;
136 
137  const double k_horizontalShift = 1.0;
138  const float dPhiMin = 0.02;
139  typedef std::array<std::vector<int32_t>, 2> Simrecovecs;
140  typedef std::array<int,3> HGCWaferParam;
142  constexpr static double tan30deg_ = 0.5773502693;
143  const double sqrt3_;
144  double rmax_, hexside_;
147  std::array<uint32_t,2> tot_layers_;
148  Simrecovecs max_modules_layer_;
150  std::map<int,HGCWaferParam> waferLayer_;
151  std::array<int,4> waferMax_;
152  std::unordered_map<int32_t,bool> waferIn_;
153 };
154 
155 #endif
bool isHalfCell(int waferType, int cell) const
type
Definition: HCALResponse.h:21
bool isValidTrap(int lay, int ieta, int iphi) const
int getTypeTrap(int layer) const
int getLayer(double z, bool reco) const
std::vector< HGCalParameters::hgtrap > getModules() const
std::array< uint32_t, 2 > tot_layers_
def copy(args, dbName)
std::map< int, HGCWaferParam > waferLayer_
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
std::vector< int > moduleLayR_
double cellSizeHex(int type) const
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Simrecovecs max_modules_layer_
double cellThickness(int layer, int waferU, int waferV) const
unsigned int layersInit(bool reco) const
std::array< std::vector< int32_t >, 2 > Simrecovecs
const HGCalParameters * getParameter() const
std::array< int, 4 > waferMax_
bool cellInLayer(int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
int maxRows(int lay, bool reco) const
int getTypeHex(int layer, int waferU, int waferV) const
bool waferInLayerTest(int wafer, int lay, bool full) const
int modulesInit(int lay, bool reco) const
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::vector< uint32_t > trformIndex_
bool isValidHex(int lay, int mod, int cell, bool reco) const
HGCalGeometryMode::GeometryMode mode_
#define constexpr
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
int layerIndex(int lay, bool reco) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
std::pair< double, double > rangeR(double z, bool reco) const
int modules(int lay, bool reco) const
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
unsigned int getTrFormN() const
double distFromEdgeTrap(double x, double y, double z) const
std::pair< double, double > rangeZ(bool reco) const
unsigned int layers(bool reco) const
bool isValidHex8(int lay, int modU, int modV, int cellU, int cellV) const
int numberCellsHexagon(int wafer) const
std::vector< HGCalParameters::hgtrform > getTrForms() const
double mouseBite(bool reco) const
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
hgtrform getTrForm(unsigned int k) const
std::pair< int, float > getIndex(int lay, bool reco) const
HGCalDDDConstants(const HGCalParameters *hp, const std::string &name)
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
double waferSepar(bool reco) const
Definition: GenABIO.cc:180
double minSlope() const
std::unordered_map< int32_t, bool > waferIn_
HGCalGeometryMode::GeometryMode geomMode() const
double waferSize(bool reco) const
bool isValidCell(int layindex, int wafer, int cell) const
int waferTypeL(int wafer) const
int sectors() const
int maxCellUV() const
std::pair< int, int > rowColumnWafer(const int wafer) const
double waferZ(int layer, bool reco) const
int k[5][pyjets_maxn]
int waferType(DetId const &id) const
std::vector< double > slopeMin_
Definition: DetId.h:18
int waferFromCopy(int copy) const
#define debug
Definition: HDRShower.cc:19
static double k_ScaleToDDD
int waferToCopy(int wafer) const
int waferUVMax() const
int numberCells(bool reco) const
bool waferFullInLayer(int wafer, int lay, bool reco) const
int waferCount(const int type) const
fixed size matrix
std::array< int, 5 > assignCellHex(float x, float y, int lay, bool reco) const
std::vector< int > waferCopy_
std::pair< double, double > waferPosition(int wafer, bool reco) const
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
const double k_horizontalShift
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
int maxMoudlesPerLayer() const
int firstLayer() const
std::vector< int > waferTypeT_
std::vector< int > levelT_
int maxModules() const
int levelTop(int ind=0) const
HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
const HGCalParameters * hgpar_
int maxCells(bool reco) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void etaPhiFromPosition(const double x, const double y, const double z, const int layer, int &ieta, int &iphi, int &type, double &wt) const
int waferTypeT(int wafer) const
std::vector< int > waferTypeL_
static double tan30deg_
double distFromEdgeHex(double x, double y, double z) const
std::array< int, 3 > HGCWaferParam
bool waferInLayer(int wafer, int lay, bool reco) const
unsigned int volumes() const