CMS 3D CMS Logo

InvRingCalib.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <cmath>
19 
22 
23 //Not to remain in the final version
24 #include "TH2.h"
25 #include "TFile.h"
26 #include <iostream>
27 //----------------------------------------------------------------
28 //ctor
29 
31  : m_barrelAlCa(iConfig.getParameter<edm::InputTag>("barrelAlca")),
32  m_endcapAlCa(iConfig.getParameter<edm::InputTag>("endcapAlca")),
33  m_ElectronLabel(iConfig.getParameter<edm::InputTag>("ElectronLabel")),
34  m_recoWindowSidex(iConfig.getParameter<int>("recoWindowSidex")),
35  m_recoWindowSidey(iConfig.getParameter<int>("recoWindowSidey")),
36  m_minEnergyPerCrystal(iConfig.getParameter<double>("minEnergyPerCrystal")),
37  m_maxEnergyPerCrystal(iConfig.getParameter<double>("maxEnergyPerCrystal")),
38  m_etaStart(iConfig.getParameter<int>("etaStart")),
39  m_etaEnd(iConfig.getParameter<int>("etaEnd")),
40  m_etaWidth(iConfig.getParameter<int>("etaWidth")),
41  m_maxSelectedNumPerRing(iConfig.getParameter<int>("maxNumPerRing")),
42  m_minCoeff(iConfig.getParameter<double>("minCoeff")),
43  m_maxCoeff(iConfig.getParameter<double>("maxCoeff")),
44  m_usingBlockSolver(iConfig.getParameter<int>("usingBlockSolver")),
45  m_startRing(iConfig.getParameter<int>("startRing")),
46  m_endRing(iConfig.getParameter<int>("endRing")),
47  m_EBcoeffFile(iConfig.getParameter<std::string>("EBcoeffs")),
48  m_EEcoeffFile(iConfig.getParameter<std::string>("EEcoeffs")),
49  m_EEZone(iConfig.getParameter<int>("EEZone")) {
50  //controls if the parameters inputed are correct
51  if ((m_etaEnd * m_etaStart) > 0)
53  if ((m_etaEnd * m_etaStart) < 0)
54  assert(!((m_etaEnd - m_etaStart - 1) % m_etaWidth));
55 
56  assert(m_etaStart >= -85 && m_etaStart <= 86);
57  assert(m_etaEnd >= m_etaStart && m_etaEnd <= 86);
58  assert(m_startRing > -1 && m_startRing <= 40);
60 
62  assert((abs(m_EEZone) <= 1));
63 
64  m_loops = (unsigned int)iConfig.getParameter<int>("loops") - 1;
65  //LP CalibBlock vector instantiation
66  edm::LogInfo("IML") << "[InvRingCalib][ctor] Calib Block";
67  std::string algorithm = iConfig.getParameter<std::string>("algorithm");
68  m_mapFillerType = iConfig.getParameter<std::string>("FillType");
69  int eventWeight = iConfig.getUntrackedParameter<int>("L3EventWeight", 1);
70 
71  for (int i = 0; i < EBRegionNum(); ++i) {
72  if (algorithm == "IMA")
74  else if (algorithm == "L3")
75  m_IMACalibBlocks.push_back(new L3CalibBlock(m_etaWidth, eventWeight));
76  else {
77  edm::LogError("building") << algorithm << " is not a valid calibration algorithm";
78  exit(1);
79  }
80  }
81  int EEBlocks = 0;
82  if (m_EEZone == 0)
83  EEBlocks = 2 * EERegionNum();
84  if (m_EEZone == 1 || m_EEZone == -1)
85  EEBlocks = EERegionNum();
86 
87  for (int i = 0; i < EEBlocks; ++i) {
88  if (algorithm == "IMA")
90  else if (algorithm == "L3")
91  m_IMACalibBlocks.push_back(new L3CalibBlock(m_etaWidth, eventWeight));
92  else {
93  edm::LogError("building") << algorithm << " is not a valid calibration algorithm";
94  exit(1);
95  }
96  }
97  edm::LogInfo("IML") << " [InvRingCalib][ctor] end of creator";
98 }
99 
100 //-------------------------------------------------------------- end ctor
102 
104 
105 //---------------------------------------------------
106 
109 
110 //--------------------------------------------------------
111 
113 void InvRingCalib::startingNewLoop(unsigned int ciclo) {
114  edm::LogInfo("IML") << "[InvMatrixCalibLooper][Start] entering loop " << ciclo;
115  for (std::vector<VEcalCalibBlock*>::iterator calibBlock = m_IMACalibBlocks.begin();
116  calibBlock != m_IMACalibBlocks.end();
117  ++calibBlock) {
118  //LP empties the energies vector, to fill DuringLoop.
119  (*calibBlock)->reset();
120  }
121  for (std::map<int, int>::const_iterator ring = m_xtalRing.begin(); ring != m_xtalRing.end(); ++ring)
122  m_RingNumOfHits[ring->second] = 0;
123  return;
124 }
125 
126 //--------------------------------------------------------
127 
130  if (isfirstcall_) {
131  edm::LogInfo("IML") << "[InvRingCalib][beginOfJob]";
132  //gets the geometry from the event setup
133  edm::ESHandle<CaloGeometry> geoHandle;
134  iSetup.get<CaloGeometryRecord>().get(geoHandle);
135  const CaloGeometry* geometry = geoHandle.product();
136  edm::LogInfo("IML") << "[InvRingCalib] Event Setup read";
137  //fills a vector with all the cells
138  m_barrelCells = geometry->getValidDetIds(DetId::Ecal, EcalBarrel);
139  m_endcapCells = geometry->getValidDetIds(DetId::Ecal, EcalEndcap);
140  //Defines the EB regions
141  edm::LogInfo("IML") << "[InvRingCalib] Defining Barrel Regions";
142  EBRegionDef();
143  //Defines what is a ring in the EE
144  edm::LogInfo("IML") << "[InvRingCalib] Defining endcap Rings";
145  EERingDef(iSetup);
146  //Defines the regions in the EE
147  edm::LogInfo("IML") << "[InvRingCalib] Defining endcap Regions";
148  EERegionDef();
149  if (m_mapFillerType == "Cluster")
156  &m_barrelMap,
157  &m_endcapMap);
158  if (m_mapFillerType == "Matrix")
165  &m_barrelMap,
166  &m_endcapMap);
167  edm::LogInfo("IML") << "[InvRingCalib] Initializing the coeffs";
168  //Sets the initial coefficients to 1.
169  //Graphs to check ring, regions and so on, not needed in the final version
170  TH2F EBRegion("EBRegion", "EBRegion", 171, -85, 86, 360, 1, 361);
171  TH2F EBRing("EBRing", "EBRing", 171, -85, 86, 360, 1, 361);
172  for (std::vector<DetId>::const_iterator it = m_barrelCells.begin(); it != m_barrelCells.end(); ++it) {
173  EBDetId eb(*it);
174  EBRing.Fill(eb.ieta(), eb.iphi(), m_RinginRegion[it->rawId()]);
175  EBRegion.Fill(eb.ieta(), eb.iphi(), m_xtalRegionId[it->rawId()]);
176  }
177 
178  TH2F EEPRegion("EEPRegion", "EEPRegion", 100, 1, 101, 100, 1, 101);
179  TH2F EEPRing("EEPRing", "EEPRing", 100, 1, 101, 100, 1, 101);
180  TH2F EEPRingReg("EEPRingReg", "EEPRingReg", 100, 1, 101, 100, 1, 101);
181  TH2F EEMRegion("EEMRegion", "EEMRegion", 100, 1, 101, 100, 1, 101);
182  TH2F EEMRing("EEMRing", "EEMRing", 100, 1, 101, 100, 1, 101);
183  TH2F EEMRingReg("EEMRingReg", "EEMRingReg", 100, 1, 101, 100, 1, 101);
184  // TH1F eta ("eta","eta",250,-85,165);
185  for (std::vector<DetId>::const_iterator it = m_endcapCells.begin(); it != m_endcapCells.end(); ++it) {
186  EEDetId ee(*it);
187  if (ee.zside() > 0) {
188  EEPRegion.Fill(ee.ix(), ee.iy(), m_xtalRegionId[ee.rawId()]);
189  EEPRing.Fill(ee.ix(), ee.iy(), m_xtalRing[ee.rawId()]);
190  EEPRingReg.Fill(ee.ix(), ee.iy(), m_RinginRegion[ee.rawId()]);
191  }
192  if (ee.zside() < 0) {
193  EEMRegion.Fill(ee.ix(), ee.iy(), m_xtalRegionId[ee.rawId()]);
194  EEMRing.Fill(ee.ix(), ee.iy(), m_xtalRing[ee.rawId()]);
195  EEMRingReg.Fill(ee.ix(), ee.iy(), m_RinginRegion[ee.rawId()]);
196  }
197  }
198 
199  // for (std::map<int,float>::iterator it=m_eta.begin();
200  // it!=m_eta.end();++it)
201  // eta.Fill(it->first,it->second);
202  TFile out("EBZone.root", "recreate");
203  EBRegion.Write();
204  EBRing.Write();
205  EEPRegion.Write();
206  EEPRing.Write();
207  EEPRingReg.Write();
208  EEMRegion.Write();
209  EEMRing.Write();
210  // eta.Write();
211  EEMRingReg.Write();
212  out.Close();
213  edm::LogInfo("IML") << "[InvRingCalib] Start to acquire the coeffs";
214  CaloMiscalibMapEcal EBmap;
215  EBmap.prefillMap();
216  MiscalibReaderFromXMLEcalBarrel barrelreader(EBmap);
217  if (!m_EBcoeffFile.empty())
218  barrelreader.parseXMLMiscalibFile(m_EBcoeffFile);
219  EcalIntercalibConstants costants(EBmap.get());
220  m_barrelMap = costants.getMap();
221  CaloMiscalibMapEcal EEmap;
222  EEmap.prefillMap();
223  MiscalibReaderFromXMLEcalEndcap endcapreader(EEmap);
224  if (!m_EEcoeffFile.empty())
225  endcapreader.parseXMLMiscalibFile(m_EEcoeffFile);
226  EcalIntercalibConstants EEcostants(EEmap.get());
227  m_endcapMap = EEcostants.getMap();
228 
229  isfirstcall_ = false;
230  } // if isfirstcall
231 
232  //gets the barrel recHits
233  double pSubtract = 0.;
234  double pTk = 0.;
235  const EcalRecHitCollection* barrelHitsCollection = nullptr;
236  edm::Handle<EBRecHitCollection> barrelRecHitsHandle;
237  iEvent.getByLabel(m_barrelAlCa, barrelRecHitsHandle);
238  barrelHitsCollection = barrelRecHitsHandle.product();
239 
240  if (!barrelRecHitsHandle.isValid()) {
241  edm::LogError("IML") << "[EcalEleCalibLooper] barrel rec hits not found";
242  return kContinue;
243  }
244  //gets the endcap recHits
245  const EcalRecHitCollection* endcapHitsCollection = nullptr;
246  edm::Handle<EERecHitCollection> endcapRecHitsHandle;
247  iEvent.getByLabel(m_endcapAlCa, endcapRecHitsHandle);
248  endcapHitsCollection = endcapRecHitsHandle.product();
249 
250  if (!endcapRecHitsHandle.isValid()) {
251  edm::LogError("IML") << "[EcalEleCalibLooper] endcap rec hits not found";
252  return kContinue;
253  }
254 
255  //gets the electrons
257  iEvent.getByLabel(m_ElectronLabel, pElectrons);
258 
259  if (!pElectrons.isValid()) {
260  edm::LogError("IML") << "[EcalEleCalibLooper] electrons not found";
261  return kContinue;
262  }
263 
264  //loops over the electrons in the event
265  for (reco::GsfElectronCollection::const_iterator eleIt = pElectrons->begin(); eleIt != pElectrons->end(); ++eleIt) {
266  pSubtract = 0;
267  pTk = eleIt->trackMomentumAtVtx().R();
268  std::map<int, double> xtlMap;
269  DetId Max = 0;
270  if (std::abs(eleIt->eta()) < 1.49)
271  Max = EcalClusterTools::getMaximum(eleIt->superCluster()->hitsAndFractions(), barrelHitsCollection).first;
272  else
273  Max = EcalClusterTools::getMaximum(eleIt->superCluster()->hitsAndFractions(), endcapHitsCollection).first;
274  if (Max.det() == 0)
275  continue;
277  eleIt->superCluster()->hitsAndFractions(), Max, barrelHitsCollection, endcapHitsCollection, xtlMap, pSubtract);
278  if (m_xtalRegionId[Max.rawId()] == -1)
279  continue;
280  pSubtract += eleIt->superCluster()->preshowerEnergy();
281  ++m_RingNumOfHits[m_xtalRing[Max.rawId()]];
282  //fills the calibBlock
283  m_IMACalibBlocks.at(m_xtalRegionId[Max.rawId()])->Fill(xtlMap.begin(), xtlMap.end(), pTk, pSubtract);
284  }
285  return kContinue;
286 } //end of duringLoop
287 
288 //-------------------------------------
289 
290 //EndOfLoop
291 edm::EDLooper::Status InvRingCalib::endOfLoop(const edm::EventSetup& dumb, unsigned int iCounter) {
292  std::map<int, double> InterRings;
293  edm::LogInfo("IML") << "[InvMatrixCalibLooper][endOfLoop] Start to invert the matrixes";
294  //call the autoexplaining "solve" method for every calibBlock
295  for (std::vector<VEcalCalibBlock*>::iterator calibBlock = m_IMACalibBlocks.begin();
296  calibBlock != m_IMACalibBlocks.end();
297  ++calibBlock)
298  (*calibBlock)->solve(m_usingBlockSolver, m_minCoeff, m_maxCoeff);
299 
300  edm::LogInfo("IML") << "[InvRingLooper][endOfLoop] Starting to write the coeffs";
301  TH1F* coeffDistr = new TH1F("coeffdistr", "coeffdistr", 100, 0.7, 1.4);
302  TH1F* coeffMap = new TH1F("coeffRingMap", "coeffRingMap", 250, -85, 165);
303  TH1F* ringDistr = new TH1F("ringDistr", "ringDistr", 250, -85, 165);
304  TH1F* RingFill = new TH1F("RingFill", "RingFill", 250, -85, 165);
305  for (std::map<int, int>::const_iterator it = m_xtalRing.begin(); it != m_xtalRing.end(); ++it)
306  ringDistr->Fill(it->second + 0.1);
307 
308  int ID;
309  std::map<int, int> flag;
310  for (std::map<int, int>::const_iterator it = m_xtalRing.begin(); it != m_xtalRing.end(); ++it)
311  flag[it->second] = 0;
312 
313  for (std::vector<DetId>::const_iterator it = m_barrelCells.begin(); it != m_barrelCells.end(); ++it) {
314  ID = it->rawId();
315  if (m_xtalRegionId[ID] == -1)
316  continue;
317  if (flag[m_xtalRing[ID]])
318  continue;
319  flag[m_xtalRing[ID]] = 1;
320  RingFill->Fill(m_xtalRing[ID], m_RingNumOfHits[m_xtalRing[ID]]);
321  InterRings[m_xtalRing[ID]] = m_IMACalibBlocks.at(m_xtalRegionId[ID])->at(m_RinginRegion[ID]);
322  coeffMap->Fill(m_xtalRing[ID] + 0.1, InterRings[m_xtalRing[ID]]);
323  coeffDistr->Fill(InterRings[m_xtalRing[ID]]);
324  }
325 
326  for (std::vector<DetId>::const_iterator it = m_endcapCells.begin(); it != m_endcapCells.end(); ++it) {
327  ID = it->rawId();
328  if (m_xtalRegionId[ID] == -1)
329  continue;
330  if (flag[m_xtalRing[ID]])
331  continue;
332  flag[m_xtalRing[ID]] = 1;
333  InterRings[m_xtalRing[ID]] = m_IMACalibBlocks.at(m_xtalRegionId[ID])->at(m_RinginRegion[ID]);
334  RingFill->Fill(m_xtalRing[ID], m_RingNumOfHits[m_xtalRing[ID]]);
335  coeffMap->Fill(m_xtalRing[ID], InterRings[m_xtalRing[ID]]);
336  coeffDistr->Fill(InterRings[m_xtalRing[ID]]);
337  }
338 
339  char filename[80];
340  sprintf(filename, "coeff%d.root", iCounter);
341  TFile out(filename, "recreate");
342  coeffDistr->Write();
343  coeffMap->Write();
344  ringDistr->Write();
345  RingFill->Write();
346  out.Close();
347  for (std::vector<DetId>::const_iterator it = m_barrelCells.begin(); it != m_barrelCells.end(); ++it) {
348  m_barrelMap[*it] *= InterRings[m_xtalRing[it->rawId()]];
349  }
350  for (std::vector<DetId>::const_iterator it = m_endcapCells.begin(); it != m_endcapCells.end(); ++it)
351  m_endcapMap[*it] *= InterRings[m_xtalRing[it->rawId()]];
352  if (iCounter < m_loops - 1)
353  return kContinue;
354  else
355  return kStop;
356 }
357 
358 //---------------------------------------
359 
360 //LP endOfJob
362  edm::LogInfo("IML") << "[InvMatrixCalibLooper][endOfJob] saving calib coeffs";
363  calibXMLwriter barrelWriter(EcalBarrel);
364  calibXMLwriter endcapWriter(EcalEndcap);
365  for (std::vector<DetId>::const_iterator barrelIt = m_barrelCells.begin(); barrelIt != m_barrelCells.end();
366  ++barrelIt) {
367  EBDetId eb(*barrelIt);
368  barrelWriter.writeLine(eb, m_barrelMap[eb]);
369  }
370  for (std::vector<DetId>::const_iterator endcapIt = m_endcapCells.begin(); endcapIt != m_endcapCells.end();
371  ++endcapIt) {
372  EEDetId ee(*endcapIt);
373  endcapWriter.writeLine(ee, m_endcapMap[ee]);
374  }
375 }
376 
377 //------------------------------------//
378 // definition of functions //
379 //------------------------------------//
380 
381 //------------------------------------------------------------
382 
385  //Gets the Handle for the geometry from the eventSetup
386  edm::ESHandle<CaloGeometry> geoHandle;
387  iSetup.get<CaloGeometryRecord>().get(geoHandle);
388  //Gets the geometry of the endcap
389  const CaloGeometry* geometry = geoHandle.product();
390  const CaloSubdetectorGeometry* endcapGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
391  // const CaloSubdetectorGeometry *barrelGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
392  //for every xtal gets the position Vector and the phi position
393 
394  // for (std::vector<DetId>::const_iterator barrelIt = m_barrelCells.begin();
395  // barrelIt!=m_barrelCells.end();
396  // ++barrelIt) {
397  // const CaloCellGeometry *cellGeometry = barrelGeometry->getGeometry(*barrelIt);
398  // GlobalPoint point;
399  // EBDetId eb (*barrelIt);
400  // point=cellGeometry->getPosition();
401  // m_eta[eb.ieta()]=point.eta() ; //cellGeometry->getPosition().eta();
402  // }
403  for (std::vector<DetId>::const_iterator endcapIt = m_endcapCells.begin(); endcapIt != m_endcapCells.end();
404  ++endcapIt) {
405  auto cellGeometry = endcapGeometry->getGeometry(*endcapIt);
406  m_cellPos[endcapIt->rawId()] = cellGeometry->getPosition();
407  m_cellPhi[endcapIt->rawId()] = cellGeometry->getPosition().phi();
408  }
409  //takes the first 39 xtals at a fixed y varying the x coordinate and saves their eta coordinate
410  float eta_ring[39];
411  for (int ring = 0; ring < 39; ring++)
412  if (EEDetId::validDetId(ring, 50, 1)) {
413  EEDetId det = EEDetId(ring, 50, 1, EEDetId::XYMODE);
414  eta_ring[ring] = m_cellPos[det.rawId()].eta();
415  }
416  //defines the bonduary of the rings as the average eta of a xtal
417  double etaBonduary[40];
418  etaBonduary[0] = 1.49;
419  etaBonduary[39] = 4.0;
420  for (int ring = 1; ring < 39; ++ring)
421  etaBonduary[ring] = (eta_ring[ring] + eta_ring[ring - 1]) / 2.;
422  //assign to each xtal a ring number
423  int CRing;
424  for (int ring = 0; ring < 39; ring++)
425  for (std::vector<DetId>::const_iterator endcapIt = m_endcapCells.begin(); endcapIt != m_endcapCells.end();
426  ++endcapIt) {
427  if (fabs(m_cellPos[endcapIt->rawId()].eta()) > etaBonduary[ring] &&
428  fabs(m_cellPos[endcapIt->rawId()].eta()) < etaBonduary[ring + 1]) {
429  EEDetId ee(*endcapIt);
430  if (ee.zside() > 0)
431  CRing = ring + 86;
432  else
433  CRing = ring + 125;
434  m_xtalRing[endcapIt->rawId()] = CRing;
435  // m_eta[CRing]=m_cellPos[endcapIt->rawId()].eta();
436  }
437  }
438  return;
439 }
440 
441 //------------------------------------------------------------
442 
445  int reg;
446  int ring;
447  EEDetId ee(id);
448  //sets the reg to -1 if the ring doesn't exist or is outside the region of interest
449  if (m_xtalRing[id] == -1)
450  return -1;
451  //avoid the calibration in the wrong zside
452  if (m_EEZone == 1) {
453  if (ee.zside() < 0)
454  return -1;
455  ring = m_xtalRing[id] - 86;
456  if (ring >= m_endRing)
457  return -1;
458  if (ring < m_startRing)
459  return -1;
460  reg = (ring - m_startRing) / m_etaWidth;
462  return reg;
463  }
464  if (m_EEZone == -1) {
465  if (ee.zside() > 0)
466  return -1;
467  ring = m_xtalRing[id] - 125;
468  if (ring >= m_endRing)
469  return -1;
470  if (ring < m_startRing)
471  return -1;
472  reg = (ring - m_startRing) / m_etaWidth;
474  return reg;
475  }
476  if (ee.zside() > 0)
477  ring = m_xtalRing[id] - 86;
478  else
479  ring = m_xtalRing[id] - 125;
480  if (ring >= m_endRing)
481  return -1;
482  if (ring < m_startRing)
483  return -1;
484  reg = (ring - m_startRing) / m_etaWidth;
486  return reg;
487 }
488 //----------------------------------------
492  int reg;
493  for (std::vector<DetId>::const_iterator endcapIt = m_endcapCells.begin(); endcapIt != m_endcapCells.end();
494  ++endcapIt) {
495  EEDetId ee(*endcapIt);
496  reg = EERegId(endcapIt->rawId());
497  //If the ring is not of interest saves only the region Id(-1)
498  if (reg == -1)
499  m_xtalRegionId[endcapIt->rawId()] = reg;
500  //sums the number of region in EB or EB+EE to have different regionsId in different regions
501  else {
502  if (ee.zside() > 0)
503  reg += EBRegionNum();
504  else
505  reg += EBRegionNum() + EERegionNum();
506  m_xtalRegionId[endcapIt->rawId()] = reg;
507  }
508  }
509 }
510 
511 //------------------------------------------------------------
512 
514 inline int InvRingCalib::EERegionNum() const { return ((m_endRing - m_startRing) / m_etaWidth); }
515 
518  if ((m_etaEnd * m_etaStart) > 0)
519  return ((m_etaEnd - m_etaStart) / m_etaWidth);
520 
521  if ((m_etaEnd * m_etaStart) < 0)
522  return ((m_etaEnd - m_etaStart - 1) / m_etaWidth);
523 
524  return 0;
525 }
529  int k = 0;
530  for (int i = m_etaStart; i < m_etaEnd; ++i) {
531  if (i == 0)
532  continue;
533  m_Reg[i] = k / m_etaWidth;
534  ++k;
535  }
536 }
538 int InvRingCalib::EBRegId(const int ieta) {
539  if (ieta < m_etaStart || ieta >= m_etaEnd)
540  return -1;
541  else
542  return (m_Reg[ieta]);
543 }
544 
545 //------------------------------------------------------------
546 
547 //EB Region Definition
549  RegPrepare();
550  for (std::vector<DetId>::const_iterator it = m_barrelCells.begin(); it != m_barrelCells.end(); ++it) {
551  EBDetId eb(it->rawId());
552  m_xtalRing[eb.rawId()] = eb.ieta();
553  m_xtalRegionId[eb.rawId()] = EBRegId(eb.ieta());
554  if (m_xtalRegionId[eb.rawId()] == -1)
555  continue;
556  m_RinginRegion[eb.rawId()] = (eb.ieta() - m_etaStart) % m_etaWidth;
557  }
558 }
559 //------------------------------------------------------------
EcalCondObjectContainer::getMap
const self & getMap() const
Definition: EcalCondObjectContainer.h:80
InvRingCalib::m_etaWidth
int m_etaWidth
eta size of the regions
Definition: InvRingCalib.h:80
InvRingCalib::m_EBcoeffFile
std::string m_EBcoeffFile
coeffs filenames
Definition: InvRingCalib.h:117
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::EDLooperBase::Status
Status
Definition: EDLooperBase.h:79
InvRingCalib::m_barrelAlCa
edm::InputTag m_barrelAlCa
EcalBarrel Input Collection name.
Definition: InvRingCalib.h:63
Handle.h
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
mps_fire.i
i
Definition: mps_fire.py:428
calibXMLwriter
Definition: calibXMLwriter.h:15
InvRingCalib::m_minEnergyPerCrystal
double m_minEnergyPerCrystal
minimum energy per crystal cut
Definition: InvRingCalib.h:72
edm::Handle::product
T const * product() const
Definition: Handle.h:70
InvRingCalib::m_recoWindowSidex
int m_recoWindowSidex
reconstruction window size
Definition: InvRingCalib.h:69
InvRingCalib::RegPrepare
void RegPrepare()
Prepares the EB regions;.
Definition: InvRingCalib.cc:528
CaloMiscalibMapEcal::get
const EcalIntercalibConstants & get()
Definition: CaloMiscalibMapEcal.h:90
ESHandle.h
InvRingCalib::m_RingNumOfHits
std::map< int, int > m_RingNumOfHits
number of events already read per Ring
Definition: InvRingCalib.h:85
L3CalibBlock.h
BasicCluster.h
InvRingCalib::m_loops
unsigned int m_loops
LP sets the number of loops to do.
Definition: InvRingCalib.h:102
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
InvRingCalib::m_endRing
int m_endRing
Definition: InvRingCalib.h:105
MiscalibReaderFromXMLEcalBarrel.h
geometry
Definition: geometry.py:1
InvRingCalib::m_etaStart
int m_etaStart
eta start of the zone of interest
Definition: InvRingCalib.h:76
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
InvRingCalib::m_etaEnd
int m_etaEnd
eta end of the zone of interest
Definition: InvRingCalib.h:78
cms::cuda::assert
assert(be >=bs)
InvRingCalib::m_RinginRegion
std::map< int, int > m_RinginRegion
association map between raw detIds and the number of the ring inside the region
Definition: InvRingCalib.h:111
edm::SortedCollection< EcalRecHit >
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ClusterFillMap
Definition: ClusterFillMap.h:7
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
CaloMiscalibMapEcal::prefillMap
void prefillMap()
Definition: CaloMiscalibMapEcal.h:20
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EEDetId::ix
int ix() const
Definition: EEDetId.h:77
edm::Handle
Definition: AssociativeIterator.h:50
InvRingCalib::m_recoWindowSidey
int m_recoWindowSidey
Definition: InvRingCalib.h:70
dqmdumpme.first
first
Definition: dqmdumpme.py:55
InvRingCalib::EBRegionNum
int EBRegionNum() const
Number of regions in EB.
Definition: InvRingCalib.cc:517
EcalBarrel
Definition: EcalSubdetector.h:10
InvRingCalib::EERingDef
void EERingDef(const edm::EventSetup &)
Defines the rins in the endcap.
Definition: InvRingCalib.cc:384
InvRingCalib::m_xtalRegionId
std::map< int, int > m_xtalRegionId
association map between raw detIds and Region
Definition: InvRingCalib.h:109
MiscalibReaderFromXMLEcalEndcap.h
InvRingCalib::isfirstcall_
bool isfirstcall_
Definition: InvRingCalib.h:124
DetId
Definition: DetId.h:17
InvRingCalib::EERegionNum
int EERegionNum() const
The number of regions in EE.
Definition: InvRingCalib.cc:514
MakerMacros.h
CaloGeometry
Definition: CaloGeometry.h:21
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
InvRingCalib::m_cellPhi
std::map< int, int > m_cellPhi
Definition: InvRingCalib.h:96
InvRingCalib::m_EEcoeffFile
std::string m_EEcoeffFile
Definition: InvRingCalib.h:118
edm::EDLooperBase::kStop
Definition: EDLooperBase.h:79
InvRingCalib::endOfLoop
Status endOfLoop(const edm::EventSetup &, unsigned int iCounter) override
Definition: InvRingCalib.cc:291
InvRingCalib::m_EEZone
int m_EEZone
endcap zone to be calibrated
Definition: InvRingCalib.h:120
calibXMLwriter::writeLine
void writeLine(EBDetId const &, float)
Definition: calibXMLwriter.cc:32
ClusterFillMap.h
edm::ESHandle< CaloGeometry >
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
InvRingCalib::beginOfJob
void beginOfJob() override
BeginOfJob.
Definition: InvRingCalib.cc:108
calibXMLwriter.h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
EEDetId::zside
int zside() const
Definition: EEDetId.h:71
InvRingCalib::EERegId
int EERegId(int)
gives back in which region of the endcap you are.
Definition: InvRingCalib.cc:444
EEDetId
Definition: EEDetId.h:14
CaloGeometryRecord.h
InvRingCalib::endOfJob
void endOfJob() override
Definition: InvRingCalib.cc:361
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
MiscalibReaderFromXMLEcalBarrel
Definition: MiscalibReaderFromXMLEcalBarrel.h:8
InvRingCalib::m_IMACalibBlocks
std::vector< VEcalCalibBlock * > m_IMACalibBlocks
single blocks calibrators
Definition: InvRingCalib.h:87
IMACalibBlock
Definition: IMACalibBlock.h:22
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
GsfElectronFwd.h
CaloMiscalibMapEcal
Definition: CaloMiscalibMapEcal.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
align::ID
uint32_t ID
Definition: Definitions.h:24
InvRingCalib.h
InvRingCalib::startingNewLoop
void startingNewLoop(unsigned int) override
startingNewLoop
Definition: InvRingCalib.cc:113
InvRingCalib::m_minCoeff
double m_minCoeff
minimum coefficient accepted (RAW)
Definition: InvRingCalib.h:89
EcalClusterTools.h
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
InvRingCalib::m_ElectronLabel
edm::InputTag m_ElectronLabel
To take the electrons.
Definition: InvRingCalib.h:67
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
InvRingCalib::m_cellPos
std::map< int, GlobalPoint > m_cellPos
position of the cell, borders, coords etc...
Definition: InvRingCalib.h:95
InvRingCalib::m_barrelMap
EcalIntercalibConstantMap m_barrelMap
Definition: InvRingCalib.h:99
InvRingCalib::m_endcapCells
std::vector< DetId > m_endcapCells
Definition: InvRingCalib.h:115
MiscalibReaderFromXMLEcalEndcap
Definition: MiscalibReaderFromXMLEcalEndcap.h:8
Max
T Max(T a, T b)
Definition: MathUtil.h:44
CaloSubdetectorGeometry::getGeometry
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: CaloSubdetectorGeometry.cc:36
edm::EventSetup
Definition: EventSetup.h:57
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:79
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
get
#define get
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:27
EEDetId::iy
int iy() const
Definition: EEDetId.h:83
InvRingCalib::m_MapFiller
VFillMap * m_MapFiller
The class that fills the map!
Definition: InvRingCalib.h:59
InvRingCalib::InvRingCalib
InvRingCalib(const edm::ParameterSet &)
ctor
Definition: InvRingCalib.cc:30
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
InvRingCalib::m_barrelCells
std::vector< DetId > m_barrelCells
geometry things used all over the file
Definition: InvRingCalib.h:114
InvRingCalib::duringLoop
Status duringLoop(const edm::Event &, const edm::EventSetup &) override
duringLoop
Definition: InvRingCalib.cc:129
InvRingCalib::m_maxCoeff
double m_maxCoeff
maximum coefficient accepted (RAW)
Definition: InvRingCalib.h:91
L3CalibBlock
interface to the L3Univ class for testing
Definition: L3CalibBlock.h:24
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EEDetId::XYMODE
static const int XYMODE
Definition: EEDetId.h:335
Frameworkfwd.h
MatrixFillMap
Definition: MatrixFillMap.h:7
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
InvRingCalib::m_endcapAlCa
edm::InputTag m_endcapAlCa
EcalEndcap Input Collection name.
Definition: InvRingCalib.h:65
SuperCluster.h
InvRingCalib::EBRegId
int EBRegId(const int)
Gives back in which region you are:
Definition: InvRingCalib.cc:538
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
InvRingCalib::m_usingBlockSolver
int m_usingBlockSolver
to exclude the blocksolver
Definition: InvRingCalib.h:93
VFillMap::fillMap
virtual void fillMap(const std::vector< std::pair< DetId, float > > &, const DetId, const EcalRecHitCollection *, const EcalRecHitCollection *, std::map< int, double > &xtlMap, double &)=0
The Map filler.
InvRingCalib::m_xtalRing
std::map< int, int > m_xtalRing
association map between Raw detIds and Rings
Definition: InvRingCalib.h:107
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
InvRingCalib::m_mapFillerType
std::string m_mapFillerType
Definition: InvRingCalib.h:123
ecalIM::coeffMap
std::map< int, CalibCoeff > coeffMap
Definition: InvMatrixCommonDefs.h:22
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
MiscalibReaderFromXML::parseXMLMiscalibFile
bool parseXMLMiscalibFile(std::string configFile)
Definition: MiscalibReaderXML.cc:69
MatrixFillMap.h
InvRingCalib::EERegionDef
void EERegionDef()
Defines the regions in the endcap.
Definition: InvRingCalib.cc:491
InvRingCalib::m_startRing
int m_startRing
LP define the EE region to calibrate.
Definition: InvRingCalib.h:104
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
InvRingCalib::m_maxEnergyPerCrystal
double m_maxEnergyPerCrystal
maximum energy per crystal cut
Definition: InvRingCalib.h:74
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
InvRingCalib::~InvRingCalib
~InvRingCalib() override
dtor
Definition: InvRingCalib.cc:103
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
ParameterSet.h
IMACalibBlock.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
InvRingCalib::EBRegionDef
void EBRegionDef()
Defines the regions in the barrel.
Definition: InvRingCalib.cc:548
InvRingCalib::m_Reg
std::map< int, int > m_Reg
EB regions vs. eta index.
Definition: InvRingCalib.h:122
InvRingCalib::m_endcapMap
EcalIntercalibConstantMap m_endcapMap
Definition: InvRingCalib.h:100
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116