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>
20 
21 #include <unordered_map>
22 
24 
25 public:
26 
29 
30  std::pair<int,int> assignCell(float x, float y, int lay, int subSec,
31  bool reco) const;
32  std::pair<int,int> assignCellSquare(float x, float y, float h, float bl,
33  float tl, float alpha,
34  float cellSize) const;
35  std::pair<int,int> assignCellHexagon(float x, float y) const;
36  double cellSizeHex(int type) const;
37  std::pair<int,int> findCell(int cell, int lay, int subSec, bool reco) const;
38  std::pair<int,int> findCellSquare(int cell, float h, float bl, float tl,
39  float alpha, float cellSize) const;
41  bool isValid(int lay, int mod, int cell, bool reco) const;
42  bool isValidCell(int layindex, int wafer, int cell) const;
43  unsigned int layers(bool reco) const;
44  unsigned int layersInit(bool reco) const;
45  std::pair<float,float> locateCell(int cell, int lay, int type,
46  bool reco) const;
47  std::pair<float,float> locateCellHex(int cell, int wafer, bool reco) const;
48  int levelTop() const {return hgpar_->levelT_;}
49  int maxCells(bool reco) const;
50  int maxCells(int lay, bool reco) const;
51  int maxCellsSquare(float h, float bl, float tl, float alpha,
52  float cellSize) const;
53  int maxModules() const {return modHalf_;}
54  int maxRows(int lay, bool reco) const;
55  double minSlope() const {return hgpar_->slopeMin_;}
56  int modules(int lay, bool reco) const;
57  int modulesInit(int lay, bool reco) const;
58  std::pair<int,int> newCell(int cell, int layer, int sector, int subsector,
59  int incrx, int incry, bool half) const;
60  std::pair<int,int> newCell(int cell, int layer, int subsector, int incrz,
61  bool half) const;
62  int newCell(int kx, int ky, int lay, int subSec) const;
63  std::vector<int> numberCells(int lay, bool reco) const;
64  std::vector<int> numberCellsSquare(float h, float bl, float tl,
65  float alpha, float cellSize) const;
66  int numberCellsHexagon(int wafer) const;
67  std::pair<int,int> rowColumnWafer(const int wafer) const;
68  int sectors() const {return hgpar_->nSectors_;}
69  std::pair<int,int> simToReco(int cell, int layer, int mod, bool half) const;
70  unsigned int volumes() const {return hgpar_->moduleLayR_.size();}
71  int waferFromCopy(int copy) const;
72  void waferFromPosition(const double x, const double y,
73  int& wafer, int& icell,
74  int& celltyp) const;
75  bool waferInLayer(int wafer, int lay, bool reco) const;
76  int waferCount(const int type) const {return ((type == 0) ? waferMax_[2] : waferMax_[3]);}
77  int waferMax() const {return waferMax_[1];}
78  int waferMin() const {return waferMax_[0];}
79  std::pair<double,double> waferPosition(int wafer, bool reco=true) const;
80  int wafers() const;
81  int wafers(int layer, int type) const;
82  int waferToCopy(int wafer) const {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
83  // wafer transverse thickness classification (2 = coarse, 1 = fine)
84  int waferTypeT(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;}
85  // wafer longitudinal thickness classification (1 = 100um, 2 = 200um, 3=300um)
86  int waferTypeL(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;}
87  bool isHalfCell(int waferType, int cell) const;
88  double waferZ(int layer, bool reco) const;
89 
90  HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const;
91  std::vector<HGCalParameters::hgtrap> getModules() const;
92 
93  unsigned int getTrFormN() const {return hgpar_->trformIndex_.size();}
94  HGCalParameters::hgtrform getTrForm(unsigned int k) const {return hgpar_->getTrForm(k);}
95  std::vector<HGCalParameters::hgtrform> getTrForms() const ;
96 
97  std::pair<int,float> getIndex(int lay, bool reco) const;
98 
99 private:
100  int cellHex(double xx, double yy, const double& cellR,
101  const std::vector<double>& posX,
102  const std::vector<double>& posY) const;
103  void getParameterSquare(int lay, int subSec, bool reco, float& h, float& bl,
104  float& tl, float& alpha) const;
105  bool waferInLayer(int wafer, int lay) const;
106 
107  typedef std::array<std::vector<int32_t>, 2> Simrecovecs;
108  typedef std::array<int,3> HGCWaferParam;
110  constexpr static double tan30deg_ = 0.5773502693;
111  double rmax_, hexside_;
114  std::array<uint32_t,2> tot_layers_;
115  Simrecovecs max_modules_layer_;
116  std::map<int,HGCWaferParam> waferLayer_;
117  std::array<int,4> waferMax_;
118 };
119 
120 #endif
bool isHalfCell(int waferType, int cell) const
type
Definition: HCALResponse.h:21
float alpha
Definition: AMPTWrapper.h:95
bool isValid(int lay, int mod, int cell, bool reco) const
std::vector< int > numberCellsSquare(float h, float bl, float tl, float alpha, float cellSize) const
std::vector< HGCalParameters::hgtrap > getModules() const
int maxCellsSquare(float h, float bl, float tl, float alpha, float cellSize) const
std::array< uint32_t, 2 > tot_layers_
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_
unsigned int layersInit(bool reco) const
std::array< std::vector< int32_t >, 2 > Simrecovecs
std::array< int, 4 > waferMax_
int maxRows(int lay, bool reco) const
std::vector< int > numberCells(int lay, bool reco) const
std::pair< int, int > findCellSquare(int cell, float h, float bl, float tl, float alpha, float cellSize) const
std::pair< int, int > assignCellSquare(float x, float y, float h, float bl, float tl, float alpha, float cellSize) 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_
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
std::pair< float, float > locateCellHex(int cell, int wafer, 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
unsigned int layers(bool reco) const
int numberCellsHexagon(int wafer) const
std::vector< HGCalParameters::hgtrform > getTrForms() const
std::pair< int, int > assignCellHexagon(float x, float y) const
std::pair< double, double > waferPosition(int wafer, bool reco=true) const
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
hgtrform getTrForm(unsigned int k) const
std::pair< int, int > findCell(int cell, int lay, int subSec, bool reco) const
std::pair< int, float > getIndex(int lay, bool reco) const
HGCalDDDConstants(const HGCalParameters *hp, const std::string &name)
double minSlope() const
HGCalGeometryMode::GeometryMode geomMode() const
bool isValidCell(int layindex, int wafer, int cell) const
int waferTypeL(int wafer) const
int sectors() const
std::pair< int, int > rowColumnWafer(const int wafer) const
double waferZ(int layer, bool reco) const
int k[5][pyjets_maxn]
int waferMin() const
int waferFromCopy(int copy) const
int waferMax() const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
int waferToCopy(int wafer) const
std::pair< int, int > newCell(int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
int waferCount(const int type) const
int levelTop() const
fixed size matrix
std::vector< int > waferCopy_
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
std::vector< int > waferTypeT_
int maxModules() 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
int waferTypeT(int wafer) const
std::vector< int > waferTypeL_
static double tan30deg_
std::array< int, 3 > HGCWaferParam
bool waferInLayer(int wafer, int lay, bool reco) const
unsigned int volumes() const