CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalDDDConstants Class Reference

#include <HGCalDDDConstants.h>

Public Types

typedef std::array
< std::vector< int32_t >, 2 > 
simrecovecs
 

Public Member Functions

std::pair< int, int > assignCell (float x, float y, int lay, int subSec, bool reco) const
 
std::pair< int, int > assignCellHexagon (float x, float y) const
 
std::pair< int, int > assignCellSquare (float x, float y, float h, float bl, float tl, float alpha, float cellSize) const
 
double cellSizeHex (int type) const
 
std::pair< int, int > findCell (int cell, int lay, int subSec, bool reco) const
 
std::pair< int, int > findCellSquare (int cell, float h, float bl, float tl, float alpha, float cellSize) const
 
HGCalGeometryMode geomMode () const
 
std::pair< int, float > getIndex (int lay, bool reco) const
 
HGCalParameters::hgtrap getModule (unsigned int k, bool hexType, bool reco) const
 
std::vector
< HGCalParameters::hgtrap
getModules () const
 
HGCalParameters::hgtrform getTrForm (unsigned int k) const
 
unsigned int getTrFormN () const
 
std::vector
< HGCalParameters::hgtrform
getTrForms () const
 
 HGCalDDDConstants (const HGCalParameters *hp, const std::string name)
 
bool isValid (int lay, int mod, int cell, bool reco) const
 
unsigned int layers (bool reco) const
 
unsigned int layersInit (bool reco) const
 
std::pair< float, float > locateCell (int cell, int lay, int type, bool reco) const
 
std::pair< float, float > locateCellHex (int cell, int wafer, bool reco) const
 
int maxCells (bool reco) const
 
int maxCells (int lay, bool reco) const
 
int maxCellsSquare (float h, float bl, float tl, float alpha, float cellSize) const
 
int maxRows (int lay, bool reco) const
 
int modules (int lay, bool reco) const
 
int modulesInit (int lay, bool reco) const
 
