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 (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, int zside, 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, int phi, int zside, int depth, int lay)
 
double getEtaHO (double &etaR, double &x, double &y, double &z) const
 
const std::vector< double > & getEtaTableHF () const
 
const std::vector< double > & getGparHF () const
 
const std::vector< HcalDetId > & getIdHF2QIE () const
 
std::pair< int, int > getiEtaRange (const int i) 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, 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, 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 (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 (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, const 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 (const int eta, const int i) const
 
unsigned int layerGroup (const int det, const int eta, const int phi, const int zside, const int i) const
 
unsigned int layerGroupSize (const 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_
 
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 gather_cfg::cout, 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  std::cout << "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 gather_cfg::cout, deltaEta(), HcalCellType::HcalCell::deta, HcalCellType::HcalCell::dphi, HcalParameters::drHB, HcalCellType::HcalCell::drz, HcalParameters::dzHE, stringResolutionProvider_cfi::eta, HcalCellType::HcalCell::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  std::cout << "HcalDDDSimConstants: det/side/depth/etaR/phi "
114  << idet << "/" << zside << "/" << depth << "/"
115  << etaR << "/" << iphi << " Cell Flag " << tmp.ok
116  << " " << tmp.eta << " " << tmp.deta << " phi "
117  << tmp.phi << " " << tmp.dphi << " r(z) " << tmp.rz
118  << " " << tmp.drz << " " << tmp.flagrz << std::endl;
119 #endif
120  return tmp;
121 }
std::vector< int > maxDepth
std::vector< double > rHB
std::vector< int > etaMax
double deltaEta(const int det, const int eta, const int depth) const
std::vector< double > zHE
std::vector< double > dzHE
std::vector< double > phioff
int getEta(const int det, const int lay, const double hetaR)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > rTable
std::vector< double > phitable
std::vector< double > phibin
int unitPhi(const int det, const int etaR) const
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 897 of file HcalDDDSimConstants.cc.

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

Referenced by cell(), and ldMap().

898  {
899 
900  double tmp = 0;
901  if (det == static_cast<int>(HcalForward)) {
902  int ir = nR + hpar->etaMin[2] - etaR - 1;
903  if (ir > 0 && ir < nR) {
904  double z = zVcal;
905  if (depth%2 != 1) z += dlShort;
906  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)-getEta(hpar->rTable[ir],z));
907  }
908  } else {
909  if (etaR > 0 && etaR < nEta) {
910  if (etaR == hpar->noff[1]-1 && depth > depthEta29[0]) {
911  tmp = 0.5*(hpar->etaTable[etaR+1]-hpar->etaTable[etaR-1]);
912  } else if (det == static_cast<int>(HcalOuter)) {
913  if (etaR == hpar->noff[2]) {
914  tmp = 0.5*(etaHO[0]-hpar->etaTable[etaR-1]);
915  } else if (etaR == hpar->noff[2]+1) {
916  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[1]);
917  } else if (etaR == hpar->noff[3]) {
918  tmp = 0.5*(etaHO[2]-hpar->etaTable[etaR-1]);
919  } else if (etaR == hpar->noff[3]+1) {
920  tmp = 0.5*(hpar->etaTable[etaR]-etaHO[3]);
921  } else {
922  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
923  }
924  } else {
925  tmp = 0.5*(hpar->etaTable[etaR]-hpar->etaTable[etaR-1]);
926  }
927  }
928  }
929 #ifdef EDM_ML_DEBUG
930  std::cout << "HcalDDDSimConstants::deltaEta " << etaR << " "
931  << depth << " ==> " << tmp << std::endl;
932 #endif
933  return tmp;
934 }
std::vector< double > etaTable
int getEta(const int det, const int lay, const double hetaR)
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 particleFlowClusterECALTimeSelected_cfi::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 getDepth(const int subdet, const int ieta, const int iphi, const int zside, const int layer) const
HcalLayerDepthMap ldmap_
unsigned int HcalDDDSimConstants::findLayer ( int  layer,
const std::vector< HcalParameters::LayerItem > &  layerGroup 
) const

Definition at line 131 of file HcalDDDSimConstants.cc.

References i, and hcalTTPDigis_cfi::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 }
int i
Definition: DBlmapReader.cc:9
unsigned int layerGroup(const int eta, const 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, 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.push_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.push_back(std::pair<double,double>(hpar->zHE[i],hpar->dzHE[i]));
153  }
154  }
155  return gcons;
156 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
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 gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::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  std::cout << "getDepthEta16: " << det << ":" << depth << std::endl;
165 #endif
166  return depth;
167 }
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 particleFlowClusterECALTimeSelected_cfi::depth, depthEta16, HcalLayerDepthMap::getDepth16(), ldmap_, HcalLayerDepthMap::validDet(), and HcalDigiParam_cfi::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 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,
int  zside,
int  i 
) const

Definition at line 183 of file HcalDDDSimConstants.cc.

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

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

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 i
Definition: DBlmapReader.cc:9
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 particleFlowClusterECALTimeSelected_cfi::depth, depthEta29, HcalLayerDepthMap::getMaxDepthLastHE(), ldmap_, HcalLayerDepthMap::validDet(), and HcalDigiParam_cfi::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 i
Definition: DBlmapReader.cc:9
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 207 of file HcalDDDSimConstants.cc.

References depthEta16, stringResolutionProvider_cfi::eta, HcalParameters::etaMax, HcalParameters::etaMin, MuonErrorMatrixValues_cff::etaRange, HcalParameters::etaTable, JetChargeProducer_cfi::exp, HcalBarrel, HcalEndcap, HcalForward, hpar, 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])) {
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 }
int i
Definition: DBlmapReader.cc:9
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 232 of file HcalDDDSimConstants.cc.

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

Referenced by cell(), deltaEta(), getEta(), ldMap(), 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 }
int i
Definition: DBlmapReader.cc:9
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,
const int  depth = 1 
) const
private

Definition at line 936 of file HcalDDDSimConstants.cc.

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

