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::getMaxDepth (const int itype, const int ieta,
291  const int iphi, const int zside) const {
292 
293  unsigned int type = (itype == 0) ? 0 : 1;
294  int lmax = hcons.getMaxDepth(type+1, ieta, iphi, zside, true);
295  if (lmax < 0) {
296  unsigned int lymax = (type == 0) ? maxLayerHB_+1 : maxLayer_+1;
297  lmax = 0;
298  if (layerGroupSize(ieta-1) > 0) {
299  if (layerGroupSize(ieta-1) < lymax) lymax = layerGroupSize(ieta-1);
300  lmax = (int)(layerGroup(ieta-1, lymax-1));
301  if (type == 0 && ieta == iEtaMax[type]) lmax = hcons.getDepthEta16M(1);
302  if (type == 1 && ieta >= hpar->noff[1]) lmax = hcons.getDepthEta29M(0,false);
303  }
304  }
305  return lmax;
306 }
307 
308 int HcalDDDRecConstants::getMinDepth (const int itype, const int ieta,
309  const int iphi, const int zside) const {
310 
311  int lmin = hcons.getMinDepth(itype+1, ieta, iphi, zside, true);
312  if (lmin < 0) {
313  if (itype == 2) { // HFn
314  lmin = 1;
315  } else if (itype == 3) { //HO
316  lmin = maxDepth[3];
317  } else {
318  unsigned int type = (itype == 0) ? 0 : 1;
319  if (layerGroupSize(ieta-1) > 0) {
320  if (type == 1 && ieta == iEtaMin[type])
321  lmin = hcons.getDepthEta16M(2);
322  else
323  lmin = (int)(layerGroup(ieta-1, 0));
324  }
325  }
326  }
327  return lmin;
328 }
329 
330 std::vector<std::pair<int,double> >
331 HcalDDDRecConstants::getPhis(int subdet, int ieta) const {
332 
333  std::vector<std::pair<int,double> > phis;
334  int ietaAbs = (ieta > 0) ? ieta : -ieta;
335  int keta = (subdet != HcalForward) ? etaSimValu[ietaAbs-1].first : ietaAbs;
336  std::pair<double,double> ficons = hcons.getPhiCons(subdet, keta);
337  double fioff = ficons.first;
338  double dphi = (subdet != HcalForward) ? phibin[ietaAbs-1] : ficons.second;
339  int nphi = int((CLHEP::twopi+0.1*dphi)/dphi);
340  int units = hcons.unitPhi(subdet, keta);
341  for (int ifi = 0; ifi < nphi; ++ifi) {
342  double phi =-fioff + (ifi+0.5)*dphi;
343  int iphi = hcons.phiNumber(ifi+1,units);
344  phis.push_back(std::pair<int,double>(iphi,phi));
345  }
346 #ifdef EDM_ML_DEBUG
347  std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta
348  << " with " << phis.size() << " phi bins" << std::endl;
349  for (unsigned int k=0; k<phis.size(); ++k)
350  std::cout << "[" << k << "] iphi " << phis[k].first << " phi "
351  << phis[k].second/CLHEP::deg << std::endl;
352 #endif
353  return phis;
354 }
355 
356 int HcalDDDRecConstants::getPhiZOne(std::vector<std::pair<int,int>>& phiz) const {
357 
358  phiz.clear();
359  int subdet = hcons.ldMap()->getSubdet();
360  if (subdet > 0) {
361  std::vector<int> phis = hcons.ldMap()->getPhis();
362  for (unsigned int k=0; k<phis.size(); ++k) {
363  int zside = (phis[k] > 0) ? 1 : -1;
364  int phi = (phis[k] > 0) ? phis[k] : -phis[k];
365  phiz.push_back(std::pair<int,int>(phi,zside));
366  }
367  }
368 #ifdef EDM_ML_DEBUG
369  std::cout << "Special RBX for detector " << subdet << " with " << phiz.size()
370  << " phi/z bins";
371  for (unsigned int k=0; k<phiz.size(); ++k)
372  std::cout << " [" << k << "] " << phiz[k].first << ":" << phiz[k].second;
373  std::cout << std::endl;
374 #endif
375  return subdet;
376 }
377 
378 double HcalDDDRecConstants::getRZ(int subdet, int ieta, int depth) const {
379 
380  int ietaAbs = (ieta > 0) ? ieta : -ieta;
381  double rz(0);
382 #ifdef EDM_ML_DEBUG
383  int lay(0);
384 #endif
385  if (ietaAbs < hpar->etaMax[1]) {
386  for (unsigned int k=0; k< layerGroupSize(ietaAbs-1); ++k) {
387  if (depth == (int)layerGroup(ietaAbs-1, k)) {
388  rz = ((subdet == static_cast<int>(HcalBarrel)) ? (gconsHB[k].first) :
389  (gconsHE[k].first));
390  if (rz > 10.) {
391 #ifdef EDM_ML_DEBUG
392  lay = k;
393 #endif
394  break;
395  }
396  }
397  }
398  }
399 #ifdef EDM_ML_DEBUG
400  std::cout << "getRZ: subdet|ieta|depth " << subdet << "|" << ieta << "|"
401  << depth << " lay|rz " << lay << "|" << rz << std::endl;
402 #endif
403  return rz;
404 }
405 
406 std::vector<HcalDDDRecConstants::HcalActiveLength>
408 
409  std::vector<HcalDDDRecConstants::HcalActiveLength> actives;
410  std::vector<HcalDDDRecConstants::HcalEtaBin> bins = getEtaBins(type);
411 #ifdef EDM_ML_DEBUG
412  unsigned int kount(0);
413 #endif
414  for (unsigned int k=0; k<bins.size(); ++k) {
415  int ieta = bins[k].ieta;
416  double eta = 0.5*(bins[k].etaMin+bins[k].etaMax);
417  double theta = 2*atan(exp(-eta));
418  double scale = 1.0/((type == 0) ? sin(theta) : cos(theta));
419  int depth = bins[k].depthStart;
420  for (unsigned int i = 0; i < bins[k].layer.size(); ++i) {
421  double thick(0);
422  for (int j = bins[k].layer[i].first; j <= bins[k].layer[i].second; ++j) {
423  if (type == 0 || j > 1) {
424  double t = ((type == 0) ? gconsHB[j-1].second : gconsHE[j-1].second);
425  if (t > 0) thick += t;
426  }
427  }
428  thick *= (2.*scale);
429  HcalDDDRecConstants::HcalActiveLength active(ieta,depth,eta,thick);
430  actives.push_back(active);
431  ++depth;
432 #ifdef EDM_ML_DEBUG
433  kount++;
434  std::cout << "getThickActive: [" << kount << "] eta:" << active.ieta
435  << ":" << active.eta << " depth " << active.depth << " thick "
436  << active.thick << std::endl;
437 #endif
438  }
439  }
440  return actives;
441 }
442 
443 std::vector<HcalCellType>
445 
446  if (subdet == HcalBarrel || subdet == HcalEndcap) {
447  std::vector<HcalCellType> cells;
448  int isub = (subdet == HcalBarrel) ? 0 : 1;
449  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
450  std::vector<int> missPhi;
451  for (unsigned int bin=0; bin<etabins.size(); ++bin) {
452  std::vector<HcalCellType> temp;
453  std::vector<int> count;
454  std::vector<double> dmin, dmax;
455  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
456  HcalCellType cell(subdet, etabins[bin].ieta, etabins[bin].zside, 0,
458  double foff = (etabins[bin].ieta <= iEtaMax[0]) ? hpar->phioff[0] : hpar->phioff[1];
459  int unit = hcons.unitPhi(etabins[bin].dphi);
460  cell.setPhi(etabins[bin].phis, missPhi, foff, etabins[bin].dphi, unit);
461  temp.push_back(cell);
462  count.push_back(0);
463  dmin.push_back(0);
464  dmax.push_back(0);
465  }
466  int ieta = etabins[bin].ieta;
467  for (int keta=etaSimValu[ieta-1].first; keta<=etaSimValu[ieta-1].second;
468  ++keta) {
469  std::vector<HcalCellType> cellsm = hcons.HcalCellTypes(subdet,keta,-1);
470  for (unsigned int ic=0; ic<cellsm.size(); ++ic) {
471  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
472  if (cellsm[ic].depthSegment() >= etabins[bin].layer[il].first &&
473  cellsm[ic].depthSegment() <= etabins[bin].layer[il].second) {
474  if (count[il] == 0) {
475  temp[il] = cellsm[ic];
476  dmin[il] = cellsm[ic].depthMin();
477  dmax[il] = cellsm[ic].depthMax();
478  }
479  ++count[il];
480  if (cellsm[ic].depthMin() < dmin[il])
481  dmin[il] = cellsm[ic].depthMin();
482  if (cellsm[ic].depthMax() > dmax[il])
483  dmax[il] = cellsm[ic].depthMax();
484  break;
485  }
486  }
487  }
488  }
489  for (unsigned int il=0; il<etabins[bin].layer.size(); ++il) {
490  int depth = etabins[bin].depthStart + (int)(il);
491  temp[il].setEta(ieta,etabins[bin].etaMin,etabins[bin].etaMax);
492  temp[il].setDepth(depth,dmin[il],dmax[il]);
493  cells.push_back(temp[il]);
494  }
495  }
496 #ifdef EDM_ML_DEBUG
497  std::cout << "HcalDDDRecConstants: found " << cells.size() << " cells for sub-detector type " << isub << std::endl;
498  for (unsigned int ic=0; ic<cells.size(); ++ic)
499  std::cout << "Cell[" << ic << "] " << cells[ic] << std::endl;
500 #endif
501  return cells;
502  } else {
503  return hcons.HcalCellTypes(subdet,-1,-1);
504  }
505 }
506 
508 
509  if (subdet == HcalBarrel || subdet == HcalEndcap) {
510  unsigned int num = 0;
511  std::vector<HcalCellType> cellTypes = HcalCellTypes(subdet);
512  for (unsigned int i=0; i<cellTypes.size(); i++) {
513  num += (unsigned int)(cellTypes[i].nPhiBins());
514  }
515 #ifdef EDM_ML_DEBUG
516  edm::LogInfo ("HCalGeom") << "HcalDDDRecConstants:numberOfCells "
517  << cellTypes.size() << " " << num
518  << " for subdetector " << subdet;
519 #endif
520  return num;
521  } else {
522  return hcons.numberOfCells(subdet);
523  }
524 }
525 
526 unsigned int HcalDDDRecConstants::nCells(HcalSubdetector subdet) const {
527 
528  if (subdet == HcalBarrel || subdet == HcalEndcap) {
529  int isub = (subdet == HcalBarrel) ? 0 : 1;
530  std::vector<HcalDDDRecConstants::HcalEtaBin> etabins = getEtaBins(isub);
531  unsigned int ncell(0);
532  for (unsigned int i=0; i<etabins.size(); ++i) {
533  ncell += ((etabins[i].phis.size())*(etabins[i].layer.size()));
534  }
535  return ncell;
536  } else if (subdet == HcalOuter) {
537  return kHOSizePreLS1;
538  } else if (subdet == HcalForward) {
539  return (unsigned int)(hcons.numberOfCells(subdet));
540  } else {
541  return 0;
542  }
543 }
544 
545 unsigned int HcalDDDRecConstants::nCells() const {
547 }
548 
550 
551  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(id);
552  if (itr == detIdSp_.end()) return id;
553  else return itr->second;
554 }
555 
557 
558  HcalDetId hid(id);
559  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
560  if (itr != detIdSpR_.end())
561  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second)[0].depth());
562  return hid;
563 }
564 
566 
567  HcalDetId hid(id);
568  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
569  if (itr != detIdSpR_.end())
570  hid = HcalDetId(id.subdet(),id.ieta(),id.iphi(),(itr->second).back().depth());
571  return hid;
572 }
573 
575  std::vector<HcalDetId>& ids) const {
576 
577  ids.clear();
578  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr = detIdSpR_.find(id);
579  if (itr == detIdSpR_.end()) {
580  ids.push_back(id);
581  } else {
582  for (unsigned k=0; k<itr->second.size(); ++k) {
583  HcalDetId hid(id.subdet(),id.ieta(),id.iphi(),(itr->second)[k].depth());
584  ids.push_back(hid);
585  }
586  }
587 }
588 
589 void HcalDDDRecConstants::specialRBXHBHE(const std::vector<HcalDetId>& idsOld,
590  std::vector<HcalDetId>& idsNew) const {
591  for (unsigned int k=0; k<idsOld.size(); ++k) {
592  std::map<HcalDetId,HcalDetId>::const_iterator itr = detIdSp_.find(idsOld[k]);
593  if (itr == detIdSp_.end()) idsNew.push_back(idsOld[k]);
594  else idsNew.push_back(itr->second);
595  }
596 }
597 
598 
600  std::vector<std::pair<int,double> >& phis,
601  std::map<int,int>& layers, bool planOne,
602  std::vector<HcalDDDRecConstants::HcalEtaBin>& bins) const {
603 
604  unsigned int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
605  int type = (subdet == HcalBarrel) ? 0 : 1;
606  double dphi = phibin[ieta-1];
608  etabin.phis.insert(etabin.phis.end(),phis.begin(),phis.end());
609  int n = (ieta == iEtaMax[type]) ? 0 : 1;
610  HcalDDDRecConstants::HcalEtaBin etabin0= HcalDDDRecConstants::HcalEtaBin(ieta,zside,dphi,etaTable[ieta-1],etaTable[ieta+n]);
611  etabin0.depthStart = hcons.getDepthEta29(phis[0].first,zside,0)+1;
612  int dstart = -1;
613  int lmin(0), lmax(0);
614  std::map<int,int>::iterator itr=layers.begin();
615  if (layers.size() > 0) {
616  int dep = itr->second;
617  if (subdet == HcalEndcap && ieta == iEtaMin[type])
618  dep = hcons.getDepthEta16(subdet,phis[0].first,zside);
619  unsigned lymx0 = (layers.size() > lymax) ? lymax : layers.size();
620 #ifdef EDM_ML_DEBUG
621  std::cout << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside
622  << " lymax " << lymx0 << ":" << lymax << " Depth " << dep << ":"
623  << itr->second;
624  unsigned int l(0);
625  for (itr = layers.begin(); itr != layers.end(); ++itr,++l)
626  std::cout << " [" << l << "] " << itr->first << ":" << itr->second;
627  std::cout << std::endl << " with " << phis.size() << " phis";
628  for (unsigned int l=0; l<phis.size(); ++l)
629  std::cout << " " << phis[l].first << ":" << phis[l].second;
630  std::cout << std::endl;
631 #endif
632  for (itr = layers.begin(); itr != layers.end(); ++itr) {
633  if (itr->first <= (int)(lymx0)) {
634  if (itr->second == dep) {
635  if (lmin == 0) lmin = itr->first;
636  lmax = itr->first;
637  } else if (itr->second > dep) {
638  if (dstart < 0) dstart = dep;
639  int lmax0 = (lmax >= lmin) ? lmax : lmin;
640  if (subdet == HcalEndcap && ieta+1 == hpar->noff[1] &&
641  dep > hcons.getDepthEta29(phis[0].first,zside,0)) {
642  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax0));
643  } else {
644  etabin.layer.push_back(std::pair<int,int>(lmin,lmax0));
645  }
646  lmin = itr->first;
647  lmax = lmin-1;
648  dep = itr->second;
649  }
650  if (subdet == HcalBarrel && ieta == iEtaMax[type] &&
651  dep > hcons.getDepthEta16M(1)) break;
652  if (subdet == HcalEndcap && ieta == hpar->noff[1] &&
653  dep > hcons.getDepthEta29M(0,planOne)) {
654  lmax = lymx0;
655  break;
656  }
657  if (itr->first == (int)(lymx0)) lmax = lymx0;
658  }
659  }
660  if (lmax >= lmin) {
661  if (ieta+1 == hpar->noff[1]) {
662  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax));
663  etabin0.phis.insert(etabin0.phis.end(),phis.begin(),phis.end());
664  bins.push_back(etabin0);
665 #ifdef EDM_ML_DEBUG
666  std::cout << "etabin0: dStatrt " << etabin0.depthStart << " layers "
667  << etabin0.layer.size() << ":" << lmin << ":" << lmax
668  << " phis " << phis.size() << std::endl;
669  for (unsigned int k=0; k<etabin0.layer.size(); ++k)
670  std::cout << " [" << k << "] " << etabin0.layer[k].first << ":"
671  << etabin0.layer[k].second;
672  std::cout << std::endl;
673 #endif
674  } else if (ieta == hpar->noff[1]) {
675  } else {
676  etabin.layer.push_back(std::pair<int,int>(lmin,lmax));
677  if (dstart < 0) dstart = dep;
678  }
679  }
680  }
681  etabin.depthStart = dstart;
682  bins.push_back(etabin);
683 #ifdef EDM_ML_DEBUG
684  std::cout << "etabin: dStatrt " << etabin.depthStart << " layers "
685  << etabin.layer.size() << ":" << lmin << ":" << lmax
686  << " phis " << etabin.phis.size() << std::endl;
687  for (unsigned int k=0; k<etabin.layer.size(); ++k)
688  std::cout << " [" << k << "] " << etabin.layer[k].first << ":"
689  << etabin.layer[k].second;
690  std::cout << std::endl;
691 #endif
692 }
693 
695 
696  //Eta grouping
697  int nEta = (int)(hpar->etagroup.size());
698  if (nEta != (int)(hpar->phigroup.size())) {
699  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
700  << " etaGroup (" << nEta << ") and phiGroup ("
701  << hpar->phigroup.size() << ") do not match";
702  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size();
703  }
704 
705  // First eta table
706  iEtaMin = hpar->etaMin;
707  iEtaMax = hpar->etaMax;
708  etaTable.clear(); ietaMap.clear(); etaSimValu.clear();
709  int ieta(0), ietaHB(0), ietaHE(0), ietaHEM(0);
710  etaTable.push_back(hpar->etaTable[ieta]);
711  for (int i=0; i<nEta; ++i) {
712  int ef = ieta+1;
713  ieta += (hpar->etagroup[i]);
714  if (ieta >= (int)(hpar->etaTable.size())) {
715  edm::LogError("HCalGeom") << "Going beyond the array boundary "
716  << hpar->etaTable.size() << " at index " << i
717  << " of etaTable from SimConstant";
718  throw cms::Exception("DDException") << "Going beyond the array boundary "
719  << hpar->etaTable.size()
720  << " at index " << i
721  << " of etaTable from SimConstant";
722  } else {
723  etaTable.push_back(hpar->etaTable[ieta]);
724  etaSimValu.push_back(std::pair<int,int>(ef,ieta));
725  }
726  for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.push_back(i+1);
727  if (ieta <= hpar->etaMax[0]) ietaHB = i+1;
728  if (ieta <= hpar->etaMin[1]) ietaHE = i+1;
729  if (ieta <= hpar->etaMax[1]) ietaHEM= i+1;
730  }
731  iEtaMin[1] = ietaHE;
732  iEtaMax[0] = ietaHB;
733  iEtaMax[1] = ietaHEM;
734 
735  // Then Phi bins
736  nPhiBins.clear();
737  for (unsigned int k=0; k<4; ++k) nPhiBins.push_back(0);
738  ieta = 0;
739  phibin.clear(); phiUnitS.clear();
740  for (int i=0; i<nEta; ++i) {
741  double dphi = (hpar->phigroup[i])*(hpar->phibin[ieta]);
742  phibin.push_back(dphi);
743  int nphi = (int)((CLHEP::twopi + 0.001)/dphi);
744  if (ieta <= iEtaMax[0]) {
745  if (nphi > nPhiBins[0]) nPhiBins[3] = nPhiBins[0] = nphi;
746  }
747  if (ieta >= iEtaMin[1]) {
748  if (nphi > nPhiBins[1]) nPhiBins[1] = nphi;
749  }
750  ieta += (hpar->etagroup[i]);
751  }
752  for (unsigned int i=1; i<hpar->etaTable.size(); ++i) {
753  int unit = hcons.unitPhi(hpar->phibin[i-1]);
754  phiUnitS.push_back(unit);
755  }
756  for (unsigned int i=0; i<hpar->phitable.size(); ++i) {
757  int nphi = (int)((CLHEP::twopi + 0.001)/hpar->phitable[i]);
758  if (nphi > nPhiBins[2]) nPhiBins[2] = nphi;
759  }
760 #ifdef EDM_ML_DEBUG
761  std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl;
762  for (int i=0; i<nEta; ++i)
763  std::cout << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i+1]
764  << ":" << etaSimValu[i].first << ":" << etaSimValu[i].second
765  << " PhiBin[" << i << "] = " << phibin[i]/CLHEP::deg <<std::endl;
766  std::cout << "PhiUnitS";
767  for (unsigned int i=0; i<phiUnitS.size(); ++i)
768  std::cout << " [" << i << "] = " << phiUnitS[i];
769  std::cout << std::endl;
770  std::cout << "nPhiBins";
771  for (unsigned int i=0; i<nPhiBins.size(); ++i)
772  std::cout << " [" << i << "] = " << nPhiBins[i];
773  std::cout << std::endl;
774  std::cout << "EtaTableHF";
775  for (unsigned int i=0; i<hpar->etaTableHF.size(); ++i)
776  std::cout << " [" << i << "] = " << hpar->etaTableHF[i];
777  std::cout << std::endl;
778  std::cout << "PhiBinHF";
779  for (unsigned int i=0; i<hpar->phitable.size(); ++i)
780  std::cout << " [" << i << "] = " << hpar->phitable[i];
781  std::cout << std::endl;
782 #endif
783 
784  //Now the depths
786  maxDepth[0] = maxDepth[1] = 0;
787  for (int i=0; i<nEta; ++i) {
788  unsigned int imx = layerGroupSize(i);
789  int laymax = (imx > 0) ? layerGroup(i,imx-1) : 0;
790  if (i < iEtaMax[0]) {
791  int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax;
792  if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1);
793 #ifdef EDM_ML_DEBUG
794  std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl;
795 #endif
796  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
797  }
798  if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) {
799 #ifdef EDM_ML_DEBUG
800  std::cout << "HE " << i << " " << imx << " " << laymax << std::endl;
801 #endif
802  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
803  }
804  }
805 #ifdef EDM_ML_DEBUG
806  for (int i=0; i<4; ++i)
807  std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
808  << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
809 #endif
810 
811  //Now the geometry constants
812  nModule[0] = hpar->modHB[0];
813  nHalves[0] = hpar->modHB[1];
814  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
815  gconsHB.push_back(std::pair<double,double>(hpar->rHB[i]/CLHEP::cm,
816  hpar->drHB[i]/CLHEP::cm));
817  }
818 #ifdef EDM_ML_DEBUG
819  std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0]
820  <<" halves and " << gconsHB.size() << " layers" << std::endl;
821  for (unsigned int i=0; i<gconsHB.size(); ++i)
822  std::cout << "rHB[" << i << "] = " << gconsHB[i].first << " +- "
823  << gconsHB[i].second << std::endl;
824 #endif
825  nModule[1] = hpar->modHE[0];
826  nHalves[1] = hpar->modHE[1];
827  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
828  gconsHE.push_back(std::pair<double,double>(hpar->zHE[i]/CLHEP::cm,
829  hpar->dzHE[i]/CLHEP::cm));
830  }
831 #ifdef EDM_ML_DEBUG
832  std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1]
833  <<" halves and " << gconsHE.size() << " layers" << std::endl;
834  for (unsigned int i=0; i<gconsHE.size(); ++i)
835  std::cout << "zHE[" << i << "] = " << gconsHE[i].first << " +- "
836  << gconsHE[i].second << std::endl;
837 #endif
838 
839  //Special RBX
841  if (depthMaxSp_.first == 0) {
842  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
843  } else if (depthMaxSp_.first == 1) {
844  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
845  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
846  } else {
847  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
848  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
849  }
850 #ifdef EDM_ML_DEBUG
851  std::cout << "Detector type and maximum depth for all RBX "
852  << depthMaxDf_.first << ":" << depthMaxDf_.second
853  << " and for special RBX " << depthMaxSp_.first << ":"
854  << depthMaxSp_.second << std::endl;
855 #endif
856 
857  //Map of special DetId's
858  std::vector<int> phis;
860  detIdSp_.clear(); detIdSpR_.clear();
861  if ((subdet == HcalBarrel) || (subdet == HcalEndcap)) {
862  int phi = (phis[0] > 0) ? phis[0] : -phis[0];
863  int zside = (phis[0] > 0) ? 1 : -1;
864  int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
865  std::pair<int,int>etas = hcons.ldMap()->validEta();
866  for (int eta=etas.first; eta<=etas.second; ++eta) {
867  std::map<int,std::pair<int,int> > oldDep;
868  int depth(0);
869  int lmin = layerGroup(eta-1,0);
870  for (int lay=0; lay<lymax; ++lay) {
871  int depc = layerGroup(eta-1,lay);
872  if (depth != depc) {
873  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lay-1);
874  depth = depc;
875  lmin = lay;
876  }
877  }
878  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lymax-1);
879 #ifdef EDM_ML_DEBUG
880  std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
881  << " with " << oldDep.size() << " old Depths" << std::endl;
882  unsigned int kk(0);
883  for (std::map<int,std::pair<int,int> >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk)
884  std::cout << "[" << kk << "] " << itr->first << " --> "
885  << itr->second.first << ":" << itr->second.second << "\n";
886 #endif
887  std::pair<int,int> depths = hcons.ldMap()->getDepths(eta);
888  for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) {
889  bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] &&
890  ndepth > hcons.getDepthEta16(subdet,phi,zside)) ||
891  (subdet == HcalEndcap && eta == iEtaMin[1] &&
892  ndepth < hcons.getDepthEta16(subdet,phi,zside)));
893  if (!flag) {
894  std::vector<int> count(oldDep.size(),0);
895  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,phi,zside,ndepth);
896  int layBack = hcons.ldMap()->getLayerBack(subdet,eta,phi,zside,ndepth);
897  for (int lay=layFront; lay<=layBack; ++lay) {
898  unsigned int l(0);
899  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
900  itr != oldDep.end(); ++itr,++l) {
901  if (lay >= (itr->second).first && lay <= (itr->second).second) {
902  ++count[l]; break;
903  }
904  }
905  }
906  int odepth(0), maxlay(0);
907  unsigned int l(0);
908  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
909  itr != oldDep.end(); ++itr,++l) {
910  if (count[l] > maxlay) {
911  odepth = itr->first;
912  maxlay = count[l];
913  }
914  }
915 #ifdef EDM_ML_DEBUG
916  std::cout << "New Depth " << ndepth << " old Depth " << odepth
917  << " max " << maxlay << std::endl;
918 #endif
919  for (unsigned int k=0; k<phis.size(); ++k) {
920  zside = (phis[k] > 0) ? 1 : -1;
921  phi = (phis[k] > 0) ? phis[k] : -phis[k];
922  if (subdet == HcalEndcap && eta == hpar->noff[1] &&
923  ndepth > hcons.getDepthEta29M(0,true)) break;
924  HcalDetId newId(subdet,zside*eta,phi,ndepth);
925  HcalDetId oldId(subdet,zside*eta,phi,odepth);
926  detIdSp_[newId] = oldId;
927  std::vector<HcalDetId> ids;
928  std::map<HcalDetId,std::vector<HcalDetId>>::iterator itr = detIdSpR_.find(oldId);
929  if (itr != detIdSpR_.end()) ids = itr->second;
930  ids.push_back(newId);
931  detIdSpR_[oldId] = ids;
932  }
933  }
934  }
935  }
936 #ifdef EDM_ML_DEBUG
937  std::cout << "Map for merging new channels to old channel IDs with "
938  << detIdSp_.size() << " entries" << std::endl;
939  int l(0);
940  for (std::map<HcalDetId,HcalDetId>::const_iterator itr=detIdSp_.begin();
941  itr != detIdSp_.end(); ++itr,++l) {
942  std::cout << "[" << l << "] Special " << itr->first << " Standard "
943  << itr->second << std::endl;
944  }
945  std::cout << "Reverse Map for mapping old to new IDs with "
946  << detIdSpR_.size() << " entries" << std::endl;
947  l = 0;
948  for (std::map<HcalDetId,std::vector<HcalDetId> >::const_iterator itr=detIdSpR_.begin();
949  itr != detIdSpR_.end(); ++itr,++l) {
950  std::cout << "[" << l << "] Standard " << itr->first << " Special";
951  for (unsigned int k=0; k < itr->second.size(); ++k)
952  std::cout << " " << (itr->second)[k];
953  std::cout << std::endl;
954  }
955 #endif
956  }
957 
958 }
959 
960 unsigned int HcalDDDRecConstants::layerGroupSize(const int eta) const {
961  unsigned int k = 0;
962  for (auto const & it : hpar->layerGroupEtaRec) {
963  if (it.layer == (unsigned int)(eta + 1)) {
964  return it.layerGroup.size();
965  }
966  if (it.layer > (unsigned int)(eta + 1)) break;
967  k = it.layerGroup.size();
968  }
969  return k;
970 }
971 
972 unsigned int HcalDDDRecConstants::layerGroup(const int eta,
973  const int i) const {
974  unsigned int k = 0;
975  for (auto const & it : hpar->layerGroupEtaRec) {
976  if (it.layer == (unsigned int)(eta + 1)) {
977  return it.layerGroup.at(i);
978  }
979  if (it.layer > (unsigned int)(eta + 1)) break;
980  k = it.layerGroup.at(i);
981  }
982  return k;
983 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
void setPhi(std::vector< std::pair< int, double >> &phis, std::vector< int > &iphiMiss, double foff, double dphi, int unit)
Definition: HcalCellType.cc:87
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:7
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
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
int j
Definition: DBlmapReader.cc:9
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
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]
bin
set the eta bin as selection string.
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