std::pair< int, int > newCell (int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
 
std::pair< int, int > newCell (int cell, int layer, int subsector, int incrz, bool half) const
 
int newCell (int kx, int ky, int lay, int subSec) const
 
std::vector< int > numberCells (int lay, bool reco) const
 
int numberCellsHexagon (int wafer) const
 
std::vector< int > numberCellsSquare (float h, float bl, float tl, float alpha, float cellSize) const
 
int sectors () const
 
std::pair< int, int > simToReco (int cell, int layer, int mod, bool half) const
 
unsigned int volumes () const
 
int waferFromCopy (int copy) const
 
bool waferInLayer (int wafer, int lay, bool reco) const
 
std::pair< double, double > waferPosition (int wafer) const
 
int wafers () const
 
int waferToCopy (int wafer) const
 
int waferTypeT (int wafer) const
 
double waferZ (int layer, bool reco) const
 
 ~HGCalDDDConstants ()
 

Private Member Functions

int cellHex (double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
 
void getParameterSquare (int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
 
bool waferInLayer (int wafer, int lay) const
 

Private Attributes

const HGCalParametershgpar_
 
simrecovecs max_modules_layer_
 
HGCalGeometryMode mode_
 
double rmax_
 
std::array< uint32_t, 2 > tot_layers_
 
int32_t tot_wafers_
 

Static Private Attributes

static double tan30deg_ = 0.5773502693
 

Detailed Description

this class reads the constant section of the numbering xml-files of the high granulairy calorimeter

Date:
2014/03/20 00:06:50
Author
Sunanda Banerjee, SINP sunan.nosp@m.da.b.nosp@m.anerj.nosp@m.ee@c.nosp@m.ern.c.nosp@m.h

Definition at line 23 of file HGCalDDDConstants.h.

Member Typedef Documentation

typedef std::array<std::vector<int32_t>, 2> HGCalDDDConstants::simrecovecs

Definition at line 27 of file HGCalDDDConstants.h.

Constructor & Destructor Documentation

HGCalDDDConstants::HGCalDDDConstants ( const HGCalParameters hp,
const std::string  name 
)

Definition at line 20 of file HGCalDDDConstants.cc.

References funct::cos(), gather_cfg::cout, hgpar_, k_ScaleFromDDD, layers(), layersInit(), max_modules_layer_, maxCells(), mode_, HGCalParameters::mode_, modulesInit(), rmax_, sectors(), Square, tot_layers_, tot_wafers_, HGCalParameters::waferR_, and wafers().

21  : hgpar_(hp) {
24  rmax_ = 0;
25 
26  for( int simreco = 0; simreco < 2; ++simreco ) {
27  tot_layers_[simreco] = layersInit((bool)simreco);
28  }
29 
30  edm::LogInfo("HGCalGeom") << "HGCalDDDConstants initialized for " << name
31  << " with " << layers(false) << ":" <<layers(true)
32  << " layers, " << sectors() << " sectors and "
33  << "maximum of " << maxCells(false) << ":"
34  << maxCells(true) << " cells";
35 #ifdef DebugLog
36  std::cout << "HGCalDDDConstants initialized for " << name << " with "
37  << layers(false) << ":" << layers(true) << " layers, "
38  << sectors() << " sectors and maximum of " << maxCells(false)
39  << ":" << maxCells(true) << " cells" << std::endl;
40 #endif
41  } else {
42  rmax_ = k_ScaleFromDDD * (hgpar_->waferR_) * std::cos(30.0*CLHEP::deg);
43 
44  // init maps and constants
45  for( int simreco = 0; simreco < 2; ++simreco ) {
46  tot_layers_[simreco] = layersInit((bool)simreco);
47  max_modules_layer_[simreco].resize(tot_layers_[simreco]+1);
48  for( unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer ) {
49  max_modules_layer_[simreco][layer] = modulesInit(layer,(bool)simreco);
50  }
51  }
52  tot_wafers_ = wafers();
53 
54  edm::LogInfo("HGCalGeom") << "HGCalDDDConstants initialized for " << name
55  << " with " << layers(false) << ":" <<layers(true)
56  << " layers, " << wafers() << " wafers and "
57  << "maximum of " << maxCells(false) << ":"
58  << maxCells(true) << " cells";
59 
60 #ifdef DebugLog
61  std::cout << "HGCalDDDConstants initialized for " << name << " with "
62  << layers(false) << ":" << layers(true) << " layers, "
63  << wafers() << " wafers and " << "maximum of " << maxCells(false)
64  << ":" << maxCells(true) << " cells" << std::endl;
65 #endif
66 
67  }
68 
69 }
std::array< uint32_t, 2 > tot_layers_
unsigned int layersInit(bool reco) const
int modulesInit(int lay, bool reco) const
unsigned int layers(bool reco) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int sectors() const
HGCalGeometryMode
HGCalGeometryMode mode_
simrecovecs max_modules_layer_
double k_ScaleFromDDD
tuple cout
Definition: gather_cfg.py:145
const HGCalParameters * hgpar_
int maxCells(bool reco) const
HGCalDDDConstants::~HGCalDDDConstants ( )

Definition at line 71 of file HGCalDDDConstants.cc.

71 {}

Member Function Documentation

std::pair< int, int > HGCalDDDConstants::assignCell ( float  x,
float  y,
int  lay,
int  subSec,
bool  reco 
) const

Definition at line 73 of file HGCalDDDConstants.cc.

References alpha, assignCellHexagon(), assignCellSquare(), getIndex(), getParameterSquare(), h, i, cmsHarvester::index, k_ScaleFromDDD, mode_, dt_dqm_sourceclient_common_cff::reco, and Square.

Referenced by HGCNumberingScheme::assignCell(), HGCalGeometry::getClosestCell(), HGCNumberingScheme::getUnitID(), and newCell().

74  {
75  std::pair<int,float> index = getIndex(lay, reco);
76  std::pair<int,int> cellAssignment(-1,-1);
77  int i = index.first;
78  if (i < 0) return cellAssignment;
80  float alpha, h, bl, tl;
81  getParameterSquare(i,subSec,reco,h,bl,tl,alpha);
82  cellAssignment = assignCellSquare(x, y, h, bl, tl, alpha, index.second);
83  } else {
84  float xx = (reco) ? x : k_ScaleFromDDD*x;
85  float yy = (reco) ? y : k_ScaleFromDDD*y;
86  cellAssignment = assignCellHexagon(xx,yy);
87  }
88  return cellAssignment;
89 }
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::pair< int, int > assignCellSquare(float x, float y, float h, float bl, float tl, float alpha, float cellSize) const
std::pair< int, int > assignCellHexagon(float x, float y) const
std::pair< int, float > getIndex(int lay, bool reco) const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
HGCalGeometryMode mode_
double k_ScaleFromDDD
std::pair< int, int > HGCalDDDConstants::assignCellHexagon ( float  x,
float  y 
) const

Definition at line 134 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, hgpar_, k_ScaleFromDDD, rmax_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, and HGCalParameters::waferTypeT_.

Referenced by assignCell().

135  {
136  double xx(x), yy(y);
137  //First the wafer
138  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
139  // Now the cell
140  xx -= hgpar_->waferPosX_[wafer];
141  yy -= hgpar_->waferPosY_[wafer];
142  int cell(0);
143  if (hgpar_->waferTypeT_[wafer] == 1)
145  else
147  return std::pair<int,int>(wafer,cell);
148 }
std::vector< double > waferPosY_
std::vector< double > cellFineY_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
std::vector< double > cellCoarseX_
std::vector< double > cellSize_
std::vector< double > cellFineX_
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< int, int > HGCalDDDConstants::assignCellSquare ( float  x,
float  y,
float  h,
float  bl,
float  tl,
float  alpha,
float  cellSize 
) const

Definition at line 91 of file HGCalDDDConstants.cc.

References a, b, h, and k_horizontalShift.

Referenced by assignCell().

94  {
95 
96  float a = (alpha==0) ? (2*h/(tl-bl)) : (h/(tl-bl));
97  float b = 2*h*bl/(tl-bl);
98 
99  float x0(x);
100  int phiSector = (x0 > 0) ? 1 : 0;
101  if (alpha < 0) {x0 -= 0.5*(tl+bl); phiSector = 0;}
102  else if (alpha > 0) {x0 += 0.5*(tl+bl); phiSector = 1;}
103 
104  //determine the i-y
105  int ky = floor((y+h)/cellSize);
106  if (ky*cellSize> y+h) ky--;
107  if (ky<0) return std::pair<int,int>(-1,-1);
108  if ((ky+1)*cellSize < (y+h) ) ky++;
109  int max_ky_allowed=floor(2*h/cellSize);
110  if (ky>max_ky_allowed-1) return std::pair<int,int>(-1,-1);
111 
112  //determine the i-x
113  //notice we substitute y by the top of the candidate cell to reduce the dead zones
114  int kx = floor(fabs(x0)/cellSize);
115  if (kx*cellSize > fabs(x0) ) kx--;
116  if (kx<0) return std::pair<int,int>(-1,-1);
117  if ((kx+1)*cellSize < fabs(x0)) kx++;
118  int max_kx_allowed=floor( ((ky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize) );
119  if (kx>max_kx_allowed-1) return std::pair<int,int>(-1,-1);
120 
121  //count cells summing in rows until required height
122  //notice the bottom of the cell must be used
123  int icell(0);
124  for (int iky=0; iky<ky; ++iky) {
125  int cellsInRow( floor( ((iky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize) ) );
126  icell += cellsInRow;
127  }
128  icell += kx;
129 
130  //return result
131  return std::pair<int,int>(phiSector,icell);
132 }
double k_horizontalShift
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
int HGCalDDDConstants::cellHex ( double  xx,
double  yy,
const double &  cellR,
const std::vector< double > &  posX,
const std::vector< double > &  posY 
) const
private

Definition at line 607 of file HGCalDDDConstants.cc.

References funct::abs(), relval_2017::k, pileupDistInMC::num, tan30deg_, and SiStripMonitorClusterAlca_cfi::xmax.

Referenced by assignCellHexagon().

610  {
611  int num(0);
612  const double tol(0.00001);
613  double cellY = 2.0*cellR*tan30deg_;
614  for (unsigned int k=0; k<posX.size(); ++k) {
615  double dx = std::abs(xx - posX[k]);
616  double dy = std::abs(yy - posY[k]);
617  if (dx <= (cellR+tol) && dy <= (cellY+tol)) {
618  double xmax = (dy<=0.5*cellY) ? cellR : (cellR-(dy-0.5*cellY)/tan30deg_);
619  if (dx <= (xmax+tol)) {
620  num = k;
621  break;
622  }
623  }
624  }
625  return num;
626 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static double tan30deg_
double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 150 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, hgpar_, and k_ScaleFromDDD.

Referenced by HGCalGeometryLoader::build().

150  {
151  int indx = (type == 1) ? 0 : 1;
152  double cell = (0.5*k_ScaleFromDDD*hgpar_->cellSize_[indx]);
153  return cell;
154 }
type
Definition: HCALResponse.h:21
std::vector< double > cellSize_
double k_ScaleFromDDD
const HGCalParameters * hgpar_
std::pair< int, int > HGCalDDDConstants::findCell ( int  cell,
int  lay,
int  subSec,
bool  reco 
) const

Definition at line 164 of file HGCalDDDConstants.cc.

References alpha, findCellSquare(), getIndex(), getParameterSquare(), h, Hexagon, i, cmsHarvester::index, and mode_.

Referenced by locateCell(), and newCell().

165  {
166 
167  std::pair<int,float> index = getIndex(lay, reco);
168  int i = index.first;
169  if (i < 0) return std::pair<int,int>(-1,-1);
171  return std::pair<int,int>(-1,-1);
172  } else {
173  float alpha, h, bl, tl;
174  getParameterSquare(i,subSec,reco,h,bl,tl,alpha);
175  return findCellSquare(cell, h, bl, tl, alpha, index.second);
176  }
177 }
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::pair< int, int > findCellSquare(int cell, float h, float bl, float tl, float alpha, float cellSize) const
std::pair< int, float > getIndex(int lay, bool reco) const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
HGCalGeometryMode mode_
std::pair< int, int > HGCalDDDConstants::findCellSquare ( int  cell,
float  h,
float  bl,
float  tl,
float  alpha,
float  cellSize 
) const

Definition at line 179 of file HGCalDDDConstants.cc.

References a, b, and k_horizontalShift.

Referenced by findCell(), and simToReco().

182  {
183 
184  //check if cell number is meaningful
185  if(cell<0) return std::pair<int,int>(-1,-1);
186 
187  //parameterization of the boundary of the trapezoid
188  float a = (alpha==0) ? (2*h/(tl-bl)) : (h/(tl-bl));
189  float b = 2*h*bl/(tl-bl);
190  int kx(cell), ky(0);
191  int kymax( floor((2*h)/cellSize) );
192  int testCell(0);
193  for (int iky=0; iky<kymax; ++iky) {
194 
195  //check if adding all the cells in this row is above the required cell
196  //notice the top of the cell is used to maximize space
197  int cellsInRow(floor(((iky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize)));
198  if (testCell+cellsInRow > cell) break;
199  testCell += cellsInRow;
200  ky++;
201  kx -= cellsInRow;
202  }
203 
204  return std::pair<int,int>(kx,ky);
205 }
double k_horizontalShift
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
HGCalGeometryMode HGCalDDDConstants::geomMode ( ) const
inline
std::pair< int, float > HGCalDDDConstants::getIndex ( int  lay,
bool  reco 
) const

Definition at line 628 of file HGCalDDDConstants.cc.

References HGCalParameters::depthIndex_, HGCalParameters::depthLayerF_, hgpar_, HGCalParameters::layerIndex_, mode_, HGCalParameters::moduleCellR_, HGCalParameters::moduleCellS_, and Square.

Referenced by assignCell(), findCell(), locateCell(), maxCells(), maxRows(), modules(), modulesInit(), newCell(), numberCells(), simToReco(), waferInLayer(), and waferZ().

628  {
629 
630  if (lay<1 || lay>(int)(hgpar_->layerIndex_.size())) return std::pair<int,float>(-1,0);
631  if (reco && lay>(int)(hgpar_->depthIndex_.size())) return std::pair<int,float>(-1,0);
632  int indx(0);
633  float cell(0);
635  indx = (reco ? hgpar_->depthIndex_[lay-1] : hgpar_->layerIndex_[lay-1]);
636  cell = (reco ? hgpar_->moduleCellR_[indx] : hgpar_->moduleCellS_[indx]);
637  } else {
638  indx = (reco ? hgpar_->depthLayerF_[lay-1] : hgpar_->layerIndex_[lay-1]);
639  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
640  }
641  return std::pair<int,float>(indx,cell);
642 }
std::vector< int > depthLayerF_
std::vector< double > moduleCellR_
std::vector< int > layerIndex_
std::vector< double > moduleCellS_
HGCalGeometryMode mode_
std::vector< int > depthIndex_
const HGCalParameters * hgpar_
HGCalParameters::hgtrap HGCalDDDConstants::getModule ( unsigned int  k,
bool  hexType,
bool  reco 
) const

Definition at line 207 of file HGCalDDDConstants.cc.

References HGCalParameters::getModule(), hgpar_, reco::if(), and HGCalParameters::waferTypeL_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::getSummary().

209  {
210 
212  if (hexType) {
213  unsigned int type = (indx < hgpar_->waferTypeL_.size()) ?
214  hgpar_->waferTypeL_[indx] : 3;
215  if (type > 0) --type;
216  mytr = hgpar_->getModule(type, true);
217  } else {
218  if (reco) mytr = hgpar_->getModule(indx,true);
219  else mytr = hgpar_->getModule(indx,false);
220  }
221  return mytr;
222 }
type
Definition: HCALResponse.h:21
hgtrap getModule(unsigned int k, bool reco) const
if(dp >Float(M_PI)) dp-
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::vector< HGCalParameters::hgtrap > HGCalDDDConstants::getModules ( ) const

Definition at line 224 of file HGCalDDDConstants.cc.

References HGCalParameters::getModule(), hgpar_, relval_2017::k, and HGCalParameters::moduleLayR_.

224  {
225 
226  std::vector<HGCalParameters::hgtrap> mytrs;
227  for (unsigned int k=0; k<hgpar_->moduleLayR_.size(); ++k)
228  mytrs.push_back(hgpar_->getModule(k,true));
229  return mytrs;
230 }
std::vector< int > moduleLayR_
hgtrap getModule(unsigned int k, bool reco) const
const HGCalParameters * hgpar_
void HGCalDDDConstants::getParameterSquare ( int  lay,
int  subSec,
bool  reco,
float &  h,
float &  bl,
float &  tl,
float &  alpha 
) const
private

Definition at line 644 of file HGCalDDDConstants.cc.

References alpha, hgpar_, HGCalParameters::moduleAlphaR_, HGCalParameters::moduleAlphaS_, HGCalParameters::moduleBlR_, HGCalParameters::moduleBlS_, HGCalParameters::moduleHR_, HGCalParameters::moduleHS_, HGCalParameters::moduleTlR_, and HGCalParameters::moduleTlS_.

Referenced by assignCell(), findCell(), locateCell(), maxCells(), and numberCells().

646  {
647  if (reco) {
648  h = hgpar_->moduleHR_[lay];
649  bl = hgpar_->moduleBlR_[lay];
650  tl = hgpar_->moduleTlR_[lay];
651  alpha= hgpar_->moduleAlphaR_[lay];
652  if ((subSec>0 && alpha<0) || (subSec<=0 && alpha>0)) alpha = -alpha;
653  } else {
654  h = hgpar_->moduleHS_[lay];
655  bl = hgpar_->moduleBlS_[lay];
656  tl = hgpar_->moduleTlS_[lay];
657  alpha= hgpar_->moduleAlphaS_[lay];
658  }
659 }
float alpha
Definition: AMPTWrapper.h:95
std::vector< double > moduleHR_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > moduleHS_
std::vector< double > moduleAlphaR_
std::vector< double > moduleBlR_
std::vector< double > moduleTlS_
std::vector< double > moduleAlphaS_
std::vector< double > moduleBlS_
const HGCalParameters * hgpar_
std::vector< double > moduleTlR_
HGCalParameters::hgtrform HGCalDDDConstants::getTrForm ( unsigned int  k) const
inline

Definition at line 80 of file HGCalDDDConstants.h.

References HGCalParameters::getTrForm(), and hgpar_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::getSummary().

80 {return hgpar_->getTrForm(k);}
hgtrform getTrForm(unsigned int k) const
const HGCalParameters * hgpar_
unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 79 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::trformIndex_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::getSummary().

79 {return hgpar_->trformIndex_.size();}
std::vector< uint32_t > trformIndex_
const HGCalParameters * hgpar_
std::vector< HGCalParameters::hgtrform > HGCalDDDConstants::getTrForms ( ) const

Definition at line 232 of file HGCalDDDConstants.cc.

References HGCalParameters::getTrForm(), hgpar_, relval_2017::k, and HGCalParameters::trformIndex_.

232  {
233 
234  std::vector<HGCalParameters::hgtrform> mytrs;
235  for (unsigned int k=0; k<hgpar_->trformIndex_.size(); ++k)
236  mytrs.push_back(hgpar_->getTrForm(k));
237  return mytrs;
238 }
std::vector< uint32_t > trformIndex_
hgtrform getTrForm(unsigned int k) const
const HGCalParameters * hgpar_
bool HGCalDDDConstants::isValid ( int  lay,
int  mod,
int  cell,
bool  reco 
) const

Definition at line 240 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCalParameters::copiesInLayers_, gather_cfg::cout, hgpar_, layers(), maxCells(), mod(), mode_, modmax, convertSQLiteXML::ok, sectors(), Square, HGCalParameters::waferCopy_, and HGCalParameters::waferTypeT_.

Referenced by HGCNumberingScheme::getUnitID(), core.AutoHandle.AutoHandle::ReallyLoad(), and HGCalTopology::valid().

240  {
241 
242  bool ok(false);
243  int cellmax(0), modmax(0);
245  cellmax = maxCells(lay,reco);
246  modmax = sectors();
247  ok = ((lay > 0 && lay <= (int)(layers(reco))) &&
248  (mod > 0 && mod <= modmax) &&
249  (cell >=0 && cell <= cellmax));
250  } else {
251  int32_t copyNumber = hgpar_->waferCopy_[mod];
252 
253 
254  ok = ((lay > 0 && lay <= (int)(layers(reco))));
255  if( ok ) {
256  const int32_t lay_idx = reco ? (lay-1)*3 + 1 : lay;
257  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
258  auto moditr = the_modules.find(copyNumber);
259  ok = (moditr != the_modules.end());
260  if (ok) {
261  cellmax = (hgpar_->waferTypeT_[mod]==1) ?
262  (int)(hgpar_->cellFineX_.size()) : (int)(hgpar_->cellCoarseX_.size());
263  ok = (cell >=0 && cell <= cellmax);
264  }
265  }
266  }
267 
268 #ifdef DebugLog
269  if (!ok) std::cout << "HGCalDDDConstants: Layer " << lay << ":"
270  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module "
271  << mod << ":" << (mod > 0 && mod <= modmax) << " Cell "
272  << cell << ":" << (cell >=0 && cell <= cellmax)
273  << ":" << maxCells(reco) << std::endl;
274 #endif
275  return ok;
276 }
layer_map copiesInLayers_
static const int modmax
Definition: herwig.h:133
std::vector< double > cellCoarseX_
unsigned int layers(bool reco) const
int sectors() const
HGCalGeometryMode mode_
std::vector< double > cellFineX_
std::vector< int > waferCopy_
tuple cout
Definition: gather_cfg.py:145
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int maxCells(bool reco) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
unsigned int HGCalDDDConstants::layers ( bool  reco) const
unsigned int HGCalDDDConstants::layersInit ( bool  reco) const

Definition at line 160 of file HGCalDDDConstants.cc.

References HGCalParameters::depthIndex_, hgpar_, and HGCalParameters::layerIndex_.

Referenced by HGCalDDDConstants().

160  {
161  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
162 }
std::vector< int > layerIndex_
std::vector< int > depthIndex_
const HGCalParameters * hgpar_
std::pair< float, float > HGCalDDDConstants::locateCell ( int  cell,
int  lay,
int  type,
bool  reco 
) const

Definition at line 278 of file HGCalDDDConstants.cc.

References alpha, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, findCell(), getIndex(), getParameterSquare(), h, hgpar_, i, cmsHarvester::index, k_ScaleFromDDD, mode_, Square, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, and y.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalGeometry::getCorners(), HGCNumberingScheme::getLocalCoords(), HGCalGeometry::getPosition(), and newCell().

279  {
280  // type refers to subsector # for square cell and wafer # for hexagon cell
281  float x(999999.), y(999999.);
282  std::pair<int,float> index = getIndex(lay, reco);
283  int i = index.first;
284  if (i < 0) return std::pair<float,float>(x,y);
286  std::pair<int,int> kxy = findCell(cell, lay, type, reco);
287  float alpha, h, bl, tl;
288  getParameterSquare(i,type,reco,h,bl,tl,alpha);
289  float cellSize = index.second;
290  x = (kxy.first+0.5)*cellSize;
291  if (alpha < 0) x -= 0.5*(tl+bl);
292  else if (alpha > 0) x -= 0.5*(tl+bl);
293  if (type != 1) x = -x;
294  y = ((kxy.second+0.5)*cellSize-h);
295  } else {
296  x = hgpar_->waferPosX_[type];
297  y = hgpar_->waferPosY_[type];
298  if (hgpar_->waferTypeT_[type] == 1) {
299  x += hgpar_->cellFineX_[cell];
300  y += hgpar_->cellFineY_[cell];
301  } else {
302  x += hgpar_->cellCoarseX_[cell];
303  y += hgpar_->cellCoarseY_[cell];
304  }
305  if (!reco) {
306  x /= k_ScaleFromDDD;
307  y /= k_ScaleFromDDD;
308  }
309  }
310  return std::pair<float,float>(x,y);
311 }
std::vector< double > waferPosY_
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
std::pair< int, int > findCell(int cell, int lay, int subSec, bool reco) const
std::pair< int, float > getIndex(int lay, bool reco) const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
HGCalGeometryMode mode_
std::vector< double > cellFineX_
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< float, float > HGCalDDDConstants::locateCellHex ( int  cell,
int  wafer,
bool  reco 
) const

Definition at line 313 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, hgpar_, k_ScaleFromDDD, HGCalParameters::waferTypeT_, x, and y.

Referenced by HGCalGeometry::getCorners(), and HGCalGeometry::getPosition().

314  {
315  float x(0), y(0);
316  if (hgpar_->waferTypeT_[wafer] == 1) {
317  x = hgpar_->cellFineX_[cell];
318  y = hgpar_->cellFineY_[cell];
319  } else {
320  x = hgpar_->cellCoarseX_[cell];
321  y = hgpar_->cellCoarseY_[cell];
322  }
323  if (!reco) {
324  x /= k_ScaleFromDDD;
325  y /= k_ScaleFromDDD;
326  }
327  return std::pair<float,float>(x,y);
328 }
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
std::vector< double > cellFineX_
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
int HGCalDDDConstants::maxCells ( bool  reco) const

Definition at line 330 of file HGCalDDDConstants.cc.

References HGCalParameters::depth_, hgpar_, i, HGCalParameters::layer_, and layers().

Referenced by HGCalDDDConstants(), HGCalTopology::HGCalTopology(), isValid(), newCell(), and HGCalGeometry::newCell().

330  {
331 
332  int cells(0);
333  for (unsigned int i = 0; i<layers(reco); ++i) {
334  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
335  if (cells < maxCells(lay, reco)) cells = maxCells(lay, reco);
336  }
337  return cells;
338 }
std::vector< int > layer_
int i
Definition: DBlmapReader.cc:9
std::vector< int > depth_
unsigned int layers(bool reco) const
const HGCalParameters * hgpar_
int maxCells(bool reco) const
int HGCalDDDConstants::maxCells ( int  lay,
bool  reco 
) const

Definition at line 340 of file HGCalDDDConstants.cc.

References alpha, HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, getIndex(), getParameterSquare(), h, hgpar_, i, cmsHarvester::index, relval_2017::k, maxCellsSquare(), mode_, Square, waferInLayer(), and HGCalParameters::waferTypeT_.

340  {
341 
342  std::pair<int,float> index = getIndex(lay, reco);
343  int i = index.first;
344  if (i < 0) return 0;
346  float h, bl, tl, alpha;
347  getParameterSquare(i,0,reco,h,bl,tl,alpha);
348  return maxCellsSquare(h, bl, tl, alpha, index.second);
349  } else {
350  unsigned int cells(0);
351  for (unsigned int k=0; k<hgpar_->waferTypeT_.size(); ++k) {
352  if (waferInLayer(k,index.first)) {
353  unsigned int cell = (hgpar_->waferTypeT_[k]==1) ?
354  (hgpar_->cellFineX_.size()) : (hgpar_->cellCoarseX_.size());
355  if (cell > cells) cells = cell;
356  }
357  }
358  return (int)(cells);
359  }
360 }
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
int maxCellsSquare(float h, float bl, float tl, float alpha, float cellSize) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
HGCalGeometryMode mode_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
bool waferInLayer(int wafer, int lay, bool reco) const
int HGCalDDDConstants::maxCellsSquare ( float  h,
float  bl,
float  tl,
float  alpha,
float  cellSize 
) const

