CMS 3D CMS Logo

HcalDDDRecConstants.cc
Go to the documentation of this file.
2 
5 
6 #include "CLHEP/Units/GlobalPhysicalConstants.h"
7 #include "CLHEP/Units/GlobalSystemOfUnits.h"
8 
9 //#define EDM_ML_DEBUG
10 
11 enum {kHOSizePreLS1 = 2160, kHFSizePreLS1 = 1728} ;
12 
14  const HcalDDDSimConstants& hc) :
15  hpar(hp), hcons(hc) {
16 
17 #ifdef EDM_ML_DEBUG
18  std::cout << "HcalDDDRecConstants::HcalDDDRecConstants (const HcalParameters* hp) constructor" << std::endl;
19 #endif
20  initialize();
21 }
22 
24 #ifdef EDM_ML_DEBUG
25  std::cout << "HcalDDDRecConstants::destructed!!!" << std::endl;
26 #endif
27 }
28 
29 std::vector<int> HcalDDDRecConstants::getDepth(const unsigned int eta,
30  const bool extra) const {
31 
32  if (!extra) {
33  std::vector<HcalParameters::LayerItem>::const_iterator last = hpar->layerGroupEtaRec.begin();
34  for (std::vector<HcalParameters::LayerItem>::const_iterator it = hpar->layerGroupEtaRec.begin(); it != hpar->layerGroupEtaRec.end(); ++it) {
35  if (it->layer == eta + 1) return it->layerGroup;
36  if (it->layer > eta + 1 ) return last->layerGroup;
37  last = it;
38  }
39  return last->layerGroup;
40  } else {
41  std::map<int,int> layers;
42  hcons.ldMap()->getLayerDepth(eta+1, layers);
43  std::vector<int> depths;
44  for (unsigned int lay=0; lay < layers.size(); ++lay)
45  depths.push_back(layers[lay+1]);
46  return depths;
47  }
48 }
49 
50 std::vector<int> HcalDDDRecConstants::getDepth(const int det, const int phi, const int zside, const unsigned int eta) const {
51  std::map<int,int> layers;
52  hcons.ldMap()->getLayerDepth(det, eta+1, phi, zside, layers);
53  if (layers.size() == 0) {
54  return getDepth(eta, false);
55  } else {
56  std::vector<int> depths;
57  for (unsigned int lay=0; lay < layers.size(); ++lay)
58  depths.push_back(layers[lay+1]);
59  return depths;
60  }
61 }
62 
63 std::vector<HcalDDDRecConstants::HcalEtaBin>
64 HcalDDDRecConstants::getEtaBins(const int itype) const {
65 
66  std::vector<HcalDDDRecConstants::HcalEtaBin> bins;
67  unsigned int type = (itype == 0) ? 0 : 1;
68  HcalSubdetector subdet = HcalSubdetector(type+1);
69  std::vector<int> phiSp;
70  HcalSubdetector subdetSp = HcalSubdetector(hcons.ldMap()->validDet(phiSp));
71  std::map<int,int> layers;
72  for (int iz=0; iz<2; ++iz) {
73  int zside = 2*iz - 1;
74  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
75  std::vector<std::pair<int,double> > phis = getPhis(subdet,ieta);
76  std::vector<std::pair<int,double> > phiUse;
77  getLayerDepth(ieta,layers);
78  if (subdet == subdetSp) {
79  for (unsigned k=0; k<phis.size(); ++k) {
80  if (std::find(phiSp.begin(),phiSp.end(),(zside*phis[k].first)) ==
81  phiSp.end()){
82  phiUse.push_back(phis[k]);
83  }
84  }
85  } else {
86  phiUse.insert(phiUse.end(),phis.begin(),phis.end());
87  }
88  getOneEtaBin(subdet,ieta,zside,phiUse,layers,false,bins);
89  }
90  }
91  if (subdetSp == subdet) {
92  for (int ieta = iEtaMin[type]; ieta <= iEtaMax[type]; ++ieta) {
93  std::vector<std::pair<int,double> > phis = getPhis(subdet,ieta);
94  for (int iz=0; iz<2; ++iz) {
95  int zside = 2*iz - 1;
96  std::vector<std::pair<int,double> > phiUse;
97  for (unsigned i=0; i<phiSp.size(); ++i) {
98  for (unsigned k=0; k<phis.size(); ++k) {
99  if (phiSp[i] == zside*phis[k].first) {
100  phiUse.push_back(phis[k]);
101  break;
102  }
103  }
104  }
105  if (phiUse.size() > 0) {
106  hcons.ldMap()->getLayerDepth(subdet,ieta,phiUse[0].first,zside,layers);
107  getOneEtaBin(subdet,ieta,zside,phiUse,layers,true,bins);
108  }
109  }
110  }
111  }
112 #ifdef EDM_ML_DEBUG
113  std::cout << "Prepares " << bins.size() << " eta bins for type " << type
114  << std::endl;
115  for (unsigned int i=0; i<bins.size(); ++i) {
116  std::cout << "Bin[" << i << "]: Eta = (" << bins[i].ieta << ":"
117  << bins[i].etaMin << ":" << bins[i].etaMax << "), Zside = "
118  << bins[i].zside << ", phis = (" << bins[i].phis.size() << ":"
119  << bins[i].dphi << ") and " << bins[i].layer.size()
120  << " depths (start) " << bins[i].depthStart << " :";
121  for (unsigned int k=0; k<bins[i].layer.size(); ++k)
122  std::cout << " [" << k << "] " << bins[i].layer[k].first << ":"
123  << bins[i].layer[k].second;
124  std::cout << std::endl << " and Phi sets";
125  for (unsigned int k=0; k<bins[i].phis.size(); ++k)
126  std::cout << " " << bins[i].phis[k].first << ":" <<bins[i].phis[k].second;
127  std::cout << std::endl;
128  }
129 #endif
130  return bins;
131 }
132 
133 std::pair<double,double>
134 HcalDDDRecConstants::getEtaPhi(int subdet, int ieta, int iphi) const {
135  int ietaAbs = (ieta > 0) ? ieta : -ieta;
136  double eta(0), phi(0);
137  if ((subdet == static_cast<int>(HcalBarrel)) ||
138  (subdet == static_cast<int>(HcalEndcap)) ||
139  (subdet == static_cast<int>(HcalOuter))) { // Use Eta Table
140  int unit = hcons.unitPhi(phibin[ietaAbs-1]);
141  int kphi = (unit == 2) ? ((iphi-1)/2 + 1) : iphi;
142  double foff = (ietaAbs <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
143  eta = 0.5*(etaTable[ietaAbs-1]+etaTable[ietaAbs]);
144  phi = foff + (kphi-0.5)*phibin[ietaAbs-1];
145  } else {
146  ietaAbs -= iEtaMin[2];
147  int unit = hcons.unitPhi(hpar->phitable[ietaAbs-1]);
148  int kphi = (unit == 4) ? ((iphi-3)/4 + 1) : ((iphi-1)/2 + 1);
149  double foff = (unit > 2) ? hpar->phioff[4] : hpar->phioff[2];
150  eta = 0.5*(hpar->etaTableHF[ietaAbs-1]+hpar->etaTableHF[ietaAbs]);
151  phi = foff + (kphi-0.5)*hpar->phitable[ietaAbs-1];
152  }
153  if (ieta < 0) eta = -eta;
154  if (phi > M_PI) phi -= (2*M_PI);
155 #ifdef EDM_ML_DEBUG
156  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta << "|"
157  << iphi << " eta|phi " << eta << "|" << phi << std::endl;
158 #endif
159  return std::pair<double,double>(eta,phi);
160 }
161 
163 HcalDDDRecConstants::getHCID(int subdet, int keta, int iphi, int lay,
164  int idepth) const {
165 
166  int ieta = (keta > 0) ? keta : -keta;
167  int zside= (keta > 0) ? 1 : -1;
168  int eta(ieta), phi(iphi), depth(idepth);
169  if ((subdet == static_cast<int>(HcalOuter)) ||
170  ((subdet == static_cast<int>(HcalBarrel)) && (lay > maxLayerHB_+1))) {
171  subdet= static_cast<int>(HcalOuter);
172  depth = 4;
173  } else if (subdet == static_cast<int>(HcalBarrel) ||
174  subdet == static_cast<int>(HcalEndcap)) {
175  eta = ietaMap[ieta-1];
176  int unit = phiUnitS[ieta-1];
177  int phi0 = (iphi-1)/(hpar->phigroup[eta-1]);
178  if (unit == 2) {
179  phi0 = (iphi+1)/2;
180  phi0 = (phi0-1)/(hpar->phigroup[eta-1]);
181  } else if (unit == 4) {
182  phi0 = (iphi+1)/4;
183  phi0 = (phi0-1)/(hpar->phigroup[eta-1]);
184  }
185  ++phi0;
186  unit = hcons.unitPhi(phibin[eta-1]);
187  phi = hcons.phiNumber(phi0,unit);
188  depth = hcons.findDepth(subdet,eta,phi,zside,lay-1);
189  if (depth <= 0) depth = layerGroup(eta-1, lay-1);
190  if (eta == iEtaMin[1]) {
191  if (subdet == static_cast<int>(HcalBarrel)) {
192  if (depth > hcons.getDepthEta16(subdet,phi,zside))
193  depth = hcons.getDepthEta16(subdet,phi,zside);
194  } else {
195  if (depth < hcons.getDepthEta16(subdet,phi,zside))
196  depth = hcons.getDepthEta16(subdet,phi,zside);
197  }
198  } else if (eta == hpar->noff[0] && lay > 1) {
199  int kphi = phi + int((hpar->phioff[3]+0.1)/phibin[eta-1]);
200  kphi = (kphi-1)%4 + 1;
201  if (kphi == 2 || kphi == 3) depth = layerGroup(eta-1, lay-2);
202  } else if (eta == hpar->noff[1] &&
203  depth > hcons.getDepthEta29(phi,zside,0)) {
204  eta -= hcons.getDepthEta29(phi,zside,1);
205  }
206  }
207 #ifdef EDM_ML_DEBUG
208  std::cout << "getHCID: input " << subdet << ":" << ieta << ":" << iphi
209  << ":" << idepth << ":" << lay << " output " << eta << ":" << phi
210  << ":" << depth << std::endl;
211 #endif
212  return HcalDDDRecConstants::HcalID(subdet,eta,phi,depth);
213 }
214 
215 std::vector<HcalDDDRecConstants::HFCellParameters>
217 
218  std::vector<HcalDDDRecConstants::HFCellParameters> cells;
219  unsigned int nEta = hcons.getPhiTableHF().size();
220  if (maxDepth[2] > 0) {
221  for (unsigned int k=0; k<nEta; ++k) {
222  int ieta = iEtaMin[2] + k;
223  int dphi = (int)(0.001 + hcons.getPhiTableHF()[k]/(5.0*CLHEP::deg));
224  int iphi = (dphi == 4) ? 3 : 1;
225  int nphi = 72/dphi;
226  double rMin = hcons.getRTableHF()[nEta-k-1]/CLHEP::cm;
227  double rMax = hcons.getRTableHF()[nEta-k]/CLHEP::cm;
228  HcalDDDRecConstants::HFCellParameters cell1( ieta,1,iphi,dphi,nphi,rMin,rMax);
229  cells.push_back(cell1);
230  HcalDDDRecConstants::HFCellParameters cell2(-ieta,1,iphi,dphi,nphi,rMin,rMax);
231  cells.push_back(cell2);
232  }
233  }
234  if (maxDepth[2] > 2) {
235  if (hcons.getIdHF2QIE().size() > 0) {
236  for (unsigned int k=0; k<hcons.getIdHF2QIE().size(); ++k) {
237  int ieta = hcons.getIdHF2QIE()[k].ieta();
238  int ind = std::abs(ieta) - iEtaMin[2];
239  int dphi = (int)(0.001 + hcons.getPhiTableHF()[ind]/(5.0*CLHEP::deg));
240  int iphi = hcons.getIdHF2QIE()[k].iphi();
241  double rMin = hcons.getRTableHF()[nEta-ind-1]/CLHEP::cm;
242  double rMax = hcons.getRTableHF()[nEta-ind]/CLHEP::cm;
243  HcalDDDRecConstants::HFCellParameters cell1( ieta,3,iphi,dphi,1,rMin,rMax);
244  cells.push_back(cell1);
245  }
246  } else {
247  for (unsigned int k=0; k<nEta; ++k) {
248  int ieta = iEtaMin[2] + k;
249  int dphi = (int)(0.001 + hcons.getPhiTableHF()[k]/(5.0*CLHEP::deg));
250  int iphi = (dphi == 4) ? 3 : 1;
251  int nphi = 72/dphi;
252  double rMin = hcons.getRTableHF()[nEta-k-1]/CLHEP::cm;
253  double rMax = hcons.getRTableHF()[nEta-k]/CLHEP::cm;
254  HcalDDDRecConstants::HFCellParameters cell1( ieta,3,iphi,dphi,nphi,rMin,rMax);
255  cells.push_back(cell1);
256  HcalDDDRecConstants::HFCellParameters cell2(-ieta,3,iphi,dphi,nphi,rMin,rMax);
257  cells.push_back(cell2);
258  }
259  }
260  }
261 #ifdef EDM_ML_DEBUG
262  std::cout << "HcalDDDRecConstants returns " << cells.size()
263  << " HF cell parameters" << std::endl;
264  for (unsigned int k=0; k<cells.size(); ++k)
265  std::cout << "Cell[" << k <<"] : (" << cells[k].ieta <<", "<< cells[k].depth
266  << ", " << cells[k].firstPhi << ", " << cells[k].stepPhi << ", "
267  << cells[k].nPhi << ", " << cells[k].rMin << ", "
268  << cells[k].rMax << ")" << std::endl;
269 #endif
270  return cells;
271 }
272 
274  std::map<int,int>& layers) const {
275 
276  layers.clear();
277  for (unsigned int l=0; l<layerGroupSize(ieta-1); ++l) {
278  int lay = l + 1;
279  layers[lay] = layerGroup(ieta-1,l);
280  }
281 #ifdef EDM_ML_DEBUG
282  std::cout << "getLayerDepth::Input " << ieta << " Output "
283  << layers.size() << " entries" << std::endl;
284  for (std::map<int,int>::iterator itr=layers.begin(); itr != layers.end();
285  ++itr) std::cout << " [" << itr->first << "] " << itr->second;
286  std::cout << std::endl;
287 #endif
288 }
289 
290 int HcalDDDRecConstants::getLayerFront(const int idet, const int ieta,
291  const int iphi, const int depth) const {
292  int subdet = (idet == 1) ? 1 : 2;
293  int zside = (ieta > 0) ? 1 : -1;
294  int eta = zside*ieta;
295  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,iphi,zside,depth);
296  if (layFront < 0) {
297  int laymin = hcons.getFrontLayer(subdet, ieta);
298  if (eta <= hpar->etaMax[1]) {
299  for (unsigned int k=0; k<layerGroupSize(eta-1); ++k) {
300  if (depth == (int)layerGroup(eta-1, k)) {
301  if ((int)(k) >= laymin) {
302  layFront = k;
303  break;
304  }
305  }
306  }
307  }
308  }
309 #ifdef EDM_ML_DEBUG
310  std::cout << "getLayerFront::Input " << idet << ":" << ieta << ":"
311  << iphi << ":" << depth << " Output " << layFront << std::endl;
312 #endif
313  return layFront;
314 }
315 
316 int HcalDDDRecConstants::getMaxDepth (const int itype, const int ieta,
317  const int iphi, const int zside) const {
318 
319  unsigned int type = (itype == 0) ? 0 : 1;
320  int lmax = hcons.getMaxDepth(type+1, ieta, iphi, zside, true);
321  if (lmax < 0) {
322  unsigned int lymax = (type == 0) ? maxLayerHB_+1 : maxLayer_+1;
323  lmax = 0;
324  if (layerGroupSize(ieta-1) > 0) {
325  if (layerGroupSize(ieta-1) < lymax) lymax = layerGroupSize(ieta-1);
326  lmax = (int)(layerGroup(ieta-1, lymax-1));
327  if (type == 0 && ieta == iEtaMax[type]) lmax = hcons.getDepthEta16M(1);
328  if (type == 1 && ieta >= hpar->noff[1]) lmax = hcons.getDepthEta29M(0,false);
329  }
330  }
331  return lmax;
332 }
333 
334 int HcalDDDRecConstants::getMinDepth (const int itype, const int ieta,
335  const int iphi, const int zside) const {
336 
337  int lmin = hcons.getMinDepth(itype+1, ieta, iphi, zside, true);
338  if (lmin < 0) {
339  if (itype == 2) { // HFn
340  lmin = 1;
341  } else if (itype == 3) { //HO
342  lmin = maxDepth[3];
343  } else {
344  unsigned int type = (itype == 0) ? 0 : 1;
345  if (layerGroupSize(ieta-1) > 0) {
346  if (type == 1 && ieta == iEtaMin[type])
347  lmin = hcons.getDepthEta16M(2);
348  else
349  lmin = (int)(layerGroup(ieta-1, 0));
350  }
351  }
352  }
353  return lmin;
354 }
355 
356 std::vector<std::pair<int,double> >
357 HcalDDDRecConstants::getPhis(int subdet, int ieta) const {
358 
359  std::vector<std::pair<int,double> > phis;
360  int ietaAbs = (ieta > 0) ? ieta : -ieta;
361  int keta = (subdet != HcalForward) ? etaSimValu[ietaAbs-1].first : ietaAbs;
362  std::pair<double,double> ficons = hcons.getPhiCons(subdet, keta);
363  double fioff = ficons.first;
364  double dphi = (subdet != HcalForward) ? phibin[ietaAbs-1] : ficons.second;
365  int nphi = int((CLHEP::twopi+0.1*dphi)/dphi);
366  int units = hcons.unitPhi(subdet, keta);
367  for (int ifi = 0; ifi < nphi; ++ifi) {
368  double phi =-fioff + (ifi+0.5)*dphi;
369  int iphi = hcons.phiNumber(ifi+1,units);
370  phis.push_back(std::pair<int,double>(iphi,phi));
371  }
372 #ifdef EDM_ML_DEBUG
373  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta
374  << " with " << phis.size() << " phi bins" << std::endl;
375  for (unsigned int k=0; k<phis.size(); ++k)
376  std::cout << "[" << k << "] iphi " << phis[k].first << " phi "
377  << phis[k].second/CLHEP::deg << std::endl;
378 #endif
379  return phis;
380 }
381 
382 int HcalDDDRecConstants::getPhiZOne(std::vector<std::pair<int,int>>& phiz) const {
383 
384  phiz.clear();
385  int subdet = hcons.ldMap()->getSubdet();
386  if (subdet > 0) {
387  std::vector<int> phis = hcons.ldMap()->getPhis();
388  for (unsigned int k=0; k<phis.size(); ++k) {
389  int zside = (phis[k] > 0) ? 1 : -1;
390  int phi = (phis[k] > 0) ? phis[k] : -phis[k];
391  phiz.push_back(std::pair<int,int>(phi,zside));
392  }
393  }
394 #ifdef EDM_ML_DEBUG
395  std::cout << "Special RBX for detector " << subdet << " with " << phiz.size()
396  << " phi/z bins";
397  for (unsigned int k=0; k<phiz.size(); ++k)
398  std::cout << " [" << k << "] " << phiz[k].first << ":" << phiz[k].second;
399  std::cout << std::endl;
400 #endif
401  return subdet;
402 }
403 
404 double HcalDDDRecConstants::getRZ(int subdet, int ieta, int depth) const {
405 
406  return getRZ(subdet, ieta, 1, depth);
407 }
408 
409 double HcalDDDRecConstants::getRZ(int subdet, int ieta, int iphi,
410  int depth) const {
411  int layf = getLayerFront(subdet,ieta,iphi,depth);
412  double rz = (layf < 0) ? 0.0 :
413  ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[layf].first) :
414  (gconsHE[layf].first));
415 #ifdef EDM_ML_DEBUG
416  std::cout << "getRZ: subdet|ieta|ipho|depth " << subdet << "|" << ieta << "|"
417  << iphi << "|" << depth << " lay|rz " << layf << "|" << rz
418  << std::endl;
419 #endif
420  return rz;
421 }
422 
423 double HcalDDDRecConstants::getRZ(int subdet, int layer) const {
424 
425  double rz(0);
426  if (layer > 0 && layer <= (int)(layerGroupSize(0)))
427  rz = ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[layer-1].first) :
428  (gconsHE[layer-1].first));
429 #ifdef EDM_ML_DEBUG
430  std::cout << "getRZ: subdet|layer " << subdet << "|" << layer << " rz "
431  << rz << std::endl;
432 #endif
433  return rz;
434 }
435 
436 
437 std::vector<HcalDDDRecConstants::HcalActiveLength>
439 
440  std::vector<HcalDDDRecConstants::HcalActiveLength> actives;
441  std::vector<HcalDDDRecConstants::HcalEtaBin> bins = getEtaBins(type);
442 #ifdef EDM_ML_DEBUG
443  unsigned int kount(0);
444 #endif
445  for (unsigned int k=0; k<bins.size(); ++k) {
446  int ieta = bins[k].ieta;
447  int zside = bins[k].zside;
448  int stype = (bins[k].phis.size() > 4) ? 0 : 1;
449  double eta = 0.5*(bins[k].etaMin+bins[k].etaMax);
450  double theta = 2*atan(exp(-eta));
451  double scale = 1.0/((type == 0) ? sin(theta) : cos(theta));
452  int depth = bins[k].depthStart;
453  for (unsigned int i = 0; i < bins[k].layer.size(); ++i) {
454  double thick(0);
455  for (int j = bins[k].layer[i].first; j <= bins[k].layer[i].second; ++j) {
456  if (type == 0 || j > 1) {
457  double t = ((type == 0) ? gconsHB[j-1].second : gconsHE[j-1].second);
458  if (t > 0) thick += t;
459  }
460  }
461  thick *= (2.*scale);
462  HcalDDDRecConstants::HcalActiveLength active(ieta,depth,zside,stype,zside*eta,thick);
463  actives.push_back(active);
464  ++depth;
465 #ifdef EDM_ML_DEBUG
466  kount++;
467  std::cout << "getThickActive: [" << kount << "] eta:" << active.ieta
468  << ":" << active.eta << " zside " << active.zside << " depth "
469  << active.depth << " type " << active.stype << " thick "
470  << active.thick << std::endl;
471 #endif
472  }
473  }
474  return actives;
475 }
476 
477 std::vector<HcalCellType>
479 
480  if (subdet == HcalBarrel || subdet == HcalEndcap) {
481  std::vector<HcalCellType> cells;
482  int isub = (subdet == HcalBarrel) ? 0 : 1;
483  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
484  std::vector<int> missPhi;
485  for (const auto& etabin : etabins) {
486  std::vector<HcalCellType> temp;
487  std::vector<int> count;
488  std::vector<double> dmin, dmax;
489  for (unsigned int il=0; il<etabin.layer.size(); ++il) {
490  HcalCellType cell(subdet, etabin.ieta, etabin.zside, 0,
492  temp.push_back(cell);
493  count.push_back(0);
494  dmin.push_back(0);
495  dmax.push_back(0);
496  }
497  int ieta = etabin.ieta;
498  for (int keta=etaSimValu[ieta-1].first; keta<=etaSimValu[ieta-1].second;
499  ++keta) {
500  std::vector<HcalCellType> cellsm = hcons.HcalCellTypes(subdet,keta,-1);
501  for (unsigned int il=0; il<etabin.layer.size(); ++il) {
502  for (unsigned int ic=0; ic<cellsm.size(); ++ic) {
503  if (cellsm[ic].depthSegment() >= etabin.layer[il].first &&
504  cellsm[ic].depthSegment() <= etabin.layer[il].second &&
505  cellsm[ic].etaBin() == temp[il].etaBin() &&
506  cellsm[ic].zside() == temp[il].zside()) {
507  if (count[il] == 0) {
508  temp[il] = cellsm[ic];
509  dmin[il] = cellsm[ic].depthMin();
510  dmax[il] = cellsm[ic].depthMax();
511  }
512  ++count[il];
513  if (cellsm[ic].depthMin() < dmin[il])
514  dmin[il] = cellsm[ic].depthMin();
515  if (cellsm[ic].depthMax() > dmax[il])
516  dmax[il] = cellsm[ic].depthMax();
517  }
518  }
519  }
520  }
521  for (unsigned int il=0; il<etabin.layer.size(); ++il) {
522  int depth = etabin.depthStart + (int)(il);
523  temp[il].setEta(ieta,etabin.etaMin,etabin.etaMax);
524  temp[il].setDepth(depth,dmin[il],dmax[il]);
525  double foff = (etabin.ieta <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
526  int unit = hcons.unitPhi(etabin.dphi);
527  temp[il].setPhi(etabin.phis, missPhi, foff, etabin.dphi, unit);
528  cells.push_back(temp[il]);
529  }
530  }
531 #ifdef EDM_ML_DEBUG
532  std::cout << "HcalDDDRecConstants: found " << cells.size()
533  << " cells for sub-detector type " << isub << std::endl;
534  for (unsigned int ic=0; ic<cells.size(); ++ic)
535  std::cout << "Cell[" << ic << "] " << cells[ic] << std::endl;
536 #endif
537  return cells;
538  } else {
539  return hcons.HcalCellTypes(subdet,-1,-1);
540  }
541 }
542 
544 
545  if (subdet == HcalBarrel || subdet == HcalEndcap) {
546  unsigned int num = 0;
547  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
548  for (unsigned int i=0; i<cellTypes.size(); i++) {
549  num += (unsigned int)(cellTypes[i].nPhiBins());
550  }
551 #ifdef EDM_ML_DEBUG
552  edm::LogInfo ("HCalGeom") << "HcalDDDRecConstants:numberOfCells "
553  << cellTypes.size() << " " << num
554  << " for subdetector " << subdet;
555 #endif
556  return num;
557  } else {
558  return hcons.numberOfCells(subdet);
559  }
560 }
561 
562 unsigned int HcalDDDRecConstants::nCells(HcalSubdetector subdet) const {
563 
564  if (subdet == HcalBarrel || subdet == HcalEndcap) {
565  int isub = (subdet == HcalBarrel) ? 0 : 1;
566  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
567  unsigned int ncell(0);
568  for (unsigned int i=0; i<etabins.size(); ++i) {
569  ncell += ((etabins[i].phis.size())*(etabins[i].layer.size()));
570  }
571  return ncell;
572  } else if (subdet == HcalOuter) {
573  return kHOSizePreLS1;
574  } else if (subdet == HcalForward) {
575  return (unsigned int)(hcons.numberOfCells(subdet));
576  } else {
577  return 0;
578  }
579 }
580 
581 unsigned int HcalDDDRecConstants::nCells() const {
583 }
584 
586 
587  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(id);
588  if (itr == detIdSp_.end()) return id;
589  else return itr->second;
590 }
591 
593 
594  HcalDetId hid(id);
595  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
596  if (itr != detIdSpR_.end())
597  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second)[0].depth());
598  return hid;
599 }
600 
602 
603  HcalDetId hid(id);
604  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
605  if (itr != detIdSpR_.end())
606  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second).back().depth());
607  return hid;
608 }
609 
611  std::vector<HcalDetId>& ids) const {
612 
613  ids.clear();
614  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
615  if (itr == detIdSpR_.end()) {
616  ids.push_back(id);
617  } else {
618  for (unsigned k=0; k<itr->second.size(); ++k) {
619  HcalDetId hid(id.subdet(),id.ieta(),id.iphi(),(itr->second)[k].depth());
620  ids.push_back(hid);
621  }
622  }
623 }
624 
625 void HcalDDDRecConstants::specialRBXHBHE(const std::vector<HcalDetId>& idsOld,
626  std::vector<HcalDetId>& idsNew) const {
627  for (unsigned int k=0; k<idsOld.size(); ++k) {
628  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(idsOld[k]);
629  if (itr == detIdSp_.end()) idsNew.push_back(idsOld[k]);
630  else idsNew.push_back(itr->second);
631  }
632 }
633 
635  std::vector<HcalDetId>& ids) const {
636  if (tobemerged) {
637  std::map<HcalDetId,HcalDetId>::const_iterator itr;
638  for (itr = detIdSp_.begin(); itr != detIdSp_.end(); ++itr)
639  ids.push_back(itr->first);
640  } else{
641  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr;
642  for (itr = detIdSpR_.begin(); itr != detIdSpR_.end(); ++itr)
643  ids.push_back(itr->first);
644  }
645  return (ids.size() > 0);
646 }
647 
649  std::vector<std::pair<int,double> >& phis,
650  std::map<int,int>& layers, bool planOne,
651  std::vector<HcalDDDRecConstants::HcalEtaBin>& bins) const {
652 
653  unsigned int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
654  int type = (subdet == HcalBarrel) ? 0 : 1;
655  double dphi = phibin[ieta-1];
657  etabin.phis.insert(etabin.phis.end(),phis.begin(),phis.end());
658  int n = (ieta == iEtaMax[type]) ? 0 : 1;
659  HcalDDDRecConstants::HcalEtaBin etabin0= HcalDDDRecConstants::HcalEtaBin(ieta,zside,dphi,etaTable[ieta-1],etaTable[ieta+n]);
660  etabin0.depthStart = hcons.getDepthEta29(phis[0].first,zside,0)+1;
661  int dstart = -1;
662  int lmin(0), lmax(0);
663  std::map<int,int>::iterator itr=layers.begin();
664  if (layers.size() > 0) {
665  int dep = itr->second;
666  if (subdet == HcalEndcap && ieta == iEtaMin[type])
667  dep = hcons.getDepthEta16(subdet,phis[0].first,zside);
668  unsigned lymx0 = (layers.size() > lymax) ? lymax : layers.size();
669 #ifdef EDM_ML_DEBUG
670  std::cout << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside
671  << " lymax " << lymx0 << ":" << lymax << " Depth " << dep << ":"
672  << itr->second;
673  unsigned int l(0);
674  for (itr = layers.begin(); itr != layers.end(); ++itr,++l)
675  std::cout << " [" << l << "] " << itr->first << ":" << itr->second;
676  std::cout << std::endl << " with " << phis.size() << " phis";
677  for (unsigned int l=0; l<phis.size(); ++l)
678  std::cout << " " << phis[l].first << ":" << phis[l].second;
679  std::cout << std::endl;
680 #endif
681  for (itr = layers.begin(); itr != layers.end(); ++itr) {
682  if (itr->first <= (int)(lymx0)) {
683  if (itr->second == dep) {
684  if (lmin == 0) lmin = itr->first;
685  lmax = itr->first;
686  } else if (itr->second > dep) {
687  if (dstart < 0) dstart = dep;
688  int lmax0 = (lmax >= lmin) ? lmax : lmin;
689  if (subdet == HcalEndcap && ieta+1 == hpar->noff[1] &&
690  dep > hcons.getDepthEta29(phis[0].first,zside,0)) {
691  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax0));
692  } else {
693  etabin.layer.push_back(std::pair<int,int>(lmin,lmax0));
694  }
695  lmin = itr->first;
696  lmax = lmin-1;
697  dep = itr->second;
698  }
699  if (subdet == HcalBarrel && ieta == iEtaMax[type] &&
700  dep > hcons.getDepthEta16M(1)) break;
701  if (subdet == HcalEndcap && ieta == hpar->noff[1] &&
702  dep > hcons.getDepthEta29M(0,planOne)) {
703  lmax = lymx0;
704  break;
705  }
706  if (itr->first == (int)(lymx0)) lmax = lymx0;
707  }
708  }
709  if (lmax >= lmin) {
710  if (ieta+1 == hpar->noff[1]) {
711  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax));
712  etabin0.phis.insert(etabin0.phis.end(),phis.begin(),phis.end());
713  bins.push_back(etabin0);
714 #ifdef EDM_ML_DEBUG
715  std::cout << "etabin0: dStatrt " << etabin0.depthStart << " layers "
716  << etabin0.layer.size() << ":" << lmin << ":" << lmax
717  << " phis " << phis.size() << std::endl;
718  for (unsigned int k=0; k<etabin0.layer.size(); ++k)
719  std::cout << " [" << k << "] " << etabin0.layer[k].first << ":"
720  << etabin0.layer[k].second;
721  std::cout << std::endl;
722 #endif
723  } else if (ieta == hpar->noff[1]) {
724  } else {
725  etabin.layer.push_back(std::pair<int,int>(lmin,lmax));
726  if (dstart < 0) dstart = dep;
727  }
728  }
729  }
730  etabin.depthStart = dstart;
731  bins.push_back(etabin);
732 #ifdef EDM_ML_DEBUG
733  std::cout << "etabin: dStatrt " << etabin.depthStart << " layers "
734  << etabin.layer.size() << ":" << lmin << ":" << lmax
735  << " phis " << etabin.phis.size() << std::endl;
736  for (unsigned int k=0; k<etabin.layer.size(); ++k)
737  std::cout << " [" << k << "] " << etabin.layer[k].first << ":"
738  << etabin.layer[k].second;
739  std::cout << std::endl;
740 #endif
741 }
742 
744 
745  //Eta grouping
746  int nEta = (int)(hpar->etagroup.size());
747  if (nEta != (int)(hpar->phigroup.size())) {
748  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
749  << " etaGroup (" << nEta << ") and phiGroup ("
750  << hpar->phigroup.size() << ") do not match";
751  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size();
752  }
753 
754  // First eta table
755  iEtaMin = hpar->etaMin;
756  iEtaMax = hpar->etaMax;
757  etaTable.clear(); ietaMap.clear(); etaSimValu.clear();
758  int ieta(0), ietaHB(0), ietaHE(0), ietaHEM(0);
759  etaTable.push_back(hpar->etaTable[ieta]);
760  for (int i=0; i<nEta; ++i) {
761  int ef = ieta+1;
762  ieta += (hpar->etagroup[i]);
763  if (ieta >= (int)(hpar->etaTable.size())) {
764  edm::LogError("HCalGeom") << "Going beyond the array boundary "
765  << hpar->etaTable.size() << " at index " << i
766  << " of etaTable from SimConstant";
767  throw cms::Exception("DDException") << "Going beyond the array boundary "
768  << hpar->etaTable.size()
769  << " at index " << i
770  << " of etaTable from SimConstant";
771  } else {
772  etaTable.push_back(hpar->etaTable[ieta]);
773  etaSimValu.push_back(std::pair<int,int>(ef,ieta));
774  }
775  for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.push_back(i+1);
776  if (ieta <= hpar->etaMax[0]) ietaHB = i+1;
777  if (ieta <= hpar->etaMin[1]) ietaHE = i+1;
778  if (ieta <= hpar->etaMax[1]) ietaHEM= i+1;
779  }
780  iEtaMin[1] = ietaHE;
781  iEtaMax[0] = ietaHB;
782  iEtaMax[1] = ietaHEM;
783 
784  // Then Phi bins
785  nPhiBins.clear();
786  for (unsigned int k=0; k<4; ++k) nPhiBins.push_back(0);
787  ieta = 0;
788  phibin.clear(); phiUnitS.clear();
789  for (int i=0; i<nEta; ++i) {
790  double dphi = (hpar->phigroup[i])*(hpar->phibin[ieta]);
791  phibin.push_back(dphi);
792  int nphi = (int)((CLHEP::twopi + 0.001)/dphi);
793  if (ieta <= iEtaMax[0]) {
794  if (nphi > nPhiBins[0]) nPhiBins[3] = nPhiBins[0] = nphi;
795  }
796  if (ieta >= iEtaMin[1]) {
797  if (nphi > nPhiBins[1]) nPhiBins[1] = nphi;
798  }
799  ieta += (hpar->etagroup[i]);
800  }
801  for (unsigned int i=1; i<hpar->etaTable.size(); ++i) {
802  int unit = hcons.unitPhi(hpar->phibin[i-1]);
803  phiUnitS.push_back(unit);
804  }
805  for (unsigned int i=0; i<hpar->phitable.size(); ++i) {
806  int nphi = (int)((CLHEP::twopi + 0.001)/hpar->phitable[i]);
807  if (nphi > nPhiBins[2]) nPhiBins[2] = nphi;
808  }
809 #ifdef EDM_ML_DEBUG
810  std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl;
811  for (int i=0; i<nEta; ++i)
812  std::cout << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i+1]
813  << ":" << etaSimValu[i].first << ":" << etaSimValu[i].second
814  << " PhiBin[" << i << "] = " << phibin[i]/CLHEP::deg <<std::endl;
815  std::cout << "PhiUnitS";
816  for (unsigned int i=0; i<phiUnitS.size(); ++i)
817  std::cout << " [" << i << "] = " << phiUnitS[i];
818  std::cout << std::endl;
819  std::cout << "nPhiBins";
820  for (unsigned int i=0; i<nPhiBins.size(); ++i)
821  std::cout << " [" << i << "] = " << nPhiBins[i];
822  std::cout << std::endl;
823  std::cout << "EtaTableHF";
824  for (unsigned int i=0; i<hpar->etaTableHF.size(); ++i)
825  std::cout << " [" << i << "] = " << hpar->etaTableHF[i];
826  std::cout << std::endl;
827  std::cout << "PhiBinHF";
828  for (unsigned int i=0; i<hpar->phitable.size(); ++i)
829  std::cout << " [" << i << "] = " << hpar->phitable[i];
830  std::cout << std::endl;
831 #endif
832 
833  //Now the depths
835  maxDepth[0] = maxDepth[1] = 0;
836  for (int i=0; i<nEta; ++i) {
837  unsigned int imx = layerGroupSize(i);
838  int laymax = (imx > 0) ? layerGroup(i,imx-1) : 0;
839  if (i < iEtaMax[0]) {
840  int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax;
841  if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1);
842 #ifdef EDM_ML_DEBUG
843  std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl;
844 #endif
845  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
846  }
847  if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) {
848 #ifdef EDM_ML_DEBUG
849  std::cout << "HE " << i << " " << imx << " " << laymax << std::endl;
850 #endif
851  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
852  }
853  }
854 #ifdef EDM_ML_DEBUG
855  for (int i=0; i<4; ++i)
856  std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
857  << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
858 #endif
859 
860  //Now the geometry constants
861  nModule[0] = hpar->modHB[0];
862  nHalves[0] = hpar->modHB[1];
863  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
864  gconsHB.push_back(std::pair<double,double>(hpar->rHB[i]/CLHEP::cm,
865  hpar->drHB[i]/CLHEP::cm));
866  }
867 #ifdef EDM_ML_DEBUG
868  std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0]
869  <<" halves and " << gconsHB.size() << " layers" << std::endl;
870  for (unsigned int i=0; i<gconsHB.size(); ++i)
871  std::cout << "rHB[" << i << "] = " << gconsHB[i].first << " +- "
872  << gconsHB[i].second << std::endl;
873 #endif
874  nModule[1] = hpar->modHE[0];
875  nHalves[1] = hpar->modHE[1];
876  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
877  gconsHE.push_back(std::pair<double,double>(hpar->zHE[i]/CLHEP::cm,
878  hpar->dzHE[i]/CLHEP::cm));
879  }
880 #ifdef EDM_ML_DEBUG
881  std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1]
882  <<" halves and " << gconsHE.size() << " layers" << std::endl;
883  for (unsigned int i=0; i<gconsHE.size(); ++i)
884  std::cout << "zHE[" << i << "] = " << gconsHE[i].first << " +- "
885  << gconsHE[i].second << std::endl;
886 #endif
887 
888  //Special RBX
890  if (depthMaxSp_.first == 0) {
891  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
892  } else if (depthMaxSp_.first == 1) {
893  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
894  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
895  } else {
896  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
897  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
898  }
899 #ifdef EDM_ML_DEBUG
900  std::cout << "Detector type and maximum depth for all RBX "
901  << depthMaxDf_.first << ":" << depthMaxDf_.second
902  << " and for special RBX " << depthMaxSp_.first << ":"
903  << depthMaxSp_.second << std::endl;
904 #endif
905 
906  //Map of special DetId's
907  std::vector<int> phis;
909  detIdSp_.clear(); detIdSpR_.clear();
910  if ((subdet == HcalBarrel) || (subdet == HcalEndcap)) {
911  int phi = (phis[0] > 0) ? phis[0] : -phis[0];
912  int zside = (phis[0] > 0) ? 1 : -1;
913  int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
914  std::pair<int,int>etas = hcons.ldMap()->validEta();
915  for (int eta=etas.first; eta<=etas.second; ++eta) {
916  std::map<int,std::pair<int,int> > oldDep;
917  int depth(0);
918  int lmin = layerGroup(eta-1,0);
919  for (int lay=0; lay<lymax; ++lay) {
920  int depc = layerGroup(eta-1,lay);
921  if (depth != depc) {
922  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lay-1);
923  depth = depc;
924  lmin = lay;
925  }
926  }
927  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lymax-1);
928 #ifdef EDM_ML_DEBUG
929  std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
930  << " with " << oldDep.size() << " old Depths" << std::endl;
931  unsigned int kk(0);
932  for (std::map<int,std::pair<int,int> >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk)
933  std::cout << "[" << kk << "] " << itr->first << " --> "
934  << itr->second.first << ":" << itr->second.second << "\n";
935 #endif
936  std::pair<int,int> depths = hcons.ldMap()->getDepths(eta);
937  for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) {
938  bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] &&
939  ndepth > hcons.getDepthEta16(subdet,phi,zside)) ||
940  (subdet == HcalEndcap && eta == iEtaMin[1] &&
941  ndepth < hcons.getDepthEta16(subdet,phi,zside)));
942  if (!flag) {
943  std::vector<int> count(oldDep.size(),0);
944  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,phi,zside,ndepth);
945  int layBack = hcons.ldMap()->getLayerBack(subdet,eta,phi,zside,ndepth);
946  for (int lay=layFront; lay<=layBack; ++lay) {
947  unsigned int l(0);
948  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
949  itr != oldDep.end(); ++itr,++l) {
950  if (lay >= (itr->second).first && lay <= (itr->second).second) {
951  ++count[l]; break;
952  }
953  }
954  }
955  int odepth(0), maxlay(0);
956  unsigned int l(0);
957  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
958  itr != oldDep.end(); ++itr,++l) {
959  if (count[l] > maxlay) {
960  odepth = itr->first;
961  maxlay = count[l];
962  }
963  }
964 #ifdef EDM_ML_DEBUG
965  std::cout << "New Depth " << ndepth << " old Depth " << odepth
966  << " max " << maxlay << std::endl;
967 #endif
968  for (unsigned int k=0; k<phis.size(); ++k) {
969  zside = (phis[k] > 0) ? 1 : -1;
970  phi = (phis[k] > 0) ? phis[k] : -phis[k];
971  if (subdet == HcalEndcap && eta == hpar->noff[1] &&
972  ndepth > hcons.getDepthEta29M(0,true)) break;
973  HcalDetId newId(subdet,zside*eta,phi,ndepth);
974  HcalDetId oldId(subdet,zside*eta,phi,odepth);
975  detIdSp_[newId] = oldId;
976  std::vector<HcalDetId> ids;
977  std::map<HcalDetId,std::vector<HcalDetId>>::iterator itr = detIdSpR_.find(oldId);
978  if (itr != detIdSpR_.end()) ids = itr->second;
979  ids.push_back(newId);
980  detIdSpR_[oldId] = ids;
981  }
982  }
983  }
984  }
985 #ifdef EDM_ML_DEBUG
986  std::cout << "Map for merging new channels to old channel IDs with "
987  << detIdSp_.size() << " entries" << std::endl;
988  int l(0);
989  for (auto itr : detIdSp_) {
990  std::cout << "[" << l << "] Special " << itr.first << " Standard "
991  << itr.second << std::endl;
992  ++l;
993  }
994  std::cout << "Reverse Map for mapping old to new IDs with "
995  << detIdSpR_.size() << " entries" << std::endl;
996  l = 0;
997  for (auto itr : detIdSpR_) {
998  std::cout << "[" << l << "] Standard " << itr.first << " Special";
999  for (auto itr1 : itr.second)
1000  std::cout << " " << (itr1);
1001  std::cout << std::endl;
1002  ++l;
1003  }
1004 #endif
1005  }
1006 
1007 }
1008 
1009 unsigned int HcalDDDRecConstants::layerGroupSize(const int eta) const {
1010  unsigned int k = 0;
1011  for (auto const & it : hpar->layerGroupEtaRec) {
1012  if (it.layer == (unsigned int)(eta + 1)) {
1013  return it.layerGroup.size();
1014  }
1015  if (it.layer > (unsigned int)(eta + 1)) break;
1016  k = it.layerGroup.size();
1017  }
1018  return k;
1019 }
1020 
1021 unsigned int HcalDDDRecConstants::layerGroup(const int eta,
1022  const int i) const {
1023  unsigned int k = 0;
1024  for (auto const & it : hpar->layerGroupEtaRec) {
1025  if (it.layer == (unsigned int)(eta + 1)) {
1026  return it.layerGroup.at(i);
1027  }
1028  if (it.layer > (unsigned int)(eta + 1)) break;
1029  k = it.layerGroup.at(i);
1030  }
1031  return k;
1032 }
type
Definition: HCALResponse.h:21
std::pair< int, int > getMaxDepthDet(const int i) const
int findDepth(const int det, const int eta, const int phi, const int zside, const int lay) const
std::vector< double > etaTable
std::vector< int > iEtaMin
std::vector< int > etagroup
std::pair< int, int > depthMaxSp_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::map< HcalDetId, std::vector< HcalDetId > > detIdSpR_
std::vector< int > getDepth(const int det, const int phi, const int zside, const unsigned int eta) const
double getRZ(int subdet, int ieta, int depth) const
void getLayerDepth(const int subdet, const int ieta, const int iphi, const int zside, std::map< int, int > &layers) const
std::vector< double > rHB
std::vector< std::pair< int, int > > etaSimValu
std::pair< double, double > getPhiCons(const int det, const int ieta) const
HcalDetId mergedDepthDetId(const HcalDetId &id) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
int getMaxDepth(const int type) const
unsigned int layerGroup(int eta, int i) const
void getOneEtaBin(HcalSubdetector subdet, int ieta, int zside, std::vector< std::pair< int, double >> &phis, std::map< int, int > &layers, bool planOne, std::vector< HcalDDDRecConstants::HcalEtaBin > &bins) const
static const int maxLayer_
int getSubdet() const
std::vector< int > maxDepth
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< double > etaTableHF
unsigned int numberOfCells(HcalSubdetector) const
int getLayerBack(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
void getLayerDepth(int ieta, std::map< int, int > &layers) const
std::vector< int > etaMax
std::vector< int > phiUnitS
std::vector< int > modHB
int getDepthEta29M(const int i, const bool planOne) const
int getLayerFront(const int subdet, const int ieta, const int iphi, const int zside, const int depth) const
U second(std::pair< T, U > const &p)
const HcalParameters * hpar
std::pair< int, int > getDepths(const int eta) const
int getMaxDepth(const int type) const
int validDet(std::vector< int > &phis) const
int getFrontLayer(const int det, const int eta) const
std::vector< std::pair< double, double > > gconsHE
std::vector< double > zHE
std::vector< double > phibin
std::vector< std::pair< int, double > > getPhis(int subdet, int ieta) const
const std::vector< double > & getRTableHF() const
void specialRBXHBHE(const std::vector< HcalDetId > &, std::vector< HcalDetId > &) const
int getMinDepth(const int itype, const int ieta, const int iphi, const int zside) const
unsigned int numberOfCells(HcalSubdetector) const
HcalDetId idFront(const HcalDetId &id) const
int getDepthEta29(const int phi, int zside, int i) const
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const
std::vector< double > dzHE
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
const std::vector< double > & getPhiTableHF() const
std::vector< HFCellParameters > getHFCellParameters() const
const std::vector< int > & getPhis() const
std::vector< int > iEtaMax
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< HcalCellType > HcalCellTypes() const
std::map< HcalDetId, HcalDetId > detIdSp_
std::vector< int > ietaMap
std::vector< int > nPhiBins
std::vector< int > modHE
std::vector< std::pair< int, int > > layer
int getLayerFront(int det, int eta, int phi, int depth) const
std::pair< int, int > validEta() const
int getMinDepth(const int det, const int eta, const int phi, const int zside, bool partialOnly) const
int getDepthEta16(const int det, const int phi, const int zside) const
std::vector< HcalCellType > HcalCellTypes(HcalSubdetector) const
HcalDetId idBack(const HcalDetId &id) const
std::vector< HcalActiveLength > getThickActive(const int type) const
#define M_PI
int k[5][pyjets_maxn]
std::vector< double > phioff
unsigned int layerGroupSize(int eta) const
std::vector< double > etaTable
HcalDDDRecConstants(const HcalParameters *hp, const HcalDDDSimConstants &hc)
void unmergeDepthDetId(const HcalDetId &id, std::vector< HcalDetId > &ids) const
std::vector< double > phitable
int phiNumber(const int phi, const int unit) const
int getDepthEta16M(const int det) const
TString units(TString variable, Char_t axis)
std::vector< double > phibin
std::vector< LayerItem > layerGroupEtaRec
int unitPhi(const int det, const int etaR) const
std::vector< double > drHB
const HcalDDDSimConstants & hcons
susybsm::HSCParticleCollection hc
Definition: classes.h:25
std::pair< int, int > depthMaxDf_
std::vector< int > noff
const std::vector< HcalDetId > & getIdHF2QIE() const
std::vector< std::pair< double, double > > gconsHB
std::vector< int > maxDepth
std::vector< int > phigroup
std::pair< double, double > getEtaPhi(int subdet, int ieta, int iphi) const
static const int maxLayerHB_
std::vector< std::pair< int, double > > phis
std::vector< int > etaMin
unsigned int nCells() const
int getPhiZOne(std::vector< std::pair< int, int > > &phiz) const
std::vector< HcalEtaBin > getEtaBins(const int itype) const
const HcalLayerDepthMap * ldMap() const