CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HcalDDDSimConstants Class Reference

#include <HcalDDDSimConstants.h>

Public Member Functions

HcalCellType::HcalCell cell (const int &det, const int &zside, const int &depth, const int &etaR, const int &iphi) const
 
int findDepth (const int &det, const int &eta, const int &phi, const int &zside, const int &lay) const
 
unsigned int findLayer (const int &layer, const std::vector< HcalParameters::LayerItem > &layerGroup) const
 
std::vector< std::pair< double, double > > getConstHBHE (const int &type) const
 
int getDepthEta16 (const int &det, const int &phi, const int &zside) const
 
int getDepthEta16M (const int &det) const
 
int getDepthEta29 (const int &phi, const int &zside, const int &i) const
 
int getDepthEta29M (const int &i, const bool &planOne) const
 
std::pair< int, double > getDetEta (const double &eta, const int &depth) const
 
int getEta (const int &det, const int &lay, const double &hetaR) const
 
std::pair< int, int > getEtaDepth (const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay) const
 
double getEtaHO (const double &etaR, const double &x, const double &y, const double &z) const
 
const std::vector< double > & getEtaTableHF () const
 
int getFrontLayer (const int &det, const int &eta) const
 
const std::vector< double > & getGparHF () const
 
const std::vector< HcalDetId > & getIdHF2QIE () const
 
std::pair< int, int > getiEtaRange (const int &i) const
 
int getLastLayer (const int &det, const int &eta) const
 
double getLayer0Wt (const int &det, const int &phi, const int &zside) const
 
int getLayerBack (const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
 
int getLayerFront (const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
 
int getLayerMax (const int &eta, const int &depth) const
 
int getMaxDepth (const int &type) const
 
int getMaxDepth (const int &det, const int &eta, const int &phi, const int &zside, const bool &partialOnly) const
 
std::pair< int, int > getMaxDepthDet (const int &i) const
 
int getMinDepth (const int &det, const int &eta, const int &phi, const int &zside, const bool &partialOnly) const
 
std::pair< int, int > getModHalfHBHE (const int &type) const
 
std::pair< double, double > getPhiCons (const int &det, const int &ieta) const
 
std::vector< std::pair< int, double > > getPhis (const int &subdet, const int &ieta) const
 
const std::vector< double > & getPhiTableHF () const
 
const std::vector< double > & getRTableHF () const
 
std::vector< HcalCellTypeHcalCellTypes () const
 
std::vector< HcalCellTypeHcalCellTypes (const HcalSubdetector &, int ieta=-1, int depth=-1) const
 
 HcalDDDSimConstants (const HcalParameters *hp)
 
bool isBH () const
 
const HcalLayerDepthMapldMap () const
 
int maxHFDepth (const int &ieta, const int &iphi) const
 
unsigned int numberOfCells (const HcalSubdetector &) const
 
int phiNumber (const int &phi, const int &unit) const
 
void printTiles () const
 
int unitPhi (const int &det, const int &etaR) const
 
int unitPhi (const double &dphi) const
 
 ~HcalDDDSimConstants ()
 

Private Member Functions

double deltaEta (const int &det, const int &eta, const int &depth) const
 
double getEta (const int &det, const int &etaR, const int &zside, int depth=1) const
 
double getEta (const double &r, const double &z) const
 
double getGain (const HcalSubdetector &subdet, const int &depth) const
 
int getShift (const HcalSubdetector &subdet, const int &depth) const
 
void initialize ()
 
unsigned int layerGroup (int eta, int i) const
 
unsigned int layerGroup (int det, int eta, int phi, int zside, int i) const
 
unsigned int layerGroupSize (int eta) const
 
void printTileHB (const int &eta, const int &phi, const int &zside, const int &depth) const
 
void printTileHE (const int &eta, const int &phi, const int &zside, const int &depth) const
 

Private Attributes

int depthEta16 [2]
 
int depthEta29 [2]
 
std::pair< int, int > depthMaxDf_
 
std::pair< int, int > depthMaxSp_
 
std::vector< int > depths [nDepthMax]
 
double dlShort
 
double dzVcal
 
double etaHO [4]
 
const HcalParametershpar
 
std::vector< HcalDetIdidHF2QIE
 
bool isBH_
 
int layBHB [3]
 
int layBHE [4]
 
int layFHB [2]
 
int layFHE [3]
 
HcalLayerDepthMap ldmap_
 
std::vector< int > maxDepth
 
int nDepth
 
int nEta
 
int nmodHB
 
int nmodHE
 
int nPhiF
 
int nR
 
int nzHB
 
int nzHE
 
double rminHO
 
double zVcal
 

Static Private Attributes

static const int maxLayer_ =18
 
static const int maxLayerHB_ =16
 
static const int nDepthMax =9
 

Detailed Description

this class reads the constant section of the hcal-sim-numbering xml-file

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 24 of file HcalDDDSimConstants.h.

Constructor & Destructor Documentation

HcalDDDSimConstants::HcalDDDSimConstants ( const HcalParameters hp)

Definition at line 12 of file HcalDDDSimConstants.cc.

References HcalCellTypes(), and initialize().

12  : hpar(hp) {
13 
14 #ifdef EDM_ML_DEBUG
15  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants::HcalDDDSimConstants (const HcalParameter* hp) constructor\n";
16 #endif
17 
18  initialize();
19 #ifdef EDM_ML_DEBUG
20  std::vector<HcalCellType> cellTypes = HcalCellTypes();
21  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants: " << cellTypes.size()
22  << " cells of type HCal (All)\n";
23 #endif
24 }
std::vector< HcalCellType > HcalCellTypes() const
const HcalParameters * hpar
HcalDDDSimConstants::~HcalDDDSimConstants ( )

Definition at line 26 of file HcalDDDSimConstants.cc.

26  {
27 #ifdef EDM_ML_DEBUG
28  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants::destructed!!!\n";
29 #endif
30 }

Member Function Documentation

HcalCellType::HcalCell HcalDDDSimConstants::cell ( const int &  det,
const int &  zside,
const int &  depth,
const int &  etaR,
const int &  iphi 
) const

Definition at line 32 of file HcalDDDSimConstants.cc.

References deltaEta(), HcalCellType::HcalCell::deta, HcalCellType::HcalCell::dphi, HcalParameters::drHB, HcalCellType::HcalCell::drz, HcalParameters::dzHE, HcalCellType::HcalCell::eta, PVValHelper::eta, HcalParameters::etaMax, HcalParameters::etaMin, HcalCellType::HcalCell::flagrz, getEta(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hpar, createfilelist::int, maxDepth, maxLayerHB_, nEta, HcalParameters::noff, nR, HcalCellType::HcalCell::ok, convertSQLiteXML::ok, phi, HcalCellType::HcalCell::phi, HcalParameters::phibin, HcalParameters::phioff, HcalParameters::phitable, HcalParameters::rHB, HcalParameters::rTable, HcalCellType::HcalCell::rz, tmp, unitPhi(), and HcalParameters::zHE.

Referenced by HGCGeometryValidation::analyze(), HGCalHitValidation::analyze(), HcalCellTypes(), and HcalTestAnalysis::update().

34  {
35 
36  double etaMn = hpar->etaMin[0];
37  double etaMx = hpar->etaMax[0];
38  if (idet==static_cast<int>(HcalEndcap)) {
39  etaMn = hpar->etaMin[1]; etaMx = hpar->etaMax[1];
40  } else if (idet==static_cast<int>(HcalForward)) {
41  etaMn = hpar->etaMin[2]; etaMx = hpar->etaMax[2];
42  }
43  double eta = 0, deta = 0, phi = 0, dphi = 0, rz = 0, drz = 0;
44  bool ok = false, flagrz = true;
45  if ((idet==static_cast<int>(HcalBarrel)||idet==static_cast<int>(HcalEndcap)||
46  idet==static_cast<int>(HcalOuter)||idet==static_cast<int>(HcalForward))
47  && etaR >=etaMn && etaR <= etaMx && depth > 0) ok = true;
48  if (idet == static_cast<int>(HcalEndcap) && depth>(int)(hpar->zHE.size()))ok=false;
49  else if (idet == static_cast<int>(HcalBarrel) && depth > maxLayerHB_+1) ok=false;
50  else if (idet == static_cast<int>(HcalOuter) && depth != 4) ok=false;
51  else if (idet == static_cast<int>(HcalForward) && depth > maxDepth[2]) ok=false;
52  if (ok) {
53  eta = getEta(idet, etaR, zside, depth);
54  deta = deltaEta(idet, etaR, depth);
55  double fibin, fioff;
56  if (idet == static_cast<int>(HcalBarrel)||
57  idet == static_cast<int>(HcalOuter)) {
58  fioff = hpar->phioff[0];
59  fibin = hpar->phibin[etaR-1];
60  } else if (idet == static_cast<int>(HcalEndcap)) {
61  fioff = hpar->phioff[1];
62  fibin = hpar->phibin[etaR-1];
63  } else {
64  fioff = hpar->phioff[2];
65  fibin = hpar->phitable[etaR-hpar->etaMin[2]];
66  if (unitPhi(fibin) > 2) fioff = hpar->phioff[4];
67  }
68  phi =-fioff + (iphi - 0.5)*fibin;
69  dphi = 0.5*fibin;
70  if (idet == static_cast<int>(HcalForward)) {
71  int ir = nR + hpar->etaMin[2] - etaR - 1;
72  if (ir > 0 && ir < nR) {
73  rz = 0.5*(hpar->rTable[ir]+hpar->rTable[ir-1]);
74  drz = 0.5*(hpar->rTable[ir]-hpar->rTable[ir-1]);
75  } else {
76  ok = false;
77 #ifdef EDM_ML_DEBUG
78  edm::LogInfo("HCalGeom") << "HcalDDDSimConstants: wrong eta " << etaR
79  << " (" << ir << "/" << nR << ") Detector "
80  << idet << std::endl;
81 #endif
82  }
83  } else if (etaR <= nEta) {
84  int laymin(depth), laymax(depth);
85  if (idet == static_cast<int>(HcalOuter)) {
86  laymin = (etaR > hpar->noff[2]) ? ((int)(hpar->zHE.size())) : ((int)(hpar->zHE.size()))-1;
87  laymax = ((int)(hpar->zHE.size()));
88  }
89  double d1=0, d2=0;
90  if (idet == static_cast<int>(HcalEndcap)) {
91  flagrz = false;
92  d1 = hpar->zHE[laymin-1] - hpar->dzHE[laymin-1];
93  d2 = hpar->zHE[laymax-1] + hpar->dzHE[laymax-1];
94  } else {
95  d1 = hpar->rHB[laymin-1] - hpar->drHB[laymin-1];
96  d2 = hpar->rHB[laymax-1] + hpar->drHB[laymax-1];
97  }
98  rz = 0.5*(d2+d1);
99  drz = 0.5*(d2-d1);
100  } else {
101  ok = false;
102  edm::LogWarning("HCalGeom") << "HcalDDDSimConstants: wrong depth "
103  << depth << " or etaR " << etaR
104  << " for detector " << idet;
105  }
106  } else {
107  ok = false;
108  edm::LogWarning("HCalGeom") << "HcalDDDSimConstants: wrong depth " << depth
109  << " det " << idet;
110  }
111  HcalCellType::HcalCell tmp(ok,eta,deta,phi,dphi,rz,drz,flagrz);
112 
113 #ifdef EDM_ML_DEBUG
114  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants: det/side/depth/etaR/"
115  << "phi " << idet << "/" << zside << "/"
116  << depth << "/" << etaR << "/" << iphi
117  << " Cell Flag " << tmp.ok << " " << tmp.eta
118  << " " << tmp.deta << " phi " << tmp.phi << " "
119  << tmp.dphi << " r(z) " << tmp.rz << " "
120  << tmp.drz << " " << tmp.flagrz;
121 #endif
122  return tmp;
123 }
std::vector< int > maxDepth
std::vector< double > rHB
int zside(DetId const &)
std::vector< int > etaMax
std::vector< double > zHE
int unitPhi(const int &det, const int &etaR) const
std::vector< double > dzHE
std::vector< double > phioff
int getEta(const int &det, const int &lay, const double &hetaR) const
double deltaEta(const int &det, const int &eta, const int &depth) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< double > phitable
std::vector< double > phibin
std::vector< double > drHB
std::vector< int > noff
const HcalParameters * hpar
static const int maxLayerHB_
std::vector< int > etaMin
double HcalDDDSimConstants::deltaEta ( const int &  det,
const int &  eta,
const int &  depth 
) const
private

Definition at line 982 of file HcalDDDSimConstants.cc.

References depthEta29, dlShort, etaHO, HcalParameters::etaMin, HcalParameters::etaTable, getEta(), HcalForward, HcalOuter, hpar, nEta, HcalParameters::noff, nR, HcalParameters::rTable, tmp, z, and zVcal.

Referenced by cell().

983  {
984 
985  double tmp = 0;
986  if (det == static_cast<int>(HcalForward)) {
987  int ir = nR + hpar->etaMin[2] - etaR - 1;
988  if (ir > 0 && ir < nR) {
989  double z = zVcal;
990  if (depth%2 != 1) z += dlShort;
991  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)-getEta(hpar->rTable[ir],z));
992  }
993  } else {
994  if (etaR > 0 && etaR < nEta) {
995  if (etaR == hpar->noff[1]-1 && depth > depthEta29[0]) {
996  tmp = 0.5*(hpar->etaTable[etaR+1]-hpar->etaTable[etaR-1]);
997  } else if (det == static_cast<int>(HcalOuter)) {
998  if (etaR == hpar->noff[2]) {
999  tmp = 0.5*(etaHO[0]-hpar->etaTable[etaR-1]);
1000  } else if (etaR == hpar->noff[2]+1) {
1001  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[1]);
1002  } else if (etaR == hpar->noff[3]) {
1003  tmp = 0.5*(etaHO[2]-hpar->etaTable[etaR-1]);
1004  } else if (etaR == hpar->noff[3]+1) {
1005  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[3]);
1006  } else {
1007  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
1008  }
1009  } else {
1010  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
1011  }
1012  }
1013  }
1014 #ifdef EDM_ML_DEBUG
1015  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::deltaEta " << etaR
1016  << " " << depth << " ==> " << tmp;
1017 #endif
1018  return tmp;
1019 }
std::vector< double > etaTable
int getEta(const int &det, const int &lay, const double &hetaR) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::findDepth ( const int &  det,
const int &  eta,
const int &  phi,
const int &  zside,
const int &  lay 
) const

