1 #ifndef HGCalCommonData_HGCalDDDConstants_h 2 #define HGCalCommonData_HGCalDDDConstants_h 23 #include <CLHEP/Geometry/Point3D.h> 27 #include <unordered_map> 34 std::pair<int, int>
assignCell(
float x,
float y,
int lay,
int subSec,
bool reco)
const;
35 std::array<int, 5>
assignCellHex(
float x,
float y,
int lay,
bool reco,
bool extend =
false,
bool debug =
false)
const;
60 std::vector<HGCalParameters::hgtrap>
getModules()
const;
70 std::vector<HGCalParameters::hgtrform>
getTrForms()
const;
73 std::pair<double, double>
getXY(
int layer,
double x,
double y,
bool forwd)
const;
78 bool isValidHex8(
int lay,
int modU,
int modV,
int cellU,
int cellV,
bool fullAndPart =
false)
const;
95 bool debug =
false)
const;
109 int modifyUV(
int uv,
int type1,
int type2)
const;
117 std::pair<double, double>
rangeR(
double z,
bool reco)
const;
119 std::pair<double, double>
rangeZ(
bool reco)
const;
136 return std::make_pair(0, 0);
145 int type(-1), sipm(-1);
151 return std::make_pair(
type, sipm);
155 void waferFromPosition(
const double x,
const double y,
int& wafer,
int& icell,
int& celltyp)
const;
166 bool debug =
false)
const;
184 if (kk < hgpar_->waferInfoMap_.size()) {
186 std::advance(itr,
kk);
192 if (kk < hgpar_->waferInfoMap_.size()) {
194 std::advance(itr,
kk);
195 return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
197 return std::make_tuple(0, 0, 0);
202 return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
204 return std::make_tuple(0, 0, 0);
211 HepGeom::Point3D<float>& loc,
const DetId&
id,
bool useWafer,
bool reco,
bool debug)
const {
219 auto xy =
getXY(detid.
layer(), (
x + loc.x()), (
y + loc.y()),
false);
222 double xx = (detid.
zside() < 0) ? -
xy.first :
xy.first;
231 return ((wafer >= 0) && (wafer < static_cast<int>(
hgpar_->
waferCopy_.size())))
256 const std::vector<double>&
posX,
257 const std::vector<double>&
posY)
const;
259 double xloc,
double yloc,
int cellType,
int& cellU,
int& cellV,
bool extend =
false,
bool debug =
false)
const;
260 std::pair<int, float>
getIndex(
int lay,
bool reco)
const;
262 bool isValidCell(
int layindex,
int wafer,
int cell)
const;
bool maskCell(const DetId &id, int corners) const
std::pair< double, double > rangeRLayer(int lay, bool reco) const
double waferZ(int layer, bool reco) const
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
std::pair< double, double > rangeZ(bool reco) const
unsigned int layersInit(bool reco) const
int waferToCopy(int wafer) const
bool isValidCell(int layindex, int wafer, int cell) const
std::pair< double, double > cellSizeTrap(int type, int irad) const
int getPhiBins(int lay) const
std::pair< double, double > cellEtaPhiTrap(int type, int irad) const
unsigned int volumes() const
int scintType(const int layer) const
const HGCalParameters * getParameter() const
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< double, double > waferParameters(bool reco) const
std::vector< int > moduleLayR_
bool waferFullInLayer(int wafer, int lay, bool reco) const
int32_t maxWafersPerLayer_
double distFromEdgeTrap(double x, double y, double z) const
Simrecovecs max_modules_layer_
HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
std::array< std::vector< int32_t >, 2 > Simrecovecs
int32_t waferU(const int32_t index)
bool isValidHex(int lay, int mod, int cell, bool reco) const
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart=false) const
std::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
int getLayerOffset() const
std::pair< int, int > getREtaRange(int lay) const
int lastLayer(bool reco) const
int waferTypeT(int wafer) const
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
bool waferHexagon8() const
int modulesInit(int lay, bool reco) const
std::unordered_map< int32_t, bool > waferIn_
int layerFromIndex(int index, bool reco) const
std::vector< uint32_t > trformIndex_
HGCalGeometryMode::GeometryMode geomMode() const
int32_t cellType(int type, int waferU, int waferV, int iz, int fwdBack, int orient) const
bool waferHexagon6() const
const std::vector< double > & getRadiusLayer(int layer) const
hgtrform getTrForm(unsigned int k) const
constexpr std::array< uint8_t, layerIndexSize > layer
HGCalGeomTools geomTools_
std::tuple< int, int, int > waferFileInfoFromIndex(int kk) const
bool waferInLayer(int wafer, int lay, bool reco) const
std::pair< int, int > tileType(int layer, int ring, int phi) const
std::map< int, HGCWaferParam > waferLayer_
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
std::vector< std::pair< int, int > > tileRingRange_
int layer() const
get the layer #
unsigned int waferFileSize() const
int getTypeHex(int layer, int waferU, int waferV) const
bool isHalfCell(int waferType, int cell) const
int maxCells(bool reco) const
bool waferFileInfoExist(int kk) const
int waferFileIndex(unsigned int kk) const
std::pair< int, int > tileRings(int layer) const
int maxModulesPerLayer() const
HGCalDDDConstants(const HGCalParameters *hp, const std::string &name)
int layerIndex(int lay, bool reco) const
std::pair< float, float > localToGlobal8(int lay, int waferU, int waferV, double localX, double localY, bool reco, bool debug) const
int waferType(DetId const &id, bool fromFile=false) const
bool isValidTrap(int lay, int ieta, int iphi) const
int getUVMax(int type) const
bool isValidCell8(int lay, int waferU, int waferV, int cellU, int cellV, int type) const
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
std::pair< int, float > getIndex(int lay, bool reco) const
int tileSiPM(int sipm) const
bool waferVirtual(int layer, int waferU, int waferV) const
int tileCount(int layer, int ring) const
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
std::vector< HGCalParameters::hgtrap > getModules() const
double mouseBite(bool reco) const
unsigned int layers(bool reco) const
bool tileTrapezoid() const
int getTypeTrap(int layer) const
double cellSizeHex(int type) const
std::pair< double, double > rangeR(double z, bool reco) const
std::pair< double, double > waferPosition(int wafer, bool reco) const
void etaPhiFromPosition(const double x, const double y, const double z, const int layer, int &ieta, int &iphi, int &type, double &wt) const
std::vector< double > slopeMin_
std::array< int, 4 > waferMax_
static constexpr double k_ScaleToDDD
int numberCellsHexagon(int wafer) const
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
bool tileExist(int zside, int layer, int ring, int phi) const
bool cellInLayer(int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
GlobalPoint waferLocal2Global(HepGeom::Point3D< float > &loc, const DetId &id, bool useWafer, bool reco, bool debug) const
constexpr uint16_t localX(uint16_t px)
int numberCells(bool reco) const
int zside() const
get the z-side of the cell (1/-1)
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
double cellThickness(int layer, int waferU, int waferV) const
constexpr uint16_t localY(uint16_t py, uint16_t n)
std::pair< int, int > rowColumnWafer(const int wafer) const
unsigned int getTrFormN() const
HGCalParameters::hgtrform getTrForm(unsigned int k) const
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
int maxRows(int lay, bool reco) const
const HGCalGeometryMode::GeometryMode mode_
int32_t waferIndex(int wafer, int index) const
std::array< int, 5 > assignCellHex(float x, float y, int lay, bool reco, bool extend=false, bool debug=false) const
std::vector< HGCalParameters::hgtrform > getTrForms() const
double waferSepar(bool reco) const
int getLayer(double z, bool reco) const
std::array< int, 3 > HGCWaferParam
int32_t waferV(const int32_t index)
int waferTypeL(int wafer) const
std::vector< int > waferCopy_
bool tileExist(const int32_t *hex, int32_t zside, int32_t phi)
static constexpr double tan30deg_
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
const double k_horizontalShift
std::vector< double > radiusLayer_[2]
std::array< uint32_t, 2 > tot_layers_
std::vector< int > waferTypeT_
int modules(int lay, bool reco) const
std::vector< int > levelT_
int modifyUV(int uv, int type1, int type2) const
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
int levelTop(int ind=0) const
T mod(const T &a, const T &b)
tileInfo_map tileInfoMap_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
std::vector< int > waferTypeL_
std::tuple< int, int, int > waferFileInfo(unsigned int kk) const
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
double waferSize(bool reco) const
double distFromEdgeHex(double x, double y, double z) const
int waferFromCopy(int copy) const
int waferCount(const int type) const