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 10 of file HcalDDDSimConstants.cc.

References HcalCellTypes(), and initialize().

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

Definition at line 24 of file HcalDDDSimConstants.cc.

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

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 30 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().

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

986  {
987 
988  double tmp = 0;
989  if (det == static_cast<int>(HcalForward)) {
990  int ir = nR + hpar->etaMin[2] - etaR - 1;
991  if (ir > 0 && ir < nR) {
992  double z = zVcal;
993  if (depth%2 != 1) z += dlShort;
994  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)-getEta(hpar->rTable[ir],z));
995  }
996  } else {
997  if (etaR > 0 && etaR < nEta) {
998  if (etaR == hpar->noff[1]-1 && depth > depthEta29[0]) {
999  tmp = 0.5*(hpar->etaTable[etaR+1]-hpar->etaTable[etaR-1]);
1000  } else if (det == static_cast<int>(HcalOuter)) {
1001  if (etaR == hpar->noff[2]) {
1002  tmp = 0.5*(etaHO[0]-hpar->etaTable[etaR-1]);
1003  } else if (etaR == hpar->noff[2]+1) {
1004  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[1]);
1005  } else if (etaR == hpar->noff[3]) {
1006  tmp = 0.5*(etaHO[2]-hpar->etaTable[etaR-1]);
1007  } else if (etaR == hpar->noff[3]+1) {
1008  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[3]);
1009  } else {
1010  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
1011  }
1012  } else {
1013  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
1014  }
1015  }
1016  }
1017 #ifdef EDM_ML_DEBUG
1018  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::deltaEta " << etaR
1019  << " " << depth << " ==> " << tmp;
1020 #endif
1021  return tmp;
1022 }
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 123 of file HcalDDDSimConstants.cc.

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

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

125  {
126 
127  int depth = (ldmap_.isValid(det,phi,zside)) ? ldmap_.getDepth(det,eta,phi,zside,lay) : -1;
128  return depth;
129 }
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 131 of file HcalDDDSimConstants.cc.

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

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

Definition at line 143 of file HcalDDDSimConstants.cc.

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

143  {
144 
145  std::vector<std::pair<double,double> > gcons;
146  if (type == 0) {
147  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
148  gcons.emplace_back(std::pair<double,double>(hpar->rHB[i],hpar->drHB[i]));
149  }
150  } else {
151  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
152  gcons.emplace_back(std::pair<double,double>(hpar->zHE[i],hpar->dzHE[i]));
153  }
154  }
155  return gcons;
156 }
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 158 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().

159  {
160 
161  int depth = ldmap_.getDepth16(det,phi,zside);
162  if (depth < 0) depth = (det == 2) ? depthEta16[1] : depthEta16[0];
163 #ifdef EDM_ML_DEBUG
164  edm::LogVerbatim("HcalGeom") << "getDepthEta16: " << det << ":" << depth;
165 #endif
166  return depth;
167 }
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 169 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().

169  {
170  int depth = (det == 2) ? depthEta16[1] : depthEta16[0];
171  std::vector<int> phis;
172  int detsp = ldmap_.validDet(phis);
173  if (detsp == det) {
174  int zside = (phis[0] > 0) ? 1 : -1;
175  int iphi = (phis[0] > 0) ? phis[0] : -phis[0];
176  int depthsp = ldmap_.getDepth16(det,iphi,zside);
177  if (det == 1 && depthsp > depth) depth = depthsp;
178  if (det == 2 && depthsp < depth) depth = depthsp;
179  }
180  return depth;
181 }
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 183 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().

184  {
185 
186  int depth = (i == 0) ? ldmap_.getMaxDepthLastHE(2,phi,zside) : -1;
187  if (depth < 0) depth = (i == 1) ? depthEta29[1] : depthEta29[0];
188  return depth;
189 }
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 191 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().

192  {
193  int depth = (i == 1) ? depthEta29[1] : depthEta29[0];
194  if (i == 0 && planOne) {
195  std::vector<int> phis;
196  int detsp = ldmap_.validDet(phis);
197  if (detsp == 2) {
198  int zside = (phis[0] > 0) ? 1 : -1;
199  int iphi = (phis[0] > 0) ? phis[0] : -phis[0];
200  int depthsp = ldmap_.getMaxDepthLastHE(2,iphi,zside);
201  if (depthsp > depth) depth = depthsp;
202  }
203  }
204  return depth;
205 }
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 207 of file HcalDDDSimConstants.cc.

