CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZeeCalibration.h
Go to the documentation of this file.
1 #ifndef CALIBRATION_ECALCALIBALGOS_ZEECALIBRATION
2 #define CALIBRATION_ECALCALIBALGOS_ZEECALIBRATION
3 
4 // -*- C++ -*-
5 //
6 // Package: ZeeCalibration
7 // Class: ZeeCalibration
8 //
16 //
17 // $Id: ZeeCalibration.h,v 1.12 2010/02/11 00:10:35 wmtan Exp $
18 //
19 //
20 
21 
22 // system include files
23 #include <memory>
24 #include <vector>
25 #include <map>
26 
27 // user include files
37 
40 
43 
46 
49 
50 #include "TTree.h"
51 #include "TFile.h"
52 #include "TGraph.h"
53 #include "TGraphErrors.h"
54 #include "TH1.h"
55 #include "TH2.h"
56 
62 
66 
67 #include<vector>
68 #include<string>
69 
70 // class declaration
71 //
72 
74 
75  public:
76 
78  ZeeCalibration( const edm::ParameterSet& iConfig );
79 
82 
84  virtual void produce(edm::Event&, const edm::EventSetup&) {};
85 
87  virtual void beginOfJob();
88 
90  virtual void endOfJob();
91 
93  virtual void startingNewLoop( unsigned int iLoop );
94 
96  virtual Status endOfLoop( const edm::EventSetup&, unsigned int iLoop );
97 
99  virtual Status duringLoop( const edm::Event&, const edm::EventSetup& );
100 
102  virtual boost::shared_ptr<EcalIntercalibConstants> produceEcalIntercalibConstants( const EcalIntercalibConstantsRcd& iRecord );
103 
104  private:
105 
106 /* ElectronEnergyCorrector myCorrector; */
107 /* ElectronClassification myClassificator; */
108 
109  double fEtaBarrelBad(double scEta) const;
110  double fEtaBarrelGood(double scEta) const;
111  double fEtaEndcapBad(double scEta) const;
112  double fEtaEndcapGood(double scEta) const;
113 
114  int ringNumberCorrector(int k);
115  double getEtaCorrection(const reco::GsfElectron*);
116 
117  \
118  void fillEleInfo(std::vector<HepMC::GenParticle*>& a, std::map<HepMC::GenParticle*,const reco::GsfElectron*>& b);
119  void fillMCInfo(HepMC::GenParticle* mcele);
120 
121  void fillMCmap(const std::vector<const reco::GsfElectron*>* electronCollection, const std::vector<HepMC::GenParticle*>& mcEle,std::map<HepMC::GenParticle*,const reco::GsfElectron*>& myMCmap);
122  // void fillMCmap(const reco::ElectronCollection* electronCollection, const std::vector<HepMC::GenParticle*>& mcEle,std::map<HepMC::GenParticle*,const reco::Electron*>& myMCmap);
123 
124  float EvalDPhi(float Phi,float Phi_ref);
125  float EvalDR(float Eta,float Eta_ref,float Phi,float Phi_ref);
126 
127 
128  void bookHistograms();
129 
130  void resetVariables();
131 
132  void resetHistograms();
133 
134  void printStatistics();
135 
136  std::pair<DetId, double> getHottestDetId(std::vector<std::pair<DetId, float> > mySCRecHits, const EBRecHitCollection* ebhits , const EERecHitCollection* eehits);
137 
138  bool xtalIsOnModuleBorder( EBDetId myEBDetId );
139 
140  float computeCoefficientDistanceAtIteration( float v1[250], float v2[250], int size);
141 
142  // float Calculate_SigmaEtaEta(const reco::SuperCluster &passedCluster);
143 
144  // ----------member data ---------------------------
145 
146 
147  TTree* myTree;
148 
149  std::string outputFileName_;
150 
151  std::string rechitProducer_;
152  std::string rechitCollection_;
153  std::string erechitProducer_;
154  std::string erechitCollection_;
155  std::string scProducer_;
156  std::string scCollection_;
157 
158  std::string scIslandProducer_;
159  std::string scIslandCollection_;
160 
161  std::string mcProducer_;
162  std::string calibMode_;
163 
164  std::string electronProducer_;
165  std::string electronCollection_;
166 
167  std::string RecalibBarrelHits_;
168 
169  unsigned int etaBins_;
170  unsigned int etBins_;
171 
172  double etaMin_;
173  double etMin_;
174  double etaMax_;
175  double etMax_;
176 
177  std::string barrelfile_;
178  std::string endcapfile_;
179 
182  double mass;
183 
184  float mass4tree;
186 
188 
190 
195 
196  boost::shared_ptr<EcalIntercalibConstants> ical;
197 
199 
202 
203  // steering parameters
204 
206 
207  // TGraph* graph;
208 
211 
214 
215 
222 
223  TH1F* h_eleEffEta[2];
224  TH1F* h_eleEffPhi[2];
225  TH1F* h_eleEffPt[2];
226 
229 
234 
241  TH1F* h1_RMin_;
242  TH1F* h1_RMinZ_;
244 
247 
248  TH1F* h_eleEffEta_[2];
249  TH1F* h_eleEffPhi_[2];
250  TH1F* h_eleEffPt_[2];
251  TH1F* h_ESCEtrue_[25];
252  TH2F* h_ESCEtrueVsEta_[25];
253 
254  TH1F* h_ESCcorrEtrue_[25];
256 
263 
265  // TH2F* h2_miscalRecalParz_[25];
266  TH1F* h1_mc_;
267  TH1F* h1_mcParz_[25];
268  /*
269  TH1F* h_DiffZMassDistr_[25];
270  TH1F* h_ZMassDistr_[25];
271  */
274  //TH2F* h2_miscalRecalEBParz_[25];
275  TH1F* h1_mcEB_;
276  TH1F* h1_mcEBParz_[25];
278  //TH2F* h2_miscalRecalEEParz_[25];
279  TH1F* h1_mcEE_;
280  TH1F* h1_mcEEParz_[25];
281 
282  TH2F* h2_chi2_[25];
283  TH2F* h2_iterations_[25];
284 
288 
292 
295 
304 
308 
310 
311 
313  Int_t NEVT, MCZBB, MCZEB, MCZEE;
314 
315  TFile* outputFile_;
316 
317  unsigned int theMaxLoops; // Number of loops to loop
318 
320 
321  unsigned int electronSelection_;
322 
323  double loopArray[50];
324  double sigmaArray[50];
325  double sigmaErrorArray[50];
327 
330 
333 
336 
339 
342 
345 
346 
348 
349  unsigned int nEvents_; // number of events processed
350 
351  unsigned int nWasRun_; // # where at least one HLT was run
352  unsigned int nAccept_; // # of accepted events
353  unsigned int nErrors_; // # where at least one HLT had error
354 
355  std::vector<unsigned int> hlWasRun_; // # where HLT[i] was run
356  std::vector<unsigned int> hlAccept_; // # of events accepted by HLT[i]
357  std::vector<unsigned int> hlErrors_; // # of events with error in HLT[i]
358 
359  std::vector<std::string> hlNames_; // name of each HLT algorithm
360  bool init_; // vectors initialised or not
361 
363  char aTriggerNames[200][30];
364  bool aTriggerResults[200];
365 
366  Int_t hltCount;
367  char aHLTNames[6000];
368  Int_t hltNamesLen;
369  TString aNames[200];
370  bool aHLTResults[200];
371 
373 
374 };
375 #endif
char aHLTNames[6000]
unsigned int etBins_
TH1F * h1_eleERecoOverEtrue_
virtual void produce(edm::Event &, const edm::EventSetup &)
Dummy implementation (job done in duringLoop)
virtual void endOfJob()
Called at end of job.
float NewCalibCoeff[nMaxChannels]
TH2F * h2_fEtaBarrelBad_
TH1F * h1_mcEEParz_[25]
std::string calibMode_
std::string outputFileName_
double fEtaEndcapGood(double scEta) const
std::string scIslandCollection_
std::string RecalibBarrelHits_
TH1F * h_eleEffPhi_[2]
std::string electronCollection_
int BARREL_ELECTRONS_AFTER_BORDER_CUT
TH2F * h2_miscalRecal_
TH1F * h1_eventsBeforeEWKSelection_
unsigned int nErrors_
double fEtaBarrelBad(double scEta) const
float computeCoefficientDistanceAtIteration(float v1[250], float v2[250], int size)
virtual Status endOfLoop(const edm::EventSetup &, unsigned int iLoop)
Called at end of loop.
virtual void beginOfJob()
Called at beginning of job.
unsigned int theMaxLoops
int GOLDEN_ELECTRONS_IN_ENDCAP
TH1F * h_ESCEtrue_[25]
TH1F * h1_occupancyVsEtaGold_
TH1F * h1_eventsAfterBorderSelection_
edm::InputTag hlTriggerResults_
std::pair< DetId, double > getHottestDetId(std::vector< std::pair< DetId, float > > mySCRecHits, const EBRecHitCollection *ebhits, const EERecHitCollection *eehits)
void fillMCmap(const std::vector< const reco::GsfElectron * > *electronCollection, const std::vector< HepMC::GenParticle * > &mcEle, std::map< HepMC::GenParticle *, const reco::GsfElectron * > &myMCmap)
float calibCoeffError[nMaxChannels]
TH1F * h1_reco_ZMassGood_
TH1F * h1_occupancyEndcap_
virtual Status duringLoop(const edm::Event &, const edm::EventSetup &)
Called at each event.
TH1F * h1_occupancyVsEtaShower_
TH1F * h_eleEffPhi[2]
TH1F * h1_eventsBeforeBorderSelection_
TH1F * h1_electronCosTheta_SC_
double fEtaEndcapBad(double scEta) const
TH1F * h1_reco_ZMassCorr_
int GOLDEN_ELECTRONS_IN_BARREL
bool aTriggerResults[200]
TH2F * h2_coeffVsEtaGrouped_
unsigned int nWasRun_
TH1F * h1_occupancyVsEta_
std::string endcapfile_
std::string rechitCollection_
TH1F * h1_occupancyBarrel_
TH2F * h2_miscalRecalEE_
float EvalDR(float Eta, float Eta_ref, float Phi, float Phi_ref)
unsigned int nAccept_
TH1F * h1_electronCosTheta_TK_
~ZeeCalibration()
Destructor.
TH2F * h_ESCcorrEtrueVsEta_[25]
boost::shared_ptr< EcalIntercalibConstants > ical
TH2F * h2_fEtaEndcapBad_
TH1F * h_eleEffPt[2]
std::string rechitProducer_
int ringNumberCorrector(int k)
std::string scIslandProducer_
int SILVER_ELECTRONS_IN_BARREL
double sigmaArray[50]
int TOTAL_ELECTRONS_IN_ENDCAP
int BARREL_ELECTRONS_BEFORE_BORDER_CUT
int SHOWER_ELECTRONS_IN_ENDCAP
TString aNames[200]
std::string scProducer_
TH1F * h1_reco_ZMassBad_
std::string erechitProducer_
TH1F * h1_mcEBParz_[25]
std::vector< std::string > hlNames_
ZIterativeAlgorithmWithFit * theAlgorithm_
ZeeRescaleFactorPlots * myZeeRescaleFactorPlots_
TH1F * h1_elePhiResol_
unsigned int electronSelection_
bool xtalIsOnModuleBorder(EBDetId myEBDetId)
TH1F * h1_eleEtaResol_
TH2F * h2_xtalRecalibCoeffBarrel_[25]
float EvalDPhi(float Phi, float Phi_ref)
TH1F * h1_eventsAfterEWKSelection_
TH1F * h1_preshowerOverSC_
TH1F * h1_electronCosTheta_SC_TK_
double coefficientDistanceAtIteration[50]
TH1F * h_eleEffPt_[2]
int k[5][pyjets_maxn]
TH2F * h2_zMassDiffVsLoop_
std::string scCollection_
TH1F * h1_mcParz_[25]
void fillMCInfo(HepMC::GenParticle *mcele)
#define nMaxChannels
ZeePlots * myZeePlots_
unsigned int nEvents_
unsigned int etaBins_
edm::ParameterSet theParameterSet
TH2F * h2_miscalRecalEB_
std::vector< unsigned int > hlErrors_
TH1F * h_ESCcorrEtrue_[25]
double loopArray[50]
TH2F * h2_xtalMiscalibCoeffEndcapPlus_
double b
Definition: hdecay.h:120
TH1F * h1_occupancyVsEtaCrack_
std::vector< unsigned int > hlAccept_
virtual boost::shared_ptr< EcalIntercalibConstants > produceEcalIntercalibConstants(const EcalIntercalibConstantsRcd &iRecord)
Produce Ecal interCalibrations.
float calibCoeff[nMaxChannels]
int SILVER_ELECTRONS_IN_ENDCAP
std::string mcProducer_
TH1F * h1_reco_ZMassCorrBB_
virtual void startingNewLoop(unsigned int iLoop)
Called at beginning of loop.
TH1F * h1_reco_ZMassCorrEE_
double a
Definition: hdecay.h:121
TH2F * h2_xtalMiscalibCoeffBarrel_
TH2F * h2_chi2_[25]
TH2F * h2_coeffVsLoop_
void fillEleInfo(std::vector< HepMC::GenParticle * > &a, std::map< HepMC::GenParticle *, const reco::GsfElectron * > &b)
std::string barrelfile_
TH1F * h1_weightSumMeanBarrel_
double fEtaBarrelGood(double scEta) const
TH2F * h_ESCEtrueVsEta_[25]
TH2F * h2_zMassVsLoop_
TH2F * h2_iterations_[25]
ZeeCalibration(const edm::ParameterSet &iConfig)
Constructor.
char aTriggerNames[200][30]
TH2F * h2_xtalRecalibCoeffEndcapPlus_[25]
int CRACK_ELECTRONS_IN_ENDCAP
int CRACK_ELECTRONS_IN_BARREL
TH2F * h2_fEtaEndcapGood_
TH2F * h2_xtalRecalibCoeffEndcapMinus_[25]
std::vector< unsigned int > hlWasRun_
std::string electronProducer_
double getEtaCorrection(const reco::GsfElectron *)
bool aHLTResults[200]
TH2F * h2_fEtaBarrelGood_
std::string erechitCollection_
tuple size
Write out results.
TH1F * h_eleEffEta_[2]
TH1F * h1_borderElectronClassification_
float initCalibCoeff[nMaxChannels]
TH2F * h2_xtalMiscalibCoeffEndcapMinus_
TH2F * h2_zWidthVsLoop_
TH1F * h1_occupancyVsEtaSilver_
double sigmaErrorArray[50]
TH2F * h2_residualSigma_
int SHOWER_ELECTRONS_IN_BARREL
TH1F * h_eleEffEta[2]
int TOTAL_ELECTRONS_IN_BARREL
TH1F * h1_weightSumMeanEndcap_