CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MatrixECALDetIds.cc
Go to the documentation of this file.
3 
5 
6 #include <algorithm>
7 #include <iostream>
8 
9 namespace spr{
10 
11  void matrixECALIds(const DetId& det, int ieta, int iphi,
12  const CaloGeometry* geo, const CaloTopology* caloTopology,
13  std::vector<DetId>& vdets, bool debug) {
14 
15  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
16  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
17  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
18  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
19 
20  if (debug) {
21  std::cout << "matrixECALIds::Add " << ieta << " rows and " << iphi
22  << " columns of cells for 1 cell" << std::endl;
23  if (det.subdetId() == EcalBarrel) {
24  EBDetId id = det;
25  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
26  << " " << id << std::endl;
27  } else if (det.subdetId() == EcalEndcap) {
28  EEDetId id = det;
29  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
30  << " " << id << std::endl;
31  } else {
32  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
33  << " Unknown Type" << std::endl;
34  }
35  }
36 
37  std::vector<DetId> dets(1,det);
38  std::vector<CaloDirection> dirs(1,NORTH);
39  vdets = spr::newECALIdNS(dets, 0, ieta,iphi, dirs, *barrelTopo,*endcapTopo,
40  *barrelGeom,*endcapGeom,debug);
41  dirs[0] = SOUTH;
42  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, ieta, iphi, dirs,
43  *barrelTopo,*endcapTopo,
44  *barrelGeom,*endcapGeom,debug);
45  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
46  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
47  vdets.push_back(vdetS[i1]);
48  }
49  unsigned int ndet = (2*ieta+1)*(2*iphi+1);
50  if (vdets.size() != ndet) {
51  std::vector<DetId> vdetExtra;
52  spr::extraIds(det, vdets, ieta, ieta, iphi, iphi,
53  *barrelGeom, *endcapGeom, vdetExtra, debug);
54  if (vdetExtra.size() > 0)
55  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
56  }
57 
58  if (debug) {
59  std::cout << "matrixECALIds::Total number of cells found is "
60  << vdets.size() << std::endl;
61  for (unsigned int i1=0; i1<vdets.size(); i1++) {
62  if (vdets[i1].subdetId() == EcalBarrel) {
63  EBDetId id = vdets[i1];
64  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
65  << vdets[i1]() << std::dec << " " << id << std::endl;
66  } else if (vdets[i1].subdetId() == EcalEndcap) {
67  EEDetId id = vdets[i1];
68  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
69  << vdets[i1]() << std::dec << " " << id << std::endl;
70  } else {
71  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
72  << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
73  }
74  }
75  }
76  }
77 
78  std::vector<DetId> matrixECALIds(const DetId& det,int ieta,int iphi,
79  const CaloGeometry* geo,
80  const CaloTopology* caloTopology,
81  bool debug) {
82 
83  std::vector<DetId> vdets;
84  matrixECALIds(det, ieta, iphi, geo, caloTopology, vdets, debug);
85  return vdets;
86  }
87 
88  void matrixECALIds(const DetId& det, int ietaE,int ietaW,int iphiN,int iphiS,
89  const CaloGeometry* geo, const CaloTopology* caloTopology,
90  std::vector<DetId>& vdets, bool debug) {
91 
92  const CaloSubdetectorTopology *barrelTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalBarrel));
93  const CaloSubdetectorTopology *endcapTopo = (caloTopology->getSubdetectorTopology(DetId::Ecal,EcalEndcap));
94  const EcalBarrelGeometry *barrelGeom = (dynamic_cast< const EcalBarrelGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalBarrel)));
95  const EcalEndcapGeometry *endcapGeom = (dynamic_cast< const EcalEndcapGeometry *> (geo->getSubdetectorGeometry(DetId::Ecal,EcalEndcap)));
96 
97  if (debug) {
98  std::cout << "matrixECALIds::Add " << ietaE << "|" << ietaW
99  << " rows and " << iphiN << "|" << iphiS
100  << " columns of cells for 1 cell" << std::endl;
101  if (det.subdetId() == EcalBarrel) {
102  EBDetId id = det;
103  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
104  << " " << id << std::endl;
105  } else if (det.subdetId() == EcalEndcap) {
106  EEDetId id = det;
107  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
108  << " " << id << std::endl;
109  } else {
110  std::cout << "matrixECALIds::Cell 0x" << std::hex << det() << std::dec
111  << " Unknown Type" << std::endl;
112  }
113  }
114 
115  std::vector<DetId> dets(1,det);
116  std::vector<CaloDirection> dirs(1,NORTH);
117  std::vector<int> jetaE(1,ietaE), jetaW(1,ietaW);
118  std::vector<int> jphiN(1,iphiN), jphiS(1,iphiS);
119  vdets = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN, jphiS, dirs,
120  *barrelTopo, *endcapTopo, *barrelGeom,
121  *endcapGeom, debug);
122  dirs[0] = SOUTH;
123  std::vector<DetId> vdetS = spr::newECALIdNS(dets, 0, jetaE, jetaW, jphiN,
124  jphiS, dirs, *barrelTopo,
125  *endcapTopo, *barrelGeom,
126  *endcapGeom, debug);
127  for (unsigned int i1=0; i1<vdetS.size(); i1++) {
128  if (std::count(vdets.begin(),vdets.end(),vdetS[i1]) == 0)
129  vdets.push_back(vdetS[i1]);
130  }
131 
132  unsigned int ndet = (ietaE+ietaW+1)*(iphiN+iphiS+1);
133  if (vdets.size() != ndet) {
134  std::vector<DetId> vdetExtra;
135  spr::extraIds(det, vdets, ietaE, ietaW, iphiN, iphiS,
136  *barrelGeom, *endcapGeom, vdetExtra, debug);
137  if (vdetExtra.size() > 0)
138  vdets.insert(vdets.end(), vdetExtra.begin(), vdetExtra.end());
139  }
140 
141  if (debug) {
142  std::cout << "matrixECALIds::Total number of cells found is "
143  << vdets.size() << std::endl;
144  for (unsigned int i1=0; i1<vdets.size(); i1++) {
145  if (vdets[i1].subdetId() == EcalBarrel) {
146  EBDetId id = vdets[i1];
147  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
148  << vdets[i1]() << std::dec << " " << id << std::endl;
149  } else if (vdets[i1].subdetId() == EcalEndcap) {
150  EEDetId id = vdets[i1];
151  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
152  << vdets[i1]() << std::dec << " " << id << std::endl;
153  } else {
154  std::cout << "matrixECALIds::Cell " << i1 << " 0x" << std::hex
155  << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
156  }
157  }
158  }
159  }
160 
161  std::vector<DetId> matrixECALIds(const DetId& det, int ietaE, int ietaW,
162  int iphiN, int iphiS,
163  const CaloGeometry* geo,
164  const CaloTopology* caloTopology,
165  bool debug) {
166 
167  std::vector<DetId> vdets;
168  spr::matrixECALIds(det, ietaE, ietaW, iphiN, iphiS, geo, caloTopology,
169  vdets, debug);
170  return vdets;
171  }
172 
173  std::vector<DetId> newECALIdNS(std::vector<DetId>& dets, unsigned int last,
174  int ieta, int iphi,
175  std::vector<CaloDirection>& dir,
176  const CaloSubdetectorTopology& barrelTopo,
177  const CaloSubdetectorTopology& endcapTopo,
178  const EcalBarrelGeometry& barrelGeom,
179  const EcalEndcapGeometry& endcapGeom,
180  bool debug) {
181 
182  if (debug) {
183  std::cout << "newECALIdNS::Add " << iphi << " columns of cells for "
184  << (dets.size()-last) << " cells (last " << last << ")"
185  << std::endl;
186  for (unsigned int i1=last; i1<dets.size(); i1++) {
187  if (dets[i1].subdetId() == EcalBarrel) {
188  EBDetId id = dets[i1];
189  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
190  << dir[i1] << std::endl;
191  } else if (dets[i1].subdetId() == EcalEndcap) {
192  EEDetId id = dets[i1];
193  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
194  << dir[i1] << std::endl;
195  } else {
196  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
197  << dets[i1]() << std::dec << " Unknown Type along "
198  << dir[i1] << std::endl;
199  }
200  }
201  }
202 
203  std::vector<DetId> vdets;
204  std::vector<CaloDirection> dirs;
205  vdets.insert(vdets.end(), dets.begin(), dets.end());
206  dirs.insert(dirs.end(), dir.begin(), dir.end());
207 
208  std::vector<DetId> vdetE, vdetW;
209  if (last == 0) {
210  unsigned int ndet = vdets.size();
211  std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
212  vdetE = spr::newECALIdEW(dets, last, ieta, dirE, barrelTopo, endcapTopo,
213  barrelGeom, endcapGeom, debug);
214  vdetW = spr::newECALIdEW(dets, last, ieta, dirW, barrelTopo, endcapTopo,
215  barrelGeom, endcapGeom, debug);
216  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
217  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
218  vdets.push_back(vdetW[i1]);
219  dirs.push_back(dir[0]);
220  }
221  }
222  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
223  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
224  vdets.push_back(vdetE[i1]);
225  dirs.push_back(dir[0]);
226  }
227  }
228  if (debug) {
229  std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
230  << (vdets.size()-dets.size()) << " new cells" << std::endl;
231  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
232  if (vdets[i1].subdetId() == EcalBarrel) {
233  EBDetId id = vdets[i1];
234  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
235  << dirs[i1] << std::endl;
236  } else if (vdets[i1].subdetId() == EcalEndcap) {
237  EEDetId id = vdets[i1];
238  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
239  << dirs[i1] << std::endl;
240  } else {
241  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
242  << vdets[i1]() << std::dec << " Unknown Type along "
243  << dirs[i1] << std::endl;
244  }
245  }
246  }
247  }
248 
249  unsigned int last0 = vdets.size();
250  std::vector<DetId> vdetnew;
251  std::vector<CaloDirection> dirnew;
252  if (iphi > 0) {
253  std::vector<DetId> vdetn(1);
254  std::vector<CaloDirection> dirn(1);
255  std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
256  int flag=0;
257  for (unsigned int i1=last; i1<dets.size(); i1++) {
258  std::vector<DetId> cells;
259  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
260  barrelGeom, endcapGeom, cells, flag, debug);
261  /*
262  if (dets[i1].subdetId() == EcalBarrel) {
263  EBDetId id = dets[i1];
264  std::cout << "Moved Cell " << i1 << " " << id << " along "
265  << dir[i1] << std::endl;
266  } else if (dets[i1].subdetId() == EcalEndcap) {
267  EEDetId id = dets[i1];
268  std::cout << "Moved Cell " << i1 << " " << id << " along "
269  << dir[i1] << std::endl;
270  } else {
271  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
272  << dets[i1]() << std::dec << " Unknown Type along "
273  << dir[i1] << std::endl;
274  }
275  for (unsigned int kk=0; kk<cells.size(); kk++) {
276  if (cells[kk].subdetId() == EcalBarrel) {
277  EBDetId id = cells[kk];
278  std::cout << "Moved to " << id << " flag " << flag << "\n";
279  } else if (cells[kk].subdetId() == EcalEndcap) {
280  EEDetId id = cells[kk];
281  std::cout << "Moved to " << id << " flag " << flag << "\n";
282  } else {
283  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
284  << cells[kk]() << std::dec << " Unknown Type flag "
285  << flag << std::endl;
286  }
287  }
288  */
289  if (flag != 0) {
290  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
291  vdetn[0] = cells[0];
292  vdetnew.push_back(vdetn[0]);
293  dirn[0] = dir[i1];
294  if (flag < 0) {
295  if (dirn[0] == NORTH) dirn[0] = SOUTH;
296  else dirn[0] = NORTH;
297  }
298  dirnew.push_back(dirn[0]);
299  vdetE = spr::newECALIdEW(vdetn, 0, ieta, dirnE, barrelTopo,
300  endcapTopo, barrelGeom, endcapGeom,debug);
301  vdetW = spr::newECALIdEW(vdetn, 0, ieta, dirnW, barrelTopo,
302  endcapTopo, barrelGeom, endcapGeom,debug);
303  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
304  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
305  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
306  vdets.push_back(vdetW[i2]);
307  dirs.push_back(dirn[0]);
308  }
309  }
310  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
311  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
312  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
313  vdets.push_back(vdetE[i2]);
314  dirs.push_back(dirn[0]);
315  }
316  }
317  }
318  }
319  }
320  iphi--;
321  last = vdets.size();
322  for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
323  if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
324  vdets.push_back(vdetnew[i2]);
325  dirs.push_back(dirnew[i2]);
326  }
327  }
328  if (debug) {
329  std::cout << "newECALIdNS::Addition results a set of "
330  << (vdets.size()-last0) << " new cells (last " << last0
331  << ", iphi " << iphi << ")" << std::endl;
332  for (unsigned int i1=last0; i1<vdets.size(); i1++) {
333  if (vdets[i1].subdetId() == EcalBarrel) {
334  EBDetId id = vdets[i1];
335  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
336  << dirs[i1] << std::endl;
337  } else if (vdets[i1].subdetId() == EcalEndcap) {
338  EEDetId id = vdets[i1];
339  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
340  << dirs[i1] << std::endl;
341  } else {
342  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
343  << vdets[i1]() << std::dec << " Unknown Type along "
344  << dirs[i1] << std::endl;
345  }
346  }
347  }
348  last0 = last;
349  }
350 
351  if (iphi > 0) {
352  last = last0;
353  return spr::newECALIdNS(vdets,last,ieta,iphi,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
354  } else {
355  if (debug) {
356  std::cout << "newECALIdNS::Final list consists of " << vdets.size()
357  << " cells" << std::endl;
358  for (unsigned int i1=0; i1<vdets.size(); i1++) {
359  if (vdets[i1].subdetId() == EcalBarrel) {
360  EBDetId id = vdets[i1];
361  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
362  } else if (vdets[i1].subdetId() == EcalEndcap) {
363  EEDetId id = vdets[i1];
364  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
365  } else {
366  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
367  << vdets[i1]() << std::dec << " Unknown Type"
368  << std::endl;
369  }
370  }
371  }
372  return vdets;
373  }
374  }
375 
376  std::vector<DetId> newECALIdNS(std::vector<DetId>& dets, unsigned int last,
377  std::vector<int>& ietaE,
378  std::vector<int>& ietaW,
379  std::vector<int>& iphiN,
380  std::vector<int>& iphiS,
381  std::vector<CaloDirection>& dir,
382  const CaloSubdetectorTopology& barrelTopo,
383  const CaloSubdetectorTopology& endcapTopo,
384  const EcalBarrelGeometry& barrelGeom,
385  const EcalEndcapGeometry& endcapGeom,
386  bool debug) {
387 
388  if (debug) {
389  std::cout << "newECALIdNS::Add columns of cells for "
390  << (dets.size()-last) << " cells (last) " << last << std::endl;
391  for (unsigned int i1=last; i1<dets.size(); i1++) {
392  if (dets[i1].subdetId() == EcalBarrel) {
393  EBDetId id = dets[i1];
394  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
395  << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
396  << std::endl;
397  } else if (dets[i1].subdetId() == EcalEndcap) {
398  EEDetId id = dets[i1];
399  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
400  << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
401  << std::endl;
402  } else {
403  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
404  << dets[i1]() << std::dec << " Unknown Type along "
405  << dir[i1] << " # " << iphiN[i1] << "|" << iphiS[i1]
406  << std::endl;
407  }
408  }
409  }
410 
411  std::vector<DetId> vdets;
412  std::vector<CaloDirection> dirs;
413  std::vector<int> jetaE, jetaW, jphiN, jphiS;
414  vdets.insert(vdets.end(), dets.begin(), dets.end());
415  dirs.insert(dirs.end(), dir.begin(), dir.end());
416  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
417  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
418  jphiN.insert(jphiN.end(), iphiN.begin(), iphiN.end());
419  jphiS.insert(jphiS.end(), iphiS.begin(), iphiS.end());
420  std::vector<DetId> vdetE, vdetW;
421  if (last == 0) {
422  unsigned int ndet = vdets.size();
423  std::vector<CaloDirection> dirE(ndet,EAST), dirW(ndet,WEST);
424  vdetE = spr::newECALIdEW(dets, last, ietaE, ietaW, dirE, barrelTopo,
425  endcapTopo, barrelGeom, endcapGeom, debug);
426  vdetW = spr::newECALIdEW(dets, last, ietaE, ietaW, dirW, barrelTopo,
427  endcapTopo, barrelGeom, endcapGeom, debug);
428  for (unsigned int i1=0; i1<vdetW.size(); i1++) {
429  if (std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0) {
430  vdets.push_back(vdetW[i1]);
431  dirs.push_back(dir[0]);
432  jetaE.push_back(0);
433  jetaW.push_back(0);
434  jphiN.push_back(iphiN[0]);
435  jphiS.push_back(iphiS[0]);
436  }
437  }
438  for (unsigned int i1=0; i1<vdetE.size(); i1++) {
439  if (std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0) {
440  vdets.push_back(vdetE[i1]);
441  dirs.push_back(dir[0]);
442  jetaE.push_back(0);
443  jetaW.push_back(0);
444  jphiN.push_back(iphiN[0]);
445  jphiS.push_back(iphiS[0]);
446  }
447  }
448  if (debug) {
449  std::cout <<"newECALIdNS::With Added cells along E/W results a set of "
450  << (vdets.size()-dets.size()) << " new cells" << std::endl;
451  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
452  if (vdets[i1].subdetId() == EcalBarrel) {
453  EBDetId id = vdets[i1];
454  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
455  << dirs[i1] << std::endl;
456  } else if (vdets[i1].subdetId() == EcalEndcap) {
457  EEDetId id = vdets[i1];
458  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
459  << dirs[i1] << std::endl;
460  } else {
461  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
462  << vdets[i1]() << std::dec << " Unknown Type along "
463  << dirs[i1] << std::endl;
464  }
465  }
466  }
467  }
468 
469  unsigned int last0 = vdets.size();
470  std::vector<DetId> vdetnew;
471  std::vector<CaloDirection> dirnew;
472  std::vector<int> kphiN, kphiS, ketaE, ketaW;
473  int kphi = 0;
474  for (unsigned int i1=last; i1<dets.size(); i1++) {
475  int iphi = iphiS[i1];
476  if (dir[i1] == NORTH) iphi = iphiN[i1];
477  if (iphi > 0) {
478  std::vector<DetId> vdetn(1);
479  std::vector<CaloDirection> dirn(1);
480  std::vector<CaloDirection> dirnE(1,EAST), dirnW(1,WEST);
481  int flag=0;
482  std::vector<DetId> cells;
483  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
484  barrelGeom, endcapGeom, cells, flag, debug);
485  iphi--;
486  if (iphi > kphi) kphi = iphi;
487  if (dir[i1] == NORTH) jphiN[i1] = iphi;
488  else jphiS[i1] = iphi;
489  if (flag != 0) {
490  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
491  int kfiN = iphiN[i1];
492  int kfiS = iphiS[i1];
493  vdetn[0] = cells[0];
494  vdetnew.push_back(vdetn[0]);
495  dirn[0] = dir[i1];
496  if (dir[i1] == NORTH) kfiN = iphi;
497  else kfiS = iphi;
498  if (flag < 0) {
499  int ktmp = kfiS; kfiS = kfiN; kfiN = ktmp;
500  if (dirn[0] == NORTH) dirn[0] = SOUTH;
501  else dirn[0] = NORTH;
502  }
503  dirnew.push_back(dirn[0]);
504  kphiN.push_back(kfiN); ketaE.push_back(ietaE[i1]);
505  kphiS.push_back(kfiS); ketaW.push_back(ietaW[i1]);
506  std::vector<int> ietE(1,ietaE[i1]), ietW(1,ietaW[i1]);
507  vdetE = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnE, barrelTopo,
508  endcapTopo, barrelGeom, endcapGeom,debug);
509  vdetW = spr::newECALIdEW(vdetn, 0, ietE, ietW, dirnW, barrelTopo,
510  endcapTopo, barrelGeom, endcapGeom,debug);
511  for (unsigned int i2=0; i2<vdetW.size(); i2++) {
512  if (std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
513  std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0) {
514  vdets.push_back(vdetW[i2]);
515  dirs.push_back(dirn[0]);
516  jetaE.push_back(0); jphiN.push_back(kfiN);
517  jetaW.push_back(0); jphiS.push_back(kfiS);
518  }
519  }
520  for (unsigned int i2=0; i2<vdetE.size(); i2++) {
521  if (std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
522  std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0) {
523  vdets.push_back(vdetE[i2]);
524  dirs.push_back(dirn[0]);
525  jetaE.push_back(0); jphiN.push_back(kfiN);
526  jetaW.push_back(0); jphiS.push_back(kfiS);
527  }
528  }
529  }
530  }
531  }
532  }
533  last = vdets.size();
534  for (unsigned int i2=0; i2<vdetnew.size(); i2++) {
535  if (std::count(vdets.begin(),vdets.end(),vdetnew[i2]) == 0) {
536  vdets.push_back(vdetnew[i2]);
537  dirs.push_back(dirnew[i2]);
538  jetaE.push_back(ketaE[i2]);
539  jetaW.push_back(ketaW[i2]);
540  jphiN.push_back(kphiN[i2]);
541  jphiS.push_back(kphiS[i2]);
542  }
543  }
544  if (debug) {
545  std::cout << "newECALIdNS::Addition results a set of "
546  << (vdets.size()-last0) << " new cells (last " << last0
547  << ", iphi " << kphi << ")" << std::endl;
548  for (unsigned int i1=last0; i1<vdets.size(); i1++) {
549  if (vdets[i1].subdetId() == EcalBarrel) {
550  EBDetId id = vdets[i1];
551  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
552  << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
553  << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
554  } else if (vdets[i1].subdetId() == EcalEndcap) {
555  EEDetId id = vdets[i1];
556  std::cout << "newECALIdNS::Cell " << i1 << " " << id << " along "
557  << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
558  << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
559  } else {
560  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
561  << vdets[i1]() << std::dec << " Unknown Type along "
562  << dirs[i1] << " iphi " << jphiN[i1] << "|" << jphiS[i1]
563  << " ieta " << jetaE[i1] << "|" << jetaW[i1] << std::endl;
564  }
565  }
566  }
567  last0 = last;
568 
569  if (kphi > 0) {
570  last = last0;
571  return spr::newECALIdNS(vdets, last, jetaE, jetaW, jphiN, jphiS, dirs,
572  barrelTopo, endcapTopo, barrelGeom, endcapGeom,
573  debug);
574  } else {
575  if (debug) {
576  std::cout << "newECALIdNS::Final list consists of " << vdets.size()
577  << " cells" << std::endl;
578  for (unsigned int i1=0; i1<vdets.size(); i1++) {
579  if (vdets[i1].subdetId() == EcalBarrel) {
580  EBDetId id = vdets[i1];
581  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
582  } else if (vdets[i1].subdetId() == EcalEndcap) {
583  EEDetId id = vdets[i1];
584  std::cout << "newECALIdNS::Cell " << i1 << " " << id << std::endl;
585  } else {
586  std::cout << "newECALIdNS::Cell " << i1 << " 0x" << std::hex
587  << vdets[i1]() << std::dec << " Unknown Type"
588  << std::endl;
589  }
590  }
591  }
592  return vdets;
593  }
594  }
595 
596  std::vector<DetId> newECALIdEW(std::vector<DetId>& dets, unsigned int last,
597  int ieta, std::vector<CaloDirection>& dir,
598  const CaloSubdetectorTopology& barrelTopo,
599  const CaloSubdetectorTopology& endcapTopo,
600  const EcalBarrelGeometry& barrelGeom,
601  const EcalEndcapGeometry& endcapGeom,
602  bool debug) {
603 
604  if (debug) {
605  std::cout << "newECALIdEW::Add " << ieta << " rows of cells for "
606  << last << ":" << dets.size() << ":" << (dets.size()-last)
607  << " cells" << std::endl;
608  for (unsigned int i1=last; i1<dets.size(); i1++) {
609  if (dets[i1].subdetId() == EcalBarrel) {
610  EBDetId id = dets[i1];
611  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
612  << dir[i1] << std::endl;
613  } else if (dets[i1].subdetId() == EcalEndcap) {
614  EEDetId id = dets[i1];
615  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
616  << dir[i1] << std::endl;
617  } else {
618  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
619  << dets[i1]() << std::dec << " Unknown Type along "
620  << dir[i1] << std::endl;
621  }
622  }
623  }
624 
625  std::vector<DetId> vdets; vdets.clear();
626  std::vector<CaloDirection> dirs; dirs.clear();
627  vdets.insert(vdets.end(), dets.begin(), dets.end());
628  dirs.insert(dirs.end(), dir.begin(), dir.end());
629 
630  if (ieta > 0) {
631  for (unsigned int i1=last; i1<dets.size(); i1++) {
632  int flag = 0;
633  std::vector<DetId> cells;
634  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
635  barrelGeom, endcapGeom, cells, flag, debug);
636  /*
637  if (dets[i1].subdetId() == EcalBarrel) {
638  EBDetId id = dets[i1];
639  std::cout << "Moved Cell " << i1 << " " << id << " along "
640  << dir[i1] << std::endl;
641  } else if (dets[i1].subdetId() == EcalEndcap) {
642  EEDetId id = dets[i1];
643  std::cout << "Moved Cell " << i1 << " " << id << " along "
644  << dir[i1] << std::endl;
645  } else {
646  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
647  << dets[i1]() << std::dec << " Unknown Type along "
648  << dir[i1] << std::endl;
649  }
650  for (unsigned int kk=0; kk<cells.size(); kk++) {
651  if (cells[kk].subdetId() == EcalBarrel) {
652  EBDetId id = cells[kk];
653  std::cout << "Moved to " << id << " flag " << flag << "\n";
654  } else if (cells[kk].subdetId() == EcalEndcap) {
655  EEDetId id = cells[kk];
656  std::cout << "Moved to " << id << " flag " << flag << "\n";
657  } else {
658  std::cout << "Moved Cell " << i1 << " 0x" << std::hex
659  << cells[kk]() << std::dec << " Unknown Type flag "
660  << flag << std::endl;
661  }
662  }
663  */
664  if (flag != 0) {
665  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
666  CaloDirection dirn = dir[i1];
667  if (flag < 0) {
668  if (dirn == EAST) dirn = WEST;
669  else dirn = EAST;
670  }
671  vdets.push_back(cells[0]);
672  dirs.push_back(dirn);
673  }
674  }
675  }
676  ieta--;
677  }
678 
679  if (debug) {
680  std::cout << "newECALIdEW::Addition results a set of "
681  << (vdets.size()-dets.size()) << " new cells" << std::endl;
682  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
683  if (vdets[i1].subdetId() == EcalBarrel) {
684  EBDetId id = vdets[i1];
685  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
686  << dirs[i1] << std::endl;
687  } else if (vdets[i1].subdetId() == EcalEndcap) {
688  EEDetId id = vdets[i1];
689  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
690  << dirs[i1] << std::endl;
691  } else {
692  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
693  << vdets[i1]() << std::dec << " Unknown Type along "
694  << dirs[i1] << std::endl;
695  }
696  }
697  }
698 
699  if (ieta > 0) {
700  last = dets.size();
701  return spr::newECALIdEW(vdets,last,ieta,dirs,barrelTopo,endcapTopo,barrelGeom,endcapGeom,debug);
702  } else {
703  if (debug) {
704  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
705  << " cells" << std::endl;
706  for (unsigned int i1=0; i1<vdets.size(); i1++) {
707  if (vdets[i1].subdetId() == EcalBarrel) {
708  EBDetId id = vdets[i1];
709  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
710  } else if (vdets[i1].subdetId() == EcalEndcap) {
711  EEDetId id = vdets[i1];
712  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
713  } else {
714  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
715  << vdets[i1]() <<std::dec << " Unknown Type" <<std::endl;
716  }
717  }
718  }
719  return vdets;
720  }
721  }
722 
723  std::vector<DetId> newECALIdEW(std::vector<DetId>& dets, unsigned int last,
724  std::vector<int>& ietaE,
725  std::vector<int>& ietaW,
726  std::vector<CaloDirection>& dir,
727  const CaloSubdetectorTopology& barrelTopo,
728  const CaloSubdetectorTopology& endcapTopo,
729  const EcalBarrelGeometry& barrelGeom,
730  const EcalEndcapGeometry& endcapGeom,
731  bool debug) {
732 
733  if (debug) {
734  std::cout << "newECALIdEW::Add " << ietaE[0] << "|" << ietaW[0]
735  << " rows of cells for " << (dets.size()-last)
736  << " cells (last " << last << ")" << std::endl;
737  for (unsigned int i1=last; i1<dets.size(); i1++) {
738  if (dets[i1].subdetId() == EcalBarrel) {
739  EBDetId id = dets[i1];
740  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
741  << dir[i1] << std::endl;
742  } else if (dets[i1].subdetId() == EcalEndcap) {
743  EEDetId id = dets[i1];
744  std::cout << "newECALIdEW::Cell " << i1 << " " << id << " along "
745  << dir[i1] << std::endl;
746  } else {
747  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
748  << dets[i1]() << std::dec << " Unknown Type along "
749  << dir[i1] << std::endl;
750  }
751  }
752  }
753 
754  std::vector<DetId> vdets;
755  vdets.insert(vdets.end(), dets.begin(), dets.end());
756  std::vector<CaloDirection> dirs;
757  dirs.insert(dirs.end(), dir.begin(), dir.end());
758  std::vector<int> jetaE, jetaW;
759  jetaE.insert(jetaE.end(), ietaE.begin(), ietaE.end());
760  jetaW.insert(jetaW.end(), ietaW.begin(), ietaW.end());
761  int keta = 0;
762  for (unsigned int i1=last; i1<dets.size(); i1++) {
763  int ieta = ietaW[i1];
764  if (dir[i1] == EAST) ieta = ietaE[i1];
765  if (ieta > 0) {
766  int flag=0;
767  std::vector<DetId> cells;
768  spr::simpleMove(dets[i1], dir[i1], barrelTopo, endcapTopo,
769  barrelGeom, endcapGeom, cells, flag, debug);
770  ieta--;
771  if (ieta > keta) keta = ieta;
772  if (dir[i1] == EAST) jetaE[i1] = ieta;
773  else jetaW[i1] = ieta;
774  if (flag != 0) {
775  if (std::count(vdets.begin(),vdets.end(),cells[0]) == 0) {
776  vdets.push_back(cells[0]);
777  CaloDirection dirn = dir[i1];
778  int ketaE = ietaE[i1];
779  int ketaW = ietaW[i1];
780  if (dirn == EAST) ketaE = ieta;
781  else ketaW = ieta;
782  if (flag < 0) {
783  int ktmp = ketaW; ketaW = ketaE; ketaE = ktmp;
784  if (dirn == EAST) dirn = WEST;
785  else dirn = EAST;
786  }
787  dirs.push_back(dirn);
788  jetaE.push_back(ketaE);
789  jetaW.push_back(ketaW);
790  }
791  }
792  }
793  }
794 
795  if (debug) {
796  std::cout << "newECALIdEW::Addition results a set of "
797  << (vdets.size()-dets.size()) << " new cells (last "
798  << dets.size() << ", ieta " << keta << ")" << std::endl;
799  for (unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
800  if (vdets[i1].subdetId() == EcalBarrel) {
801  EBDetId id = vdets[i1];
802  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
803  } else if (vdets[i1].subdetId() == EcalEndcap) {
804  EEDetId id = vdets[i1];
805  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
806  } else {
807  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
808  << vdets[i1]() << std::dec << " Unknown Type" << std::endl;
809  }
810  }
811  }
812 
813  if (keta > 0) {
814  last = dets.size();
815  return spr::newECALIdEW(vdets, last, jetaE, jetaW, dirs, barrelTopo,
816  endcapTopo, barrelGeom, endcapGeom, debug);
817  } else {
818  if (debug) {
819  std::cout << "newECALIdEW::Final list (EW) consists of " <<vdets.size()
820  << " cells" << std::endl;
821  for (unsigned int i1=0; i1<vdets.size(); i1++) {
822  if (vdets[i1].subdetId() == EcalBarrel) {
823  EBDetId id = vdets[i1];
824  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
825  } else if (vdets[i1].subdetId() == EcalEndcap) {
826  EEDetId id = vdets[i1];
827  std::cout << "newECALIdEW::Cell " << i1 << " " << id << std::endl;
828  } else {
829  std::cout << "newECALIdEW::Cell " << i1 << " 0x" << std::hex
830  << vdets[i1]() <<std::dec << " Unknown Type" <<std::endl;
831  }
832  }
833  }
834  return vdets;
835  }
836  }
837 
838  void simpleMove(DetId& det, const CaloDirection& dir,
839  const CaloSubdetectorTopology& barrelTopo,
840  const CaloSubdetectorTopology& endcapTopo,
841  const EcalBarrelGeometry& barrelGeom,
842  const EcalEndcapGeometry& endcapGeom,
843  std::vector<DetId>& cells, int& ok, bool debug) {
844 
845  DetId cell;
846  ok = 0;
847  if (det.subdetId() == EcalBarrel) {
848  EBDetId detId = det;
849  std::vector<DetId> neighbours = barrelTopo.getNeighbours(detId,dir);
850  if (neighbours.size()>0 && !neighbours[0].null()) {
851  cells.push_back(neighbours[0]);
852  cell = neighbours[0];
853  ok = 1;
854  } else {
855  const int ietaAbs ( detId.ietaAbs() ) ; // abs value of ieta
856  if (EBDetId::MAX_IETA == ietaAbs ) {
857  // get ee nbrs for for end of barrel crystals
859  ol( * barrelGeom.getClosestEndcapCells(detId) ) ;
860  // take closest neighbour on the other side, that is in the endcap
861  cell = *(ol.begin() );
862  neighbours = endcapTopo.getNeighbours(cell,dir);
863  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
864  else ok =-1;
865  for (EcalBarrelGeometry::OrderedListOfEEDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
866  cells.push_back(*iptr);
867  }
868  }
869  } else if (det.subdetId() == EcalEndcap) {
870  EEDetId detId = det;
871  std::vector<DetId> neighbours = endcapTopo.getNeighbours(detId,dir);
872  if (neighbours.size()>0 && !neighbours[0].null()) {
873  cells.push_back(neighbours[0]);
874  cell = neighbours[0];
875  ok = 1;
876  } else {
877  // are we on the outer ring ?
878  const int iphi ( detId.iPhiOuterRing() ) ;
879  if (iphi!= 0) {
880  // get eb nbrs for for end of endcap crystals
882  ol( * endcapGeom.getClosestBarrelCells(detId) ) ;
883  // take closest neighbour on the other side, that is in the barrel.
884  cell = *(ol.begin() );
885  neighbours = barrelTopo.getNeighbours(cell,dir);
886  if (neighbours.size()>0 && !neighbours[0].null()) ok = 1;
887  else ok =-1;
888  for (EcalEndcapGeometry::OrderedListOfEBDetId::const_iterator iptr=ol.begin(); iptr != ol.end(); ++iptr)
889  cells.push_back(*iptr);
890  }
891  }
892  }
893  if (debug) {
894  std::cout << "simpleMove:: Move DetId 0x" << std::hex << det()
895  << std::dec << " along " << dir << " to get 0x" << std::hex
896  << cell() << std::dec << " with flag " << ok << " # "
897  << cells.size();
898  for (unsigned int i1=0; i1<cells.size(); ++i1)
899  std::cout << " " << std::hex << cells[0]() << std::dec;
900  std::cout << std::endl;
901  }
902  }
903 
904  void extraIds(const DetId& det, std::vector<DetId>& dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry& barrelGeom, const EcalEndcapGeometry& endcapGeom, std::vector<DetId>& cells, bool debug) {
905 
906  if (det.subdetId() == EcalBarrel) {
907  EBDetId id = det;
908  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
909  << "|" << ietaE << " columns " << iphiS << "|"
910  << iphiN << std::endl;
911  int etaC = id.ietaAbs();
912  int phiC = id.iphi();
913  int zsid = id.zside();
914  for (int eta = -ietaW; eta <= ietaE; ++eta) {
915  for (int phi = -iphiS; phi <= iphiN; ++phi) {
916  int iphi = phiC+phi;
917  if (iphi < 0) iphi += 360;
918  else if (iphi > 360) iphi -= 360;
919  int ieta = zsid*(etaC+eta);
920  if (EBDetId::validDetId(ieta,iphi)) {
921  id = EBDetId(ieta,iphi);
922  if (barrelGeom.present(id)) {
923  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
924  cells.push_back((DetId)id);
925  }
926  }
927  }
928  }
929  }
930  } else if (det.subdetId() == EcalEndcap) {
931  EEDetId id = det;
932  if (debug) std::cout << "extraIds::Cell " << id << " rows " << ietaW
933  << "|" << ietaE << " columns " << iphiS << "|"
934  << iphiN << std::endl;
935  int ixC = id.ix();
936  int iyC = id.iy();
937  int zsid = id.zside();
938  for (int kx = -ietaW; kx <= ietaE; ++kx) {
939  for (int ky = -iphiS; ky <= iphiN; ++ky) {
940  int ix = ixC+kx;
941  int iy = iyC+ky;
942  if (EEDetId::validDetId(ix,iy,zsid)) {
943  id = EEDetId(ix,iy,zsid);
944  if (endcapGeom.present(id)) {
945  if (std::count(dets.begin(),dets.end(),(DetId)id) == 0) {
946  cells.push_back((DetId)id);
947  }
948  }
949  }
950  }
951  }
952  }
953 
954  if (debug) {
955  std::cout << "extraIds:: finds " << cells.size() << " new cells"
956  << std::endl;
957  for (unsigned int i1=0; i1<cells.size(); ++i1) {
958  if (cells[i1].subdetId() == EcalBarrel) {
959  EBDetId id = cells[i1];
960  std::cout << "extraIds::Cell " << i1 << " " << id << std::endl;
961  } else if (cells[i1].subdetId() == EcalEndcap) {
962  EEDetId id = cells[i1];
963  std::cout << "ectraIds::Cell " << i1 << " " << id << std::endl;
964  } else {
965  std::cout << "extraIds::Cell " << i1 << " 0x" << std::hex
966  << cells[i1]() <<std::dec << " Unknown Type" <<std::endl;
967  }
968  }
969  }
970  }
971 }
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.cc:59
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const OrderedListOfEEDetId * getClosestEndcapCells(EBDetId id) const
long int flag
Definition: mlp_lapack.h:47
virtual std::vector< DetId > getNeighbours(const DetId &id, const CaloDirection &dir) const
void extraIds(const DetId &det, std::vector< DetId > &dets, int ietaE, int ietaW, int iphiN, int iphiS, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, bool debug=false)
T eta() const
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
std::vector< DetId > newECALIdEW(std::vector< DetId > &dets, unsigned int last, int ieta, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
virtual bool present(const DetId &id) const
is this detid present in the geometry?
int iPhiOuterRing() const
Definition: EEDetId.cc:404
const OrderedListOfEBDetId * getClosestBarrelCells(EEDetId id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false)
static const int MAX_IETA
Definition: EBDetId.h:122
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:27
void simpleMove(DetId &det, const CaloDirection &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, std::vector< DetId > &cells, int &flag, bool debug=false)
tuple cout
Definition: gather_cfg.py:41
dbl *** dir
Definition: mlp_gen.cc:35
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
#define debug
Definition: MEtoEDMFormat.h:34
std::vector< DetId > newECALIdNS(std::vector< DetId > &dets, unsigned int last, int ieta, int iphi, std::vector< CaloDirection > &dir, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorTopology &endcapTopo, const EcalBarrelGeometry &barrelGeom, const EcalEndcapGeometry &endcapGeom, bool debug=false)
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:42
Definition: DDAxes.h:10