References depthEta16, PVValHelper::eta, ALCARECOTkAlBeamHalo_cff::etaMax, 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().

208  {
209 
210  int hsubdet(0), ieta(0);
211  double etaR(0);
212  double heta = fabs(eta);
213  for (int i = 0; i < nEta; i++)
214  if (heta > hpar->etaTable[i]) ieta = i + 1;
215  if (heta <= hpar->etaRange[1]) {
216  if (((ieta == hpar->etaMin[1] && depth==depthEta16[1]) ||
217  (ieta > hpar->etaMax[0])) && (ieta <= hpar->etaMax[1])) {
218  hsubdet = static_cast<int>(HcalEndcap);
219  } else {
220  hsubdet = static_cast<int>(HcalBarrel);
221  }
222  etaR = eta;
223  } else {
224  hsubdet = static_cast<int>(HcalForward);
225  double theta = 2.*atan(exp(-heta));
226  double hR = zVcal*tan(theta);
227  etaR = (eta >= 0. ? hR : -hR);
228  }
229  return std::pair<int,double>(hsubdet,etaR);
230 }
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 232 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().

233  {
234 
235  int ieta(0);
236  if (det == static_cast<int>(HcalForward)) { // Forward HCal
237  ieta = hpar->etaMax[2];
238  for (int i = nR-1; i > 0; i--)
239  if (hetaR < hpar->rTable[i]) ieta = hpar->etaMin[2] + nR - i - 1;
240  } else { // Barrel or Endcap
241  ieta = 1;
242  for (int i = 0; i < nEta-1; i++)
243  if (hetaR > hpar->etaTable[i]) ieta = i + 1;
244  if (det == static_cast<int>(HcalBarrel)) {
245  if (ieta > hpar->etaMax[0]) ieta = hpar->etaMax[0];
246  if (lay == maxLayer_) {
247  if (hetaR > etaHO[1] && ieta == hpar->noff[2]) ieta++;
248  }
249  } else if (det == static_cast<int>(HcalEndcap)) {
250  if (ieta <= hpar->etaMin[1]) ieta = hpar->etaMin[1];
251  }
252  }
253  return ieta;
254 }
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 1024 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.

1025  {
1026 
1027  double tmp = 0;
1028  if (det == static_cast<int>(HcalForward)) {
1029  int ir = nR + hpar->etaMin[2] - etaR - 1;
1030  if (ir > 0 && ir < nR) {
1031  double z = zVcal;
1032  if (depth%2 != 1) z += dlShort;
1033  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)+getEta(hpar->rTable[ir],z));
1034  }
1035  } else {
1036  if (etaR > 0 && etaR < nEta) {
1037  if (etaR == hpar->noff[1]-1 && depth > depthEta29[0]) {
1038  tmp = 0.5*(hpar->etaTable[etaR+1]+hpar->etaTable[etaR-1]);
1039  } else if (det == static_cast<int>(HcalOuter)) {
1040  if (etaR == hpar->noff[2]) {
1041  tmp = 0.5*(etaHO[0]+hpar->etaTable[etaR-1]);
1042  } else if (etaR == hpar->noff[2]+1) {
1043  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[1]);
1044  } else if (etaR == hpar->noff[3]) {
1045  tmp = 0.5*(etaHO[2]+hpar->etaTable[etaR-1]);
1046  } else if (etaR == hpar->noff[3]+1) {
1047  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[3]);
1048  } else {
1049  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
1050  }
1051  } else {
1052  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
1053  }
1054  }
1055  }
1056  if (zside == 0) tmp = -tmp;
1057 #ifdef EDM_ML_DEBUG
1058  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::getEta " << etaR << " "
1059  << zside << " " << depth << " ==> " << tmp;
1060 #endif
1061  return tmp;
1062 }
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 1064 of file HcalDDDSimConstants.cc.

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

1064  {
1065 
1066  double tmp = 0;
1067  if (z != 0) tmp = -log(tan(0.5*atan(r/z)));
1068 #ifdef EDM_ML_DEBUG
1069  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::getEta " << r << " "
1070  << z << " ==> " << tmp;
1071 #endif
1072  return tmp;
1073 }
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 256 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().

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

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

Referenced by HcalNumberingFromDDD::unitID().

