00001 #ifndef GsfElectronMCAnalyzer_h
00002 #define GsfElectronMCAnalyzer_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "FWCore/Framework/interface/EDAnalyzer.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "DataFormats/Common/interface/Handle.h"
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 #include "FWCore/Framework/interface/EventSetup.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023
00024 #include "DataFormats/Common/interface/EDProduct.h"
00025
00026 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00027
00028 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00029
00030 class MagneticField;
00031 class TFile;
00032 class TH1F;
00033 class TH2F;
00034 class TH1I;
00035 class TProfile;
00036 class TTree;
00037
00038 class GsfElectronMCAnalyzer : public edm::EDAnalyzer
00039 {
00040 public:
00041
00042 explicit GsfElectronMCAnalyzer(const edm::ParameterSet& conf);
00043
00044 virtual ~GsfElectronMCAnalyzer();
00045
00046 virtual void beginJob(edm::EventSetup const& iSetup);
00047 virtual void endJob();
00048 virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
00049
00050 private:
00051
00052 TrajectoryStateTransform transformer_;
00053 edm::ESHandle<TrackerGeometry> pDD;
00054 edm::ESHandle<MagneticField> theMagField;
00055 TFile *histfile_;
00056 TTree *tree_;
00057 float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10];
00058 float superclusterEnergy[10], superclusterEta[10], superclusterPhi[10], superclusterEt[10];
00059 float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10];
00060
00061 TH1F *h_mcNum;
00062 TH1F *h_eleNum;
00063 TH1F *h_gamNum;
00064
00065 TH1F *h_simEta;
00066 TH1F *h_simAbsEta;
00067 TH1F *h_simP;
00068 TH1F *h_simPt;
00069 TH1F *h_simPhi;
00070 TH1F *h_simZ;
00071
00072 TH1F *h_ele_simEta_matched;
00073 TH1F *h_ele_simAbsEta_matched;
00074 TH1F *h_ele_simPt_matched;
00075 TH1F *h_ele_simPhi_matched;
00076 TH1F *h_ele_simZ_matched;
00077
00078 TH1F *h_ele_TIP_all;
00079 TH1F *h_ele_EoverP_all;
00080 TH1F *h_ele_vertexEta_all;
00081 TH1F *h_ele_vertexPt_all;
00082 TH1F *h_ele_mee_all;
00083
00084 TH1F *h_ele_charge;
00085 TH2F *h_ele_chargeVsEta;
00086 TH2F *h_ele_chargeVsPhi;
00087 TH2F *h_ele_chargeVsPt;
00088 TH1F *h_ele_vertexP;
00089 TH1F *h_ele_vertexPt;
00090 TH2F *h_ele_vertexPtVsEta;
00091 TH2F *h_ele_vertexPtVsPhi;
00092 TH1F *h_ele_vertexPt_5100;
00093 TH1F *h_ele_vertexEta;
00094 TH2F *h_ele_vertexEtaVsPhi;
00095 TH1F *h_ele_vertexAbsEta;
00096 TH1F *h_ele_vertexPhi;
00097 TH1F *h_ele_vertexX;
00098 TH1F *h_ele_vertexY;
00099 TH1F *h_ele_vertexZ;
00100 TH1F *h_ele_vertexTIP;
00101 TH2F *h_ele_vertexTIPVsEta;
00102 TH2F *h_ele_vertexTIPVsPhi;
00103 TH2F *h_ele_vertexTIPVsPt;
00104
00105 TH1F *histNum_;
00106
00107 TH1F *histSclEn_ ;
00108 TH1F *histSclEoEtrue_barrel;
00109 TH1F *histSclEoEtrue_endcaps;
00110 TH1F *histSclEt_ ;
00111 TH2F *histSclEtVsEta_ ;
00112 TH2F *histSclEtVsPhi_ ;
00113 TH2F *histSclEtaVsPhi_ ;
00114 TH1F *histSclEta_ ;
00115 TH1F *histSclPhi_ ;
00116
00117 TH1F *h_ctf_foundHits;
00118 TH2F *h_ctf_foundHitsVsEta;
00119 TH2F *h_ctf_lostHitsVsEta;
00120
00121 TH1F *h_ele_foundHits;
00122 TH2F *h_ele_foundHitsVsEta;
00123 TH2F *h_ele_foundHitsVsPhi;
00124 TH2F *h_ele_foundHitsVsPt;
00125 TH1F *h_ele_lostHits;
00126 TH2F *h_ele_lostHitsVsEta;
00127 TH2F *h_ele_lostHitsVsPhi;
00128 TH2F *h_ele_lostHitsVsPt;
00129 TH1F *h_ele_chi2;
00130 TH2F *h_ele_chi2VsEta;
00131 TH2F *h_ele_chi2VsPhi;
00132 TH2F *h_ele_chi2VsPt;
00133
00134 TH1F *h_ele_PoPtrue;
00135 TH2F *h_ele_PoPtrueVsEta;
00136 TH2F *h_ele_PoPtrueVsPhi;
00137 TH2F *h_ele_PoPtrueVsPt;
00138 TH1F *h_ele_PoPtrue_barrel;
00139 TH1F *h_ele_PoPtrue_endcaps;
00140 TH1F *h_ele_EtaMnEtaTrue;
00141 TH2F *h_ele_EtaMnEtaTrueVsEta;
00142 TH2F *h_ele_EtaMnEtaTrueVsPhi;
00143 TH2F *h_ele_EtaMnEtaTrueVsPt;
00144 TH1F *h_ele_PhiMnPhiTrue;
00145 TH1F *h_ele_PhiMnPhiTrue2;
00146 TH2F *h_ele_PhiMnPhiTrueVsEta;
00147 TH2F *h_ele_PhiMnPhiTrueVsPhi;
00148 TH2F *h_ele_PhiMnPhiTrueVsPt;
00149 TH1F *h_ele_PinMnPout;
00150 TH1F *h_ele_PinMnPout_mode;
00151 TH2F *h_ele_PinMnPoutVsEta_mode;
00152 TH2F *h_ele_PinMnPoutVsPhi_mode;
00153 TH2F *h_ele_PinMnPoutVsPt_mode;
00154 TH2F *h_ele_PinMnPoutVsE_mode;
00155 TH2F *h_ele_PinMnPoutVsChi2_mode;
00156
00157 TH1F *h_ele_outerP;
00158 TH1F *h_ele_outerP_mode;
00159 TH2F *h_ele_outerPVsEta_mode;
00160 TH1F *h_ele_outerPt;
00161 TH1F *h_ele_outerPt_mode;
00162 TH2F *h_ele_outerPtVsEta_mode;
00163 TH2F *h_ele_outerPtVsPhi_mode;
00164 TH2F *h_ele_outerPtVsPt_mode;
00165 TH1F *h_ele_EoP;
00166 TH2F *h_ele_EoPVsEta;
00167 TH2F *h_ele_EoPVsPhi;
00168 TH2F *h_ele_EoPVsE;
00169 TH1F *h_ele_EoPout;
00170 TH2F *h_ele_EoPoutVsEta;
00171 TH2F *h_ele_EoPoutVsPhi;
00172 TH2F *h_ele_EoPoutVsE;
00173
00174 TH1F *h_ele_dEtaSc_propVtx;
00175 TH2F *h_ele_dEtaScVsEta_propVtx;
00176 TH2F *h_ele_dEtaScVsPhi_propVtx;
00177 TH2F *h_ele_dEtaScVsPt_propVtx;
00178 TH1F *h_ele_dPhiSc_propVtx;
00179 TH2F *h_ele_dPhiScVsEta_propVtx;
00180 TH2F *h_ele_dPhiScVsPhi_propVtx;
00181 TH2F *h_ele_dPhiScVsPt_propVtx;
00182 TH1F *h_ele_dEtaCl_propOut;
00183 TH2F *h_ele_dEtaClVsEta_propOut;
00184 TH2F *h_ele_dEtaClVsPhi_propOut;
00185 TH2F *h_ele_dEtaClVsPt_propOut;
00186 TH1F *h_ele_dPhiCl_propOut;
00187 TH2F *h_ele_dPhiClVsEta_propOut;
00188 TH2F *h_ele_dPhiClVsPhi_propOut;
00189 TH2F *h_ele_dPhiClVsPt_propOut;
00190
00191 TH1F *h_ele_classes;
00192 TH1F *h_ele_eta;
00193 TH1F *h_ele_eta_golden;
00194 TH1F *h_ele_eta_bbrem;
00195 TH1F *h_ele_eta_narrow;
00196 TH1F *h_ele_eta_shower;
00197
00198 TH1F *h_ele_HoE;
00199 TH2F *h_ele_HoEVsEta;
00200 TH2F *h_ele_HoEVsPhi;
00201 TH2F *h_ele_HoEVsE;
00202
00203 TProfile *h_ele_fbremVsEta_mode;
00204 TProfile *h_ele_fbremVsEta_mean;
00205
00206 TH2F *h_ele_PinVsPoutGolden_mode;
00207 TH2F *h_ele_PinVsPoutShowering0_mode;
00208 TH2F *h_ele_PinVsPoutShowering1234_mode;
00209 TH2F *h_ele_PinVsPoutGolden_mean;
00210 TH2F *h_ele_PinVsPoutShowering0_mean;
00211 TH2F *h_ele_PinVsPoutShowering1234_mean;
00212 TH2F *h_ele_PtinVsPtoutGolden_mode;
00213 TH2F *h_ele_PtinVsPtoutShowering0_mode;
00214 TH2F *h_ele_PtinVsPtoutShowering1234_mode;
00215 TH2F *h_ele_PtinVsPtoutGolden_mean;
00216 TH2F *h_ele_PtinVsPtoutShowering0_mean;
00217 TH2F *h_ele_PtinVsPtoutShowering1234_mean;
00218 TH1F *histSclEoEtrueGolden_barrel;
00219 TH1F *histSclEoEtrueGolden_endcaps;
00220 TH1F *histSclEoEtrueShowering0_barrel;
00221 TH1F *histSclEoEtrueShowering0_endcaps;
00222 TH1F *histSclEoEtrueShowering1234_barrel;
00223 TH1F *histSclEoEtrueShowering1234_endcaps;
00224
00225 std::string outputFile_;
00226 edm::InputTag electronCollection_;
00227 edm::InputTag mcTruthCollection_;
00228
00229 double maxPt_;
00230 double maxAbsEta_;
00231 double deltaR_;
00232
00233
00234 double etamin;
00235 double etamax;
00236 double phimin;
00237 double phimax;
00238 double ptmax;
00239 double pmax;
00240 double eopmax;
00241 double eopmaxsht;
00242 double detamin;
00243 double detamax;
00244 double dphimin;
00245 double dphimax;
00246 double detamatchmin;
00247 double detamatchmax;
00248 double dphimatchmin;
00249 double dphimatchmax;
00250 double fhitsmax;
00251 double lhitsmax;
00252 int nbineta;
00253 int nbinp;
00254 int nbinpt;
00255 int nbinpteff;
00256 int nbinphi;
00257 int nbinp2D;
00258 int nbinpt2D;
00259 int nbineta2D;
00260 int nbinphi2D;
00261 int nbineop;
00262 int nbineop2D;
00263 int nbinfhits;
00264 int nbinlhits;
00265 int nbinxyz;
00266 int nbindeta;
00267 int nbindphi;
00268 int nbindetamatch;
00269 int nbindphimatch;
00270 int nbindetamatch2D;
00271 int nbindphimatch2D;
00272
00273 };
00274
00275 #endif
00276
00277
00278