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)
 
int getEta (const int &det, const int &lay, const double &hetaR)
 
std::pair< int, int > getEtaDepth (const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay)
 
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 11 of file HcalDDDSimConstants.cc.

References HcalCellTypes(), and initialize().

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

Definition at line 25 of file HcalDDDSimConstants.cc.

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

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

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

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

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

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

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

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

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

Definition at line 144 of file HcalDDDSimConstants.cc.

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

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

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

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

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

Definition at line 170 of file HcalDDDSimConstants.cc.

References particleFlowClusterECALTimeSelected_cfi::depth, depthEta16, HcalLayerDepthMap::getDepth16(), ldmap_, HcalLayerDepthMap::validDet(), and HcalDigiParam_cfi::zside.

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

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

Definition at line 192 of file HcalDDDSimConstants.cc.

References particleFlowClusterECALTimeSelected_cfi::depth, depthEta29, HcalLayerDepthMap::getMaxDepthLastHE(), ldmap_, HcalLayerDepthMap::validDet(), and HcalDigiParam_cfi::zside.

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

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

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

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

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

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

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

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

1058  {
1059 
1060  double tmp = 0;
1061  if (z != 0) tmp = -log(tan(0.5*atan(r/z)));
1062 #ifdef EDM_ML_DEBUG
1063  edm::LogVerbatim("HcalGeom") << "HcalDDDSimConstants::getEta " << r << " "
1064  << z << " ==> " << tmp;
1065 #endif
1066  return tmp;
1067 }
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 
)

Definition at line 257 of file HcalDDDSimConstants.cc.

References particleFlowClusterECALTimeSelected_cfi::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().

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

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

Referenced by HcalNumberingFromDDD::unitID().

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

References HcalParameters::etaTableHF, and hpar.

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

Definition at line 330 of file HcalDDDSimConstants.cc.

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

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

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

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

Referenced by HcalCellTypes().

1091  {
1092 
1093  double gain;
1094  switch(subdet) {
1095  case HcalEndcap:
1096  gain = hpar->HEGains[0];
1097  break;
1098  case HcalForward:
1099  gain = hpar->HFGains[(depth-1)%2];
1100  break;
1101  case HcalOuter:
1102  gain = hpar->HBGains[3];
1103  break;
1104  default:
1105  gain = hpar->HBGains[0];
1106  break;
1107  }
1108  return gain;
1109 }
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 50 of file HcalDDDSimConstants.h.

References HcalParameters::gparHF, and hpar.

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