937  {
938 
939  double tmp = 0;
940  if (det == static_cast<int>(HcalForward)) {
941  int ir = nR + hpar->etaMin[2] - etaR - 1;
942  if (ir > 0 && ir < nR) {
943  double z = zVcal;
944  if (depth%2 != 1) z += dlShort;
945  tmp = 0.5*(getEta(hpar->rTable[ir-1],z)+getEta(hpar->rTable[ir],z));
946  }
947  } else {
948  if (etaR > 0 && etaR < nEta) {
949  if (etaR == hpar->noff[1]-1 && depth > depthEta29[0]) {
950  tmp = 0.5*(hpar->etaTable[etaR+1]+hpar->etaTable[etaR-1]);
951  } else if (det == static_cast<int>(HcalOuter)) {
952  if (etaR == hpar->noff[2]) {
953  tmp = 0.5*(etaHO[0]+hpar->etaTable[etaR-1]);
954  } else if (etaR == hpar->noff[2]+1) {
955  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[1]);
956  } else if (etaR == hpar->noff[3]) {
957  tmp = 0.5*(etaHO[2]+hpar->etaTable[etaR-1]);
958  } else if (etaR == hpar->noff[3]+1) {
959  tmp = 0.5*(hpar->etaTable[etaR]+etaHO[3]);
960  } else {
961  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
962  }
963  } else {
964  tmp = 0.5*(hpar->etaTable[etaR]+hpar->etaTable[etaR-1]);
965  }
966  }
967  }
968  if (zside == 0) tmp = -tmp;
969 #ifdef EDM_ML_DEBUG
970  std::cout << "HcalDDDSimConstants::getEta " << etaR << " "
971  << zside << " " << depth << " ==> " << tmp << "\n";
972 #endif
973  return tmp;
974 }
std::vector< double > etaTable
int getEta(const int det, const int lay, const double hetaR)
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 976 of file HcalDDDSimConstants.cc.

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

976  {
977 
978  double tmp = 0;
979  if (z != 0) tmp = -log(tan(0.5*atan(r/z)));
980 #ifdef EDM_ML_DEBUG
981  std::cout << "HcalDDDSimConstants::getEta " << r << " " << z
982  << " ==> " << tmp << std::endl;
983 #endif
984  return tmp;
985 }
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,
int  phi,
int  zside,
int  depth,
int  lay 
)

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

258  {
259 
260  //Modify the depth index
261  if ((det == static_cast<int>(HcalEndcap)) && (etaR == 17) && (lay == 1))
262  etaR = 18;
263  if (det == static_cast<int>(HcalForward)) { // Forward HCal
264  } else if (det == static_cast<int>(HcalOuter)) {
265  depth = 4;
266  } else {
267  if (lay >= 0) {
268  depth= layerGroup(det, etaR, phi, zside, lay-1);
269  if (etaR == hpar->noff[0] && lay > 1) {
270  int kphi = phi + int((hpar->phioff[3]+0.1)/hpar->phibin[etaR-1]);
271  kphi = (kphi-1)%4 + 1;
272  if (kphi == 2 || kphi == 3)
273  depth = layerGroup(det, etaR, phi, zside, lay-2);
274  }
275  } else if (det == static_cast<int>(HcalBarrel)) {
276  if (depth>getMaxDepth(det,etaR,phi,zside,false))
277  depth = getMaxDepth(det,etaR,phi,zside,false);
278  }
279  if (etaR >= hpar->noff[1] && depth > getDepthEta29(phi,zside,0)) {
280  etaR -= getDepthEta29(phi,zside,1);
281  } else if (etaR == hpar->etaMin[1]) {
282  if (det == static_cast<int>(HcalBarrel)) {
283  if (depth > getDepthEta16(det, phi, zside))
284  depth = getDepthEta16(det, phi, zside);
285  } else {
286  if (depth < getDepthEta16(det, phi, zside))
287  depth = getDepthEta16(det, phi, zside);
288  }
289  }
290  }
291  return std::pair<int,int>(etaR,depth);
292 }
int getMaxDepth(const int type) const
int getDepthEta29(const int phi, int zside, int i) const
int getDepthEta16(const int det, const int phi, const int zside) const
unsigned int layerGroup(const int eta, const int i) const
std::vector< double > phioff
std::vector< double > phibin
std::vector< int > noff
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getEtaHO ( double &  etaR,
double &  x,
double &  y,
double &  z 
) const

Definition at line 294 of file HcalDDDSimConstants.cc.

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

Referenced by HcalNumberingFromDDD::unitID().

295  {
296 
297  if (hpar->zHO.size() > 4) {
298  double eta = fabs(etaR);
299  double r = std::sqrt(x*x+y*y);
300  if (r > rminHO) {
301  double zz = fabs(z);
302  if (zz > hpar->zHO[3]) {
303  if (eta <= hpar->etaTable[10]) eta = hpar->etaTable[10]+0.001;
304  } else if (zz > hpar->zHO[1]) {
305  if (eta <= hpar->etaTable[4]) eta = hpar->etaTable[4]+0.001;
306  }
307  }
308  eta = (z >= 0. ? eta : -eta);
309 #ifdef EDM_ML_DEBUG
310  std::cout << "R " << r << " Z " << z << " eta " << etaR
311  << ":" << eta << std::endl;
312  if (eta != etaR) edm::LogInfo ("HCalGeom") << "**** Check *****";
313 #endif
314  return eta;
315  } else {
316  return etaR;
317  }
318 }
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 51 of file HcalDDDSimConstants.h.

References HcalParameters::etaTableHF, and hpar.

51 {return hpar->etaTableHF;}
std::vector< double > etaTableHF
const HcalParameters * hpar
double HcalDDDSimConstants::getGain ( const HcalSubdetector  subdet,
const int  depth 
) const
private

Definition at line 1008 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes(), and ldMap().

1009  {
1010 
1011  double gain;
1012  switch(subdet) {
1013  case HcalEndcap:
1014  gain = hpar->HEGains[0];
1015  break;
1016  case HcalForward:
1017  gain = hpar->HFGains[(depth-1)%2];
1018  break;
1019  case HcalOuter:
1020  gain = hpar->HBGains[3];
1021  break;
1022  default:
1023  gain = hpar->HBGains[0];
1024  break;
1025  }
1026  return gain;
1027 }
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 52 of file HcalDDDSimConstants.h.

References HcalParameters::gparHF, and hpar.

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

52 {return hpar->gparHF;}
std::vector< double > gparHF
const HcalParameters * hpar
const std::vector<HcalDetId>& HcalDDDSimConstants::getIdHF2QIE ( ) const
inline

Definition at line 53 of file HcalDDDSimConstants.h.

References getLayer0Wt(), getLayerBack(), getLayerFront(), getLayerMax(), and idHF2QIE.

Referenced by HcalDDDRecConstants::getHFCellParameters().

53 {return idHF2QIE;}
std::vector< HcalDetId > idHF2QIE
std::pair<int,int> HcalDDDSimConstants::getiEtaRange ( const int  i) const
inline

Definition at line 50 of file HcalDDDSimConstants.h.

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

50 {return std::pair<int,int>(hpar->etaMin[i],hpar->etaMax[i]);}
int i
Definition: DBlmapReader.cc:9
std::vector< int > etaMax
const HcalParameters * hpar
std::vector< int > etaMin
double HcalDDDSimConstants::getLayer0Wt ( const int  det,
const int  phi,
const int  zside 
) const

Definition at line 320 of file HcalDDDSimConstants.cc.

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

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