306  {
307 
308  if (hpar->zHO.size() > 4) {
309  double eta = fabs(etaR);
310  double r = std::sqrt(x*x+y*y);
311  if (r > rminHO) {
312  double zz = fabs(z);
313  if (zz > hpar->zHO[3]) {
314  if (eta <= hpar->etaTable[10]) eta = hpar->etaTable[10]+0.001;
315  } else if (zz > hpar->zHO[1]) {
316  if (eta <= hpar->etaTable[4]) eta = hpar->etaTable[4]+0.001;
317  }
318  }
319  eta = (z >= 0. ? eta : -eta);
320 #ifdef EDM_ML_DEBUG
321  edm::LogVerbatim("HcalGeom") << "R " << r << " Z " << z << " eta " << etaR
322  << ":" << eta;
323  if (eta != etaR) edm::LogInfo ("HCalGeom") << "**** Check *****";
324 #endif
325  return eta;
326  } else {
327  return etaR;
328  }
329 }
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 331 of file HcalDDDSimConstants.cc.

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

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

331  {
332 
333  int lay=0;
334  if (det == 1) {
335  if (std::abs(eta) == 16) lay = layFHB[1];
336  else lay = layFHB[0];
337  } else {
338  if (std::abs(eta) == 16) lay = layFHE[1];
339  else if (std::abs(eta) == 18) lay = layFHE[2];
340  else lay = layFHE[0];
341  }
342  return lay;
343 }
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 1096 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes().

1097  {
1098 
1099  double gain;
1100  switch(subdet) {
1101  case HcalEndcap:
1102  gain = hpar->HEGains[0];
1103  break;
1104  case HcalForward:
1105  gain = hpar->HFGains[(depth-1)%2];
1106  break;
1107  case HcalOuter:
1108  gain = hpar->HBGains[3];
1109  break;
1110  default:
1111  gain = hpar->HBGains[0];
1112  break;
1113  }
1114  return gain;
1115 }
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 345 of file HcalDDDSimConstants.cc.

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

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

345  {
346 
347  int lay=0;
348  if (det == 1) {
349  if (std::abs(eta) == 15) lay = layBHB[1];
350  else if (std::abs(eta) == 16) lay = layBHB[2];
351  else lay = layBHB[0];
352  } else {
353  if (std::abs(eta) == 16) lay = layBHE[1];
354  else if (std::abs(eta) == 17) lay = layBHE[2];
355  else if (std::abs(eta) == 18) lay = layBHE[3];
356  else lay = layBHE[0];
357  }
358  return lay;
359 }
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 361 of file HcalDDDSimConstants.cc.

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

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

362  {
363 
364  double wt = ldmap_.getLayer0Wt(det, phi, zside);
365  if (wt < 0) wt = (det == 2) ? hpar->Layer0Wt[1] : hpar->Layer0Wt[0];
366  return wt;
367 }
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 389 of file HcalDDDSimConstants.cc.

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

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

391  {
392 
393  int layer = ldmap_.getLayerBack(det, eta, phi, zside, depth);
394  if (layer < 0) {
395  if (det == 1 || det ==2) {
396  layer = depths[depth-1][eta-1];
397  } else {
398  layer = maxLayer_;
399  }
400  }
401  return layer;
402 }
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 369 of file HcalDDDSimConstants.cc.

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

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

371  {
372 
373  int layer = ldmap_.getLayerFront(det, eta, phi, zside, depth);
374  if (layer < 0) {
375  if (det == 1 || det == 2) {
376  layer = 1;
377  for (int l=0; l<getLayerMax(eta,depth); ++l) {
378  if ((int)(layerGroup(eta-1,l)) == depth) {
379  layer = l+1; break;
380  }
381  }
382  } else {
383  layer = (eta > hpar->noff[2]) ? maxLayerHB_+1 : maxLayer_;
384  }
385  }
386  return layer;
387 }
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 404 of file HcalDDDSimConstants.cc.

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

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

404  {
405 
406  int layermx = ((eta < hpar->etaMin[1]) && depth-1 < maxDepth[0]) ? maxLayerHB_+1 : (int)layerGroupSize(eta-1);
407  return layermx;
408 }
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 410 of file HcalDDDSimConstants.cc.

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

