CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalEleCalibLooper.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <cmath>
3 #include <iostream>
26 #include "TH1.h"
27 #include "TH2.h"
28 #include "TFile.h"
29 
30 
31 
32 //----------------------------------------------------------------
33 
34 
37  m_barrelAlCa (iConfig.getParameter<edm::InputTag> ("alcaBarrelHitCollection")) ,
38  m_endcapAlCa (iConfig.getParameter<edm::InputTag> ("alcaEndcapHitCollection")) ,
39  m_recoWindowSidex (iConfig.getParameter<int> ("recoWindowSidex")) ,
40  m_recoWindowSidey (iConfig.getParameter<int> ("recoWindowSidey")) ,
41  m_etaWidth (iConfig.getParameter<int> ("etaWidth")) ,
42  m_phiWidthEB (iConfig.getParameter<int> ("phiWidthEB")) ,
43  m_etaStart (etaShifter (iConfig.getParameter<int> ("etaStart"))) ,
44  m_etaEnd (etaShifter (iConfig.getParameter<int> ("etaEnd"))) ,
45  m_phiStartEB (iConfig.getParameter<int> ("phiStartEB")) ,
46  m_phiEndEB (iConfig.getParameter<int> ("phiEndEB")),
47  m_radStart (iConfig.getParameter<int> ("radStart")) ,
48  m_radEnd (iConfig.getParameter<int> ("radEnd")) ,
49  m_radWidth (iConfig.getParameter<int> ("radWidth")) ,
50  m_phiStartEE (iConfig.getParameter<int> ("phiStartEE")) ,
51  m_phiEndEE (iConfig.getParameter<int> ("phiEndEE")) ,
52  m_phiWidthEE (iConfig.getParameter<int> ("phiWidthEE")) ,
53  m_maxSelectedNumPerXtal (iConfig.getParameter<int> ("maxSelectedNumPerCrystal")) ,
54  m_minEnergyPerCrystal (iConfig.getParameter<double> ("minEnergyPerCrystal")),
55  m_maxEnergyPerCrystal (iConfig.getParameter<double> ("maxEnergyPerCrystal")) ,
56  m_minCoeff (iConfig.getParameter<double> ("minCoeff")) ,
57  m_maxCoeff (iConfig.getParameter<double> ("maxCoeff")) ,
58  m_usingBlockSolver (iConfig.getParameter<int> ("usingBlockSolver")) ,
59  m_loops (iConfig.getParameter<int> ("loops")),
60  m_ElectronLabel (iConfig.getParameter<edm::InputTag> ("electronLabel"))
61 {
62  edm::LogInfo ("IML") << "[EcalEleCalibLooper][ctor] asserts" ;
63  assert (!((m_etaEnd - m_etaStart )%m_etaWidth));
64 
65  assert (m_etaStart >=0 && m_etaStart <= 171);
66  assert (m_etaEnd >= m_etaStart && m_etaEnd <= 171);
67  assert ( (m_radEnd - m_radStart)%m_radWidth == 0) ;
68  assert (m_radStart >=0 && m_radStart <= 50);
69  assert (m_radEnd >= m_radStart && m_radEnd <= 50);
70  edm::LogInfo ("IML") << "[EcalEleCalibLooper][ctor] entering " ;
71  edm::LogInfo ("IML") << "[EcalEleCalibLooper][ctor] region definition" ;
75  TH2F * EBRegion = new TH2F ("EBRegion","EBRegion",170,0,170,360,0,360) ;
76  for (int eta = 0; eta<170; ++eta)
77  for (int phi = 0; phi <360; ++phi){
78  EBRegion->Fill (eta, phi,m_xtalRegionId[EBDetId::unhashIndex(eta*360+phi).rawId()] );
79  }
80  TH2F * EERegion = new TH2F ("EERegion", "EERegion",100,0,100,100,0,100);
81  for (int x = 0; x<100; ++x)
82  for (int y = 0; y<100;++y){
83  if(EEDetId::validDetId(x+1,y+1,1))
84  EERegion->Fill(x,y,m_xtalRegionId[EEDetId(x+1,y+1,-1).rawId()]);
85  }
86 
87  TFile out ("EBZone.root", "recreate");
88  EBRegion->Write ();
89  EERegion->Write ();
90  out.Close ();
91  delete EERegion;
92  delete EBRegion;
94 
95  //PG build the calibration algorithms for the regions
96  //PG ------------------------------------------------
97 
98  edm::LogInfo ("IML") << "[EcalEleCalibLooper][ctor] Calib Block" ;
99  std::string algorithm = iConfig.getParameter<std::string> ("algorithm") ;
100  int eventWeight = iConfig.getUntrackedParameter<int> ("L3EventWeight",1) ;
101 
102  //PG loop over the regions set
103  for (int region = 0 ;
104  region < EBregionsNum () + 2 * EEregionsNum () ;
105  ++region)
106  {
107  if (algorithm == "IMA")
108  m_EcalCalibBlocks.push_back (
109  new IMACalibBlock (m_regions.at (region))
110  ) ;
111  else if (algorithm == "L3")
112  m_EcalCalibBlocks.push_back (
113  new L3CalibBlock (m_regions.at (region), eventWeight)
114  ) ;
115  else
116  {
117  edm::LogError ("building") << algorithm
118  << " is not a valid calibration algorithm" ;
119  exit (1) ;
120  }
121  } //PG loop over the regions set
122  std::string mapFiller = iConfig.getParameter<std::string> ("FillType");
123  if (mapFiller == "Cluster") m_MapFiller= new ClusterFillMap (
127  & m_barrelMap ,
128  & m_endcapMap );
129  if (mapFiller == "Matrix") m_MapFiller = new MatrixFillMap (
133  & m_barrelMap ,
134  & m_endcapMap);
135  } //end ctor
136 
137 
138 //---------------------------------------------------------------------------
139 
140 
143 {
144  edm::LogInfo ("IML") << "[EcalEleCalibLooper][dtor]" ;
145  for (std::vector<VEcalCalibBlock *>::iterator calibBlock = m_EcalCalibBlocks.begin () ;
146  calibBlock != m_EcalCalibBlocks.end () ;
147  ++calibBlock)
148  delete (*calibBlock) ;
149 
150 }
151 
152 
153 //---------------------------------------------------------------------------
154 
155 
157 void
159 {
160  isfirstcall_=true;
161 
162 }
163 
164 
165 //----------------------------------------------------------------------
166 
167 
170 void EcalEleCalibLooper::startingNewLoop (unsigned int ciclo)
171 {
172  edm::LogInfo ("IML") << "[InvMatrixCalibLooper][Start] entering loop " << ciclo;
173 
174 
175 
176  for (std::vector<VEcalCalibBlock *>::iterator calibBlock = m_EcalCalibBlocks.begin () ;
177  calibBlock != m_EcalCalibBlocks.end () ;
178  ++calibBlock)
179  (*calibBlock)->reset ();
180  for (std::map<int,int>::iterator it= m_xtalNumOfHits.begin();
181  it!=m_xtalNumOfHits.end();
182  ++it)
183  it->second = 0 ;
184  return ;
185 }
186 
187 
188 //----------------------------------------------------------------------
189 
190 
195  const edm::EventSetup& iSetup)
196 {
197 
198  // this chunk used to belong to beginJob(isetup). Moved here
199  // with the beginJob without arguments migration
200 
201  if (isfirstcall_){
202  edm::ESHandle<CaloGeometry> geoHandle;
203  iSetup.get<CaloGeometryRecord> ().get (geoHandle);
204  const CaloGeometry& geometry = *geoHandle;
207  for (std::vector<DetId>::const_iterator barrelIt=m_barrelCells.begin();
208  barrelIt!=m_barrelCells.end();++barrelIt){
209  m_barrelMap[*barrelIt]=1;
210  m_xtalNumOfHits[barrelIt->rawId()]=0;
211  }
212  for (std::vector<DetId>::const_iterator endcapIt=m_endcapCells.begin();
213  endcapIt!=m_endcapCells.end();++endcapIt){
214  m_endcapMap[*endcapIt]=1;
215  m_xtalNumOfHits[endcapIt->rawId()]=0;
216  }
217 
218  isfirstcall_=false;
219  }
220 
221 
222 
223  //take the collection of recHits in the barrel
224  const EBRecHitCollection* barrelHitsCollection = 0;
225  edm::Handle<EBRecHitCollection> barrelRecHitsHandle ;
226  iEvent.getByLabel (m_barrelAlCa, barrelRecHitsHandle) ;
227  barrelHitsCollection = barrelRecHitsHandle.product () ;
228  if (!barrelRecHitsHandle.isValid ()) {
229  edm::LogError ("reading") << "[EcalEleCalibLooper] barrel rec hits not found" ;
230  return kContinue ;
231  }
232 
233  //take the collection of rechis in the endcap
234  const EERecHitCollection * endcapHitsCollection = 0 ;
235  edm::Handle<EERecHitCollection> endcapRecHitsHandle ;
236  iEvent.getByLabel (m_endcapAlCa, endcapRecHitsHandle) ;
237  endcapHitsCollection = endcapRecHitsHandle.product () ;
238  if (!endcapRecHitsHandle.isValid ()) {
239  edm::LogError ("reading") << "[EcalEleCalibLooper] endcap rec hits not found" ;
240  return kContinue;
241  }
242 
243  //Takes the electron collection of the pixel detector
245  iEvent.getByLabel (m_ElectronLabel,pElectrons);
246  if (!pElectrons.isValid ()) {
247  edm::LogError ("reading")<< "[EcalEleCalibLooper] electrons not found" ;
248  return kContinue;
249  }
250 
251  //Start the loop over the electrons
252  for (reco::GsfElectronCollection::const_iterator eleIt = pElectrons->begin ();
253  eleIt != pElectrons->end ();
254  ++eleIt )
255  {
256  double pSubtract = 0 ;
257  double pTk = 0 ;
258  std::map<int , double> xtlMap;
259  DetId Max =0;
260  if (fabs(eleIt->eta()<1.49))
261  Max = EcalClusterTools::getMaximum(eleIt->superCluster()->hitsAndFractions(),barrelHitsCollection).first;
262  else
263  Max = EcalClusterTools::getMaximum(eleIt->superCluster()->hitsAndFractions(),endcapHitsCollection).first;
264  if (Max.det()==0) continue;
265  m_MapFiller->fillMap(eleIt->superCluster ()->hitsAndFractions (),Max,
266  barrelHitsCollection,endcapHitsCollection, xtlMap,pSubtract);
267  if (m_maxSelectedNumPerXtal > 0 &&
268  m_xtalNumOfHits[Max.rawId ()] > m_maxSelectedNumPerXtal ) continue;
269  ++m_xtalNumOfHits[Max.rawId()];
270  if (m_xtalRegionId[Max.rawId()]==-1) continue;
271  pTk = eleIt->trackMomentumAtVtx ().R ();
272  m_EcalCalibBlocks.at (m_xtalRegionId[Max.rawId()])->Fill (xtlMap.begin (),
273  xtlMap.end (),pTk,pSubtract) ;
274  } //End of the loop over the electron collection
275 
276  return kContinue;
277 } //end of duringLoop
278 
279 
280 //----------------------------------------------------------------------
281 
282 
287 {
288  edm::LogInfo ("IML") << "[InvMatrixCalibLooper][endOfLoop] entering..." ;
289  for (std::vector<VEcalCalibBlock *>::iterator calibBlock = m_EcalCalibBlocks.begin ();
290  calibBlock!=m_EcalCalibBlocks.end ();
291  ++calibBlock)
292  (*calibBlock)->solve (m_usingBlockSolver, m_minCoeff,m_maxCoeff);
293 
294  TH1F * EBcoeffEnd = new TH1F ("EBRegion","EBRegion",100,0.5,2.1) ;
295  TH2F * EBcoeffMap = new TH2F ("EBcoeff","EBcoeff",171,-85,85,360,1,361);
296  TH1F * EEPcoeffEnd = new TH1F ("EEPRegion", "EEPRegion",100,0.5,2.1);
297  TH1F * EEMcoeffEnd = new TH1F ("EEMRegion", "EEMRegion",100,0.5,2.1);
298  TH2F * EEPcoeffMap = new TH2F ("EEPcoeffMap","EEPcoeffMap",101,1,101,101,0,101);
299  TH2F * EEMcoeffMap = new TH2F ("EEMcoeffMap","EEMcoeffMap",101,1,101,101,0,101);
300  //loop over the barrel xtals to get the coeffs
301  for (std::vector<DetId>::const_iterator barrelIt=m_barrelCells.begin();
302  barrelIt!=m_barrelCells.end();++barrelIt)
303  {
304  EBDetId ee (*barrelIt);
305  int index= barrelIt->rawId();
306  if(m_xtalRegionId[index]==-1)continue;
307  m_barrelMap[*barrelIt] *=
309  EBcoeffEnd->Fill(m_barrelMap[*barrelIt]);
310  EBcoeffMap->Fill(ee.ieta(),ee.iphi(),m_barrelMap[*barrelIt]);
311  } //PG loop over phi
312 
313  // loop over the EndCap to get the recalib coefficients
314  for(std::vector<DetId>::const_iterator endcapIt=m_endcapCells.begin();
315  endcapIt!=m_endcapCells.end();++endcapIt)
316  {
317  EEDetId ee (*endcapIt);
318  int index =endcapIt->rawId();
319  if (ee.zside()>0)
320  {
321  if (m_xtalRegionId[index]==-1) continue ;
322  m_endcapMap[*endcapIt] *=
324  EEPcoeffEnd->Fill (m_endcapMap[*endcapIt]) ;
325  EEPcoeffMap->Fill (ee.ix(),ee.iy(),m_endcapMap[*endcapIt]) ;
326  }
327  else
328  {
329  m_endcapMap[*endcapIt] *=
331  EEMcoeffEnd->Fill (m_endcapMap[*endcapIt]) ;
332  EEMcoeffMap->Fill (ee.ix(),ee.iy(),m_endcapMap[*endcapIt]) ;
333  }
334  } // loop over the EndCap to get the recalib coefficients
335 
336  edm::LogInfo ("IML") << "[InvMatrixCalibLooper][endOfLoop] End of endOfLoop" ;
337 
338  char filename[80];
339  sprintf(filename,"coeffs%d.root",iCounter);
340  TFile zout (filename, "recreate");
341  EBcoeffEnd->Write () ;
342  EBcoeffMap->Write () ;
343  EEPcoeffEnd->Write () ;
344  EEPcoeffMap->Write () ;
345  EEMcoeffEnd->Write () ;
346  EEMcoeffMap->Write () ;
347  zout.Close () ;
348  delete EBcoeffEnd;
349  delete EBcoeffMap;
350  delete EEPcoeffEnd;
351  delete EEMcoeffEnd;
352  delete EEPcoeffMap;
353  delete EEMcoeffMap;
354  if (iCounter < m_loops-1 ) return kContinue ;
355  else return kStop;
356 }
357 
358 
359 //-------------------------------------------------------------------
360 
361 
364 void
366 {
367  edm::LogInfo ("IML") << "[InvMatrixCalibLooper][endOfJob] saving calib coeffs" ;
368 
369 //Writes the coeffs
370  calibXMLwriter barrelWriter (EcalBarrel);
371  calibXMLwriter endcapWriter (EcalEndcap);
372  for (std::vector<DetId>::const_iterator barrelIt = m_barrelCells.begin ();
373  barrelIt!=m_barrelCells.end ();
374  ++barrelIt)
375  {
376  EBDetId eb (*barrelIt);
377  barrelWriter.writeLine (eb,m_barrelMap[*barrelIt]);
378  }
379  for (std::vector<DetId>::const_iterator endcapIt = m_endcapCells.begin ();
380  endcapIt!=m_endcapCells.end ();
381  ++endcapIt)
382  {
383  EEDetId ee (*endcapIt);
384  endcapWriter.writeLine (ee,m_endcapMap[*endcapIt]);
385  }
386  edm::LogInfo ("IML") << "[InvMatrixCalibLooper][endOfJob] Exiting" ;
387 }
388 
389 
390 //------------------------------------//
391 // definition of functions //
392 //------------------------------------//
393 
394 
396 int
397 EcalEleCalibLooper::EBregionCheck (const int eta, const int phi) const
398  {
399  if (eta < m_etaStart) return 1 ;
400  if (eta >= m_etaEnd) return 2 ;
401  if (phi < m_phiStartEB) return 3 ;
402  if (phi >= m_phiEndEB) return 4 ;
403  return 0 ;
404  }
405 
406 
407 //--------------------------------------------
408 
409 
411 inline double degrees (double radiants)
412  {
413  return radiants * 180 * (1/M_PI) ;
414  }
415 
416 
417 //--------------------------------------------
418 
419 
421 inline double radiants (int degrees)
422  {
423  return degrees * M_PI * (1 / 180) ;
424  }
425 
426 
427 //--------------------------------------------
428 
429 
432  {
433  //PG 200 > atan (50/0.5)
434  if (degrees == 90) return 90 ;
435  return tan (radiants (degrees)) ;
436  }
437 
438 
439 //--------------------------------------------
440 
441 
443 inline double Mod (double phi)
444  {
445  if (phi>=360 && phi<720) return phi-360;
446  if (phi>=720) return phi-720;
447  return phi;
448  }
449 
450 
451 //----------------------------------------
452 
453 
455 int EcalEleCalibLooper::EBRegionId (const int etaXtl,const int phiXtl) const
456 {
457  if (EBregionCheck(etaXtl,phiXtl)) return -1;
458  int phifake = m_phiStartEB;
459  if (m_phiStartEB>m_phiEndEB) phifake = m_phiStartEB - 360;
460  int Nphi = (m_phiEndEB-phifake)/m_phiWidthEB ;
461  int etaI = (etaXtl-m_etaStart) / m_etaWidth ;
462  int phiI = (phiXtl-m_phiStartEB) / m_phiWidthEB ;
463  int regionNumEB = phiI + Nphi*etaI ;
464  return (int) regionNumEB;
465 }
466 
467 
468 //----------------------------------------
469 
470 
472 int EcalEleCalibLooper::EERegionId (const int ics, const int ips) const
473 {
474  if (EEregionCheck(ics,ips)) return -1;
475  int phifake = m_phiStartEE;
476  if (m_phiStartEE>m_phiEndEE) phifake = m_phiStartEE - 360;
477  double radius = (ics-50) * (ics-50) + (ips-50) * (ips-50) ;
478  radius = sqrt (radius) ;
479  int Nphi = (m_phiEndEE - phifake)/m_phiWidthEE ;
480  double phi = atan2 (static_cast<double> (ips-50),
481  static_cast<double> (ics-50)) ;
482  phi = degrees (phi);
483  if (phi < 0) phi += 360;
484  int radI = static_cast<int> ((radius-m_radStart) / m_radWidth) ;
485  int phiI = static_cast<int> ((m_phiEndEE-phi) / m_phiWidthEE) ;
486  int regionNumEE = phiI + Nphi*radI ;
487  return regionNumEE ;
488 }
489 
490 
491 //----------------------------------------
492 
493 
496 {
497  int phifake = m_phiStartEE;
498  if (m_phiStartEE>m_phiEndEE) phifake = m_phiStartEE - 360;
499  return ( (m_radEnd - m_radStart)/m_radWidth) * ( (m_phiEndEE - phifake)/m_phiWidthEE) ;
500 }
501 
502 
503 //----------------------------------------
504 
505 
508 {
509  int phi = m_phiStartEB;
510  if (m_phiStartEB>m_phiEndEB) phi = m_phiStartEB - 360;
511  return ( (m_etaEnd - m_etaStart)/m_etaWidth) * ( (m_phiEndEB - phi)/m_phiWidthEB) ;
512 }
513 
514 
515 //----------------------------------------
516 
517 
520 {
521  int reg=-1;
522  for (int it = 0 ; it < EBregionsNum () ; ++it) m_regions.push_back (0) ;
523  for (int eta = 0 ; eta < 170 ; ++eta)
524  for (int phi = 0 ; phi < 360 ; ++phi)
525  {
526  reg = EBRegionId (eta,phi) ;
527  m_xtalRegionId[EBDetId::unhashIndex (eta*360+phi).rawId ()] = reg ;
528  if (reg==-1) continue;
530  ++m_regions.at (reg);
531  }
532 }
533 
534 
535 //----------------------------------------
536 
537 
538 //DS EE Region Definition
540 {
541  // reset
542  int EBnum=EBregionsNum();
543  int EEnum=EEregionsNum();
544  for (int it = 0 ; it < 2* EEnum ; ++it) m_regions.push_back (0) ;
545  // loop sui xtl
546  int reg=-1;
547  for (int ics = 0 ; ics < 100 ; ++ics)
548  for (int ips = 0 ; ips < 100 ; ++ips)
549  {
550  int ireg = EERegionId(ics, ips);
551  if (ireg==-1) reg =-1;
552  else reg = EBnum + ireg;
553  if (EEDetId::validDetId (ics+1, ips+1, 1))
554  {
555  m_xtalRegionId[EEDetId (ics+1, ips+1, 1).rawId ()] = reg ;
556  if (reg==-1) continue;
557  m_xtalPositionInRegion[EEDetId (ics+1, ips+1, 1).rawId ()] = m_regions.at (reg) ;
558  ++m_regions.at(reg);
559  }
560  if (reg!=-1) reg += EEnum;
561  if (EEDetId::validDetId (ics+1, ips+1, -1))
562  {
563  m_xtalRegionId[EEDetId (ics+1, ips+1, -1).rawId ()] = reg ;
564  if (reg==-1) continue;
565  m_xtalPositionInRegion[EEDetId (ics+1, ips+1, -1).rawId ()] = m_regions.at (reg) ;
566  ++m_regions.at (reg) ;
567  }
568  }
569 }
570 
571 
572 //-----------------------------------------
573 
574 
576 int EcalEleCalibLooper::EEregionCheck (const int ics, const int ips) const
577 {
578  int x = ics-50;
579  int y = ips-50;
580  double radius2 = x*x + y*y ;
581  if (radius2 < 10*10) return 1; //center of the donut
582  if (radius2 > 50*50) return 1; //outer part of the donut
583  if (radius2 < m_radStart * m_radStart) return 2 ;
584  if (radius2 >= m_radEnd * m_radEnd) return 2 ;
585  double phi = atan2 (static_cast<double> (y),static_cast<double> (x));
586  phi = degrees (phi);
587  if (phi < 0) phi += 360;
588  if (m_phiStartEE < m_phiEndEE
589  && phi > m_phiStartEE && phi < m_phiEndEE ) return 0;
590  if (m_phiStartEE > m_phiEndEE
591  && (phi > m_phiStartEE || phi < m_phiEndEE )) return 0;
592  return 3;
593 }
594 
595 
596 //--------------------------------------------
597 
598 
599 //Shifts eta in other coordinates (from 0 to 170)
600 int EcalEleCalibLooper::etaShifter (const int etaOld) const
601  {
602  if (etaOld < 0) return etaOld + 85;
603  else if (etaOld > 0) return etaOld + 84;
604  assert(0!=etaOld); // etaOld = 0, apparently not a foreseen value, so fail
605  return 999; // dummy statement to silence compiler warning
606  }
607 
608 
609 //--------------------------------------------
T getParameter(std::string const &) const
double degrees(double radiants)
def degrees
T getUntrackedParameter(std::string const &, T const &) const
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.
std::vector< DetId > m_barrelCells
int ix() const
Definition: EEDetId.h:76
double giveLimit(int)
copes with the infinitives of the tangent
int EEregionsNum() const
DS Number of regions in EE.
std::vector< VEcalCalibBlock * > m_EcalCalibBlocks
single blocks calibrators
edm::InputTag m_endcapAlCa
EcalEndcap Input Collection name.
void startingNewLoop(unsigned int)
T eta() const
unsigned int m_loops
DS sets the number of loops to do.
int EBregionCheck(const int eta, const int phi) const
Tells if you are in the region to be calibrated.
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
double Mod(double phi)
autoexplaining
int m_phiWidthEB
eta size of the additive border to the sub-matrix
int m_maxSelectedNumPerXtal
maximum number of events per crystal
int iEvent
Definition: GenABIO.cc:230
double m_minEnergyPerCrystal
minimum energy per crystal cut
double m_maxCoeff
maximum coefficient accepted (RAW)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:48
std::vector< DetId > m_endcapCells
interface to the L3Univ class for testing
Definition: L3CalibBlock.h:24
int zside() const
Definition: EEDetId.h:70
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int m_usingBlockSolver
to exclude the blocksolver
int m_radStart
DS For the EE.
int iy() const
Definition: EEDetId.h:82
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
edm::InputTag m_ElectronLabel
To take the electrons.
bool first
Definition: L1TdeRCT.cc:75
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
#define M_PI
int m_etaStart
phi size of the additive border to the sub-matrix
EcalIntercalibConstantMap m_barrelMap
the maps of recalib coeffs
int EEregionCheck(const int, const int) const
returns zero if the coordinates are in the right place.
tuple out
Definition: dbtoconf.py:99
T Max(T a, T b)
Definition: MathUtil.h:44
int m_recoWindowSidex
reconstruction window size
Definition: DetId.h:18
std::map< int, int > m_xtalRegionId
void EBRegionDefinition()
DS EB Region Definition.
T const * product() const
Definition: Handle.h:81
int EERegionId(const int, const int) const
Gives the id of the region.
void beginOfJob()
BeginOfJob.
double m_minCoeff
minimum coefficient accepted (RAW)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
const T & get() const
Definition: EventSetup.h:55
int m_etaWidth
eta size of the sub-matrix
std::vector< int > m_regions
int etaShifter(const int) const
LP Change the coordinate system.
std::map< int, int > m_xtalNumOfHits
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:90
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:114
int m_phiEndEB
phi end of the region of interest
ESHandle< TrackerGeometry > geometry
void writeLine(EBDetId const &, float)
int m_phiStartEB
phi start of the region of interest
tuple filename
Definition: lut2db_cfg.py:20
EcalIntercalibConstantMap m_endcapMap
edm::InputTag m_barrelAlCa
EcalBarrel Input Collection name.
Status duringLoop(const edm::Event &, const edm::EventSetup &)
EcalEleCalibLooper(const edm::ParameterSet &)
ctor
double radiants(int degrees)
DS def radiants.
Definition: DDAxes.h:10
int m_etaEnd
eta end of the region of interest
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
int EBRegionId(const int, const int) const
Reg Id generator EB --— for the barrel.
Status endOfLoop(const edm::EventSetup &, unsigned int iCounter)
int EBregionsNum() const
DS number of regions in EB.
Definition: DDAxes.h:10
std::map< int, int > m_xtalPositionInRegion
double m_maxEnergyPerCrystal
maximum energy per crystal cut