321  {
322 
323  double wt = ldmap_.getLayer0Wt(det, phi, zside);
324  if (wt < 0) wt = (det == 2) ? hpar->Layer0Wt[1] : hpar->Layer0Wt[0];
325  return wt;
326 }
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 348 of file HcalDDDSimConstants.cc.

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

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

350  {
351 
352  int layer = ldmap_.getLayerBack(det, eta, phi, zside, depth);
353  if (layer < 0) {
354  if (det == 1 || det ==2) {
355  layer = depths[depth-1][eta-1];
356  } else {
357  layer = maxLayer_;
358  }
359  }
360  return layer;
361 }
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 328 of file HcalDDDSimConstants.cc.

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

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

330  {
331 
332  int layer = ldmap_.getLayerFront(det, eta, phi, zside, depth);
333  if (layer < 0) {
334  if (det == 1 || det == 2) {
335  layer = 1;
336  for (int l=0; l<getLayerMax(eta,depth); ++l) {
337  if ((int)(layerGroup(eta-1,l)) == depth+1) {
338  layer = l+1; break;
339  }
340  }
341  } else {
342  layer = (eta > hpar->noff[2]) ? maxLayerHB_+1 : maxLayer_;
343  }
344  }
345  return layer;
346 }
static const int maxLayer_
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
unsigned int layerGroup(const int eta, const int i) const
std::vector< int > noff
const HcalParameters * hpar
static const int maxLayerHB_
int getLayerMax(const int eta, const int depth) const
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::getLayerMax ( const int  eta,
const int  depth 
) const

Definition at line 363 of file HcalDDDSimConstants.cc.

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

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

363  {
364 
365  int layermx = ((eta < hpar->etaMin[1]) && depth-1 < maxDepth[0]) ? maxLayerHB_+1 : (int)layerGroupSize(eta-1);
366  return layermx;
367 }
std::vector< int > maxDepth
unsigned int layerGroupSize(const int eta) const
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,
bool  partialOnly 
) const

Definition at line 369 of file HcalDDDSimConstants.cc.

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

371  {
372 
373  int dmax(-1);
374  if (partialDetOnly) {
375  if (ldmap_.isValid(det,phi,zside)) {
376  dmax = ldmap_.getDepths(eta).second;
377  }
378  } else if (det == 1 || det == 2) {
379  if (ldmap_.isValid(det,phi,zside))
380  dmax = ldmap_.getDepths(eta).second;
381  else if (det == 2)
382  dmax = layerGroup(eta-1,maxLayer_);
383  else if (eta == hpar->etaMax[0])
384  dmax = getDepthEta16(det,phi,zside);
385  else
386  dmax = layerGroup(eta-1,maxLayerHB_);
387  } else if (det == 3) { // HF
388  dmax = maxHFDepth(zside*eta,phi);
389  } else if (det == 4) { // HO
390  dmax = maxDepth[3];
391  } else {
392  dmax = -1;
393  }
394  return dmax;
395 }
int maxHFDepth(const int ieta, const int iphi) 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
int getDepthEta16(const int det, const int phi, const int zside) const
unsigned int layerGroup(const int eta, const int i) const
const HcalParameters * hpar
static const int maxLayerHB_
HcalLayerDepthMap ldmap_
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_);}
int i
Definition: DBlmapReader.cc:9
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,
bool  partialOnly 
) const

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

399  {
400 
401  int lmin(-1);
402  if (partialDetOnly) {
403  if (ldmap_.isValid(det,phi,zside)) {
404  lmin = ldmap_.getDepths(eta).first;
405  }
406  } else if (det == 3) { // HF
407  lmin = 1;
408  } else if (det == 4) { // HO
409  lmin = maxDepth[3];
410  } else {
411  if (ldmap_.isValid(det,phi,zside)) {
412  lmin = ldmap_.getDepths(eta).first;
413  } else if (layerGroupSize(eta-1) > 0) {
414  lmin = (int)(layerGroup(eta-1, 0));
415  unsigned int type = (det == 1) ? 0 : 1;
416  if (type == 1 && eta == hpar->etaMin[1])
417  lmin = getDepthEta16(det, phi, zside);
418  } else {
419  lmin = 1;
420  }
421  }
422  return lmin;
423 }
type
Definition: HCALResponse.h:21
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
int getDepthEta16(const int det, const int phi, const int zside) const
unsigned int layerGroup(const int eta, const int i) const
unsigned int layerGroupSize(const int eta) const
const HcalParameters * hpar
std::vector< int > etaMin
HcalLayerDepthMap ldmap_
std::pair< int, int > HcalDDDSimConstants::getModHalfHBHE ( const int  type) const

Definition at line 425 of file HcalDDDSimConstants.cc.

References nmodHB, nmodHE, nzHB, and nzHE.

Referenced by getMaxDepthDet().

425  {
426 
427  if (type == 0) {
428  return std::pair<int,int>(nmodHB,nzHB);
429  } else {
430  return std::pair<int,int>(nmodHE,nzHE);
431  }
432 }
type
Definition: HCALResponse.h:21
std::pair< double, double > HcalDDDSimConstants::getPhiCons ( const int  det,
const int  ieta 
) const

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

435  {
436 
437  double fioff(0), fibin(0);
438  if (det == static_cast<int>(HcalForward)) { // Forward HCal
439  fioff = hpar->phioff[2];
440  fibin = hpar->phitable[ieta-hpar->etaMin[2]];
441  if (unitPhi(fibin) > 2) { // HF double-phi
442  fioff = hpar->phioff[4];
443  }
444  } else { // Barrel or Endcap
445  if (det == static_cast<int>(HcalEndcap)) {
446  fioff = hpar->phioff[1];
447  } else {
448  fioff = hpar->phioff[0];
449  }
450  fibin = hpar->phibin[ieta-1];
451  }
452  return std::pair<double,double>(fioff,fibin);
453 }
std::vector< double > phioff
std::vector< double > phitable
std::vector< double > phibin
int unitPhi(const int det, const int etaR) const
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 456 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, plotBeamSpotDB::first, getPhiCons(), createfilelist::int, gen::k, phi, phiNumber(), edm::second(), unitPhi(), and units().

Referenced by getMaxDepthDet(), and HcalCellTypes().

456  {
457 
458  std::vector<std::pair<int,double> > phis;
459  int ietaAbs = (ieta > 0) ? ieta : -ieta;
460  std::pair<double,double> ficons = getPhiCons(subdet, ietaAbs);
461  int nphi = int((CLHEP::twopi+0.1*ficons.second)/ficons.second);
462  int units = unitPhi(subdet, ietaAbs);
463  for (int ifi = 0; ifi < nphi; ++ifi) {
464  double phi =-ficons.first + (ifi+0.5)*ficons.second;
465  int iphi = phiNumber(ifi+1,units);
466  phis.push_back(std::pair<int,double>(iphi,phi));
467  }
468 #ifdef EDM_ML_DEBUG
469  std::cout << "getPhis: subdet|ieta|iphi " << subdet << "|" << ieta
470  << " with " << phis.size() << " phi bins" << std::endl;
471  for (unsigned int k=0; k<phis.size(); ++k)
472  std::cout << "[" << k << "] iphi " << phis[k].first << " phi "
473  << phis[k].second/CLHEP::deg << std::endl;
474 #endif
475  return phis;
476 }
std::pair< double, double > getPhiCons(const int det, const int ieta) const
U second(std::pair< T, U > const &p)
int k[5][pyjets_maxn]
int phiNumber(const int phi, const int unit) const
TString units(TString variable, Char_t axis)
int unitPhi(const int det, const int etaR) 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 987 of file HcalDDDSimConstants.cc.

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