412  {
413 
414  int dmax(-1);
415  if (partialDetOnly) {
416  if (ldmap_.isValid(det,phi,zside)) {
417  dmax = ldmap_.getDepths(eta).second;
418  }
419  } else if (det == 1 || det == 2) {
420  if (ldmap_.isValid(det,phi,zside))
421  dmax = ldmap_.getDepths(eta).second;
422  else if (det == 2)
423  dmax = (maxDepth[1] > 0) ? layerGroup(eta-1,maxLayer_) : 0;
424  else if (eta == hpar->etaMax[0])
425  dmax = getDepthEta16(det,phi,zside);
426  else
427  dmax = layerGroup(eta-1,maxLayerHB_);
428  } else if (det == 3) { // HF
429  dmax = maxHFDepth(zside*eta,phi);
430  } else if (det == 4) { // HO
431  dmax = maxDepth[3];
432  } else {
433  dmax = -1;
434  }
435  return dmax;
436 }
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 438 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().

440  {
441 
442  int lmin(-1);
443  if (partialDetOnly) {
444  if (ldmap_.isValid(det,phi,zside)) {
445  lmin = ldmap_.getDepths(eta).first;
446  }
447  } else if (det == 3) { // HF
448  lmin = 1;
449  } else if (det == 4) { // HO
450  lmin = maxDepth[3];
451  } else {
452  if (ldmap_.isValid(det,phi,zside)) {
453  lmin = ldmap_.getDepths(eta).first;
454  } else if (layerGroupSize(eta-1) > 0) {
455  lmin = (int)(layerGroup(eta-1, 0));
456  unsigned int type = (det == 1) ? 0 : 1;
457  if (type == 1 && eta == hpar->etaMin[1])
458  lmin = getDepthEta16(det, phi, zside);
459  } else {
460  lmin = 1;
461  }
462  }
463  return lmin;
464 }
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 466 of file HcalDDDSimConstants.cc.

References nmodHB, nmodHE, nzHB, and nzHE.

Referenced by getMaxDepthDet().

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

Definition at line 475 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().

476  {
477 
478  double fioff(0), fibin(0);
479  if (det == static_cast<int>(HcalForward)) { // Forward HCal
480  fioff = hpar->phioff[2];
481  fibin = hpar->phitable[ieta-hpar->etaMin[2]];
482  if (unitPhi(fibin) > 2) { // HF double-phi
483  fioff = hpar->phioff[4];
484  }
485  } else { // Barrel or Endcap
486  if (det == static_cast<int>(HcalEndcap)) {
487  fioff = hpar->phioff[1];
488  } else {
489  fioff = hpar->phioff[0];
490  }
491  fibin = hpar->phibin[ieta-1];
492  }
493  return std::pair<double,double>(fioff,fibin);
494 }
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 497 of file HcalDDDSimConstants.cc.

References geant_units::operators::convertRadToDeg(), getPhiCons(), createfilelist::int, gen::k, phi, phiNumber(), edm::second(), unitPhi(), and units().

Referenced by getMaxDepthDet(), and HcalCellTypes().