Definition at line 125 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, HcalLayerDepthMap::getDepth(), HcalLayerDepthMap::isValid(), and ldmap_.

Referenced by HcalDDDRecConstants::getHCID(), and layerGroup().

127  {
128 
129  int depth = (ldmap_.isValid(det,phi,zside)) ? ldmap_.getDepth(det,eta,phi,zside,lay) : -1;
130  return depth;
131 }
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
int getDepth(const int subdet, const int ieta, const int iphi, const int zside, const int layer) const
HcalLayerDepthMap ldmap_
unsigned int HcalDDDSimConstants::findLayer ( const int &  layer,
const std::vector< HcalParameters::LayerItem > &  layerGroup 
) const

Definition at line 133 of file HcalDDDSimConstants.cc.

References mps_fire::i, and triggerObjects_cff::id.

133  {
134 
135  unsigned int id = layerGroup.size();
136  for (unsigned int i = 0; i < layerGroup.size(); i++) {
137  if (layer == (int)(layerGroup[i].layer)) {
138  id = i;
139  break;
140  }
141  }
142  return id;
143 }
unsigned int layerGroup(int eta, int i) const
std::vector< std::pair< double, double > > HcalDDDSimConstants::getConstHBHE ( const int &  type) const

Definition at line 145 of file HcalDDDSimConstants.cc.

References HcalParameters::drHB, HcalParameters::dzHE, hpar, mps_fire::i, HcalParameters::rHB, and HcalParameters::zHE.

145  {
146 
147  std::vector<std::pair<double,double> > gcons;
148  if (type == 0) {
149  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
150  gcons.emplace_back(std::pair<double,double>(hpar->rHB[i],hpar->drHB[i]));
151  }
152  } else {
153  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
154  gcons.emplace_back(std::pair<double,double>(hpar->zHE[i],hpar->dzHE[i]));
155  }
156  }
157  return gcons;
158 }
type
Definition: HCALResponse.h:21
std::vector< double > rHB
std::vector< double > zHE
std::vector< double > dzHE
std::vector< double > drHB
const HcalParameters * hpar
int HcalDDDSimConstants::getDepthEta16 ( const int &  det,
const int &  phi,
const int &  zside 
) const

Definition at line 160 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, depthEta16, HcalLayerDepthMap::getDepth16(), and ldmap_.

Referenced by HcalDDDRecConstants::getDepthEta16(), getEtaDepth(), HcalDDDRecConstants::getHCID(), getMaxDepth(), getMinDepth(), HcalDDDRecConstants::getOneEtaBin(), HcalDDDRecConstants::initialize(), and printTiles().

161  {
162 
163  int depth = ldmap_.getDepth16(det,phi,zside);
164  if (depth < 0) depth = (det == 2) ? depthEta16[1] : depthEta16[0];
165 #ifdef EDM_ML_DEBUG
166  edm::LogVerbatim("HcalGeom") << "getDepthEta16: " << det << ":" << depth;
167 #endif
168  return depth;
169 }
int zside(DetId const &)
int getDepth16(const int subdet, const int iphi, const int zside) const
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getDepthEta16M ( const int &  det) const

Definition at line 171 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, depthEta16, HcalLayerDepthMap::getDepth16(), ldmap_, HcalLayerDepthMap::validDet(), and ecaldqm::zside().

Referenced by HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getMinDepth(), HcalDDDRecConstants::getOneEtaBin(), and HcalDDDRecConstants::initialize().

171  {
172  int depth = (det == 2) ? depthEta16[1] : depthEta16[0];
173  std::vector<int> phis;
174  int detsp = ldmap_.validDet(phis);
175  if (detsp == det) {
176  int zside = (phis[0] > 0) ? 1 : -1;
177  int iphi = (phis[0] > 0) ? phis[0] : -phis[0];
178  int depthsp = ldmap_.getDepth16(det,iphi,zside);
179  if (det == 1 && depthsp > depth) depth = depthsp;
180  if (det == 2 && depthsp < depth) depth = depthsp;
181  }
182  return depth;
183 }
int zside(DetId const &)
int validDet(std::vector< int > &phis) const
int getDepth16(const int subdet, const int iphi, const int zside) const
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getDepthEta29 ( const int &  phi,
const int &  zside,
const int &  i 
) const

Definition at line 185 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, depthEta29, HcalLayerDepthMap::getMaxDepthLastHE(), and ldmap_.

Referenced by HcalDDDRecConstants::getDepthEta29(), getEtaDepth(), HcalDDDRecConstants::getHCID(), HcalDDDRecConstants::getOneEtaBin(), and HcalDDDRecConstants::mergedDepthList29().

186  {
187 
188  int depth = (i == 0) ? ldmap_.getMaxDepthLastHE(2,phi,zside) : -1;
189  if (depth < 0) depth = (i == 1) ? depthEta29[1] : depthEta29[0];
190  return depth;
191 }
int zside(DetId const &)
int getMaxDepthLastHE(const int subdet, const int iphi, const int zside) const
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getDepthEta29M ( const int &  i,
const bool &  planOne 
) const

Definition at line 193 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, depthEta29, HcalLayerDepthMap::getMaxDepthLastHE(), ldmap_, HcalLayerDepthMap::validDet(), and ecaldqm::zside().

Referenced by HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getOneEtaBin(), and HcalDDDRecConstants::initialize().

194  {
195  int depth = (i == 1) ? depthEta29[1] : depthEta29[0];
196  if (i == 0 && planOne) {
197  std::vector<int> phis;
198  int detsp = ldmap_.validDet(phis);
199  if (detsp == 2) {
200  int zside = (phis[0] > 0) ? 1 : -1;
201  int iphi = (phis[0] > 0) ? phis[0] : -phis[0];
202  int depthsp = ldmap_.getMaxDepthLastHE(2,iphi,zside);
203  if (depthsp > depth) depth = depthsp;
204  }
205  }
206  return depth;
207 }
int zside(DetId const &)
int validDet(std::vector< int > &phis) const
int getMaxDepthLastHE(const int subdet, const int iphi, const int zside) const
HcalLayerDepthMap ldmap_
std::pair< int, double > HcalDDDSimConstants::getDetEta ( const double &  eta,
const int &  depth 
) const

Definition at line 209 of file HcalDDDSimConstants.cc.

References depthEta16, PVValHelper::eta, HcalParameters::etaMax, HcalParameters::etaMin, MuonErrorMatrixValues_cff::etaRange, HcalParameters::etaTable, JetChargeProducer_cfi::exp, HcalBarrel, HcalEndcap, HcalForward, hpar, mps_fire::i, nEta, funct::tan(), theta(), and zVcal.

Referenced by HcalNumberingFromDDD::unitID().

210  {
211 
212  int hsubdet(0), ieta(0);
213  double etaR(0);
214  double heta = fabs(eta);
215  for (int i = 0; i < nEta; i++)
216  if (heta > hpar->etaTable[i]) ieta = i + 1;
217  if (heta <= hpar->etaRange[1]) {
218  if ((ieta == hpar->etaMin[1] && depth==depthEta16[1]) ||
219  (ieta > hpar->etaMax[0])) {
220  hsubdet = static_cast<int>(HcalEndcap);
221  } else {
222  hsubdet = static_cast<int>(HcalBarrel);
223  }
224  etaR = eta;
225  } else {
226  hsubdet = static_cast<int>(HcalForward);
227  double theta = 2.*atan(exp(-heta));
228  double hR = zVcal*tan(theta);
229  etaR = (eta >= 0. ? hR : -hR);
230  }
231  return std::pair<int,double>(hsubdet,etaR);
232 }
std::vector< double > etaTable
Geom::Theta< T > theta() const
std::vector< int > etaMax
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::getEta ( const int &  det,
const int &  lay,
const double &  hetaR 
) const

Definition at line 234 of file HcalDDDSimConstants.cc.

References etaHO, HcalParameters::etaMax, ALCARECOTkAlBeamHalo_cff::etaMin, HcalParameters::etaMin, HcalParameters::etaTable, HcalBarrel, HcalEndcap, HcalForward, hpar, mps_fire::i, maxLayer_, nEta, HcalParameters::noff, and nR.

Referenced by cell(), deltaEta(), getEta(), and HcalNumberingFromDDD::unitID().

