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 
599  std::vector<HcalDetId>& ids) const {
600  if (tobemerged) {
601  std::map<HcalDetId,HcalDetId>::const_iterator itr;
602  for (itr = detIdSp_.begin(); itr != detIdSp_.end(); ++itr)
603  ids.push_back(itr->first);
604  } else{
605  std::map<HcalDetId,std::vector<HcalDetId>>::const_iterator itr;
606  for (itr = detIdSpR_.begin(); itr != detIdSpR_.end(); ++itr)
607  ids.push_back(itr->first);
608  }
609  return (ids.size() > 0);
610 }
611 
613  std::vector<std::pair<int,double> >& phis,
614  std::map<int,int>& layers, bool planOne,
615  std::vector<HcalDDDRecConstants::HcalEtaBin>& bins) const {
616 
617  unsigned int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
618  int type = (subdet == HcalBarrel) ? 0 : 1;
619  double dphi = phibin[ieta-1];
621  etabin.phis.insert(etabin.phis.end(),phis.begin(),phis.end());
622  int n = (ieta == iEtaMax[type]) ? 0 : 1;
623  HcalDDDRecConstants::HcalEtaBin etabin0= HcalDDDRecConstants::HcalEtaBin(ieta,zside,dphi,etaTable[ieta-1],etaTable[ieta+n]);
624  etabin0.depthStart = hcons.getDepthEta29(phis[0].first,zside,0)+1;
625  int dstart = -1;
626  int lmin(0), lmax(0);
627  std::map<int,int>::iterator itr=layers.begin();
628  if (layers.size() > 0) {
629  int dep = itr->second;
630  if (subdet == HcalEndcap && ieta == iEtaMin[type])
631  dep = hcons.getDepthEta16(subdet,phis[0].first,zside);
632  unsigned lymx0 = (layers.size() > lymax) ? lymax : layers.size();
633 #ifdef EDM_ML_DEBUG
634  std::cout << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside
635  << " lymax " << lymx0 << ":" << lymax << " Depth " << dep << ":"
636  << itr->second;
637  unsigned int l(0);
638  for (itr = layers.begin(); itr != layers.end(); ++itr,++l)
639  std::cout << " [" << l << "] " << itr->first << ":" << itr->second;
640  std::cout << std::endl << " with " << phis.size() << " phis";
641  for (unsigned int l=0; l<phis.size(); ++l)
642  std::cout << " " << phis[l].first << ":" << phis[l].second;
643  std::cout << std::endl;
644 #endif
645  for (itr = layers.begin(); itr != layers.end(); ++itr) {
646  if (itr->first <= (int)(lymx0)) {
647  if (itr->second == dep) {
648  if (lmin == 0) lmin = itr->first;
649  lmax = itr->first;
650  } else if (itr->second > dep) {
651  if (dstart < 0) dstart = dep;
652  int lmax0 = (lmax >= lmin) ? lmax : lmin;
653  if (subdet == HcalEndcap && ieta+1 == hpar->noff[1] &&
654  dep > hcons.getDepthEta29(phis[0].first,zside,0)) {
655  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax0));
656  } else {
657  etabin.layer.push_back(std::pair<int,int>(lmin,lmax0));
658  }
659  lmin = itr->first;
660  lmax = lmin-1;
661  dep = itr->second;
662  }
663  if (subdet == HcalBarrel && ieta == iEtaMax[type] &&
664  dep > hcons.getDepthEta16M(1)) break;
665  if (subdet == HcalEndcap && ieta == hpar->noff[1] &&
666  dep > hcons.getDepthEta29M(0,planOne)) {
667  lmax = lymx0;
668  break;
669  }
670  if (itr->first == (int)(lymx0)) lmax = lymx0;
671  }
672  }
673  if (lmax >= lmin) {
674  if (ieta+1 == hpar->noff[1]) {
675  etabin0.layer.push_back(std::pair<int,int>(lmin,lmax));
676  etabin0.phis.insert(etabin0.phis.end(),phis.begin(),phis.end());
677  bins.push_back(etabin0);
678 #ifdef EDM_ML_DEBUG
679  std::cout << "etabin0: dStatrt " << etabin0.depthStart << " layers "
680  << etabin0.layer.size() << ":" << lmin << ":" << lmax
681  << " phis " << phis.size() << std::endl;
682  for (unsigned int k=0; k<etabin0.layer.size(); ++k)
683  std::cout << " [" << k << "] " << etabin0.layer[k].first << ":"
684  << etabin0.layer[k].second;
685  std::cout << std::endl;
686 #endif
687  } else if (ieta == hpar->noff[1]) {
688  } else {
689  etabin.layer.push_back(std::pair<int,int>(lmin,lmax));
690  if (dstart < 0) dstart = dep;
691  }
692  }
693  }
694  etabin.depthStart = dstart;
695  bins.push_back(etabin);
696 #ifdef EDM_ML_DEBUG
697  std::cout << "etabin: dStatrt " << etabin.depthStart << " layers "
698  << etabin.layer.size() << ":" << lmin << ":" << lmax
699  << " phis " << etabin.phis.size() << std::endl;
700  for (unsigned int k=0; k<etabin.layer.size(); ++k)
701  std::cout << " [" << k << "] " << etabin.layer[k].first << ":"
702  << etabin.layer[k].second;
703  std::cout << std::endl;
704 #endif
705 }
706 
708 
709  //Eta grouping
710  int nEta = (int)(hpar->etagroup.size());
711  if (nEta != (int)(hpar->phigroup.size())) {
712  edm::LogError("HCalGeom") << "HcalDDDRecConstants: sizes of the vectors "
713  << " etaGroup (" << nEta << ") and phiGroup ("
714  << hpar->phigroup.size() << ") do not match";
715  throw cms::Exception("DDException") << "HcalDDDRecConstants: inconsistent array sizes" << nEta << ":" << hpar->phigroup.size();
716  }
717 
718  // First eta table
719  iEtaMin = hpar->etaMin;
720  iEtaMax = hpar->etaMax;
721  etaTable.clear(); ietaMap.clear(); etaSimValu.clear();
722  int ieta(0), ietaHB(0), ietaHE(0), ietaHEM(0);
723  etaTable.push_back(hpar->etaTable[ieta]);
724  for (int i=0; i<nEta; ++i) {
725  int ef = ieta+1;
726  ieta += (hpar->etagroup[i]);
727  if (ieta >= (int)(hpar->etaTable.size())) {
728  edm::LogError("HCalGeom") << "Going beyond the array boundary "
729  << hpar->etaTable.size() << " at index " << i
730  << " of etaTable from SimConstant";
731  throw cms::Exception("DDException") << "Going beyond the array boundary "
732  << hpar->etaTable.size()
733  << " at index " << i
734  << " of etaTable from SimConstant";
735  } else {
736  etaTable.push_back(hpar->etaTable[ieta]);
737  etaSimValu.push_back(std::pair<int,int>(ef,ieta));
738  }
739  for (int k=0; k<(hpar->etagroup[i]); ++k) ietaMap.push_back(i+1);
740  if (ieta <= hpar->etaMax[0]) ietaHB = i+1;
741  if (ieta <= hpar->etaMin[1]) ietaHE = i+1;
742  if (ieta <= hpar->etaMax[1]) ietaHEM= i+1;
743  }
744  iEtaMin[1] = ietaHE;
745  iEtaMax[0] = ietaHB;
746  iEtaMax[1] = ietaHEM;
747 
748  // Then Phi bins
749  nPhiBins.clear();
750  for (unsigned int k=0; k<4; ++k) nPhiBins.push_back(0);
751  ieta = 0;
752  phibin.clear(); phiUnitS.clear();
753  for (int i=0; i<nEta; ++i) {
754  double dphi = (hpar->phigroup[i])*(hpar->phibin[ieta]);
755  phibin.push_back(dphi);
756  int nphi = (int)((CLHEP::twopi + 0.001)/dphi);
757  if (ieta <= iEtaMax[0]) {
758  if (nphi > nPhiBins[0]) nPhiBins[3] = nPhiBins[0] = nphi;
759  }
760  if (ieta >= iEtaMin[1]) {
761  if (nphi > nPhiBins[1]) nPhiBins[1] = nphi;
762  }
763  ieta += (hpar->etagroup[i]);
764  }
765  for (unsigned int i=1; i<hpar->etaTable.size(); ++i) {
766  int unit = hcons.unitPhi(hpar->phibin[i-1]);
767  phiUnitS.push_back(unit);
768  }
769  for (unsigned int i=0; i<hpar->phitable.size(); ++i) {
770  int nphi = (int)((CLHEP::twopi + 0.001)/hpar->phitable[i]);
771  if (nphi > nPhiBins[2]) nPhiBins[2] = nphi;
772  }
773 #ifdef EDM_ML_DEBUG
774  std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl;
775  for (int i=0; i<nEta; ++i)
776  std::cout << "Eta[" << i << "] = " << etaTable[i] << ":" << etaTable[i+1]
777  << ":" << etaSimValu[i].first << ":" << etaSimValu[i].second
778  << " PhiBin[" << i << "] = " << phibin[i]/CLHEP::deg <<std::endl;
779  std::cout << "PhiUnitS";
780  for (unsigned int i=0; i<phiUnitS.size(); ++i)
781  std::cout << " [" << i << "] = " << phiUnitS[i];
782  std::cout << std::endl;
783  std::cout << "nPhiBins";
784  for (unsigned int i=0; i<nPhiBins.size(); ++i)
785  std::cout << " [" << i << "] = " << nPhiBins[i];
786  std::cout << std::endl;
787  std::cout << "EtaTableHF";
788  for (unsigned int i=0; i<hpar->etaTableHF.size(); ++i)
789  std::cout << " [" << i << "] = " << hpar->etaTableHF[i];
790  std::cout << std::endl;
791  std::cout << "PhiBinHF";
792  for (unsigned int i=0; i<hpar->phitable.size(); ++i)
793  std::cout << " [" << i << "] = " << hpar->phitable[i];
794  std::cout << std::endl;
795 #endif
796 
797  //Now the depths
799  maxDepth[0] = maxDepth[1] = 0;
800  for (int i=0; i<nEta; ++i) {
801  unsigned int imx = layerGroupSize(i);
802  int laymax = (imx > 0) ? layerGroup(i,imx-1) : 0;
803  if (i < iEtaMax[0]) {
804  int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax;
805  if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1);
806 #ifdef EDM_ML_DEBUG
807  std::cout << "HB " << i << " " << imx << " " << laymax << " " << laymax0 << std::endl;
808 #endif
809  if (maxDepth[0] < laymax0) maxDepth[0] = laymax0;
810  }
811  if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) {
812 #ifdef EDM_ML_DEBUG
813  std::cout << "HE " << i << " " << imx << " " << laymax << std::endl;
814 #endif
815  if (maxDepth[1] < laymax) maxDepth[1] = laymax;
816  }
817  }
818 #ifdef EDM_ML_DEBUG
819  for (int i=0; i<4; ++i)
820  std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":"
821  << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl;
822 #endif
823 
824  //Now the geometry constants
825  nModule[0] = hpar->modHB[0];
826  nHalves[0] = hpar->modHB[1];
827  for (unsigned int i=0; i<hpar->rHB.size(); ++i) {
828  gconsHB.push_back(std::pair<double,double>(hpar->rHB[i]/CLHEP::cm,
829  hpar->drHB[i]/CLHEP::cm));
830  }
831 #ifdef EDM_ML_DEBUG
832  std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0]
833  <<" halves and " << gconsHB.size() << " layers" << std::endl;
834  for (unsigned int i=0; i<gconsHB.size(); ++i)
835  std::cout << "rHB[" << i << "] = " << gconsHB[i].first << " +- "
836  << gconsHB[i].second << std::endl;
837 #endif
838  nModule[1] = hpar->modHE[0];
839  nHalves[1] = hpar->modHE[1];
840  for (unsigned int i=0; i<hpar->zHE.size(); ++i) {
841  gconsHE.push_back(std::pair<double,double>(hpar->zHE[i]/CLHEP::cm,
842  hpar->dzHE[i]/CLHEP::cm));
843  }
844 #ifdef EDM_ML_DEBUG
845  std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1]
846  <<" halves and " << gconsHE.size() << " layers" << std::endl;
847  for (unsigned int i=0; i<gconsHE.size(); ++i)
848  std::cout << "zHE[" << i << "] = " << gconsHE[i].first << " +- "
849  << gconsHE[i].second << std::endl;
850 #endif
851 
852  //Special RBX
854  if (depthMaxSp_.first == 0) {
855  depthMaxSp_ = depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
856  } else if (depthMaxSp_.first == 1) {
857  depthMaxDf_ = std::pair<int,int>(1,maxDepth[0]);
858  if (depthMaxSp_.second > maxDepth[0]) maxDepth[0] = depthMaxSp_.second;
859  } else {
860  depthMaxDf_ = std::pair<int,int>(2,maxDepth[1]);
861  if (depthMaxSp_.second > maxDepth[1]) maxDepth[1] = depthMaxSp_.second;
862  }
863 #ifdef EDM_ML_DEBUG
864  std::cout << "Detector type and maximum depth for all RBX "
865  << depthMaxDf_.first << ":" << depthMaxDf_.second
866  << " and for special RBX " << depthMaxSp_.first << ":"
867  << depthMaxSp_.second << std::endl;
868 #endif
869 
870  //Map of special DetId's
871  std::vector<int> phis;
873  detIdSp_.clear(); detIdSpR_.clear();
874  if ((subdet == HcalBarrel) || (subdet == HcalEndcap)) {
875  int phi = (phis[0] > 0) ? phis[0] : -phis[0];
876  int zside = (phis[0] > 0) ? 1 : -1;
877  int lymax = (subdet == HcalBarrel) ? maxLayerHB_+1 : maxLayer_+1;
878  std::pair<int,int>etas = hcons.ldMap()->validEta();
879  for (int eta=etas.first; eta<=etas.second; ++eta) {
880  std::map<int,std::pair<int,int> > oldDep;
881  int depth(0);
882  int lmin = layerGroup(eta-1,0);
883  for (int lay=0; lay<lymax; ++lay) {
884  int depc = layerGroup(eta-1,lay);
885  if (depth != depc) {
886  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lay-1);
887  depth = depc;
888  lmin = lay;
889  }
890  }
891  if (depth != 0) oldDep[depth] = std::pair<int,int>(lmin,lymax-1);
892 #ifdef EDM_ML_DEBUG
893  std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside
894  << " with " << oldDep.size() << " old Depths" << std::endl;
895  unsigned int kk(0);
896  for (std::map<int,std::pair<int,int> >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk)
897  std::cout << "[" << kk << "] " << itr->first << " --> "
898  << itr->second.first << ":" << itr->second.second << "\n";
899 #endif
900  std::pair<int,int> depths = hcons.ldMap()->getDepths(eta);
901  for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) {
902  bool flag = ((subdet == HcalBarrel && eta == iEtaMax[0] &&
903  ndepth > hcons.getDepthEta16(subdet,phi,zside)) ||
904  (subdet == HcalEndcap && eta == iEtaMin[1] &&
905  ndepth < hcons.getDepthEta16(subdet,phi,zside)));
906  if (!flag) {
907  std::vector<int> count(oldDep.size(),0);
908  int layFront = hcons.ldMap()->getLayerFront(subdet,eta,phi,zside,ndepth);
909  int layBack = hcons.ldMap()->getLayerBack(subdet,eta,phi,zside,ndepth);
910  for (int lay=layFront; lay<=layBack; ++lay) {
911  unsigned int l(0);
912  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
913  itr != oldDep.end(); ++itr,++l) {
914  if (lay >= (itr->second).first && lay <= (itr->second).second) {
915  ++count[l]; break;
916  }
917  }
918  }
919  int odepth(0), maxlay(0);
920  unsigned int l(0);
921  for (std::map<int,std::pair<int,int> >::iterator itr=oldDep.begin();
922  itr != oldDep.end(); ++itr,++l) {
923  if (count[l] > maxlay) {
924  odepth = itr->first;
925  maxlay = count[l];
926  }
927  }
928 #ifdef EDM_ML_DEBUG
929  std::cout << "New Depth " << ndepth << " old Depth " << odepth
930  << " max " << maxlay << std::endl;
931 #endif
932  for (unsigned int k=0; k<phis.size(); ++k) {
933  zside = (phis[k] > 0) ? 1 : -1;
934  phi = (phis[k] > 0) ? phis[k] : -phis[k];
935  if (subdet == HcalEndcap && eta == hpar->noff[1] &&
936  ndepth > hcons.getDepthEta29M(0,true)) break;
937  HcalDetId newId(subdet,zside*eta,phi,ndepth);
938  HcalDetId oldId(subdet,zside*eta,phi,odepth);
939  detIdSp_[newId] = oldId;
940  std::vector<HcalDetId> ids;
941  std::map<HcalDetId,std::vector<HcalDetId>>::iterator itr = detIdSpR_.find(oldId);
942  if (itr != detIdSpR_.end()) ids = itr->second;
943  ids.push_back(newId);
944  detIdSpR_[oldId] = ids;
945  }
946  }
947  }
948  }
949 #ifdef EDM_ML_DEBUG
950  std::cout << "Map for merging new channels to old channel IDs with "
951  << detIdSp_.size() << " entries" << std::endl;
952  int l(0);
953  for (std::map<HcalDetId,HcalDetId>::const_iterator itr=detIdSp_.begin();
954  itr != detIdSp_.end(); ++itr,++l) {
955  std::cout << "[" << l << "] Special " << itr->first << " Standard "
956  << itr->second << std::endl;
957  }
958  std::cout << "Reverse Map for mapping old to new IDs with "
959  << detIdSpR_.size() << " entries" << std::endl;
960  l = 0;
961  for (std::map<HcalDetId,std::vector<HcalDetId> >::const_iterator itr=detIdSpR_.begin();
962  itr != detIdSpR_.end(); ++itr,++l) {
963  std::cout << "[" << l << "] Standard " << itr->first << " Special";
964  for (unsigned int k=0; k < itr->second.size(); ++k)
965  std::cout << " " << (itr->second)[k];
966  std::cout << std::endl;
967  }
968 #endif
969  }
970 
971 }
972 
973 unsigned int HcalDDDRecConstants::layerGroupSize(const int eta) 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.size();
978  }
979  if (it.layer > (unsigned int)(eta + 1)) break;
980  k = it.layerGroup.size();
981  }
982  return k;
983 }
984 
985 unsigned int HcalDDDRecConstants::layerGroup(const int eta,
986  const int i) const {
987  unsigned int k = 0;
988  for (auto const & it : hpar->layerGroupEtaRec) {
989  if (it.layer == (unsigned int)(eta + 1)) {
990  return it.layerGroup.at(i);
991  }
992  if (it.layer > (unsigned int)(eta + 1)) break;
993  k = it.layerGroup.at(i);
994  }
995  return k;
996 }
type
Definition: HCALResponse.h:21
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: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
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
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