50 {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 48 of file HcalDDDSimConstants.h.

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

48 {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 344 of file HcalDDDSimConstants.cc.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References maxDepth.

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

63 {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 409 of file HcalDDDSimConstants.cc.

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

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

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

Referenced by HcalDDDRecConstants::initialize().

67 {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 437 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().

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

References nmodHB, nmodHE, nzHB, and nzHE.

Referenced by getMaxDepthDet().

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

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

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

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

Referenced by getMaxDepthDet(), and HcalCellTypes().

496  {
497 
498  std::vector<std::pair<int,double> > phis;
499  int ietaAbs = (ieta > 0) ? ieta : -ieta;
500  std::pair<double,double> ficons = getPhiCons(subdet, ietaAbs);
501  int nphi = int((CLHEP::twopi+0.1*ficons.second)/ficons.second);
502  int units = unitPhi(subdet, ietaAbs);
503  for (int ifi = 0; ifi < nphi; ++ifi) {
504  double phi =-ficons.first + (ifi+0.5)*ficons.second;
505  int iphi = phiNumber(ifi+1,units);
506  phis.emplace_back(std::pair<int,double>(iphi,phi));
507  }
508 #ifdef EDM_ML_DEBUG
509  edm::LogVerbatim("HcalGeom") << "getPhis: subdet|ieta|iphi " << subdet << "|"
510  << ieta << " with " << phis.size()
511  << " phi bins";
512  for (unsigned int k=0; k<phis.size(); ++k)
513  edm::LogVerbatim("HcalGeom") << "[" << k << "] iphi " << phis[k].first
514  << " phi " << phis[k].second/CLHEP::deg;
515 #endif
516  return phis;
517 }
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 74 of file HcalDDDSimConstants.h.

References hpar, and HcalParameters::phitable.

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

74 {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 1069 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes().

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

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

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

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

Definition at line 559 of file HcalDDDSimConstants.cc.

References cell(), particleFlowClusterECALTimeSelected_cfi::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 HcalDigiParam_cfi::zside.

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

Referenced by HcalDDDSimConstants().

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

References isBH_.

Referenced by HcalDDDRecConstants::isBH().

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

Definition at line 1234 of file HcalDDDSimConstants.cc.

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

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

1234  {
1235  unsigned int k = 0;
1236  for (auto const & it : hpar->layerGroupEtaSim) {
1237  if (it.layer == (unsigned int)(eta + 1)) {
1238  return it.layerGroup.at(i);
1239  }
1240  if (it.layer > (unsigned int)(eta + 1)) break;
1241  k = it.layerGroup.at(i);
1242  }
1243  return k;
1244 }
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 1246 of file HcalDDDSimConstants.cc.

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

1248  {
1249 
1250  int depth0 = findDepth(det,eta,phi,zside,lay);
1251  unsigned int depth = (depth0 > 0) ? (unsigned int)(depth0) : layerGroup(eta-1,lay);
1252  return depth;
1253 }
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
unsigned int HcalDDDSimConstants::layerGroupSize ( int  eta) const
private

Definition at line 1222 of file HcalDDDSimConstants.cc.

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

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

1222  {
1223  unsigned int k = 0;
1224  for (auto const & it : hpar->layerGroupEtaSim) {
1225  if (it.layer == (unsigned int)(eta + 1)) {
1226  return it.layerGroup.size();
1227  }
1228  if (it.layer > (unsigned int)(eta + 1)) break;
1229  k = it.layerGroup.size();
1230  }
1231  return k;
1232 }
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 659 of file HcalDDDSimConstants.cc.

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

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

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

Definition at line 673 of file HcalDDDSimConstants.cc.

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

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

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

Definition at line 688 of file HcalDDDSimConstants.cc.

References phi.

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

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

References jets_cff::area, funct::cos(), particleFlowClusterECALTimeSelected_cfi::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().

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

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

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

Referenced by ldMap().

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

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

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

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

Member Data Documentation

int HcalDDDSimConstants::depthEta16[2]
private

Definition at line 126 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::depthEta29[2]
private

Definition at line 127 of file HcalDDDSimConstants.h.

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

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

Definition at line 134 of file HcalDDDSimConstants.h.

Referenced by getMaxDepthDet(), and initialize().

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

Definition at line 134 of file HcalDDDSimConstants.h.

Referenced by getMaxDepthDet(), and initialize().

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

Definition at line 118 of file HcalDDDSimConstants.h.

Referenced by getLayerBack(), and initialize().

double HcalDDDSimConstants::dlShort
private

Definition at line 125 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::dzVcal
private

Definition at line 124 of file HcalDDDSimConstants.h.

Referenced by HcalCellTypes(), and initialize().

double HcalDDDSimConstants::etaHO[4]
private

Definition at line 122 of file HcalDDDSimConstants.h.

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

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

Definition at line 133 of file HcalDDDSimConstants.h.

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

bool HcalDDDSimConstants::isBH_
private

Definition at line 132 of file HcalDDDSimConstants.h.

Referenced by initialize(), and isBH().

int HcalDDDSimConstants::layBHB[3]
private

Definition at line 130 of file HcalDDDSimConstants.h.

Referenced by getLastLayer(), and initialize().

int HcalDDDSimConstants::layBHE[4]
private

Definition at line 131 of file HcalDDDSimConstants.h.

Referenced by getLastLayer(), and initialize().

int HcalDDDSimConstants::layFHB[2]
private

Definition at line 128 of file HcalDDDSimConstants.h.

Referenced by getFrontLayer(), and initialize().

int HcalDDDSimConstants::layFHE[3]
private

Definition at line 129 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 91 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 119 of file HcalDDDSimConstants.h.

const int HcalDDDSimConstants::nDepthMax =9
staticprivate

Definition at line 90 of file HcalDDDSimConstants.h.

int HcalDDDSimConstants::nEta
private

Definition at line 115 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nmodHB
private

Definition at line 120 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), and initialize().

int HcalDDDSimConstants::nmodHE
private

Definition at line 121 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), and initialize().

int HcalDDDSimConstants::nPhiF
private

Definition at line 117 of file HcalDDDSimConstants.h.

Referenced by initialize().

int HcalDDDSimConstants::nR
private

Definition at line 116 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nzHB
private

Definition at line 120 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nzHE
private

Definition at line 121 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::rminHO
private

Definition at line 122 of file HcalDDDSimConstants.h.

Referenced by getEtaHO(), and initialize().

double HcalDDDSimConstants::zVcal
private

Definition at line 123 of file HcalDDDSimConstants.h.

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