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) const;
70  std::pair<float,float> locateCellHex(int cell, int wafer, bool reco) const;
71  std::pair<float,float> locateCellTrap(int lay, int ieta, int iphi,
72  bool reco) const;
73  int levelTop(int ind=0) const {return hgpar_->levelT_[ind];}
74  int maxCellUV() const {
76  2*hgpar_->nCellsFine_);}
77  int maxCells(bool reco) const;
78  int maxCells(int lay, bool reco) const;
79  int maxModules() const {return modHalf_;}
80  int maxMoudlesPerLayer() const {return maxWafersPerLayer_;}
81  int maxRows(int lay, bool reco) const;
82  double minSlope() const {return hgpar_->slopeMin_;}
83  int modules(int lay, bool reco) const;
84  int modulesInit(int lay, bool reco) const;
85  double mouseBite(bool reco) const;
86  int numberCells(bool reco) const;
87  std::vector<int> numberCells(int lay, bool reco) const;
88  int numberCellsHexagon(int wafer) const;
89  int numberCellsHexagon(int lay, int waferU, int waferV,
90  bool flag) const;
91  std::pair<int,int> rowColumnWafer(const int wafer) const;
92  int scintType(const float dPhi) const
93  { return ((dPhi < dPhiMin) ? 0 : 1); }
94  int sectors() const {return hgpar_->nSectors_;}
95  std::pair<int,int> simToReco(int cell, int layer, int mod, bool half) const;
96  unsigned int volumes() const {return hgpar_->moduleLayR_.size();}
97  int waferFromCopy(int copy) const;
98  void waferFromPosition(const double x, const double y,
99  int& wafer, int& icell,
100  int& celltyp) const;
101  void waferFromPosition(const double x, const double y,
102  const int layer, int& waferU,
103  int& waferV, int& cellU, int& cellV,
104  int& celltype, double& wt) const;
105  bool waferInLayer(int wafer, int lay, bool reco) const;
106  bool waferFullInLayer(int wafer, int lay, bool reco) const;
107  int waferCount(const int type) const {return ((type == 0) ? waferMax_[2] : waferMax_[3]);}
108  int waferMax() const {return waferMax_[1];}
109  int waferMin() const {return waferMax_[0];}
110  std::pair<double,double> waferPosition(int wafer, bool reco) const;
111  std::pair<double,double> waferPosition(int waferU, int waferV, bool reco) const;
113  double waferSize(bool reco) const {return (reco ? hgpar_->waferSize_ : HGCalParameters::k_ScaleToDDD*hgpar_->waferSize_);}
114  int wafers() const;
115  int wafers(int layer, int type) const;
116  int waferToCopy(int wafer) const {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
117  // wafer transverse thickness classification (2 = coarse, 1 = fine)
118  int waferTypeT(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;}
119  // wafer longitudinal thickness classification (1 = 100um, 2 = 200um, 3=300um)
120  int waferTypeL(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;}
121  int waferType(DetId const& id) const;
122  int waferUVMax() const {return hgpar_->waferUVMax_;}
123  double waferZ(int layer, bool reco) const;
124 
125 private:
126  int cellHex(double xx, double yy, const double& cellR,
127  const std::vector<double>& posX,
128  const std::vector<double>& posY) const;
129  void cellHex(double xloc, double yloc, int cellType, int& cellU,
130  int& cellV) const;
131  std::pair<int,float> getIndex(int lay, bool reco) const;
132  bool isValidCell(int layindex, int wafer, int cell) const;
133  bool waferInLayerTest(int wafer, int lay, bool full) const;
134 
135  const double k_horizontalShift = 1.0;
136  const float dPhiMin = 0.02;
137  typedef std::array<std::vector<int32_t>, 2> Simrecovecs;
138  typedef std::array<int,3> HGCWaferParam;
140  constexpr static double tan30deg_ = 0.5773502693;
141  const double sqrt3_;
142  double rmax_, hexside_;
145  std::array<uint32_t,2> tot_layers_;
146  Simrecovecs max_modules_layer_;
148  std::map<int,HGCWaferParam> waferLayer_;
149  std::array<int,4> waferMax_;
150  std::unordered_map<int32_t,bool> waferIn_;
151 };
152 
153 #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
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
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
int scintType(const float dPhi) 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
Definition: DetId.h:18
int waferFromCopy(int copy) const
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