235  {
236 
237  int ieta(0);
238  if (det == static_cast<int>(HcalForward)) { // Forward HCal
239  ieta = hpar->etaMax[2];
240  for (int i = nR-1; i > 0; i--)
241  if (hetaR < hpar->rTable[i]) ieta = hpar->etaMin[2] + nR - i - 1;
242  } else { // Barrel or Endcap
243  ieta = 1;
244  for (int i = 0; i < nEta-1; i++)
245  if (hetaR > hpar->etaTable[i]) ieta = i + 1;
246  if (det == static_cast<int>(HcalBarrel)) {
247  if (ieta > hpar->etaMax[0]) ieta = hpar->etaMax[0];
248  if (lay == maxLayer_) {
249  if (hetaR > etaHO[1] && ieta == hpar->noff[2]) ieta++;
250  }
251  } else if (det == static_cast<int>(HcalEndcap)) {
252  if (ieta <= hpar->etaMin[1]) ieta = hpar->etaMin[1];
253  }
254  }
255  return ieta;
256 }
std::vector< double > etaTable
static const int maxLayer_
std::vector< int > etaMax
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getEta ( const int &  det,
const int &  etaR,
const int &  zside,
int  depth = 1 
) const
private

Definition at line 1021 of file HcalDDDSimConstants.cc.

References depthEta29, dlShort, etaHO, HcalParameters::etaMin, HcalParameters::etaTable, getEta(), HcalForward, HcalOuter, hpar, nEta, HcalParameters::noff, nR, HcalParameters::rTable, tmp, z, and zVcal.

1022  {
1023 
1024  double tmp = 0;
1025  if (det == static_cast<int>(HcalForward)) {
1026  int ir = nR + hpar->etaMin[2] - etaR - 1;
1027  if (ir > 0 && ir < nR) {
1028  double z = zVcal;
1029  if (depth%2 != 1) z += dlShort;
1030  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)+getEta(hpar->rTable[ir],z));
1031  }
1032  } else {
1033  if (etaR > 0 && etaR < nEta) {
1034  if (etaR == hpar->noff[1]-1 && depth > depthEta29[0]) {
1035  tmp = 0.5*(hpar->etaTable[etaR+1]+hpar->etaTable[etaR-1]);
1036  } else if (det == static_cast<int>(HcalOuter)) {
1037  if (etaR == hpar->noff[2]) {
1038  tmp = 0.5*(etaHO[0]+hpar->etaTable[etaR-1]);
1039  } else if (etaR == hpar->noff[2]+1) {
1040  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[1]);
1041  } else if (etaR == hpar->noff[3]) {
1042  tmp = 0.5*(etaHO[2]+hpar->etaTable[etaR-1]);
1043  } else if (etaR == hpar->noff[3]+1) {
1044  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[3]);
1045  } else {
1046  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
1047  }
1048  } else {
1049  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
1050  }
1051  }
1052  }
1053  if (zside == 0) tmp = -tmp;
1054 #ifdef EDM_ML_DEBUG
1055  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::getEta " << etaR << " "
1056  << zside << " " << depth << " ==> " << tmp;
1057 #endif
1058  return tmp;
1059 }
std::vector< double > etaTable
int zside(DetId const &)
int getEta(const int &det, const int &lay, const double &hetaR) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getEta ( const double &  r,
const double &  z 
) const
private

Definition at line 1061 of file HcalDDDSimConstants.cc.

References cmsBatch::log, funct::tan(), and tmp.