Definition at line 362 of file HGCalDDDConstants.cc.

References a, b, and k_horizontalShift.

Referenced by maxCells().

363  {
364 
365  float a = (alpha==0) ? (2*h/(tl-bl)) : (h/(tl-bl));
366  float b = 2*h*bl/(tl-bl);
367 
368  int ncells(0);
369  //always use the top of the cell to maximize space
370  int kymax = floor((2*h)/cellSize);
371  for (int iky=0; iky<kymax; ++iky) {
372  int cellsInRow=floor(((iky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize));
373  ncells += cellsInRow;
374  }
375 
376  return ncells;
377 }
double k_horizontalShift
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
int HGCalDDDConstants::maxRows ( int  lay,
bool  reco 
) const

Definition at line 379 of file HGCalDDDConstants.cc.

References getIndex(), h, hgpar_, i, cmsHarvester::index, relval_2017::k, mode_, HGCalParameters::moduleHR_, HGCalParameters::moduleHS_, dt_dqm_sourceclient_common_cff::reco, Square, HGCalParameters::waferCopy_, and waferInLayer().

Referenced by newCell().

379  {
380 
381  int kymax(0);
382  std::pair<int,float> index = getIndex(lay, reco);
383  int i = index.first;
384  if (i < 0) return kymax;
386  float h = (reco) ? hgpar_->moduleHR_[i] : hgpar_->moduleHS_[i];
387  kymax = floor((2*h)/index.second);
388  } else {
389  for (unsigned int k=0; k<hgpar_->waferCopy_.size(); ++k) {
390  if (waferInLayer(k,i)) {
391  int ky = ((hgpar_->waferCopy_[k])/100)%100;
392  if (ky > kymax) kymax = ky;
393  }
394  }
395  }
396  return kymax;
397 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > moduleHR_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > moduleHS_
std::pair< int, float > getIndex(int lay, bool reco) const
HGCalGeometryMode mode_
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
bool waferInLayer(int wafer, int lay, bool reco) const
int HGCalDDDConstants::modules ( int  lay,
bool  reco 
) const

Definition at line 399 of file HGCalDDDConstants.cc.

References plotBeamSpotDB::first, getIndex(), and max_modules_layer_.

Referenced by wafers().

399  {
400  if( getIndex(lay,reco).first < 0 ) return 0;
401  return max_modules_layer_[(int)reco][lay];
402 }
std::pair< int, float > getIndex(int lay, bool reco) const
simrecovecs max_modules_layer_
int HGCalDDDConstants::modulesInit ( int  lay,
bool  reco 
) const

Definition at line 404 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, cmsHarvester::index, relval_2017::k, waferInLayer(), and HGCalParameters::waferPosX_.

Referenced by HGCalDDDConstants().

404  {
405  int nmod(0);
406  std::pair<int,float> index = getIndex(lay, reco);
407  if (index.first < 0) return nmod;
408  for (unsigned int k=0; k<hgpar_->waferPosX_.size(); ++k) {
409  if (waferInLayer(k,index.first)) ++nmod;
410  }
411  return nmod;
412 }
std::pair< int, float > getIndex(int lay, bool reco) const
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
bool waferInLayer(int wafer, int lay, bool reco) const
std::pair< int, int > HGCalDDDConstants::newCell ( int  cell,
int  layer,
int  sector,
int  subsector,
int  incrx,
int  incry,
bool  half 
) const

Definition at line 414 of file HGCalDDDConstants.cc.

References findCell(), hgpar_, maxCells(), maxRows(), and HGCalParameters::nSectors_.

Referenced by HGCalTopology::changeXY(), and HGCalTopology::changeZ().

416  {
417 
418  int subSec = half ? subsector : 0;
419  std::pair<int,int> kxy = findCell(cell, layer, subSec, true);
420  int kx = kxy.first + incrx;
421  int ky = kxy.second + incry;
422  if (ky < 0 || ky > maxRows(layer, true)) {
423  cell = maxCells(true);
424  return std::pair<int,int>(cell,sector*subsector);
425  } else if (kx < 0) {
426  kx =-kx;
427  subsector =-subsector;
428  } else if (kx > maxCells(layer, true)) {
429  kx -= maxCells(layer, true);
430  sector += subsector;
431  subsector =-subsector;
432  if (sector < 1) sector = hgpar_->nSectors_;
433  else if (sector > hgpar_->nSectors_) sector = 1;
434  }
435  cell = newCell(kx, ky, layer, subSec);
436  return std::pair<int,int>(cell,sector*subsector);
437 }
int maxRows(int lay, bool reco) const
std::pair< int, int > findCell(int cell, int lay, int subSec, bool reco) const
std::pair< int, int > newCell(int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
const HGCalParameters * hgpar_
int maxCells(bool reco) const
std::pair< int, int > HGCalDDDConstants::newCell ( int  cell,
int  layer,
int  subsector,
int  incrz,
bool  half 
) const

Definition at line 439 of file HGCalDDDConstants.cc.

References assignCell(), layers(), locateCell(), and create_public_lumi_plots::xy.

440  {
441 
442  int layer = lay + incrz;
443  if (layer <= 0 || layer > (int)(layers(true))) return std::pair<int,int>(cell,0);
444  int subSec = half ? subsector : 0;
445  std::pair<float,float> xy = locateCell(cell, lay, subSec, true);
446  std::pair<int,int> kcell = assignCell(xy.first, xy.second, layer, subSec,
447  true);
448  return std::pair<int,int>(kcell.second,layer);
449 }
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
unsigned int layers(bool reco) const
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
int HGCalDDDConstants::newCell ( int  kx,
int  ky,
int  lay,
int  subSec 
) const

Definition at line 451 of file HGCalDDDConstants.cc.

References a, alpha, b, getIndex(), hgpar_, i, cmsHarvester::index, k_horizontalShift, maxCells(), HGCalParameters::moduleAlphaS_, HGCalParameters::moduleBlR_, HGCalParameters::moduleHR_, and HGCalParameters::moduleTlR_.

451  {
452 
453  std::pair<int,float> index = getIndex(lay, true);
454  int i = index.first;
455  if (i < 0) return maxCells(true);
456  float alpha = (subSec == 0) ? hgpar_->moduleAlphaS_[i] : subSec;
457  float cellSize = index.second;
458  float a = (alpha==0) ?
461  float b = 2*hgpar_->moduleHR_[i]*hgpar_->moduleBlR_[i]/
463  int icell(kx);
464  for (int iky=0; iky<ky; ++iky)
465  icell += floor(((iky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize));
466  return icell;
467 }
int i
Definition: DBlmapReader.cc:9
double k_horizontalShift
float alpha
Definition: AMPTWrapper.h:95
std::vector< double > moduleHR_
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > moduleBlR_
double b
Definition: hdecay.h:120
std::vector< double > moduleAlphaS_
double a
Definition: hdecay.h:121
const HGCalParameters * hgpar_
int maxCells(bool reco) const
std::vector< double > moduleTlR_
std::vector< int > HGCalDDDConstants::numberCells ( int  lay,
bool  reco 
) const

Definition at line 469 of file HGCalDDDConstants.cc.

References alpha, HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, getIndex(), getParameterSquare(), h, hgpar_, i, cmsHarvester::index, relval_2017::k, mode_, numberCellsSquare(), Square, waferInLayer(), and HGCalParameters::waferTypeT_.

469  {
470 
471  std::pair<int,float> index = getIndex(lay, reco);
472  int i = index.first;
473  std::vector<int> ncell;
474  if (i >= 0) {
476  float h, bl, tl, alpha;
477  getParameterSquare(i,0,reco,h,bl,tl,alpha);
478  return numberCellsSquare(h, bl, tl, alpha, index.second);
479  } else {
480  for (unsigned int k=0; k<hgpar_->waferTypeT_.size(); ++k) {
481  if (waferInLayer(k,i)) {
482  unsigned int cell = (hgpar_->waferTypeT_[k]==1) ?
483  (hgpar_->cellFineX_.size()) : (hgpar_->cellCoarseX_.size());
484  ncell.push_back((int)(cell));
485  }
486  }
487  }
488  }
489  return ncell;
490 }
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
std::vector< int > numberCellsSquare(float h, float bl, float tl, float alpha, float cellSize) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
HGCalGeometryMode mode_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
bool waferInLayer(int wafer, int lay, bool reco) const
int HGCalDDDConstants::numberCellsHexagon ( int  wafer) const

Definition at line 505 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, hgpar_, and HGCalParameters::waferTypeT_.

Referenced by HGCalGeometry::newCell().

505  {
506 
507  int ncell(0);
508  if (wafer >= 0 && wafer < (int)(hgpar_->waferTypeT_.size())) {
509  if (hgpar_->waferTypeT_[wafer]==1)
510  ncell = (int)(hgpar_->cellFineX_.size());
511  else
512  ncell = (int)(hgpar_->cellCoarseX_.size());
513  }
514  return ncell;
515 }
std::vector< double > cellCoarseX_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
std::vector< int > HGCalDDDConstants::numberCellsSquare ( float  h,
float  bl,
float  tl,
float  alpha,
float  cellSize 
) const

Definition at line 492 of file HGCalDDDConstants.cc.

References a, b, and k_horizontalShift.

Referenced by numberCells().

494  {
495 
496  float a = (alpha==0) ? (2*h/(tl-bl)) : (h/(tl-bl));
497  float b = 2*h*bl/(tl-bl);
498  int kymax = floor((2*h)/cellSize);
499  std::vector<int> ncell;
500  for (int iky=0; iky<kymax; ++iky)
501  ncell.push_back(floor(((iky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize)));
502  return ncell;
503 }
double k_horizontalShift
float alpha
Definition: AMPTWrapper.h:95
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
int HGCalDDDConstants::sectors ( ) const
inline
std::pair< int, int > HGCalDDDConstants::simToReco ( int  cell,
int  layer,
int  mod,
bool  half 
) const

Definition at line 517 of file HGCalDDDConstants.cc.

References a, b, HGCalParameters::cellFactor_, gather_cfg::cout, HLT_FULL_cff::depth, findCellSquare(), getIndex(), h, hgpar_, i, cmsHarvester::index, k_horizontalShift, HGCalParameters::layerGroup_, HGCalParameters::layerGroupM_, HGCalParameters::layerGroupO_, mod(), mode_, HGCalParameters::moduleAlphaS_, HGCalParameters::moduleBlS_, HGCalParameters::moduleHS_, HGCalParameters::moduleTlS_, Square, and HGCalParameters::waferTypeL_.

Referenced by HGCDigitizer::accumulate().

518  {
519 
520  std::pair<int,float> index = getIndex(lay, false);
521  int i = index.first;
522  if (i < 0) return std::pair<int,int>(-1,-1);
523  int kx(-1), depth(-1);
525  float h = hgpar_->moduleHS_[i];
526  float bl = hgpar_->moduleBlS_[i];
527  float tl = hgpar_->moduleTlS_[i];
528  float cellSize = hgpar_->cellFactor_[i]*index.second;
529 
530  std::pair<int,int> kxy = findCellSquare(cell, h, bl, tl, hgpar_->moduleAlphaS_[i], index.second);
532  if (depth<0) return std::pair<int,int>(-1,-1);
533  kx = kxy.first/hgpar_->cellFactor_[i];
534  int ky = kxy.second/hgpar_->cellFactor_[i];
535 
536  float a = (half) ? (h/(tl-bl)) : (2*h/(tl-bl));
537  float b = 2*h*bl/(tl-bl);
538  for (int iky=0; iky<ky; ++iky)
539  kx += floor(((iky+1)*cellSize+b+k_horizontalShift*cellSize)/(a*cellSize));
540 #ifdef DebugLog
541  std::cout << "simToReco: input " << cell << ":" << lay << ":" << half
542  << " kxy " << kxy.first << ":" << kxy.second << " output "
543  << kx << ":" << depth << " cell factor="
544  << hgpar_->cellFactor_[i] << std::endl;
545 #endif
546  } else {
547  kx = cell;
548  int type = hgpar_->waferTypeL_[mod];
549  if (type == 1) {
551  } else if (type == 2) {
553  } else {
555  }
556  }
557  return std::pair<int,int>(kx,depth);
558 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
double k_horizontalShift
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > moduleHS_
std::pair< int, int > findCellSquare(int cell, float h, float bl, float tl, float alpha, float cellSize) const
std::vector< int > layerGroupM_
std::vector< int > cellFactor_
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > moduleTlS_
std::vector< int > layerGroup_
double b
Definition: hdecay.h:120
HGCalGeometryMode mode_
std::vector< double > moduleAlphaS_
std::vector< int > layerGroupO_
std::vector< double > moduleBlS_
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:145
const HGCalParameters * hgpar_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > waferTypeL_
unsigned int HGCalDDDConstants::volumes ( ) const
inline

Definition at line 67 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::moduleLayR_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::getSummary().

67 {return hgpar_->moduleLayR_.size();}
std::vector< int > moduleLayR_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 560 of file HGCalDDDConstants.cc.

References hgpar_, relval_2017::k, and HGCalParameters::waferCopy_.

Referenced by HGCNumberingScheme::getUnitID().

560  {
561  const int ncopies = hgpar_->waferCopy_.size();
562  int wafer = ncopies;
563  for (int k=0; k<ncopies; ++k) {
564  if (copy == hgpar_->waferCopy_[k]) {
565  wafer = k;
566  break;
567  }
568  }
569  return wafer;
570 }
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 572 of file HGCalDDDConstants.cc.

References getIndex().

Referenced by HGCalGeometryLoader::build(), HGCalGeometry::getSummary(), maxCells(), maxRows(), modulesInit(), and numberCells().

572  {
573 
574  std::pair<int,float> indx = getIndex(lay, reco);
575  if (indx.first < 0) return false;
576  return waferInLayer(wafer,indx.first);
577 }
std::pair< int, float > getIndex(int lay, bool reco) const
bool waferInLayer(int wafer, int lay, bool reco) const
bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay 
) const
private

Definition at line 661 of file HGCalDDDConstants.cc.

References hgpar_, recoMuon::in, rmax_, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, findQualityFiles::rr, mathSSE::sqrt(), tan30deg_, HGCalParameters::waferPosX_, and HGCalParameters::waferPosY_.

661  {
662 
663  const double rr = 2*rmax_*tan30deg_;
664  const double waferX = hgpar_->waferPosX_[wafer];
665  const double waferY = hgpar_->waferPosY_[wafer];
666  const double rpos = std::sqrt(waferX*waferX+waferY*waferY);
667  const bool in = (rpos-rr >= hgpar_->rMinLayHex_[lay] &&
668  rpos+rr <= hgpar_->rMaxLayHex_[lay]);
669  return in;
670 }
std::vector< double > waferPosY_
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
static double tan30deg_
std::pair< double, double > HGCalDDDConstants::waferPosition ( int  wafer) const

Definition at line 579 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, and create_public_lumi_plots::xy.

Referenced by HGCalGeometryLoader::build().

579  {
580 
581  std::pair<double,double> xy;
582  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
583  xy = std::pair<double,double>(hgpar_->waferPosX_[wafer],hgpar_->waferPosY_[wafer]);
584  } else {
585  xy = std::pair<double,double>(0,0);
586  }
587  return xy;
588 }
std::vector< double > waferPosY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int HGCalDDDConstants::wafers ( ) const

Definition at line 597 of file HGCalDDDConstants.cc.

References HGCalParameters::depth_, hgpar_, i, layers(), and modules().

Referenced by HGCalTopology::allGeomModules(), and HGCalDDDConstants().

597  {
598 
599  int wafer(0);
600  for (unsigned int i = 0; i<layers(true); ++i) {
601  int lay = hgpar_->depth_[i];
602  wafer += modules(lay, true);
603  }
604  return wafer;
605 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > depth_
int modules(int lay, bool reco) const
unsigned int layers(bool reco) const
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 72 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferCopy_.

72 {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferTypeT ( int  wafer) const
inline

Definition at line 73 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeT_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::getClosestCell().

73 {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;}
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
double HGCalDDDConstants::waferZ ( int  layer,
bool  reco 
) const

Definition at line 590 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, i, cmsHarvester::index, and HGCalParameters::zLayerHex_.

Referenced by HGCalSimHitValidation::analyzeHits().

590  {
591  std::pair<int,float> index = getIndex(lay, reco);
592  int i = index.first;
593  if (i < 0) return 0;
594  else return hgpar_->zLayerHex_[i];
595 }
int i
Definition: DBlmapReader.cc:9
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > zLayerHex_
const HGCalParameters * hgpar_

Member Data Documentation

const HGCalParameters* HGCalDDDConstants::hgpar_
private
simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 99 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

HGCalGeometryMode HGCalDDDConstants::mode_
private
double HGCalDDDConstants::rmax_
private

Definition at line 95 of file HGCalDDDConstants.h.

Referenced by assignCellHexagon(), HGCalDDDConstants(), and waferInLayer().

double HGCalDDDConstants::tan30deg_ = 0.5773502693
staticprivate

Definition at line 94 of file HGCalDDDConstants.h.

Referenced by cellHex(), and waferInLayer().

std::array<uint32_t,2> HGCalDDDConstants::tot_layers_
private

Definition at line 98 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and layers().

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 97 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().