Referenced by HcalCellTypes(), and ldMap().

988  {
989 
990  int shift;
991  switch(subdet) {
992  case HcalEndcap:
993  shift = hpar->HEShift[0];
994  break;
995  case HcalForward:
996  shift = hpar->HFShift[(depth-1)%2];
997  break;
998  case HcalOuter:
999  shift = hpar->HBShift[3];
1000  break;
1001  default:
1002  shift = hpar->HBShift[0];
1003  break;
1004  }
1005  return shift;
1006 }
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 478 of file HcalDDDSimConstants.cc.

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

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

478  {
479 
480  std::vector<HcalCellType> cellTypes = HcalCellTypes(HcalBarrel);
481 #ifdef EDM_ML_DEBUG
482  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << cellTypes.size()
483  << " cells of type HCal Barrel\n";
484  for (unsigned int i=0; i<cellTypes.size(); i++)
485  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << cellTypes[i] << "\n";
486 #endif
487 
488  std::vector<HcalCellType> hoCells = HcalCellTypes(HcalOuter);
489 #ifdef EDM_ML_DEBUG
490  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hoCells.size()
491  << " cells of type HCal Outer\n";
492  for (unsigned int i=0; i<hoCells.size(); i++)
493  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hoCells[i] << "\n";
494 #endif
495  cellTypes.insert(cellTypes.end(), hoCells.begin(), hoCells.end());
496 
497  std::vector<HcalCellType> heCells = HcalCellTypes(HcalEndcap);
498 #ifdef EDM_ML_DEBUG
499  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << heCells.size()
500  << " cells of type HCal Endcap\n";
501  for (unsigned int i=0; i<heCells.size(); i++)
502  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << heCells[i] << "\n";
503 #endif
504  cellTypes.insert(cellTypes.end(), heCells.begin(), heCells.end());
505 
506  std::vector<HcalCellType> hfCells = HcalCellTypes(HcalForward);
507 #ifdef EDM_ML_DEBUG
508  edm::LogInfo ("HCalGeom") << "HcalDDDSimConstants: " << hfCells.size()
509  << " cells of type HCal Forward\n";
510  for (unsigned int i=0; i<hfCells.size(); i++)
511  edm::LogInfo ("HCalGeom") << "Cell " << i << " " << hfCells[i] << "\n";
512 #endif
513  cellTypes.insert(cellTypes.end(), hfCells.begin(), hfCells.end());
514 
515  return cellTypes;
516 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCellType > HcalCellTypes() const
std::vector< HcalCellType > HcalDDDSimConstants::HcalCellTypes ( HcalSubdetector  subdet,
int  ieta = -1,
int  depth = -1 
) const

Definition at line 518 of file HcalDDDSimConstants.cc.

References cell(), particleFlowClusterECALTimeSelected_cfi::depth, dlShort, dzVcal, stringResolutionProvider_cfi::eta, HcalParameters::etaMax, HcalParameters::etaMin, plotBeamSpotDB::first, muonCSCDigis_cfi::gain, getGain(), getPhis(), getShift(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, hpar, idHF2QIE, gen::k, 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.

518  {
519 
520  std::vector<HcalCellType> cellTypes;
521  if (subdet == HcalForward) {
522  if (dzVcal < 0) return cellTypes;
523  }
524 
525  int dmin, dmax, indx, nz;
526  double hsize = 0;
527  switch(subdet) {
528  case HcalEndcap:
529  dmin = 1; dmax = maxLayer_+1; indx = 1; nz = nzHE;
530  break;
531  case HcalForward:
532  dmin = 1; dmax = (idHF2QIE.size() > 0) ? 2 : maxDepth[2]; indx = 2; nz = 2;
533  break;
534  case HcalOuter:
535  dmin = 4; dmax = 4; indx = 0; nz = nzHB;
536  break;
537  default:
538  dmin = 1; dmax = maxLayerHB_+1; indx = 0; nz = nzHB;
539  break;
540  }
541  if (depthl > 0) dmin = dmax = depthl;
542  int ietamin = (ieta>0) ? ieta : hpar->etaMin[indx];
543  int ietamax = (ieta>0) ? ieta : hpar->etaMax[indx];
544  int phi = (indx == 2) ? 3 : 1;
545 
546  // Get the Cells
547  int subdet0 = static_cast<int>(subdet);
548  for (int depth=dmin; depth<=dmax; depth++) {
549  int shift = getShift(subdet, depth);
550  double gain = getGain (subdet, depth);
551  if (subdet == HcalForward) {
552  if (depth%2 == 1) hsize = dzVcal;
553  else hsize = dzVcal-0.5*dlShort;
554  }
555  for (int eta=ietamin; eta<=ietamax; eta++) {
556  for (int iz=0; iz<nz; ++iz) {
557  int zside = -2*iz + 1;
558  HcalCellType::HcalCell temp1 = cell(subdet0,zside,depth,eta,phi);
559  if (temp1.ok) {
560  std::vector<std::pair<int,double> > phis = getPhis(subdet0,eta);
561  HcalCellType temp2(subdet, eta, zside, depth, temp1,
562  shift, gain, hsize);
563  double dphi, fioff;
564  std::vector<int> phiMiss2;
565  if ((subdet == HcalBarrel) || (subdet == HcalOuter)) {
566  fioff = hpar->phioff[0];
567  dphi = hpar->phibin[eta-1];
568  if (subdet == HcalOuter) {
569  if (eta == hpar->noff[4]) {
570  int kk = (iz == 0) ? 7 : (7+hpar->noff[5]);
571  for (int miss=0; miss<hpar->noff[5+iz]; miss++) {
572  phiMiss2.push_back(hpar->noff[kk]);
573  kk++;
574  }
575  }
576  }
577  } else if (subdet == HcalEndcap) {
578  fioff = hpar->phioff[1];
579  dphi = hpar->phibin[eta-1];
580  } else {
581  fioff = hpar->phioff[2];
582  dphi = hpar->phitable[eta-hpar->etaMin[2]];
583  if (unitPhi(dphi) > 2) fioff = hpar->phioff[4];
584  }
585  int unit = unitPhi(dphi);
586  temp2.setPhi(phis,phiMiss2,fioff,dphi,unit);
587  cellTypes.push_back(temp2);
588  // For HF look at extra cells
589  if ((subdet == HcalForward) && (idHF2QIE.size() > 0)) {
590  HcalCellType temp3(subdet, eta, zside+2, depth, temp1,
591  shift, gain, hsize);
592  std::vector<int> phiMiss3;
593  for (unsigned int k=0; k<phis.size(); ++k) {
594  bool ok(false);
595  for (unsigned int l=0; l<idHF2QIE.size(); ++l) {
596  if ((eta*zside == idHF2QIE[l].ieta()) &&
597  (phis[k].first == idHF2QIE[l].iphi())) {
598  ok = true;
599  break;
600  }
601  }
602  if (!ok) phiMiss3.push_back(phis[k].first);
603  }
604  dphi = hpar->phitable[eta-hpar->etaMin[2]];
605  unit = unitPhi(dphi);
606  fioff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2];
607  temp3.setPhi(phis,phiMiss2,fioff,dphi,unit);
608  cellTypes.push_back(temp3);
609  }
610  }
611  }
612  }
613  }
614  return cellTypes;
615 }
std::vector< int > maxDepth
double getGain(const HcalSubdetector subdet, const int depth) const
static const int maxLayer_
int getShift(const HcalSubdetector subdet, const int depth) const
std::vector< int > etaMax
std::vector< std::pair< int, double > > getPhis(const int subdet, const int ieta) const
std::vector< HcalDetId > idHF2QIE
int k[5][pyjets_maxn]
std::vector< double > phioff
std::vector< double > phitable
std::vector< double > phibin
int unitPhi(const int det, const int etaR) const
HcalCellType::HcalCell cell(const int det, const int zside, const int depth, const int etaR, const int iphi) const
static unsigned int const shift
std::vector< int > noff
const HcalParameters * hpar
static const int maxLayerHB_
std::vector< int > etaMin
void HcalDDDSimConstants::initialize ( void  )
private

Definition at line 702 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, 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, i, idHF2QIE, HcalLayerDepthMap::initialize(), isBH_, gen::k, GetRecoTauVFromDQM_MC_cff::kk, checklumidiff::l, HcalParameters::Layer0Wt, layerGroup(), layerGroupSize(), 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(), and ldMap().

702  {
703 
704  nEta = hpar->etaTable.size();
705  nR = hpar->rTable.size();
706  nPhiF = nR - 1;
707  isBH_ = false;
708 
709 #ifdef EDM_ML_DEBUG
710  for (int i=0; i<nEta-1; ++i) {
711  std::cout << "HcalDDDSimConstants:Read LayerGroup" << i << ":";
712  for (unsigned int k=0; k<layerGroupSize( i ); k++)
713  std::cout << " [" << k << "] = " << layerGroup( i, k );
714  std::cout << std::endl;
715  }
716 #endif
717 
718  // Geometry parameters for HF
719  dlShort = hpar->gparHF[0];
720  zVcal = hpar->gparHF[4];
721  dzVcal = hpar->dzVcal;
722 #ifdef EDM_ML_DEBUG
723  std::cout << "HcalDDDSimConstants: dlShort " << dlShort << " zVcal " << zVcal
724  << " and dzVcal " << dzVcal << std::endl;
725 #endif
726 
727  //Transform some of the parameters
729  maxDepth[0] = maxDepth[1] = 0;
730  for (int i=0; i<nEta-1; ++i) {
731  unsigned int imx = layerGroupSize( i );
732  int laymax = (imx > 0) ? layerGroup( i, imx-1 ) : 0;
733  if (i < hpar->etaMax[0]) {
734  int laymax0 = (imx > 16) ? layerGroup(i, 16) : laymax;
735  if (i+1 == hpar->etaMax[0] && laymax0 > 2) laymax0 = 2;
736  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
737  }
738  if (i >= hpar->etaMin[1]-1 && i < hpar->etaMax[1]) {
739  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
740  }
741  }
742 #ifdef EDM_ML_DEBUG
743  for (int i=0; i<4; ++i)
744  std::cout << "Detector Type [" << i << "] iEta " << hpar->etaMin[i] << ":"
745  << hpar->etaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
746 #endif
747 
748  int maxdepth = (maxDepth[1]>maxDepth[0]) ? maxDepth[1] : maxDepth[0];
749  for (int i=0; i<maxdepth; ++i) {
750  for (int k=0; k<nEta-1; ++k) {
751  int layermx = getLayerMax(k+1,i+1);
752  int ll = layermx;
753  for (int l=layermx-1; l >= 0; --l) {
754  if ((int)layerGroup( k, l ) == i+1) {
755  ll = l+1; break;
756  }
757  }
758  depths[i].push_back(ll);
759  }
760 
761 #ifdef EDM_ML_DEBUG
762  std::cout << "Depth " << i << " with " << depths[i].size() << " etas:";
763  for (int k=0; k<nEta-1; ++k) std::cout << " " << depths[i][k];
764  std::cout << std::endl;
765 #endif
766  }
767 
768  nzHB = hpar->modHB[1];
769  nmodHB = hpar->modHB[0];
770  nzHE = hpar->modHE[1];
771  nmodHE = hpar->modHE[0];
772 #ifdef EDM_ML_DEBUG
773  std::cout << "HcalDDDSimConstants:: " << nzHB << ":" << nmodHB
774  << " barrel and " << nzHE << ":" << nmodHE
775  << " endcap half-sectors" << std::endl;
776 #endif
777 
778  if (hpar->rHB.size() > maxLayerHB_+1 && hpar->zHO.size() > 4) {
779  rminHO = hpar->rHO[0];
780  for (int k=0; k<4; ++k) etaHO[k] = hpar->rHO[k+1];
781  } else {
782  rminHO =-1.0;
783  etaHO[0] = hpar->etaTable[4];
784  etaHO[1] = hpar->etaTable[4];
785  etaHO[2] = hpar->etaTable[10];
786  etaHO[3] = hpar->etaTable[10];
787  }
788 #ifdef EDM_ML_DEBUG
789  std::cout << "HO Eta boundaries " << etaHO[0] << " " << etaHO[1]
790  << " " << etaHO[2] << " " << etaHO[3] << std::endl;
791  std::cout << "HO Parameters " << rminHO << " " << hpar->zHO.size();
792  for (int i=0; i<4; ++i) std::cout << " eta[" << i << "] = " << etaHO[i];
793  for (unsigned int i=0; i<hpar->zHO.size(); ++i)
794  std::cout << " zHO[" << i << "] = " << hpar->zHO[i];
795  std::cout << std::endl;
796 #endif
797 
798  int noffsize = 7 + hpar->noff[5] + hpar->noff[6];
799  int noffl(noffsize+5);
800  if ((int)(hpar->noff.size()) > (noffsize+3)) {
801  depthEta16[0] = hpar->noff[noffsize];
802  depthEta16[1] = hpar->noff[noffsize+1];
803  depthEta29[0] = hpar->noff[noffsize+2];
804  depthEta29[1] = hpar->noff[noffsize+3];
805  if ((int)(hpar->noff.size()) > (noffsize+4)) {
806  noffl += (2*hpar->noff[noffsize+4]);
807  if ((int)(hpar->noff.size()) > noffl) isBH_ = (hpar->noff[noffl] > 0);
808  }
809  } else {
810  depthEta16[0] = 2;
811  depthEta16[1] = 3;
812  depthEta29[0] = 2;
813  depthEta29[1] = 1;
814  }
815 #ifdef EDM_ML_DEBUG
816  std::cout << "isBH_ " << hpar->noff.size() << ":" << noffsize << ":"
817  << noffl << ":" << isBH_ << std::endl;
818  std::cout << "Depth index at ieta = 16 for HB (max) " << depthEta16[0]
819  << " HE (min) " << depthEta16[1] << "; max depth for itea = 29 : ("
820  << depthEta29[0] << ":" << depthEta29[1] << ")" << std::endl;
821 #endif
822 
823  if ((int)(hpar->noff.size()) > (noffsize+4)) {
824  int npair = hpar->noff[noffsize+4];
825  int kk = noffsize+4;
826  for (int k=0; k<npair; ++k) {
827  idHF2QIE.push_back(HcalDetId(HcalForward,hpar->noff[kk+1],hpar->noff[kk+2],1));
828  kk += 2;
829  }
830  }
831 #ifdef EDM_ML_DEBUG
832  std::cout << idHF2QIE.size() << " detector channels having 2 QIE cards:"
833  << std::endl;
834  for (unsigned int k=0; k<idHF2QIE.size(); ++k)
835  std::cout << " [" << k << "] " << idHF2QIE[k] << std::endl;
836 #endif
837 
838  depthMaxSp_ = std::pair<int,int>(0,0);
839  int noffk(noffsize+5);
840  if ((int)(hpar->noff.size()) > (noffsize+5)) {
841  noffk += (2*hpar->noff[noffsize+4]);
842  if ((int)(hpar->noff.size()) > noffk+5) {
843  int dtype = hpar->noff[noffk+1];
844  int nphi = hpar->noff[noffk+2];
845  int ndeps = hpar->noff[noffk+3];
846  int ndp16 = hpar->noff[noffk+4];
847  int ndp29 = hpar->noff[noffk+5];
848  double wt = 0.1*(hpar->noff[noffk+6]);
849  if (dtype == 1 || dtype == 2) {
850  if ((int)(hpar->noff.size()) >= (noffk+7+nphi+3*ndeps)) {
851  std::vector<int> ifi, iet, ily, idp;
852  for (int i=0; i<nphi; ++i) ifi.push_back(hpar->noff[noffk+7+i]);
853  for (int i=0; i<ndeps;++i) {
854  iet.push_back(hpar->noff[noffk+7+nphi+3*i]);
855  ily.push_back(hpar->noff[noffk+7+nphi+3*i+1]);
856  idp.push_back(hpar->noff[noffk+7+nphi+3*i+2]);
857  }
858 #ifdef EDM_ML_DEBUG
859  std::cout << "Initialize HcalLayerDepthMap for Detector " << dtype
860  << " etaMax " << hpar->etaMax[dtype] << " with " << nphi
861  << " sectors";
862  for (int i=0; i<nphi; ++i) std::cout << ":" << ifi[i];
863  std::cout << " and " << ndeps << " depth sections" << std::endl;
864  for (int i=0; i<ndeps;++i)
865  std::cout << " [" << i << "] " << iet[i] << " " << ily[i] << " "
866  << idp[i] << std::endl;
867  std::cout << "Maximum depth for last HE Eta tower " << depthEta29[0]
868  << ":" << ndp16 << ":" << ndp29 << " L0 Wt "
869  << hpar->Layer0Wt[dtype-1] << ":" << wt << std::endl;
870 #endif
871  ldmap_.initialize(dtype,hpar->etaMax[dtype-1],ndp16,ndp29,wt,ifi,iet,
872  ily,idp);
873  int zside = (ifi[0]>0) ? 1 : -1;
874  int iphi = (ifi[0]>0) ? ifi[0] : -ifi[0];
875  depthMaxSp_ = std::pair<int,int>(dtype,ldmap_.getDepthMax(dtype,iphi,zside));
876  }
877  }
878  }
879  }
880  if (depthMaxSp_.first == 0) {
881  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
882  } else if (depthMaxSp_.first == 1) {
883  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
884  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
885  } else {
886  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
887  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
888  }
889 #ifdef EDM_ML_DEBUG
890  std::cout << "Detector type and maximum depth for all RBX "
891  << depthMaxDf_.first << ":" << depthMaxDf_.second
892  << " and for special RBX " << depthMaxSp_.first << ":"
893  << depthMaxSp_.second << std::endl;
894 #endif
895 }
std::vector< double > zHO
int i
Definition: DBlmapReader.cc:9
std::vector< double > etaTable
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
std::vector< HcalDetId > idHF2QIE
unsigned int layerGroup(const int eta, const int i) const
int k[5][pyjets_maxn]
std::vector< double > gparHF
unsigned int layerGroupSize(const int eta) const
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
int getLayerMax(const int eta, const int depth) 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 ( const int  eta,
const int  i 
) const
private

Definition at line 1124 of file HcalDDDSimConstants.cc.

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

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

1125  {
1126  unsigned int k = 0;
1127  for (auto const & it : hpar->layerGroupEtaSim) {
1128  if (it.layer == (unsigned int)(eta + 1)) {
1129  return it.layerGroup.at(i);
1130  }
1131  if (it.layer > (unsigned int)(eta + 1)) break;
1132  k = it.layerGroup.at(i);
1133  }
1134  return k;
1135 }
int i
Definition: DBlmapReader.cc:9
std::vector< LayerItem > layerGroupEtaSim
int k[5][pyjets_maxn]
const HcalParameters * hpar
unsigned int HcalDDDSimConstants::layerGroup ( const int  det,
const int  eta,
const int  phi,
const int  zside,
const int  i 
) const
private

Definition at line 1137 of file HcalDDDSimConstants.cc.

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

1139  {
1140 
1141  int depth0 = findDepth(det,eta,phi,zside,lay);
1142  unsigned int depth = (depth0 > 0) ? (unsigned int)(depth0) : layerGroup(eta-1,lay);
1143  return depth;
1144 }
int findDepth(const int det, const int eta, const int phi, const int zside, const int lay) const
unsigned int layerGroup(const int eta, const int i) const
unsigned int HcalDDDSimConstants::layerGroupSize ( const int  eta) const
private

Definition at line 1112 of file HcalDDDSimConstants.cc.

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

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

1112  {
1113  unsigned int k = 0;
1114  for (auto const & it : hpar->layerGroupEtaSim) {
1115  if (it.layer == (unsigned int)(eta + 1)) {
1116  return it.layerGroup.size();
1117  }
1118  if (it.layer > (unsigned int)(eta + 1)) break;
1119  k = it.layerGroup.size();
1120  }
1121  return k;
1122 }
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 617 of file HcalDDDSimConstants.cc.

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

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

617  {
618  int mxdepth = maxDepth[2];
619  if (idHF2QIE.size() > 0) {
620  bool ok(false);
621  for (unsigned int k=0; k<idHF2QIE.size(); ++k) {
622  if ((eta == idHF2QIE[k].ieta()) && (iphi == idHF2QIE[k].iphi())) {
623  ok = true; break;
624  }
625  }
626  if (!ok) mxdepth = 2;
627  }
628  return mxdepth;
629 }
std::vector< int > maxDepth
std::vector< HcalDetId > idHF2QIE
int k[5][pyjets_maxn]
unsigned int HcalDDDSimConstants::numberOfCells ( HcalSubdetector  subdet) const

Definition at line 631 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, HcalCellTypes(), i, createfilelist::int, ecaldqm::binning::nPhiBins, and pileupDistInMC::num.

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

631  {
632 
633  unsigned int num = 0;
634  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
635  for (unsigned int i=0; i<cellTypes.size(); i++) {
636  num += (unsigned int)(cellTypes[i].nPhiBins());
637  }
638 #ifdef EDM_ML_DEBUG
639  std::cout << "HcalDDDSimConstants:numberOfCells "
640  << cellTypes.size() << " " << num
641  << " for subdetector " << subdet << std::endl;
642 #endif
643  return num;
644 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalCellType > HcalCellTypes() const
int HcalDDDSimConstants::phiNumber ( const int  phi,
const int  unit 
) const

Definition at line 646 of file HcalDDDSimConstants.cc.

References phi.

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

646  {
647 
648  int iphi_skip = phi;
649  if (units==2) iphi_skip = (phi-1)*2+1;
650  else if (units==4) iphi_skip = (phi-1)*4-1;
651  if (iphi_skip < 0) iphi_skip += 72;
652  return iphi_skip;
653 }
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 1029 of file HcalDDDSimConstants.cc.

References funct::cos(), gather_cfg::cout, HcalParameters::dxHB, HcalParameters::dyHB, allConversions_cfi::dz, HcalParameters::etaTable, JetChargeProducer_cfi::exp, getLayerBack(), getLayerFront(), hpar, gen::k, GetRecoTauVFromDQM_MC_cff::kk, HcalParameters::layHB, min(), HcalParameters::rhoxHB, and funct::sin().

Referenced by ldMap(), and printTiles().

1030  {
1031  std::cout << "HcalDDDSimConstants::printTileHB for eta " << eta << " and depth " << depth << "\n";
1032 
1033  double etaL = hpar->etaTable.at(eta-1);
1034  double thetaL = 2.*atan(exp(-etaL));
1035  double etaH = hpar->etaTable.at(eta);
1036  double thetaH = 2.*atan(exp(-etaH));
1037  int layL = getLayerFront(1,eta,phi,zside,depth);
1038  int layH = getLayerBack(1,eta,phi,zside,depth);
1039  std::cout << "\ntileHB:: eta|depth " << zside*eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << "\n";
1040  for (int lay=layL; lay<layH; ++lay) {
1041  std::vector<double> area(2,0);
1042  int kk=0;
1043  for (unsigned int k=0; k<hpar->layHB.size(); ++k) {
1044  if (lay == hpar->layHB[k]) {
1045  double zmin = hpar->rhoxHB[k]*std::cos(thetaL)/std::sin(thetaL);
1046  double zmax = hpar->rhoxHB[k]*std::cos(thetaH)/std::sin(thetaH);
1047  double dz = (std::min(zmax,hpar->dxHB[k]) - zmin);
1048  if (dz > 0) {
1049  area[kk] = dz*hpar->dyHB[k];
1050  kk++;
1051  }
1052  }
1053  }
1054  if (area[0] > 0) std::cout << std::setw(2) << lay << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n";
1055  }
1056 }
std::vector< double > etaTable
int getLayerBack(const int det, const int eta, const int phi, const int zside, const int depth) const
std::vector< double > rhoxHB
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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
std::vector< double > dxHB
int getLayerFront(const int det, const int eta, const int phi, const int zside, const int depth) const
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 1058 of file HcalDDDSimConstants.cc.

References gather_cfg::cout, HcalParameters::dx1HE, HcalParameters::dyHE, stringResolutionProvider_cfi::eta, HcalParameters::etaTable, JetChargeProducer_cfi::exp, getLayerBack(), getLayerFront(), hpar, gen::k, GetRecoTauVFromDQM_MC_cff::kk, HcalParameters::layHE, hpstanc_transforms::max, min(), HcalParameters::phibin, HcalParameters::rhoxHE, funct::tan(), and HcalParameters::zxHE.

Referenced by ldMap(), and printTiles().

1059  {
1060 
1061  double etaL = hpar->etaTable[eta-1];
1062  double thetaL = 2.*atan(exp(-etaL));
1063  double etaH = hpar->etaTable[eta];
1064  double thetaH = 2.*atan(exp(-etaH));
1065  int layL = getLayerFront(2,eta,phi,zside,depth);
1066  int layH = getLayerBack(2,eta,phi,zside,depth);
1067  double phib = hpar->phibin[eta-1];
1068  int nphi = 2;
1069  if (phib > 6*CLHEP::deg) nphi = 1;
1070  std::cout << "\ntileHE:: Eta/depth " << zside*eta << "|" << depth << " theta " << thetaH/CLHEP::deg << ":" << thetaL/CLHEP::deg << " Layer " << layL << ":" << layH-1 << " phi " << nphi << "\n";
1071  for (int lay=layL; lay<layH; ++lay) {
1072  std::vector<double> area(4,0);
1073  int kk=0;
1074  for (unsigned int k=0; k<hpar->layHE.size(); ++k) {
1075  if (lay == hpar->layHE[k]) {
1076  double rmin = hpar->zxHE[k]*std::tan(thetaH);
1077  double rmax = hpar->zxHE[k]*std::tan(thetaL);
1078  if ((lay != 0 || eta == 18) &&
1079  (lay != 1 || (eta == 18 && hpar->rhoxHE[k]-hpar->dyHE[k] > 1000) ||
1080  (eta != 18 && hpar->rhoxHE[k]-hpar->dyHE[k] < 1000)) &&
1081  rmin+30 < hpar->rhoxHE[k]+hpar->dyHE[k] &&
1082  rmax > hpar->rhoxHE[k]-hpar->dyHE[k]) {
1083  rmin = std::max(rmin,hpar->rhoxHE[k]-hpar->dyHE[k]);
1084  rmax = std::min(rmax,hpar->rhoxHE[k]+hpar->dyHE[k]);
1085  double dx1 = rmin*std::tan(phib);
1086  double dx2 = rmax*std::tan(phib);
1087  double ar1=0, ar2=0;
1088  if (nphi == 1) {
1089  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*hpar->dx1HE[k]);
1090  } else {
1091  ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*hpar->dx1HE[k]);
1092  ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*tan(10.*CLHEP::deg)-4*hpar->dx1HE[k])-ar1;
1093  }
1094  area[kk] = ar1;
1095  area[kk+2] = ar2;
1096  kk++;
1097  }
1098  }
1099  }
1100  if (area[0] > 0 && area[1] > 0) {
1101  int lay0 = lay-1;
1102  if (eta == 18) lay0++;
1103  if (nphi == 1) {
1104  std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << "\n";
1105  } else {
1106  std::cout << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << ":" << std::setw(8) << area[2] << " " << std::setw(8) << area[3] << "\n";
1107  }
1108  }
1109  }
1110 }
std::vector< double > etaTable
std::vector< int > layHE
int getLayerBack(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 getLayerFront(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 655 of file HcalDDDSimConstants.cc.

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

Referenced by ldMap().

655  {
656 
657  std::vector<int> phis;
658  int detsp = ldmap_.validDet(phis);
659  int kphi = (detsp > 0) ? phis[0] : 1;
660  int zside = (kphi > 0) ? 1 : -1;
661  int iphi = (kphi > 0) ? kphi : -kphi;
662  std::cout << "Tile Information for HB from " << hpar->etaMin[0] << " to " << hpar->etaMax[0] << "\n\n";
663  for (int eta=hpar->etaMin[0]; eta<= hpar->etaMax[0]; eta++) {
664  int dmax = getMaxDepth(1,eta,iphi,-zside,false);
665  for (int depth=1; depth<=dmax; depth++)
666  printTileHB(eta, iphi, -zside, depth);
667  if (detsp == 1) {
668  int dmax = getMaxDepth(1,eta,iphi,zside,false);
669  for (int depth=1; depth<=dmax; depth++)
670  printTileHB(eta, iphi, zside, depth);
671  }
672  }
673 
674  std::cout << "\nTile Information for HE from " << hpar->etaMin[1] << " to " << hpar->etaMax[1] << "\n\n";
675  for (int eta=hpar->etaMin[1]; eta<= hpar->etaMax[1]; eta++) {
676  int dmin = (eta == hpar->etaMin[1]) ? getDepthEta16(2,iphi,-zside) : 1;
677  int dmax = getMaxDepth(2,eta,iphi,-zside,false);
678  for (int depth=dmin; depth<=dmax; depth++)
679  printTileHE(eta, iphi, -zside, depth);
680  if (detsp == 2) {
681  int dmax = getMaxDepth(2,eta,iphi,zside,false);
682  for (int depth=1; depth<=dmax; depth++)
683  printTileHE(eta, iphi, zside, depth);
684  }
685  }
686 }
int getMaxDepth(const int type) const
void printTileHE(const int eta, const int phi, const int zside, const int depth) const
std::vector< int > etaMax
int validDet(std::vector< int > &phis) const
void printTileHB(const int eta, const int phi, const int zside, const int depth) const
int getDepthEta16(const int det, const int phi, const int zside) const
const HcalParameters * hpar
std::vector< int > etaMin
HcalLayerDepthMap ldmap_
int HcalDDDSimConstants::unitPhi ( const int  det,
const int  etaR 
) const

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

688  {
689 
690  double dphi = (det == static_cast<int>(HcalForward)) ? hpar->phitable[etaR-hpar->etaMin[2]] : hpar->phibin[etaR-1];
691  return unitPhi(dphi);
692 }
std::vector< double > phitable
std::vector< double > phibin
int unitPhi(const int det, const int etaR) const
const HcalParameters * hpar
std::vector< int > etaMin
int HcalDDDSimConstants::unitPhi ( const double  dphi) const

Definition at line 694 of file HcalDDDSimConstants.cc.

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

694  {
695 
696  const double fiveDegInRad = 2*M_PI/72;
697  int units = int(dphi/fiveDegInRad+0.5);
698  if (units < 1) units = 1;
699  return units;
700 }
#define M_PI
TString units(TString variable, Char_t axis)

Member Data Documentation

int HcalDDDSimConstants::depthEta16[2]
private

Definition at line 128 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::depthEta29[2]
private

Definition at line 129 of file HcalDDDSimConstants.h.

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

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

Definition at line 132 of file HcalDDDSimConstants.h.

Referenced by getMaxDepthDet(), and initialize().

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

Definition at line 132 of file HcalDDDSimConstants.h.

Referenced by getMaxDepthDet(), and initialize().

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

Definition at line 120 of file HcalDDDSimConstants.h.

Referenced by getLayerBack(), and initialize().

double HcalDDDSimConstants::dlShort
private

Definition at line 127 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::dzVcal
private

Definition at line 126 of file HcalDDDSimConstants.h.

Referenced by HcalCellTypes(), and initialize().

double HcalDDDSimConstants::etaHO[4]
private

Definition at line 124 of file HcalDDDSimConstants.h.

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

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

Definition at line 131 of file HcalDDDSimConstants.h.

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

bool HcalDDDSimConstants::isBH_
private

Definition at line 130 of file HcalDDDSimConstants.h.

Referenced by initialize(), and isBH().

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

Definition at line 121 of file HcalDDDSimConstants.h.

const int HcalDDDSimConstants::nDepthMax =9
staticprivate

Definition at line 112 of file HcalDDDSimConstants.h.

int HcalDDDSimConstants::nEta
private

Definition at line 117 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nmodHB
private

Definition at line 122 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), and initialize().

int HcalDDDSimConstants::nmodHE
private

Definition at line 123 of file HcalDDDSimConstants.h.

Referenced by getModHalfHBHE(), and initialize().

int HcalDDDSimConstants::nPhiF
private

Definition at line 119 of file HcalDDDSimConstants.h.

Referenced by initialize().

int HcalDDDSimConstants::nR
private

Definition at line 118 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nzHB
private

Definition at line 122 of file HcalDDDSimConstants.h.

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

int HcalDDDSimConstants::nzHE
private

Definition at line 123 of file HcalDDDSimConstants.h.

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

double HcalDDDSimConstants::rminHO
private

Definition at line 124 of file HcalDDDSimConstants.h.

Referenced by getEtaHO(), and initialize().

double HcalDDDSimConstants::zVcal
private

Definition at line 125 of file HcalDDDSimConstants.h.

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