CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/Calibration/EcalCalibAlgos/interface/ElectronCalibrationUniv.h

Go to the documentation of this file.
00001 #ifndef CALIBRATION_ECALCALIBALGOS_ELECTRONCALIBRATIONUNIV
00002 #define CALIBRATION_ECALCALIBALGOS_ELECTRONCALIBRATIONUNIV
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    ElectronCalibrationUniv
00007 // Class:      ElectronCalibrationUniv
00008 // 
00016 //
00017 // Original Author:  Lorenzo AGOSTINO, Radek Ofierzynski
00018 //         Created:  Tue Jul 18 12:17:01 CEST 2006
00019 // $Id: ElectronCalibrationUniv.h,v 1.7 2011/01/13 18:28:26 beaucero Exp $
00020 //
00021 //
00022 
00023 
00024 // system include files
00025 #include <memory>
00026 
00027 // user include files
00028 #include "FWCore/Framework/interface/Frameworkfwd.h"
00029 #include "FWCore/Framework/interface/EDAnalyzer.h"
00030 
00031 #include "FWCore/Framework/interface/ESHandle.h"
00032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00033 
00034 // Geometry
00035 #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
00036 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00037 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00038 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00039 
00040 #include "FWCore/Framework/interface/Event.h"
00041 #include "FWCore/Framework/interface/MakerMacros.h"
00042 #include "FWCore/Framework/interface/EventSetup.h"
00043 #include "FWCore/Framework/interface/ESHandle.h"
00044 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00045 #include "Calibration/Tools/interface/HouseholderDecomposition.h"
00046 #include "Calibration/Tools/interface/MinL3Algorithm.h"
00047 #include "Calibration/Tools/interface/CalibrationCluster.h"
00048 #include "DataFormats/DetId/interface/DetId.h"
00049 #include "TFile.h"
00050 #include "TH1.h"
00051 #include "TH2.h"
00052 
00053 #include "Calibration/Tools/interface/MinL3AlgoUniv.h"
00054 
00055 // class decleration
00056 //
00057 
00058 class ElectronCalibrationUniv : public edm::EDAnalyzer {
00059    public:
00060       explicit ElectronCalibrationUniv(const edm::ParameterSet&);
00061       ~ElectronCalibrationUniv();
00062 
00063       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00064       virtual void beginJob();
00065       virtual void beginRun(edm::Run const &, edm::EventSetup const&);
00066       virtual void endJob();
00067    private:
00068       DetId  findMaxHit(const std::vector<DetId> & v1,const EBRecHitCollection *EBhits,const EERecHitCollection *EEhits);
00069       bool TestEEvalidDetId(int crystal_ix, int crystal_iy, int iz);     
00070 
00071 
00072       // ----------member data ---------------------------
00073 
00074       std::string rootfile_;
00075       edm::InputTag EBrecHitLabel_;
00076       edm::InputTag EErecHitLabel_;
00077       edm::InputTag electronLabel_;
00078       edm::InputTag trackLabel_;
00079       std::string calibAlgo_;
00080       std::string miscalibfile_;
00081       std::string miscalibfileEndCap_;
00082       int keventweight_;
00083       double ElePt_;
00084       int maxeta_;
00085       int mineta_;
00086       int maxphi_;
00087       int minphi_;
00088       double cut1_;
00089       double cut2_;
00090       double cut3_;
00091       double cutEPCalo1_;
00092       double cutEPCalo2_;
00093       double cutEPin1_;
00094       double cutEPin2_;
00095       double cutCalo1_;
00096       double cutCalo2_;
00097       double cutESeed_;
00098       int ClusterSize_;
00099      int elecclass_;
00100       int theMaxLoops;
00101 
00102       bool FirstIteration;
00103 
00104       int read_events;
00105       
00106       int calibClusterSize,keventweight;
00107       int etaMin, etaMax, phiMin, phiMax;
00108       std::vector<float> EnergyVector;
00109       std::vector<float> WeightVector;
00110       std::vector<std::vector<float> > EventMatrix;
00111       std::vector<int> MaxCCeta;
00112       std::vector<int> MaxCCphi;
00113       std::vector<float> EnergyVectorNoCuts;
00114       std::vector<float> WeightVectorNoCuts;
00115       std::vector<std::vector<float> > EventMatrixNoCuts;
00116       std::vector<int> MaxCCetaNoCuts;
00117       std::vector<int> MaxCCphiNoCuts;
00118       MinL3Algorithm* MyL3Algo1;
00119       MinL3AlgoUniv<DetId>* UnivL3;
00120 
00121       edm::ESHandle<CaloTopology> theCaloTopology;
00122 
00123       std::vector<float> solution;
00124       std::vector<float> solutionNoCuts;
00125 
00126       //For Universal Algo
00127       std::vector<std::vector<DetId> > UnivEventIds;
00128       std::map<DetId,float> Univsolution;
00129       
00130       // int eventcrystal[25][25];
00131       int numevent_;
00132 
00133       TFile * f;
00134 
00135       TH1F * EventsAfterCuts;
00136 
00137       TH1F * e25;
00138       TH1F * e9;
00139       TH1F * scE;
00140       TH1F * trP;
00141       TH1F * EoP;
00142       TH1F * EoP_all;
00143       TH1F * calibs;
00144       TH1F * calibsEndCapMinus;
00145       TH1F * calibsEndCapPlus;
00146       TH1F * e9Overe25;
00147       TH1F * e25OverScE;
00148       TH2F * Map;
00149       TH1F * E25oP;
00150 
00151       TH1F * PinOverPout;
00152       TH1F * eSeedOverPout;
00153 /*       TH1F * MisCalibs; */
00154 /*       TH1F * RatioCalibs; */
00155 /*       TH1F * DiffCalibs; */
00156 /*       TH1F * RatioCalibsNoCuts; */
00157 /*       TH1F * DiffCalibsNoCuts; */
00158 /*      TH1F * MisCalibsEndCapMinus; */
00159 /*      TH1F * MisCalibsEndCapPlus; */
00160 /*       TH1F * RatioCalibsEndCapMinus; */
00161 /*       TH1F * RatioCalibsEndCapPlus; */
00162 /*       TH1F * DiffCalibsEndCapMinus; */
00163 /*       TH1F * DiffCalibsEndCapPlus; */
00164 
00165       TH1F * e25NoCuts;
00166       TH1F * e9NoCuts;
00167       TH1F * scENoCuts;
00168       TH1F * trPNoCuts;
00169       TH1F * EoPNoCuts;
00170       TH1F * calibsNoCuts;
00171       TH1F * e9Overe25NoCuts;
00172       TH1F * e25OverScENoCuts;
00173       TH2F * MapEndCapMinus;
00174       TH2F * MapEndCapPlus;
00175       TH1F * E25oPNoCuts;
00176       TH2F * Map3Dcalib;
00177       TH2F * Map3DcalibEndCapMinus;
00178       TH2F * Map3DcalibEndCapPlus;
00179       TH2F * Map3DcalibNoCuts;
00180       TH1F * calibinter;
00181       TH1F * calibinterEndCapMinus;
00182       TH1F * calibinterEndCapPlus;
00183       TH1F * calibinterNoCuts;
00184       HouseholderDecomposition * MyHH;
00185       TH1F * PinOverPoutNoCuts;
00186       TH1F * eSeedOverPoutNoCuts;
00187 
00188       TH2F * GeneralMap;
00189       TH2F * GeneralMapEndCapMinus;
00190       TH2F * GeneralMapEndCapPlus;
00191       TH2F * GeneralMapBeforePt;
00192       TH2F * GeneralMapEndCapMinusBeforePt;
00193       TH2F * GeneralMapEndCapPlusBeforePt;
00194 
00195       TH2F * MapCor1;
00196       TH2F * MapCor2;
00197       TH2F * MapCor3;
00198       TH2F * MapCor4;
00199       TH2F * MapCor5;
00200       TH2F * MapCor6;
00201       TH2F * MapCor7;
00202       TH2F * MapCor8;
00203       TH2F * MapCor9;
00204       TH2F * MapCor10;
00205       TH2F * MapCor11;
00206       //      TH2F * MapCorCalib;
00207 
00208       TH2F * MapCor1NoCuts;
00209       TH2F * MapCor2NoCuts;
00210       TH2F * MapCor3NoCuts;
00211       TH2F * MapCor4NoCuts;
00212       TH2F * MapCor5NoCuts;
00213       TH2F * MapCor6NoCuts;
00214       TH2F * MapCor7NoCuts;
00215       TH2F * MapCor8NoCuts;
00216       TH2F * MapCor9NoCuts;
00217       TH2F * MapCor10NoCuts;
00218       TH2F * MapCor11NoCuts;
00219 /*       TH2F * MapCorCalibEndCapMinus; */
00220 /*       TH2F * MapCorCalibEndCapPlus; */
00221 
00222       TH2F * MapCor1ESeed;
00223       TH2F * MapCor2ESeed;
00224       TH2F * MapCor3ESeed;
00225       TH2F * MapCor4ESeed;
00226       TH2F * MapCor5ESeed;
00227       TH2F * MapCor6ESeed;
00228       TH2F * MapCor7ESeed;
00229       TH2F * MapCor8ESeed;
00230       TH2F * MapCor9ESeed;
00231       TH2F * MapCor10ESeed;
00232       TH2F * MapCor11ESeed;
00233 
00234       TH2F * E25oPvsEta;
00235       TH2F * E25oPvsEtaEndCapMinus;
00236       TH2F * E25oPvsEtaEndCapPlus;
00237 
00238       TH1F * PinMinPout; 
00239       TH1F * PinMinPoutNoCuts;
00240 
00241       TH1F * Error1;
00242       TH1F * Error2;
00243       TH1F * Error3;
00244       TH1F * Error1NoCuts;
00245       TH1F * Error2NoCuts;
00246       TH1F * Error3NoCuts;
00247 
00248       TH1F * eSeedOverPout2;
00249       TH1F * eSeedOverPout2NoCuts;
00250       TH1F * eSeedOverPout2ESeed;
00251 
00252       TH1F * hadOverEm;
00253       TH1F * hadOverEmNoCuts;
00254       TH1F * hadOverEmESeed;
00255 };
00256 #endif