00001 #ifndef CALIBRATION_ECALCALIBALGOS_ELECTRONCALIBRATIONUNIV
00002 #define CALIBRATION_ECALCALIBALGOS_ELECTRONCALIBRATIONUNIV
00003
00004
00005
00006
00007
00008
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <memory>
00026
00027
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
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
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(edm::EventSetup const&);
00065 virtual void endJob();
00066 private:
00067 DetId findMaxHit(const std::vector<DetId> & v1,const EBRecHitCollection *EBhits,const EERecHitCollection *EEhits);
00068 bool TestEEvalidDetId(int crystal_ix, int crystal_iy, int iz);
00069
00070
00071
00072
00073 std::string rootfile_;
00074 edm::InputTag EBrecHitLabel_;
00075 edm::InputTag EErecHitLabel_;
00076 edm::InputTag electronLabel_;
00077 edm::InputTag trackLabel_;
00078 std::string calibAlgo_;
00079 std::string miscalibfile_;
00080 std::string miscalibfileEndCap_;
00081 int keventweight_;
00082 double ElePt_;
00083 double maxeta_;
00084 double mineta_;
00085 double maxphi_;
00086 double minphi_;
00087 double cut1_;
00088 double cut2_;
00089 double cut3_;
00090 double cutEPCalo1_;
00091 double cutEPCalo2_;
00092 double cutEPin1_;
00093 double cutEPin2_;
00094 double cutCalo1_;
00095 double cutCalo2_;
00096 double cutESeed_;
00097 int ClusterSize_;
00098 int elecclass_;
00099 int theMaxLoops;
00100
00101 bool FirstIteration;
00102
00103 int read_events;
00104
00105 int calibClusterSize,keventweight;
00106 int etaMin, etaMax, phiMin, phiMax;
00107 vector<float> EnergyVector;
00108 vector<float> WeightVector;
00109 vector<vector<float> > EventMatrix;
00110 vector<int> MaxCCeta;
00111 vector<int> MaxCCphi;
00112 vector<float> EnergyVectorNoCuts;
00113 vector<float> WeightVectorNoCuts;
00114 vector<vector<float> > EventMatrixNoCuts;
00115 vector<int> MaxCCetaNoCuts;
00116 vector<int> MaxCCphiNoCuts;
00117 MinL3Algorithm* MyL3Algo1;
00118 MinL3AlgoUniv<DetId>* UnivL3;
00119
00120 edm::ESHandle<CaloTopology> theCaloTopology;
00121
00122 vector<float> solution;
00123 vector<float> solutionNoCuts;
00124
00125
00126 vector<vector<DetId> > UnivEventIds;
00127 map<DetId,float> Univsolution;
00128
00129
00130 int numevent_;
00131
00132 TFile * f;
00133
00134 TH1F * EventsAfterCuts;
00135
00136 TH1F * e25;
00137 TH1F * e9;
00138 TH1F * scE;
00139 TH1F * trP;
00140 TH1F * EoP;
00141 TH1F * EoP_all;
00142 TH1F * calibs;
00143 TH1F * calibsEndCap;
00144 TH1F * e9Overe25;
00145 TH1F * e25OverScE;
00146 TH2F * Map;
00147 TH1F * E25oP;
00148
00149 TH1F * PinOverPout;
00150 TH1F * eSeedOverPout;
00151 TH1F * MisCalibs;
00152 TH1F * RatioCalibs;
00153 TH1F * DiffCalibs;
00154 TH1F * RatioCalibsNoCuts;
00155 TH1F * DiffCalibsNoCuts;
00156 TH1F * MisCalibsEndCap;
00157 TH1F * RatioCalibsEndCap;
00158 TH1F * DiffCalibsEndCap;
00159
00160 TH1F * e25NoCuts;
00161 TH1F * e9NoCuts;
00162 TH1F * scENoCuts;
00163 TH1F * trPNoCuts;
00164 TH1F * EoPNoCuts;
00165 TH1F * calibsNoCuts;
00166 TH1F * e9Overe25NoCuts;
00167 TH1F * e25OverScENoCuts;
00168 TH2F * MapEndCap;
00169 TH1F * E25oPNoCuts;
00170 TH2F * Map3Dcalib;
00171 TH2F * Map3DcalibEndCap;
00172 TH2F * Map3DcalibNoCuts;
00173 TH1F * calibinter;
00174 TH1F * calibinterEndCap;
00175 TH1F * calibinterNoCuts;
00176 HouseholderDecomposition * MyHH;
00177 TH1F * PinOverPoutNoCuts;
00178 TH1F * eSeedOverPoutNoCuts;
00179
00180 TH2F * GeneralMap;
00181 TH2F * GeneralMapEndCap;
00182 TH2F * GeneralMapBeforePt;
00183 TH2F * GeneralMapEndCapBeforePt;
00184
00185 TH2F * MapCor1;
00186 TH2F * MapCor2;
00187 TH2F * MapCor3;
00188 TH2F * MapCor4;
00189 TH2F * MapCor5;
00190 TH2F * MapCor6;
00191 TH2F * MapCor7;
00192 TH2F * MapCor8;
00193 TH2F * MapCor9;
00194 TH2F * MapCor10;
00195 TH2F * MapCor11;
00196 TH2F * MapCorCalib;
00197
00198 TH2F * MapCor1NoCuts;
00199 TH2F * MapCor2NoCuts;
00200 TH2F * MapCor3NoCuts;
00201 TH2F * MapCor4NoCuts;
00202 TH2F * MapCor5NoCuts;
00203 TH2F * MapCor6NoCuts;
00204 TH2F * MapCor7NoCuts;
00205 TH2F * MapCor8NoCuts;
00206 TH2F * MapCor9NoCuts;
00207 TH2F * MapCor10NoCuts;
00208 TH2F * MapCor11NoCuts;
00209 TH2F * MapCorCalibEndCap;
00210
00211 TH2F * MapCor1ESeed;
00212 TH2F * MapCor2ESeed;
00213 TH2F * MapCor3ESeed;
00214 TH2F * MapCor4ESeed;
00215 TH2F * MapCor5ESeed;
00216 TH2F * MapCor6ESeed;
00217 TH2F * MapCor7ESeed;
00218 TH2F * MapCor8ESeed;
00219 TH2F * MapCor9ESeed;
00220 TH2F * MapCor10ESeed;
00221 TH2F * MapCor11ESeed;
00222
00223 TH2F * E25oPvsEta;
00224 TH2F * E25oPvsEtaEndCap;
00225
00226 TH1F * PinMinPout;
00227 TH1F * PinMinPoutNoCuts;
00228
00229 TH1F * Error1;
00230 TH1F * Error2;
00231 TH1F * Error3;
00232 TH1F * Error1NoCuts;
00233 TH1F * Error2NoCuts;
00234 TH1F * Error3NoCuts;
00235
00236 TH1F * eSeedOverPout2;
00237 TH1F * eSeedOverPout2NoCuts;
00238 TH1F * eSeedOverPout2ESeed;
00239
00240 TH1F * hadOverEm;
00241 TH1F * hadOverEmNoCuts;
00242 TH1F * hadOverEmESeed;
00243 };
00244 #endif