1061  {
1062 
1063  double tmp = 0;
1064  if (z != 0) tmp = -log(tan(0.5*atan(r/z)));
1065 #ifdef EDM_ML_DEBUG
1066  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::getEta " << r << " "
1067  << z << " ==> " << tmp;
1068 #endif
1069  return tmp;
1070 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::pair< int, int > HcalDDDSimConstants::getEtaDepth ( const int &  det,
int  etaR,
const int &  phi,
const int &  zside,
int  depth,
const int &  lay 
) const

Definition at line 258 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, HcalParameters::etaMin, getDepthEta16(), getDepthEta29(), getMaxDepth(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hpar, createfilelist::int, layerGroup(), HcalParameters::noff, HcalParameters::phibin, and HcalParameters::phioff.

Referenced by HcalNumberingFromDDD::unitID().

262  {
263 
264 #ifdef EDM_ML_DEBUG
265  edm::LogVerbatim("HcalGeom") << "HcalDDDEsimConstants:getEtaDepth: I/P "
266  << det << ":" << etaR << ":" << phi << ":"
267  << zside << ":" << depth << ":" << lay;
268 #endif
269  //Modify the depth index
270  if ((det == static_cast<int>(HcalEndcap)) && (etaR == 17) && (lay == 1))
271  etaR = 18;
272  if (det == static_cast<int>(HcalForward)) { // Forward HCal
273  } else if (det == static_cast<int>(HcalOuter)) {
274  depth = 4;
275  } else {
276  if (lay >= 0) {
277  depth = layerGroup(det, etaR, phi, zside, lay-1);
278  if (etaR == hpar->noff[0] && lay > 1) {
279  int kphi = phi + int((hpar->phioff[3]+0.1)/hpar->phibin[etaR-1]);
280  kphi = (kphi-1)%4 + 1;
281  if (kphi == 2 || kphi == 3)
282  depth = layerGroup(det, etaR, phi, zside, lay-2);
283  }
284  } else if (det == static_cast<int>(HcalBarrel)) {
285  if (depth>getMaxDepth(det,etaR,phi,zside,false))
286  depth = getMaxDepth(det,etaR,phi,zside,false);
287  }
288  if (etaR >= hpar->noff[1] && depth > getDepthEta29(phi,zside,0)) {
289  etaR -= getDepthEta29(phi,zside,1);
290  } else if (etaR == hpar->etaMin[1]) {
291  if (det == static_cast<int>(HcalBarrel)) {
292  if (depth > getDepthEta16(det, phi, zside))
293  depth = getDepthEta16(det, phi, zside);
294  } else {
295  if (depth < getDepthEta16(det, phi, zside))
296  depth = getDepthEta16(det, phi, zside);
297  }
298  }
299  }
300 #ifdef EDM_ML_DEBUG
301  edm::LogVerbatim("HcalGeom") << "HcalDDDEsimConstants:getEtaDepth: O/P "
302  << etaR << ":" << depth;
303 #endif
304  return std::pair<int,int>(etaR,depth);
305 }
unsigned int layerGroup(int eta, int i) const
int zside(DetId const &)
int getMaxDepth(const int &type) const
int getDepthEta29(const int &phi, const int &zside, const int &i) const
std::vector< double > phioff
std::vector< double > phibin
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
int getDepthEta16(const int &det, const int &phi, const int &zside) const
double HcalDDDSimConstants::getEtaHO ( const double &  etaR,
const double &  x,
const double &  y,
const double &  z 
) const

Definition at line 307 of file HcalDDDSimConstants.cc.

References PVValHelper::eta, HcalParameters::etaTable, hpar, alignCSCRings::r, rminHO, mathSSE::sqrt(), HcalParameters::zHO, and geometryCSVtoXML::zz.

Referenced by HcalNumberingFromDDD::unitID().

308  {
309 
310  if (hpar->zHO.size() > 4) {
311  double eta = fabs(etaR);
312  double r = std::sqrt(x*x+y*y);
313  if (r > rminHO) {
314  double zz = fabs(z);
315  if (zz > hpar->zHO[3]) {
316  if (eta <= hpar->etaTable[10]) eta = hpar->etaTable[10]+0.001;
317  } else if (zz > hpar->zHO[1]) {
318  if (eta <= hpar->etaTable[4]) eta = hpar->etaTable[4]+0.001;
319  }
320  }
321  eta = (z >= 0. ? eta : -eta);
322 #ifdef EDM_ML_DEBUG
323  edm::LogVerbatim("HcalGeom") << "R " << r << " Z " << z << " eta " << etaR
324  << ":" << eta;
325  if (eta != etaR) edm::LogInfo ("HCalGeom") << "**** Check *****";
326 #endif
327  return eta;
328  } else {
329  return etaR;
330  }
331 }
std::vector< double > zHO
std::vector< double > etaTable
T sqrt(T t)
Definition: SSEVec.h:18
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getEtaTableHF ( ) const
inline

Definition at line 50 of file HcalDDDSimConstants.h.

References HcalParameters::etaTableHF, and hpar.

50 {return hpar->etaTableHF;}
std::vector< double > etaTableHF
const HcalParameters * hpar
int HcalDDDSimConstants::getFrontLayer ( const int &  det,
const int &  eta 
) const

Definition at line 333 of file HcalDDDSimConstants.cc.

References funct::abs(), layFHB, and layFHE.

Referenced by getIdHF2QIE(), and HcalDDDRecConstants::getLayerFront().

333  {
334 
335  int lay=0;
336  if (det == 1) {
337  if (std::abs(eta) == 16) lay = layFHB[1];
338  else lay = layFHB[0];
339  } else {
340  if (std::abs(eta) == 16) lay = layFHE[1];
341  else if (std::abs(eta) == 18) lay = layFHE[2];
342  else lay = layFHE[0];
343  }
344  return lay;
345 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double HcalDDDSimConstants::getGain ( const HcalSubdetector subdet,
const int &  depth 
) const
private

Definition at line 1093 of file HcalDDDSimConstants.cc.

References muonCSCDigis_cfi::gain, HcalParameters::HBGains, HcalEndcap, HcalForward, HcalOuter, HcalParameters::HEGains, HcalParameters::HFGains, and hpar.

Referenced by HcalCellTypes().

1094  {
1095 
1096  double gain;
1097  switch(subdet) {
1098  case HcalEndcap:
1099  gain = hpar->HEGains[0];
1100  break;
1101  case HcalForward:
1102  gain = hpar->HFGains[(depth-1)%2];
1103  break;
1104  case HcalOuter:
1105  gain = hpar->HBGains[3];
1106  break;
1107  default:
1108  gain = hpar->HBGains[0];
1109  break;
1110  }
1111  return gain;
1112 }
std::vector< double > HBGains
std::vector< double > HEGains
std::vector< double > HFGains
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getGparHF ( ) const
inline

Definition at line 51 of file HcalDDDSimConstants.h.

References HcalParameters::gparHF, and hpar.

Referenced by HFFibre::initRun(), HFShower::initRun(), HFShowerLibrary::initRun(), and HCalSD::update().

51 {return hpar->gparHF;}
std::vector< double > gparHF
const HcalParameters * hpar
const std::vector<HcalDetId>& HcalDDDSimConstants::getIdHF2QIE ( ) const
inline
std::pair<int,int> HcalDDDSimConstants::getiEtaRange ( const int &  i) const
inline

Definition at line 49 of file HcalDDDSimConstants.h.

References HcalParameters::etaMax, HcalParameters::etaMin, hpar, and mps_fire::i.

49 {return std::pair<int,int>(hpar->etaMin[i],hpar->etaMax[i]);}
std::vector< int > etaMax
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::getLastLayer ( const int &  det,
const int &  eta 
) const

Definition at line 347 of file HcalDDDSimConstants.cc.

References funct::abs(), layBHB, and layBHE.

Referenced by getIdHF2QIE(), HcalDDDRecConstants::getLayerBack(), and HcalDDDRecConstants::getThickActive().

347  {
348 
349  int lay=0;
350  if (det == 1) {
351  if (std::abs(eta) == 15) lay = layBHB[1];
352  else if (std::abs(eta) == 16) lay = layBHB[2];
353  else lay = layBHB[0];
354  } else {
355  if (std::abs(eta) == 16) lay = layBHE[1];
356  else if (std::abs(eta) == 17) lay = layBHE[2];
357  else if (std::abs(eta) == 18) lay = layBHE[3];
358  else lay = layBHE[0];
359  }
360  return lay;
361 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double HcalDDDSimConstants::getLayer0Wt ( const int &  det,
const int &  phi,
const int &  zside 
) const

Definition at line 363 of file HcalDDDSimConstants.cc.

References HcalLayerDepthMap::getLayer0Wt(), hpar, HcalParameters::Layer0Wt, and ldmap_.

Referenced by HCalSD::getEnergyDeposit(), getIdHF2QIE(), and HcalDDDRecConstants::getLayer0Wt().

364  {
365 
366  double wt = ldmap_.getLayer0Wt(det, phi, zside);
367  if (wt < 0) wt = (det == 2) ? hpar->Layer0Wt[1] : hpar->Layer0Wt[0];
368  return wt;
369 }
int zside(DetId const &)
double getLayer0Wt(const int subdet, const int iphi, const int zside) const
std::vector< double > Layer0Wt
const HcalParameters * hpar
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getLayerBack ( const int &  det,
const int &  eta,
const int &  phi,
const int &  zside,
const int &  depth 
) const

Definition at line 391 of file HcalDDDSimConstants.cc.

References depths, HcalLayerDepthMap::getLayerBack(), ldmap_, and maxLayer_.

Referenced by getIdHF2QIE(), printTileHB(), and printTileHE().

393  {
394 
395  int layer = ldmap_.getLayerBack(det, eta, phi, zside, depth);
396  if (layer < 0) {
397  if (det == 1 || det ==2) {
398  layer = depths[depth-1][eta-1];
399  } else {
400  layer = maxLayer_;
401  }
402  }
403  return layer;
404 }
static const int maxLayer_
int zside(DetId const &)
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
std::vector< int > depths[nDepthMax]
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getLayerFront ( const int &  det,
const int &  eta,
const int &  phi,
const int &  zside,
const int &  depth 
) const

Definition at line 371 of file HcalDDDSimConstants.cc.

References HcalLayerDepthMap::getLayerFront(), getLayerMax(), hpar, checklumidiff::l, layerGroup(), ldmap_, maxLayer_, maxLayerHB_, and HcalParameters::noff.

Referenced by getIdHF2QIE(), printTileHB(), and printTileHE().

373  {
374 
375  int layer = ldmap_.getLayerFront(det, eta, phi, zside, depth);
376  if (layer < 0) {
377  if (det == 1 || det == 2) {
378  layer = 1;
379  for (int l=0; l<getLayerMax(eta,depth); ++l) {
380  if ((int)(layerGroup(eta-1,l)) == depth+1) {
381  layer = l+1; break;
382  }
383  }
384  } else {
385  layer = (eta > hpar->noff[2]) ? maxLayerHB_+1 : maxLayer_;
386  }
387  }
388  return layer;
389 }
unsigned int layerGroup(int eta, int i) const
static const int maxLayer_
int zside(DetId const &)
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
int getLayerMax(const int &eta, const int &depth) const
std::vector< int > noff
const HcalParameters * hpar
static const int maxLayerHB_
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getLayerMax ( const int &  eta,
const int &  depth 
) const

Definition at line 406 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMin, hpar, createfilelist::int, layerGroupSize(), maxDepth, and maxLayerHB_.

Referenced by getIdHF2QIE(), getLayerFront(), and initialize().

406  {
407 
408  int layermx = ((eta < hpar->etaMin[1]) && depth-1 < maxDepth[0]) ? maxLayerHB_+1 : (int)layerGroupSize(eta-1);
409  return layermx;
410 }
unsigned int layerGroupSize(int eta) const
std::vector< int > maxDepth
const HcalParameters * hpar
static const int maxLayerHB_
std::vector< int > etaMin
int HcalDDDSimConstants::getMaxDepth ( const int &  type) const
inline

Definition at line 64 of file HcalDDDSimConstants.h.

References maxDepth.

Referenced by getEtaDepth(), HcalDDDRecConstants::getMaxDepth(), printTiles(), and HCalSD::update().

64 {return maxDepth[type];}
type
Definition: HCALResponse.h:21
std::vector< int > maxDepth
int HcalDDDSimConstants::getMaxDepth ( const int &  det,
const int &  eta,
const int &  phi,
const int &  zside,
const bool &  partialOnly 
) const

Definition at line 412 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMax, getDepthEta16(), HcalLayerDepthMap::getDepths(), hpar, HcalLayerDepthMap::isValid(), layerGroup(), ldmap_, maxDepth, maxHFDepth(), maxLayer_, and maxLayerHB_.

414  {
415 
416  int dmax(-1);
417  if (partialDetOnly) {
418  if (ldmap_.isValid(det,phi,zside)) {
419  dmax = ldmap_.getDepths(eta).second;
420  }
421  } else if (det == 1 || det == 2) {
422  if (ldmap_.isValid(det,phi,zside))
423  dmax = ldmap_.getDepths(eta).second;
424  else if (det == 2)
425  dmax = layerGroup(eta-1,maxLayer_);
426  else if (eta == hpar->etaMax[0])
427  dmax = getDepthEta16(det,phi,zside);
428  else
429  dmax = layerGroup(eta-1,maxLayerHB_);
430  } else if (det == 3) { // HF
431  dmax = maxHFDepth(zside*eta,phi);
432  } else if (det == 4) { // HO
433  dmax = maxDepth[3];
434  } else {
435  dmax = -1;
436  }
437  return dmax;
438 }
unsigned int layerGroup(int eta, int i) const
std::vector< int > maxDepth
static const int maxLayer_
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
std::vector< int > etaMax
std::pair< int, int > getDepths(const int eta) const
const HcalParameters * hpar
int maxHFDepth(const int &ieta, const int &iphi) const
static const int maxLayerHB_
HcalLayerDepthMap ldmap_
int getDepthEta16(const int &det, const int &phi, const int &zside) const
std::pair<int,int> HcalDDDSimConstants::getMaxDepthDet ( const int &  i) const
inline

Definition at line 68 of file HcalDDDSimConstants.h.

References depthMaxDf_, depthMaxSp_, getMinDepth(), getModHalfHBHE(), getPhiCons(), and getPhis().

Referenced by HcalDDDRecConstants::initialize().

68 {return ((i==1) ? depthMaxDf_ : depthMaxSp_);}
std::pair< int, int > depthMaxDf_
std::pair< int, int > depthMaxSp_
int HcalDDDSimConstants::getMinDepth ( const int &  det,
const int &  eta,
const int &  phi,
const int &  zside,
const bool &  partialOnly 
) const

Definition at line 440 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMin, getDepthEta16(), HcalLayerDepthMap::getDepths(), hpar, createfilelist::int, HcalLayerDepthMap::isValid(), layerGroup(), layerGroupSize(), ldmap_, and maxDepth.

Referenced by getMaxDepthDet(), and HcalDDDRecConstants::getMinDepth().

442  {
443 
444  int lmin(-1);
445  if (partialDetOnly) {
446  if (ldmap_.isValid(det,phi,zside)) {
447  lmin = ldmap_.getDepths(eta).first;
448  }
449  } else if (det == 3) { // HF
450  lmin = 1;
451  } else if (det == 4) { // HO
452  lmin = maxDepth[3];
453  } else {
454  if (ldmap_.isValid(det,phi,zside)) {
455  lmin = ldmap_.getDepths(eta).first;
456  } else if (layerGroupSize(eta-1) > 0) {
457  lmin = (int)(layerGroup(eta-1, 0));
458  unsigned int type = (det == 1) ? 0 : 1;
459  if (type == 1 && eta == hpar->etaMin[1])
460  lmin = getDepthEta16(det, phi, zside);
461  } else {
462  lmin = 1;
463  }
464  }
465  return lmin;
466 }
type
Definition: HCALResponse.h:21
unsigned int layerGroupSize(int eta) const
unsigned int layerGroup(int eta, int i) const
std::vector< int > maxDepth
bool isValid(const int det, const int phi, const int zside) const
int zside(DetId const &)
std::pair< int, int > getDepths(const int eta) const
const HcalParameters * hpar
std::vector< int > etaMin
HcalLayerDepthMap ldmap_
int getDepthEta16(const int &det, const int &phi, const int &zside) const
std::pair< int, int > HcalDDDSimConstants::getModHalfHBHE ( const int &  type) const

Definition at line 468 of file HcalDDDSimConstants.cc.

References nmodHB, nmodHE, nzHB, and nzHE.

Referenced by getMaxDepthDet().

468  {
469 
470  if (type == 0) {
471  return std::pair<int,int>(nmodHB,nzHB);
472  } else {
473  return std::pair<int,int>(nmodHE,nzHE);
474  }
475 }
type
Definition: HCALResponse.h:21
std::pair< double, double > HcalDDDSimConstants::getPhiCons ( const int &  det,
const int &  ieta 
) const

Definition at line 477 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMin, HcalEndcap, HcalForward, hpar, HcalParameters::phibin, HcalParameters::phioff, HcalParameters::phitable, and unitPhi().

Referenced by getMaxDepthDet(), getPhis(), HcalDDDRecConstants::getPhis(), and HcalNumberingFromDDD::unitID().

478  {
479 
480  double fioff(0), fibin(0);
481  if (det == static_cast<int>(HcalForward)) { // Forward HCal
482  fioff = hpar->phioff[2];
483  fibin = hpar->phitable[ieta-hpar->etaMin[2]];
484  if (unitPhi(fibin) > 2) { // HF double-phi
485  fioff = hpar->phioff[4];
486  }
487  } else { // Barrel or Endcap
488  if (det == static_cast<int>(HcalEndcap)) {
489  fioff = hpar->phioff[1];
490  } else {
491  fioff = hpar->phioff[0];
492  }
493  fibin = hpar->phibin[ieta-1];
494  }
495  return std::pair<double,double>(fioff,fibin);
496 }
int unitPhi(const int &det, const int &etaR) const
std::vector< double > phioff
std::vector< double > phitable
std::vector< double > phibin
const HcalParameters * hpar
std::vector< int > etaMin
std::vector< std::pair< int, double > > HcalDDDSimConstants::getPhis ( const int &  subdet,
const int &  ieta 
) const

Definition at line 499 of file HcalDDDSimConstants.cc.

References getPhiCons(), createfilelist::int, gen::k, phi, phiNumber(), unitPhi(), and units().

Referenced by getMaxDepthDet(), and HcalCellTypes().

499  {
500 
501  std::vector<std::pair<int,double> > phis;
502  int ietaAbs = (ieta > 0) ? ieta : -ieta;
503  std::pair<double,double> ficons = getPhiCons(subdet, ietaAbs);
504  int nphi = int((CLHEP::twopi+0.1*ficons.second)/ficons.second);
505  int units = unitPhi(subdet, ietaAbs);
506  for (int ifi = 0; ifi < nphi; ++ifi) {
507  double phi =-ficons.first + (ifi+0.5)*ficons.second;
508  int iphi = phiNumber(ifi+1,units);
509  phis.emplace_back(std::pair<int,double>(iphi,phi));
510  }
511 #ifdef EDM_ML_DEBUG
512  edm::LogVerbatim("HcalGeom") << "getPhis: subdet|ieta|iphi " << subdet << "|"
513  << ieta << " with " << phis.size()
514  << " phi bins";
515  for (unsigned int k=0; k<phis.size(); ++k)
516  edm::LogVerbatim("HcalGeom") << "[" << k << "] iphi " << phis[k].first
517  << " phi " << phis[k].second/CLHEP::deg;
518 #endif
519  return phis;
520 }
int phiNumber(const int &phi, const int &unit) const
int unitPhi(const int &det, const int &etaR) const
int k[5][pyjets_maxn]
TString units(TString variable, Char_t axis)
std::pair< double, double > getPhiCons(const int &det, const int &ieta) const
const std::vector<double>& HcalDDDSimConstants::getPhiTableHF ( ) const
inline

Definition at line 75 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::phitable.

Referenced by HcalDDDRecConstants::getHFCellParameters(), and HFShowerLibrary::initRun().

75 {return hpar->phitable;}
std::vector< double > phitable
const HcalParameters * hpar
const std::vector<double>& HcalDDDSimConstants::getRTableHF ( ) const
inline
int HcalDDDSimConstants::getShift ( const HcalSubdetector subdet,
const int &  depth 
) const
private

Definition at line 1072 of file HcalDDDSimConstants.cc.

References HcalParameters::HBShift, HcalEndcap, HcalForward, HcalOuter, HcalParameters::HEShift, HcalParameters::HFShift, hpar, and edm::shift.

Referenced by HcalCellTypes().

1073  {
1074 
1075  int shift;
1076  switch(subdet) {
1077  case HcalEndcap:
1078  shift = hpar->HEShift[0];
1079  break;
1080  case HcalForward:
1081  shift = hpar->HFShift[(depth-1)%2];
1082  break;
1083  case HcalOuter:
1084  shift = hpar->HBShift[3];
1085  break;
1086  default:
1087  shift = hpar->HBShift[0];
1088  break;
1089  }
1090  return shift;
1091 }
std::vector< int > HEShift
std::vector< int > HFShift
static unsigned int const shift
std::vector< int > HBShift
const HcalParameters * hpar
std::vector< HcalCellType > HcalDDDSimConstants::HcalCellTypes ( ) const

Definition at line 522 of file HcalDDDSimConstants.cc.

References HcalBarrel, HcalEndcap, HcalForward, HcalOuter, and mps_fire::i.

Referenced by getRTableHF(), HcalDDDRecConstants::HcalCellTypes(), HcalDDDSimConstants(), and numberOfCells().

522  {
523 
524  std::vector<HcalCellType> cellTypes = HcalCellTypes(HcalBarrel);
525 #ifdef EDM_ML_DEBUG
526  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << cellTypes.size()
527  << " cells of type HCal Barrel\n";
528  for (unsigned int i=0; i<cellTypes.size(); i++)
529  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << cellTypes[i] << "\n";
530 #endif
531 
532  std::vector<HcalCellType> hoCells = HcalCellTypes(HcalOuter);
533 #ifdef EDM_ML_DEBUG
534  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hoCells.size()
535  << " cells of type HCal Outer\n";
536  for (unsigned int i=0; i<hoCells.size(); i++)
537  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hoCells[i] << "\n";
538 #endif
539  cellTypes.insert(cellTypes.end(), hoCells.begin(), hoCells.end());
540 
541  std::vector<HcalCellType> heCells = HcalCellTypes(HcalEndcap);
542 #ifdef EDM_ML_DEBUG
543  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << heCells.size()
544  << " cells of type HCal Endcap\n";
545  for (unsigned int i=0; i<heCells.size(); i++)
546  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << heCells[i] << "\n";
547 #endif
548  cellTypes.insert(cellTypes.end(), heCells.begin(), heCells.end());
549 
550  std::vector<HcalCellType> hfCells = HcalCellTypes(HcalForward);
551 #ifdef EDM_ML_DEBUG
552  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hfCells.size()
553  << " cells of type HCal Forward\n";
554  for (unsigned int i=0; i<hfCells.size(); i++)
555  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hfCells[i] << "\n";
556 #endif
557  cellTypes.insert(cellTypes.end(), hfCells.begin(), hfCells.end());
558 
559  return cellTypes;
560 }
std::vector< HcalCellType > HcalCellTypes() const
std::vector< HcalCellType > HcalDDDSimConstants::HcalCellTypes ( const HcalSubdetector subdet,
int  ieta = -1,
int  depth = -1 
) const

Definition at line 562 of file HcalDDDSimConstants.cc.

References cell(), egammaForCoreTracking_cff::depth, dlShort, dzVcal, PVValHelper::eta, HcalParameters::etaMax, HcalParameters::etaMin, muonCSCDigis_cfi::gain, getGain(), getPhis(), getShift(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hpar, idHF2QIE, GetRecoTauVFromDQM_MC_cff::kk, checklumidiff::l, maxDepth, maxLayer_, maxLayerHB_, HcalParameters::noff, nzHB, nzHE, HcalCellType::HcalCell::ok, convertSQLiteXML::ok, phi, HcalParameters::phibin, HcalParameters::phioff, HcalParameters::phitable, HcalCellType::setPhi(), edm::shift, csvLumiCalc::unit, unitPhi(), and ecaldqm::zside().

563  {
564 
565  std::vector<HcalCellType> cellTypes;
566  if (subdet == HcalForward) {
567  if (dzVcal < 0) return cellTypes;
568  }
569 
570  int dmin, dmax, indx, nz;
571  double hsize = 0;
572  switch(subdet) {
573  case HcalEndcap:
574  dmin = 1; dmax = maxLayer_+1; indx = 1; nz = nzHE;
575  break;
576  case HcalForward:
577  dmin = 1; dmax = (!idHF2QIE.empty()) ? 2 : maxDepth[2]; indx = 2; nz = 2;
578  break;
579  case HcalOuter:
580  dmin = 4; dmax = 4; indx = 0; nz = nzHB;
581  break;
582  default:
583  dmin = 1; dmax = maxLayerHB_+1; indx = 0; nz = nzHB;
584  break;
585  }
586  if (depthl > 0) dmin = dmax = depthl;
587  int ietamin = (ieta>0) ? ieta : hpar->etaMin[indx];
588  int ietamax = (ieta>0) ? ieta : hpar->etaMax[indx];
589  int phi = (indx == 2) ? 3 : 1;
590 
591  // Get the Cells
592  int subdet0 = static_cast<int>(subdet);
593  for (int depth=dmin; depth<=dmax; depth++) {
594  int shift = getShift(subdet, depth);
595  double gain = getGain (subdet, depth);
596  if (subdet == HcalForward) {
597  if (depth%2 == 1) hsize = dzVcal;
598  else hsize = dzVcal-0.5*dlShort;
599  }
600  for (int eta=ietamin; eta<=ietamax; eta++) {
601  for (int iz=0; iz<nz; ++iz) {
602  int zside = -2*iz + 1;
603  HcalCellType::HcalCell temp1 = cell(subdet0,zside,depth,eta,phi);
604  if (temp1.ok) {
605  std::vector<std::pair<int,double> > phis = getPhis(subdet0,eta);
606  HcalCellType temp2(subdet, eta, zside, depth, temp1,
607  shift, gain, hsize);
608  double dphi, fioff;
609  std::vector<int> phiMiss2;
610  if ((subdet == HcalBarrel) || (subdet == HcalOuter)) {
611  fioff = hpar->phioff[0];
612  dphi = hpar->phibin[eta-1];
613  if (subdet == HcalOuter) {
614  if (eta == hpar->noff[4]) {
615  int kk = (iz == 0) ? 7 : (7+hpar->noff[5]);
616  for (int miss=0; miss<hpar->noff[5+iz]; miss++) {
617  phiMiss2.emplace_back(hpar->noff[kk]);
618  kk++;
619  }
620  }
621  }
622  } else if (subdet == HcalEndcap) {
623  fioff = hpar->phioff[1];
624  dphi = hpar->phibin[eta-1];
625  } else {
626  fioff = hpar->phioff[2];
627  dphi = hpar->phitable[eta-hpar->etaMin[2]];
628  if (unitPhi(dphi) > 2) fioff = hpar->phioff[4];
629  }
630  int unit = unitPhi(dphi);
631  temp2.setPhi(phis,phiMiss2,fioff,dphi,unit);
632  cellTypes.emplace_back(temp2);
633  // For HF look at extra cells
634  if ((subdet == HcalForward) && (!idHF2QIE.empty())) {
635  HcalCellType temp3(subdet, eta, zside+2, depth, temp1,
636  shift, gain, hsize);
637  std::vector<int> phiMiss3;
638  for (auto & phi : phis) {
639  bool ok(false);
640  for (auto l : idHF2QIE) {
641  if ((eta*zside == l.ieta()) &&
642  (phi.first == l.iphi())) {
643  ok = true;
644  break;
645  }
646  }
647  if (!ok) phiMiss3.emplace_back(phi.first);
648  }
649  dphi = hpar->phitable[eta-hpar->etaMin[2]];
650  unit = unitPhi(dphi);
651  fioff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2];
652  temp3.setPhi(phis,phiMiss2,fioff,dphi,unit);
653  cellTypes.emplace_back(temp3);
654  }
655  }
656  }
657  }
658  }
659  return cellTypes;
660 }
std::vector< int > maxDepth
static const int maxLayer_
int zside(DetId const &)
HcalCellType::HcalCell cell(const int &det, const int &zside, const int &depth, const int &etaR, const int &iphi) const
int getShift(const HcalSubdetector &subdet, const int &depth) const
std::vector< int > etaMax
int unitPhi(const int &det, const int &etaR) const
std::vector< HcalDetId > idHF2QIE
std::vector< double > phioff
std::vector< double > phitable
std::vector< double > phibin
static unsigned int const shift
std::vector< int > noff
const HcalParameters * hpar
static const int maxLayerHB_
double getGain(const HcalSubdetector &subdet, const int &depth) const
std::vector< std::pair< int, double > > getPhis(const int &subdet, const int &ieta) const
std::vector< int > etaMin
void HcalDDDSimConstants::initialize ( void  )
private

Definition at line 751 of file HcalDDDSimConstants.cc.

References depthEta16, depthEta29, depthMaxDf_, depthMaxSp_, depths, dlShort, runTauDisplay::dtype, HcalParameters::dzVcal, dzVcal, etaHO, ALCARECOTkAlBeamHalo_cff::etaMax, HcalParameters::etaMax, HcalParameters::etaMin, HcalParameters::etaTable, HcalLayerDepthMap::getDepthMax(), getLayerMax(), HcalParameters::gparHF, HcalForward, hpar, mps_fire::i, idHF2QIE, HcalLayerDepthMap::initialize(), isBH_, gen::k, GetRecoTauVFromDQM_MC_cff::kk, checklumidiff::l, layBHB, layBHE, HcalParameters::Layer0Wt, layerGroup(), layerGroupSize(), layFHB, layFHE, ldmap_, HcalParameters::maxDepth, maxDepth, maxLayerHB_, HcalParameters::modHB, HcalParameters::modHE, nEta, nmodHB, nmodHE, HcalParameters::noff, nPhiF, nR, nzHB, nzHE, HcalParameters::rHB, HcalParameters::rHO, rminHO, HcalParameters::rTable, HcalParameters::zHO, ecaldqm::zside(), and zVcal.

Referenced by HcalDDDSimConstants().

751  {
752 
753  nEta = hpar->etaTable.size();
754  nR = hpar->rTable.size();
755  nPhiF = nR - 1;
756  isBH_ = false;
757 
758 #ifdef EDM_ML_DEBUG
759  for (int i=0; i<nEta-1; ++i) {
760  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants:Read LayerGroup"
761  << i << ":";
762  for (unsigned int k=0; k<layerGroupSize( i ); k++)
763  edm::LogVerbatim("HcalGeom") << " [" << k << "] = " << layerGroup(i, k);
764  }
765 #endif
766 
767  // Geometry parameters for HF
768  dlShort = hpar->gparHF[0];
769  zVcal = hpar->gparHF[4];
770  dzVcal = hpar->dzVcal;
771 #ifdef EDM_ML_DEBUG
772  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants: dlShort " << dlShort
773  << " zVcal " << zVcal << " and dzVcal "
774  << dzVcal;
775 #endif
776 
777  //Transform some of the parameters
779  maxDepth[0] = maxDepth[1] = 0;
780  for (int i=0; i<nEta-1; ++i) {
781  unsigned int imx = layerGroupSize( i );
782  int laymax = (imx > 0) ? layerGroup( i, imx-1 ) : 0;
783  if (i < hpar->etaMax[0]) {
784  int laymax0 = (imx > 16) ? layerGroup(i, 16) : laymax;
785  if (i+1 == hpar->etaMax[0] && laymax0 > 2) laymax0 = 2;
786  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
787  }
788  if (i >= hpar->etaMin[1]-1 && i < hpar->etaMax[1]) {
789  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
790  }
791  }
792 #ifdef EDM_ML_DEBUG
793  for (int i=0; i<4; ++i)
794  edm::LogVerbatim("HcalGeom") << "Detector Type [" << i << "] iEta "
795  << hpar->etaMin[i] << ":" << hpar->etaMax[i]
796  << " MaxDepth " << maxDepth[i];
797 #endif
798 
799  int maxdepth = (maxDepth[1]>maxDepth[0]) ? maxDepth[1] : maxDepth[0];
800  for (int i=0; i<maxdepth; ++i) {
801  for (int k=0; k<nEta-1; ++k) {
802  int layermx = getLayerMax(k+1,i+1);
803  int ll = layermx;
804  for (int l=layermx-1; l >= 0; --l) {
805  if ((int)layerGroup( k, l ) == i+1) {
806  ll = l+1; break;
807  }
808  }
809  depths[i].emplace_back(ll);
810  }
811 
812 #ifdef EDM_ML_DEBUG
813  edm::LogVerbatim("HcalGeom") << "Depth " << i << " with "
814  << depths[i].size() << " etas:";
815  for (int k=0; k<nEta-1; ++k)
816  edm::LogVerbatim("HcalGeom") << " [" << k << "] " << depths[i][k];
817 #endif
818  }
819 
820  nzHB = hpar->modHB[1];
821  nmodHB = hpar->modHB[0];
822  nzHE = hpar->modHE[1];
823  nmodHE = hpar->modHE[0];
824 #ifdef EDM_ML_DEBUG
825  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants:: " << nzHB << ":"
826  << nmodHB << " barrel and " << nzHE << ":"
827  << nmodHE << " endcap half-sectors";
828 #endif
829 
830  if (hpar->rHB.size() > maxLayerHB_+1 && hpar->zHO.size() > 4) {
831  rminHO = hpar->rHO[0];
832  for (int k=0; k<4; ++k) etaHO[k] = hpar->rHO[k+1];
833  } else {
834  rminHO =-1.0;
835  etaHO[0] = hpar->etaTable[4];
836  etaHO[1] = hpar->etaTable[4];
837  etaHO[2] = hpar->etaTable[10];
838  etaHO[3] = hpar->etaTable[10];
839  }
840 #ifdef EDM_ML_DEBUG
841  edm::LogVerbatim("HcalGeom") << "HO Eta boundaries " << etaHO[0] << " "
842  << etaHO[1] << " " << etaHO[2] << " "
843  << etaHO[3];
844  edm::LogVerbatim("HcalGeom") << "HO Parameters " << rminHO << " "
845  << hpar->zHO.size();
846  for (int i=0; i<4; ++i)
847  edm::LogVerbatim("HcalGeom") << " eta[" << i << "] = " << etaHO[i];
848  for (unsigned int i=0; i<hpar->zHO.size(); ++i)
849  edm::LogVerbatim("HcalGeom") << " zHO[" << i << "] = " << hpar->zHO[i];
850 #endif
851 
852  int noffsize = 7 + hpar->noff[5] + hpar->noff[6];
853  int noffl(noffsize+5);
854  if ((int)(hpar->noff.size()) > (noffsize+3)) {
855  depthEta16[0] = hpar->noff[noffsize];
856  depthEta16[1] = hpar->noff[noffsize+1];
857  depthEta29[0] = hpar->noff[noffsize+2];
858  depthEta29[1] = hpar->noff[noffsize+3];
859  if ((int)(hpar->noff.size()) > (noffsize+4)) {
860  noffl += (2*hpar->noff[noffsize+4]);
861  if ((int)(hpar->noff.size()) > noffl) isBH_ = (hpar->noff[noffl] > 0);
862  }
863  } else {
864  depthEta16[0] = 2;
865  depthEta16[1] = 3;
866  depthEta29[0] = 2;
867  depthEta29[1] = 1;
868  }
869 #ifdef EDM_ML_DEBUG
870  edm::LogVerbatim("HcalGeom") << "isBH_ " << hpar->noff.size() << ":"
871  << noffsize << ":" << noffl << ":" << isBH_;
872  edm::LogVerbatim("HcalGeom") << "Depth index at ieta = 16 for HB (max) "
873  << depthEta16[0] << " HE (min) " <<depthEta16[1]
874  << "; max depth for itea = 29 : ("
875  << depthEta29[0] << ":" << depthEta29[1] << ")";
876 #endif
877 
878  if ((int)(hpar->noff.size()) > (noffsize+4)) {
879  int npair = hpar->noff[noffsize+4];
880  int kk = noffsize+4;
881  for (int k=0; k<npair; ++k) {
882  idHF2QIE.emplace_back(HcalDetId(HcalForward,hpar->noff[kk+1],hpar->noff[kk+2],1));
883  kk += 2;
884  }
885  }
886 #ifdef EDM_ML_DEBUG
887  edm::LogVerbatim("HcalGeom") << idHF2QIE.size()
888  << " detector channels having 2 QIE cards:";
889  for (unsigned int k=0; k<idHF2QIE.size(); ++k)
890  edm::LogVerbatim("HcalGeom") << " [" << k << "] " << idHF2QIE[k];
891 #endif
892 
893  layFHB[0] = 0; layFHB[1] = 1;
894  layBHB[0] = 16; layBHB[1] = 15; layBHB[2] = 8;
895  layFHE[0] = 1; layFHE[1] = 4; layFHE[2] = 0;
896  layBHE[0] = 18; layBHE[1] = 9; layBHE[2] = 14; layBHE[3] = 16;
897  depthMaxSp_ = std::pair<int,int>(0,0);
898  int noffk(noffsize+5);
899  if ((int)(hpar->noff.size()) > (noffsize+5)) {
900  noffk += (2*hpar->noff[noffsize+4]);
901  if ((int)(hpar->noff.size()) >= noffk+7) {
902  int dtype = hpar->noff[noffk+1];
903  int nphi = hpar->noff[noffk+2];
904  int ndeps = hpar->noff[noffk+3];
905  int ndp16 = hpar->noff[noffk+4];
906  int ndp29 = hpar->noff[noffk+5];
907  double wt = 0.1*(hpar->noff[noffk+6]);
908  if ((int)(hpar->noff.size()) >= (noffk+7+nphi+3*ndeps)) {
909  if (dtype == 1 || dtype == 2) {
910  std::vector<int> ifi, iet, ily, idp;
911  for (int i=0; i<nphi; ++i) ifi.emplace_back(hpar->noff[noffk+7+i]);
912  for (int i=0; i<ndeps;++i) {
913  iet.emplace_back(hpar->noff[noffk+7+nphi+3*i]);
914  ily.emplace_back(hpar->noff[noffk+7+nphi+3*i+1]);
915  idp.emplace_back(hpar->noff[noffk+7+nphi+3*i+2]);
916  }
917 #ifdef EDM_ML_DEBUG
918  edm::LogVerbatim("HcalGeom") << "Initialize HcalLayerDepthMap for "
919  << "Detector " << dtype << " etaMax "
920  << hpar->etaMax[dtype] << " with "
921  << nphi << " sectors";
922  for (int i=0; i<nphi; ++i)
923  edm::LogVerbatim("HcalGeom") << " [" << i << "] " << ifi[i];
924  edm::LogVerbatim("HcalGeom") << "And " << ndeps << " depth sections";
925  for (int i=0; i<ndeps;++i)
926  edm::LogVerbatim("HcalGeom") << " [" << i << "] " << iet[i] << " "
927  << ily[i] << " " << idp[i];
928  edm::LogVerbatim("HcalGeom") <<"Maximum depth for last HE Eta tower "
929  << depthEta29[0] << ":" << ndp16 << ":"
930  << ndp29 << " L0 Wt "
931  << hpar->Layer0Wt[dtype-1] << ":" << wt;
932 #endif
933  ldmap_.initialize(dtype,hpar->etaMax[dtype-1],ndp16,ndp29,wt,ifi,iet,
934  ily,idp);
935  int zside = (ifi[0]>0) ? 1 : -1;
936  int iphi = (ifi[0]>0) ? ifi[0] : -ifi[0];
937  depthMaxSp_ = std::pair<int,int>(dtype,ldmap_.getDepthMax(dtype,iphi,zside));
938  }
939  }
940  int noffm = (noffk+7+nphi+3*ndeps);
941  if ((int)(hpar->noff.size()) > noffm) {
942  int ndnext = hpar->noff[noffm];
943  if (ndnext > 4 && (int)(hpar->noff.size()) >= noffm+ndnext) {
944  for (int i=0; i<2; ++i) layFHB[i] = hpar->noff[noffm+i+1];
945  for (int i=0; i<3; ++i) layFHE[i] = hpar->noff[noffm+i+3];
946  }
947  if (ndnext > 11 && (int)(hpar->noff.size()) >= noffm+ndnext) {
948  for (int i=0; i<3; ++i) layBHB[i] = hpar->noff[noffm+i+6];
949  for (int i=0; i<4; ++i) layBHE[i] = hpar->noff[noffm+i+9];
950  }
951  }
952  }
953  }
954 #ifdef EDM_ML_DEBUG
955  edm::LogVerbatim("HcalGeom") << "Front Layer Definition for HB: "
956  << layFHB[0] << ":" << layFHB[1]
957  << " and for HE: " << layFHE[0] << ":"
958  << layFHE[1] << ":" << layFHE[2];
959  edm::LogVerbatim("HcalGeom") << "Last Layer Definition for HB: " << layBHB[0]
960  << ":" << layBHB[1] << ":" << layBHB[2]
961  << " and for HE: " << layBHE[0] << ":"
962  << layBHE[1] << ":" << layBHE[2] << ":"
963  << layBHE[3];
964 #endif
965  if (depthMaxSp_.first == 0) {
966  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
967  } else if (depthMaxSp_.first == 1) {
968  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
969  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
970  } else {
971  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
972  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
973  }
974 #ifdef EDM_ML_DEBUG
975  edm::LogVerbatim("HcalGeom") <<"Detector type and maximum depth for all RBX "
976  << depthMaxDf_.first << ":" <<depthMaxDf_.second
977  << " and for special RBX " << depthMaxSp_.first
978  << ":" << depthMaxSp_.second;
979 #endif
980 }
std::vector< double > zHO
std::vector< double > etaTable
unsigned int layerGroupSize(int eta) const
unsigned int layerGroup(int eta, int i) const
void initialize(const int subdet, const int ietaMax, const int dep16C, const int dep29C, const double wtl0C, std::vector< int > const &iphi, std::vector< int > const &ieta, std::vector< int > const &layer, std::vector< int > const &depth)
std::vector< int > maxDepth
std::vector< double > rHB
int zside(DetId const &)
std::vector< int > etaMax
std::vector< int > depths[nDepthMax]
std::vector< int > modHB
std::vector< double > rHO
std::pair< int, int > depthMaxDf_
std::vector< int > modHE
int getLayerMax(const int &eta, const int &depth) const
std::vector< HcalDetId > idHF2QIE
int k[5][pyjets_maxn]
std::vector< double > gparHF
std::vector< double > Layer0Wt
std::vector< double > rTable
std::vector< int > noff
std::pair< int, int > depthMaxSp_
const HcalParameters * hpar
std::vector< int > maxDepth
static const int maxLayerHB_
int getDepthMax(const int subdet, const int iphi, const int zside) const
std::vector< int > etaMin
HcalLayerDepthMap ldmap_
bool HcalDDDSimConstants::isBH ( ) const
inline

Definition at line 80 of file HcalDDDSimConstants.h.

References isBH_.

Referenced by HcalDDDRecConstants::isBH().

80 {return isBH_;}
unsigned int HcalDDDSimConstants::layerGroup ( int  eta,
int  i 
) const
private

Definition at line 1237 of file HcalDDDSimConstants.cc.

References hpar, gen::k, and HcalParameters::layerGroupEtaSim.

Referenced by getEtaDepth(), getLayerFront(), getMaxDepth(), getMinDepth(), initialize(), and layerGroup().

1237  {
1238  unsigned int k = 0;
1239  for (auto const & it : hpar->layerGroupEtaSim) {
1240  if (it.layer == (unsigned int)(eta + 1)) {
1241  return it.layerGroup.at(i);
1242  }
1243  if (it.layer > (unsigned int)(eta + 1)) break;
1244  k = it.layerGroup.at(i);
1245  }
1246  return k;
1247 }
std::vector< LayerItem > layerGroupEtaSim
int k[5][pyjets_maxn]
const HcalParameters * hpar
unsigned int HcalDDDSimConstants::layerGroup ( int  det,
int  eta,
int  phi,
int  zside,
int  i 
) const
private

Definition at line 1249 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, findDepth(), and layerGroup().

1251  {
1252 
1253  int depth0 = findDepth(det,eta,phi,zside,lay);
1254  unsigned int depth = (depth0 > 0) ? (unsigned int)(depth0) : layerGroup(eta-1,lay);
1255  return depth;
1256 }
int findDepth(const int &det, const int &eta, const int &phi, const int &zside, const int &lay) const
unsigned int layerGroup(int eta, int i) const
int zside(DetId const &)
unsigned int HcalDDDSimConstants::layerGroupSize ( int  eta) const
private

Definition at line 1225 of file HcalDDDSimConstants.cc.

References hpar, gen::k, and HcalParameters::layerGroupEtaSim.

Referenced by getLayerMax(), getMinDepth(), and initialize().

1225  {
1226  unsigned int k = 0;
1227  for (auto const & it : hpar->layerGroupEtaSim) {
1228  if (it.layer == (unsigned int)(eta + 1)) {
1229  return it.layerGroup.size();
1230  }
1231  if (it.layer > (unsigned int)(eta + 1)) break;
1232  k = it.layerGroup.size();
1233  }
1234  return k;
1235 }
std::vector< LayerItem > layerGroupEtaSim
int k[5][pyjets_maxn]
const HcalParameters * hpar
const HcalLayerDepthMap* HcalDDDSimConstants::ldMap ( ) const
inline
int HcalDDDSimConstants::maxHFDepth ( const int &  ieta,
const int &  iphi 
) const

Definition at line 662 of file HcalDDDSimConstants.cc.

References idHF2QIE, gen::k, maxDepth, and convertSQLiteXML::ok.

Referenced by getMaxDepth(), ldMap(), HcalDDDRecConstants::maxHFDepth(), FastHFShowerLibrary::modifyDepth(), and HCalSD::modifyDepth().

662  {
663  int mxdepth = maxDepth[2];
664  if (!idHF2QIE.empty()) {
665  bool ok(false);
666  for (auto k : idHF2QIE) {
667  if ((eta == k.ieta()) && (iphi == k.iphi())) {
668  ok = true; break;
669  }
670  }
671  if (!ok) mxdepth = 2;
672  }
673  return mxdepth;
674 }
std::vector< int > maxDepth
std::vector< HcalDetId > idHF2QIE
int k[5][pyjets_maxn]
unsigned int HcalDDDSimConstants::numberOfCells ( const HcalSubdetector subdet) const

Definition at line 676 of file HcalDDDSimConstants.cc.

References HcalCellTypes(), createfilelist::int, and pileupDistInMC::num.

Referenced by ldMap(), HcalDDDRecConstants::nCells(), and HcalDDDRecConstants::numberOfCells().

676  {
677 
678  unsigned int num = 0;
679  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
680  for (auto & cellType : cellTypes) {
681  num += (unsigned int)(cellType.nPhiBins());
682  }
683 #ifdef EDM_ML_DEBUG
684  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants:numberOfCells "
685  << cellTypes.size() << " " << num
686  << " for subdetector " << subdet;
687 #endif
688  return num;
689 }
std::vector< HcalCellType > HcalCellTypes() const
int HcalDDDSimConstants::phiNumber ( const int &  phi,
const int &  unit 
) const

Definition at line 691 of file HcalDDDSimConstants.cc.

References phi.

Referenced by HcalDDDRecConstants::getHCID(), getPhis(), HcalDDDRecConstants::getPhis(), ldMap(), and HcalNumberingFromDDD::unitID().

691  {
692 
693  int iphi_skip = phi;
694  if (units==2) iphi_skip = (phi-1)*2+1;
695  else if (units==4) iphi_skip = (phi-1)*4-1;
696  if (iphi_skip < 0) iphi_skip += 72;
697  return iphi_skip;
698 }
TString units(TString variable, Char_t axis)
void HcalDDDSimConstants::printTileHB ( const int &  eta,
const int &  phi,
const int &  zside,
const int &  depth 
) const
private

Definition at line 1114 of file HcalDDDSimConstants.cc.

References jets_cff::area, funct::cos(), egammaForCoreTracking_cff::depth, HcalParameters::dxHB, HcalParameters::dyHB, PVValHelper::dz, HcalParameters::etaTable, JetChargeProducer_cfi::exp, getLayerBack(), getLayerFront(), hpar, gen::k, GetRecoTauVFromDQM_MC_cff::kk, HcalParameters::layHB, SiStripPI::mean, min(), HcalParameters::rhoxHB, and funct::sin().

Referenced by printTiles().

1115  {
1116  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::printTileHB for eta "
1117  << eta << " and depth " << depth;
1118 
1119  double etaL = hpar->etaTable.at(eta-1);
1120  double thetaL = 2.*atan(exp(-etaL));
1121  double etaH = hpar->etaTable.at(eta);
1122  double thetaH = 2.*atan(exp(-etaH));
1123  int layL = getLayerFront(1,eta,phi,zside,depth);
1124  int layH = getLayerBack(1,eta,phi,zside,depth);
1125  edm::LogVerbatim("HcalGeom") << "\ntileHB:: eta|depth " << zside*eta << "|"
1126  << depth << " theta " << thetaH/CLHEP::deg
1127  << ":" << thetaL/CLHEP::deg << " Layer "
1128  << layL << ":" << layH-1;
1129  for (int lay=layL; lay<layH; ++lay) {
1130  std::vector<double> area(2,0);
1131  int kk(0);
1132  double mean(0);
1133  for (unsigned int k=0; k<hpar->layHB.size(); ++k) {
1134  if (lay == hpar->layHB[k]) {
1135  double zmin = hpar->rhoxHB[k]*std::cos(thetaL)/std::sin(thetaL);
1136  double zmax = hpar->rhoxHB[k]*std::cos(thetaH)/std::sin(thetaH);
1137  double dz = (std::min(zmax,hpar->dxHB[k]) - zmin);
1138  if (dz > 0) {
1139  area[kk] = dz*hpar->dyHB[k];
1140  mean += area[kk];
1141  kk++;
1142  }
1143  }
1144  }
1145  if (area[0] > 0) {
1146  mean /= (kk*100);
1147  edm::LogVerbatim("HcalGeom") << std::setw(2) << lay << " Area "
1148  << std::setw(8) << area[0] << " "
1149  << std::setw(8) << area[1] << " Mean "
1150  << mean;
1151  }
1152  }
1153 }
std::vector< double > etaTable
std::vector< double > rhoxHB
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int getLayerFront(const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
int zside(DetId const &)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T min(T a, T b)
Definition: MathUtil.h:58
int k[5][pyjets_maxn]
std::vector< double > dyHB
int getLayerBack(const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
std::vector< double > dxHB
const HcalParameters * hpar
std::vector< int > layHB
void HcalDDDSimConstants::printTileHE ( const int &  eta,
const int &  phi,
const int &  zside,
const int &  depth 
) const
private

Definition at line 1155 of file HcalDDDSimConstants.cc.

References jets_cff::area, HcalParameters::dx1HE, HcalParameters::dyHE, PVValHelper::eta, HcalParameters::etaTable, JetChargeProducer_cfi::exp, getLayerBack(), getLayerFront(), hpar, gen::k, GetRecoTauVFromDQM_MC_cff::kk, HcalParameters::layHE, SiStripPI::max, SiStripPI::mean, min(), HcalParameters::phibin, HcalParameters::rhoxHE, funct::tan(), and HcalParameters::zxHE.

Referenced by printTiles().

1156  {
1157 
1158  double etaL = hpar->etaTable[eta-1];
1159  double thetaL = 2.*atan(exp(-etaL));
1160  double etaH = hpar->etaTable[eta];
1161  double thetaH = 2.*atan(exp(-etaH));
1162  int layL = getLayerFront(2,eta,phi,zside,depth);
1163  int layH = getLayerBack(2,eta,phi,zside,depth);
1164  double phib = hpar->phibin[eta-1];
1165  int nphi = 2;
1166  if (phib > 6*CLHEP::deg) nphi = 1;
1167  edm::LogVerbatim("HcalGeom") << "\ntileHE:: Eta/depth " << zside*eta << "|"
1168  << depth << " theta " << thetaH/CLHEP::deg
1169  << ":" << thetaL/CLHEP::deg << " Layer "
1170  << layL << ":" << layH-1 << " phi " << nphi;
1171  for (int lay=layL; lay<layH; ++lay) {
1172  std::vector<double> area(4,0);
1173  int kk(0);
1174  double mean(0);
1175  for (unsigned int k=0; k<hpar->layHE.size(); ++k) {
1176  if (lay == hpar->layHE[k]) {
1177  double rmin = hpar->zxHE[k]*std::tan(thetaH);
1178  double rmax = hpar->zxHE[k]*std::tan(thetaL);
1179  if ((lay != 0 || eta == 18) &&
1180  (lay != 1 || (eta == 18 && hpar->rhoxHE[k]-hpar->dyHE[k] > 1000) ||
1181  (eta != 18 && hpar->rhoxHE[k]-hpar->dyHE[k] < 1000)) &&
1182  rmin+30 < hpar->rhoxHE[k]+hpar->dyHE[k] &&
1183  rmax > hpar->rhoxHE[k]-hpar->dyHE[k]) {
1184  rmin = std::max(rmin,hpar->rhoxHE[k]-hpar->dyHE[k]);
1185  rmax = std::min(rmax,hpar->rhoxHE[k]+hpar->dyHE[k]);
1186  double dx1 = rmin*std::tan(phib);
1187  double dx2 = rmax*std::tan(phib);
1188  double ar1=0, ar2=0;
1189  if (nphi == 1) {
1190  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*hpar->dx1HE[k]);
1191  mean += ar1;
1192  } else {
1193  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*hpar->dx1HE[k]);
1194  ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*tan(10.*CLHEP::deg)-4*hpar->dx1HE[k])-ar1;
1195  mean += (ar1+ar2);
1196  }
1197  area[kk] = ar1;
1198  area[kk+2] = ar2;
1199  kk++;
1200  }
1201  }
1202  }
1203  if (area[0] > 0 && area[1] > 0) {
1204  int lay0 = lay-1;
1205  if (eta == 18) lay0++;
1206  if (nphi == 1) {
1207  mean /= (kk*100);
1208  edm::LogVerbatim("HcalGeom") << std::setw(2) << lay0 << " Area "
1209  << std::setw(8) << area[0] << " "
1210  << std::setw(8) << area[1] << " Mean "
1211  << mean;
1212  } else {
1213  mean /= (kk*200);
1214  edm::LogVerbatim("HcalGeom") << std::setw(2) << lay0 << " Area "
1215  << std::setw(8) << area[0] << " "
1216  << std::setw(8) << area[1] << ":"
1217  << std::setw(8) << area[2] << " "
1218  << std::setw(8) << area[3] << " Mean "
1219  << mean;
1220  }
1221  }
1222  }
1223 }
std::vector< double > etaTable
std::vector< int > layHE
int getLayerFront(const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
int zside(DetId const &)
std::vector< double > rhoxHE
std::vector< double > zxHE
std::vector< double > dyHE
std::vector< double > dx1HE
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
T min(T a, T b)
Definition: MathUtil.h:58
int k[5][pyjets_maxn]
int getLayerBack(const int &det, const int &eta, const int &phi, const int &zside, const int &depth) const
std::vector< double > phibin
const HcalParameters * hpar
void HcalDDDSimConstants::printTiles ( ) const

Definition at line 700 of file HcalDDDSimConstants.cc.

References egammaForCoreTracking_cff::depth, PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::etaMax, HcalParameters::etaMax, HcalParameters::etaMin, getDepthEta16(), getMaxDepth(), hpar, ldmap_, printTileHB(), printTileHE(), HcalLayerDepthMap::validDet(), and ecaldqm::zside().

Referenced by ldMap().

700  {
701 
702  std::vector<int> phis;
703  int detsp = ldmap_.validDet(phis);
704  int kphi = (detsp > 0) ? phis[0] : 1;
705  int zside = (kphi > 0) ? 1 : -1;
706  int iphi = (kphi > 0) ? kphi : -kphi;
707  edm::LogVerbatim("HcalGeom") << "Tile Information for HB from "
708  << hpar->etaMin[0] << " to " << hpar->etaMax[0]
709  << "\n";
710  for (int eta=hpar->etaMin[0]; eta<= hpar->etaMax[0]; eta++) {
711  int dmax = getMaxDepth(1,eta,iphi,-zside,false);
712  for (int depth=1; depth<=dmax; depth++)
713  printTileHB(eta, iphi, -zside, depth);
714  if (detsp == 1) {
715  int dmax = getMaxDepth(1,eta,iphi,zside,false);
716  for (int depth=1; depth<=dmax; depth++)
717  printTileHB(eta, iphi, zside, depth);
718  }
719  }
720 
721  edm::LogVerbatim("HcalGeom") << "\nTile Information for HE from "
722  << hpar->etaMin[1] << " to " << hpar->etaMax[1]
723  << "\n";
724  for (int eta=hpar->etaMin[1]; eta<= hpar->etaMax[1]; eta++) {
725  int dmin = (eta == hpar->etaMin[1]) ? getDepthEta16(2,iphi,-zside) : 1;
726  int dmax = getMaxDepth(2,eta,iphi,-zside,false);
727  for (int depth=dmin; depth<=dmax; depth++)
728  printTileHE(eta, iphi, -zside, depth);
729  if (detsp == 2) {
730  int dmax = getMaxDepth(2,eta,iphi,zside,false);
731  for (int depth=1; depth<=dmax; depth++)
732  printTileHE(eta, iphi, zside, depth);
733  }
734  }
735 }
int zside(DetId const &)
void printTileHB(const int &eta, const int &phi, const int &zside, const int &depth) const
std::vector< int > etaMax
int validDet(std::vector< int > &phis) const
int getMaxDepth(const int &type) const
const HcalParameters * hpar
void printTileHE(const int &eta, const int &phi, const int &zside, const int &depth) const
std::vector< int > etaMin
HcalLayerDepthMap ldmap_
int getDepthEta16(const int &det, const int &phi, const int &zside) const
int HcalDDDSimConstants::unitPhi ( const int &  det,
const int &  etaR 
) const

Definition at line 737 of file HcalDDDSimConstants.cc.

References HcalParameters::etaMin, HcalForward, hpar, HcalParameters::phibin, and HcalParameters::phitable.

Referenced by cell(), HcalDDDRecConstants::getEtaPhi(), HcalDDDRecConstants::getHCID(), getPhiCons(), getPhis(), HcalDDDRecConstants::getPhis(), HcalCellTypes(), HcalDDDRecConstants::HcalCellTypes(), HcalDDDRecConstants::initialize(), ldMap(), and HcalNumberingFromDDD::unitID().

737  {
738 
739  double dphi = (det == static_cast<int>(HcalForward)) ? hpar->phitable[etaR-hpar->etaMin[2]] : hpar->phibin[etaR-1];
740  return unitPhi(dphi);
741 }
int unitPhi(const int &det, const int &etaR) const
std::vector< double > phitable
std::vector< double > phibin
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::unitPhi ( const double &  dphi) const

Definition at line 743 of file HcalDDDSimConstants.cc.

References createfilelist::int, M_PI, and units().

743  {
744 
745  const double fiveDegInRad = 2*M_PI/72;
746  int units = int(dphi/fiveDegInRad+0.5);
747  if (units < 1) units = 1;
748  return units;
749 }
#define M_PI
TString units(TString variable, Char_t axis)

Member Data Documentation

int HcalDDDSimConstants::depthEta16[2]
private

Definition at line 127 of file HcalDDDSimConstants.h.

Referenced by getDepthEta16(), getDepthEta16M(), getDetEta(), and initialize().

int HcalDDDSimConstants::depthEta29[2]
private

Definition at line 128 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getDepthEta29(), getDepthEta29M(), getEta(), and initialize().

std::pair<int,int> HcalDDDSimConstants::depthMaxDf_
private

Definition at line 135 of file HcalDDDSimConstants.h.

Referenced by getMaxDepthDet(), and initialize().

std::pair<int,int> HcalDDDSimConstants::depthMaxSp_
private

Definition at line 135 of file HcalDDDSimConstants.h.

Referenced by getMaxDepthDet(), and initialize().

std::vector<int> HcalDDDSimConstants::depths[nDepthMax]
private

Definition at line 119 of file HcalDDDSimConstants.h.

Referenced by getLayerBack(), and initialize().

double HcalDDDSimConstants::dlShort
private

Definition at line 126 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getEta(), HcalCellTypes(), and initialize().

double HcalDDDSimConstants::dzVcal
private

Definition at line 125 of file HcalDDDSimConstants.h.

Referenced by HcalCellTypes(), and initialize().

double HcalDDDSimConstants::etaHO[4]
private

Definition at line 123 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getEta(), and initialize().

const HcalParameters* HcalDDDSimConstants::hpar
private
std::vector<HcalDetId> HcalDDDSimConstants::idHF2QIE
private

Definition at line 134 of file HcalDDDSimConstants.h.

Referenced by getIdHF2QIE(), HcalCellTypes(), initialize(), and maxHFDepth().

bool HcalDDDSimConstants::isBH_
private

Definition at line 133 of file HcalDDDSimConstants.h.

Referenced by initialize(), and isBH().

int HcalDDDSimConstants::layBHB[3]
private

Definition at line 131 of file HcalDDDSimConstants.h.

Referenced by getLastLayer(), and initialize().

int HcalDDDSimConstants::layBHE[4]
private

Definition at line 132 of file HcalDDDSimConstants.h.

Referenced by getLastLayer(), and initialize().

int HcalDDDSimConstants::layFHB[2]
private

Definition at line 129 of file HcalDDDSimConstants.h.

Referenced by getFrontLayer(), and initialize().

int HcalDDDSimConstants::layFHE[3]
private

Definition at line 130 of file HcalDDDSimConstants.h.

Referenced by getFrontLayer(), and initialize().

HcalLayerDepthMap HcalDDDSimConstants::ldmap_
private
std::vector<int> HcalDDDSimConstants::maxDepth
private
const int HcalDDDSimConstants::maxLayer_ =18
staticprivate

Definition at line 92 of file HcalDDDSimConstants.h.

Referenced by getEta(), getLayerBack(), getLayerFront(), getMaxDepth(), and HcalCellTypes().

const int HcalDDDSimConstants::maxLayerHB_ =16
staticprivate
int HcalDDDSimConstants::nDepth
private

Definition at line 120 of file HcalDDDSimConstants.h.

const int HcalDDDSimConstants::nDepthMax =9
staticprivate

Definition at line 91 of file HcalDDDSimConstants.h.

int HcalDDDSimConstants::nEta
private

Definition at line 116 of file HcalDDDSimConstants.h.

Referenced by cell(), deltaEta(), getDetEta(), getEta(), and initialize().

int HcalDDDSimConstants::nmodHB
private

Definition at line 121 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), and initialize().

int HcalDDDSimConstants::nmodHE
private

Definition at line 122 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), and initialize().

int HcalDDDSimConstants::nPhiF
private

Definition at line 118 of file HcalDDDSimConstants.h.

Referenced by initialize().

int HcalDDDSimConstants::nR
private

Definition at line 117 of file HcalDDDSimConstants.h.

Referenced by cell(), deltaEta(), getEta(), and initialize().

int HcalDDDSimConstants::nzHB
private

Definition at line 121 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), HcalCellTypes(), and initialize().

int HcalDDDSimConstants::nzHE
private

Definition at line 122 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), HcalCellTypes(), and initialize().

double HcalDDDSimConstants::rminHO
private

Definition at line 123 of file HcalDDDSimConstants.h.

Referenced by getEtaHO(), and initialize().

double HcalDDDSimConstants::zVcal
private

Definition at line 124 of file HcalDDDSimConstants.h.

Referenced by deltaEta(), getDetEta(), getEta(), and initialize().