497  {
498 
499  std::vector<std::pair<int,double> > phis;
500  int ietaAbs = (ieta > 0) ? ieta : -ieta;
501  std::pair<double,double> ficons = getPhiCons(subdet, ietaAbs);
502  int nphi = int((2._pi+0.1*ficons.second)/ficons.second);
503  int units = unitPhi(subdet, ietaAbs);
504  for (int ifi = 0; ifi < nphi; ++ifi) {
505  double phi =-ficons.first + (ifi+0.5)*ficons.second;
506  int iphi = phiNumber(ifi+1,units);
507  phis.emplace_back(std::pair<int,double>(iphi,phi));
508  }
509 #ifdef EDM_ML_DEBUG
510  edm::LogVerbatim("HcalGeom") << "getPhis: subdet|ieta|iphi " << subdet << "|"
511  << ieta << " with " << phis.size()
512  << " phi bins";
513  for (unsigned int k=0; k<phis.size(); ++k)
514  edm::LogVerbatim("HcalGeom") << "[" << k << "] iphi " << phis[k].first
515  << " phi " << convertRadToDeg(phis[k].second);
516 #endif
517  return phis;
518 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
int phiNumber(const int &phi, const int &unit) const
U second(std::pair< T, U > const &p)
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 1075 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes().

1076  {
1077 
1078  int shift;
1079  switch(subdet) {
1080  case HcalEndcap:
1081  shift = hpar->HEShift[0];
1082  break;
1083  case HcalForward:
1084  shift = hpar->HFShift[(depth-1)%2];
1085  break;
1086  case HcalOuter:
1087  shift = hpar->HBShift[3];
1088  break;
1089  default:
1090  shift = hpar->HBShift[0];
1091  break;
1092  }
1093  return shift;
1094 }
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 520 of file HcalDDDSimConstants.cc.

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

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

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

Definition at line 560 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().

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

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

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

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

1240  {
1241  unsigned int k = 0;
1242  for (auto const & it : hpar->layerGroupEtaSim) {
1243  if (it.layer == (unsigned int)(eta + 1)) {
1244  return it.layerGroup.at(i);
1245  }
1246  if (it.layer > (unsigned int)(eta + 1)) break;
1247  k = it.layerGroup.at(i);
1248  }
1249  return k;
1250 }
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 1252 of file HcalDDDSimConstants.cc.

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

1254  {
1255 
1256  int depth0 = findDepth(det,eta,phi,zside,lay);
1257  unsigned int depth = (depth0 > 0) ? (unsigned int)(depth0) : layerGroup(eta-1,lay);
1258  return depth;
1259 }
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 1228 of file HcalDDDSimConstants.cc.

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

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

1228  {
1229  unsigned int k = 0;
1230  for (auto const & it : hpar->layerGroupEtaSim) {
1231  if (it.layer == (unsigned int)(eta + 1)) {
1232  return it.layerGroup.size();
1233  }
1234  if (it.layer > (unsigned int)(eta + 1)) break;
1235  k = it.layerGroup.size();
1236  }
1237  return k;
1238 }
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 660 of file HcalDDDSimConstants.cc.

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

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

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

Definition at line 674 of file HcalDDDSimConstants.cc.

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

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

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

Definition at line 689 of file HcalDDDSimConstants.cc.

References phi.

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

689  {
690 
691  int iphi_skip = phi;
692  if (units==2) iphi_skip = (phi-1)*2+1;
693  else if (units==4) iphi_skip = (phi-1)*4-1;
694  if (iphi_skip < 0) iphi_skip += 72;
695  return iphi_skip;
696 }
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 1117 of file HcalDDDSimConstants.cc.

References jets_cff::area, geant_units::operators::convertRadToDeg(), 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().

1118  {
1119  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::printTileHB for eta "
1120  << eta << " and depth " << depth;
1121 
1122  double etaL = hpar->etaTable.at(eta-1);
1123  double thetaL = 2.*atan(exp(-etaL));
1124  double etaH = hpar->etaTable.at(eta);
1125  double thetaH = 2.*atan(exp(-etaH));
1126  int layL = getLayerFront(1,eta,phi,zside,depth);
1127  int layH = getLayerBack(1,eta,phi,zside,depth);
1128  edm::LogVerbatim("HcalGeom") << "\ntileHB:: eta|depth " << zside*eta << "|"
1129  << depth << " theta " << convertRadToDeg(thetaH)
1130  << ":" << convertRadToDeg(thetaL) << " Layer "
1131  << layL-1 << ":" << layH-1;
1132  for (int lay=layL-1; lay<layH; ++lay) {
1133  std::vector<double> area(2,0);
1134  int kk(0);
1135  double mean(0);
1136  for (unsigned int k=0; k<hpar->layHB.size(); ++k) {
1137  if (lay == hpar->layHB[k]) {
1138  double zmin = hpar->rhoxHB[k]*std::cos(thetaL)/std::sin(thetaL);
1139  double zmax = hpar->rhoxHB[k]*std::cos(thetaH)/std::sin(thetaH);
1140  double dz = (std::min(zmax,hpar->dxHB[k]) - zmin);
1141  if (dz > 0) {
1142  area[kk] = dz*hpar->dyHB[k];
1143  mean += area[kk];
1144  kk++;
1145  }
1146  }
1147  }
1148  if (area[0] > 0) {
1149  mean /= (kk*100);
1150  edm::LogVerbatim("HcalGeom") << std::setw(2) << lay << " Area "
1151  << std::setw(8) << area[0] << " "
1152  << std::setw(8) << area[1] << " Mean "
1153  << mean;
1154  }
1155  }
1156 }
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
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
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 1158 of file HcalDDDSimConstants.cc.

References jets_cff::area, geant_units::operators::convertRadToDeg(), 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().

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

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

735  {
736 
737  double dphi = (det == static_cast<int>(HcalForward)) ? hpar->phitable[etaR-hpar->etaMin[2]] : hpar->phibin[etaR-1];
738  return unitPhi(dphi);
739 }
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 741 of file HcalDDDSimConstants.cc.

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

741  {
742 
743  const double fiveDegInRad = 2*M_PI/72;
744  int units = int(dphi/fiveDegInRad+0.5);
745  if (units < 1) units = 1;
746  return units;
747 }
#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().