CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DQMOffline/EGamma/plugins/ElectronAnalyzer.h

Go to the documentation of this file.
00001 
00002 #ifndef DQMOffline_EGamma_ElectronAnalyzer_h
00003 #define DQMOffline_EGamma_ElectronAnalyzer_h
00004 
00005 #include "DQMOffline/EGamma/interface/ElectronDqmAnalyzerBase.h"
00006 
00007 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00008 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00009 
00010 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00011 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00012 
00013 class MagneticField ;
00014 
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/Framework/interface/ESHandle.h"
00017 #include "FWCore/Framework/interface/EventSetup.h"
00018 
00019 class ElectronAnalyzer : public ElectronDqmAnalyzerBase
00020  {
00021   public:
00022 
00023     explicit ElectronAnalyzer(const edm::ParameterSet& conf);
00024     virtual ~ElectronAnalyzer();
00025 
00026     virtual void book() ;
00027     virtual void analyze( const edm::Event & e, const edm::EventSetup & c) ;
00028 
00029   private:
00030 
00031     //=========================================
00032     // parameters
00033     //=========================================
00034 
00035     // general, collections
00036     int Selection_;
00037     edm::InputTag electronCollection_;
00038     edm::InputTag matchingObjectCollection_;
00039     edm::InputTag gsftrackCollection_;
00040     edm::InputTag trackCollection_;
00041     edm::InputTag vertexCollection_;
00042     edm::InputTag beamSpotTag_;
00043     bool readAOD_; //NEW
00044 
00045     // matching
00046     std::string matchingCondition_; //NEW
00047     double maxPtMatchingObject_; // SURE ?
00048     double maxAbsEtaMatchingObject_; // SURE ?
00049     double deltaR_;
00050 
00051     // electron selection NEW
00052     double minEt_;
00053     double minPt_;
00054     double maxAbsEta_;
00055     bool isEB_;
00056     bool isEE_;
00057     bool isNotEBEEGap_;
00058     bool isEcalDriven_;
00059     bool isTrackerDriven_;
00060     double eOverPMinBarrel_;
00061     double eOverPMaxBarrel_;
00062     double eOverPMinEndcaps_;
00063     double eOverPMaxEndcaps_;
00064     double dEtaMinBarrel_;
00065     double dEtaMaxBarrel_;
00066     double dEtaMinEndcaps_;
00067     double dEtaMaxEndcaps_;
00068     double dPhiMinBarrel_;
00069     double dPhiMaxBarrel_;
00070     double dPhiMinEndcaps_;
00071     double dPhiMaxEndcaps_;
00072     double sigIetaIetaMinBarrel_;
00073     double sigIetaIetaMaxBarrel_;
00074     double sigIetaIetaMinEndcaps_;
00075     double sigIetaIetaMaxEndcaps_;
00076     double hadronicOverEmMaxBarrel_;
00077     double hadronicOverEmMaxEndcaps_;
00078     double mvaMin_;
00079     double tipMaxBarrel_;
00080     double tipMaxEndcaps_;
00081     double tkIso03Max_;
00082     double hcalIso03Depth1MaxBarrel_;
00083     double hcalIso03Depth1MaxEndcaps_;
00084     double hcalIso03Depth2MaxEndcaps_;
00085     double ecalIso03MaxBarrel_;
00086     double ecalIso03MaxEndcaps_;
00087 
00088     // for trigger NEW
00089     edm::InputTag triggerResults_;
00090 //    std::vector<std::string > HLTPathsByName_;
00091 
00092     // histos limits and binning
00093     int nbineta; int nbineta2D; double etamin; double etamax;
00094     int nbinphi; int nbinphi2D; double phimin; double phimax;
00095     int nbinpt; int nbinpteff; int nbinpt2D; double ptmax;
00096     int nbinp; int nbinp2D; double pmax;
00097     int nbineop; int nbineop2D; double eopmax; double eopmaxsht;
00098     int nbindeta; double detamin; double detamax;
00099     int nbindphi; double dphimin; double dphimax;
00100     int nbindetamatch; int nbindetamatch2D; double detamatchmin; double detamatchmax;
00101     int nbindphimatch; int nbindphimatch2D; double dphimatchmin; double dphimatchmax;
00102     int nbinfhits; double fhitsmax;
00103     int nbinlhits; double lhitsmax;
00104     int nbinxyz; int nbinxyz2D;
00105     int nbinpoptrue; double poptruemin; double poptruemax; //NEW
00106     int nbinmee; double meemin; double meemax; //NEW
00107     int nbinhoe; double hoemin; double hoemax; //NEW
00108 
00109     //=========================================
00110     // general attributes and utility methods
00111     //=========================================
00112 
00113     unsigned int nEvents_ ;
00114 
00115     float computeInvMass
00116      ( const reco::GsfElectron & e1,
00117        const reco::GsfElectron & e2 ) ;
00118 
00119     bool selected( const reco::GsfElectronCollection::const_iterator & gsfIter , double vertexTIP ) ;
00120     bool generalCut( const reco::GsfElectronCollection::const_iterator & gsfIter) ;
00121     bool etCut( const reco::GsfElectronCollection::const_iterator & gsfIter ) ;
00122     bool isolationCut( const reco::GsfElectronCollection::const_iterator & gsfIter, double vertexTIP ) ;
00123     bool idCut( const reco::GsfElectronCollection::const_iterator & gsfIter ) ;
00124 
00125 //    bool trigger( const edm::Event & e ) ;
00126 //    unsigned int nAfterTrigger_;
00127 //    std::vector<unsigned int> HLTPathsByIndex_;
00128 
00129     edm::ESHandle<TrackerGeometry> pDD;
00130     edm::ESHandle<MagneticField> theMagField;
00131 
00132     float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10];
00133     float superclusterEnergy[10], superclusterEta[10], superclusterPhi[10], superclusterEt[10];
00134     float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10];
00135 
00136     //=========================================
00137     // histograms
00138     //=========================================
00139 
00140     // general
00141     MonitorElement * h2_beamSpotXvsY ;
00142     MonitorElement * py_nElectronsVsLs ;
00143     MonitorElement * py_nClustersVsLs ;
00144     MonitorElement * py_nGsfTracksVsLs ;
00145     MonitorElement * py_nTracksVsLs ;
00146     MonitorElement * py_nVerticesVsLs ;
00147     MonitorElement * h1_triggers ;
00148 
00149     // basic quantities
00150 //    MonitorElement * h1_num_ ; // number of electrons in a single event
00151 //    MonitorElement * h1_charge ;
00152 //    MonitorElement * h1_vertexP ;
00153 //    MonitorElement * h1_Et ;
00154 //    MonitorElement * h1_vertexTIP ;
00155 //    MonitorElement * h1_vertexPhi ;
00156 //    MonitorElement * h1_vertexX ;
00157 //    MonitorElement * h1_vertexY ;
00158     MonitorElement * h1_vertexPt_barrel ;
00159     MonitorElement * h1_vertexPt_endcaps ;
00160     MonitorElement * h1_vertexEta ;
00161     MonitorElement * h2_vertexEtaVsPhi ;
00162     MonitorElement * h2_vertexXvsY ;
00163     MonitorElement * h1_vertexZ ;
00164 
00165     // super-clusters
00166 //    MonitorElement * h1_sclEn ;
00167 //    MonitorElement * h1_sclEta ;
00168 //    MonitorElement * h1_sclPhi ;
00169     MonitorElement * h1_sclEt ;
00170 
00171     // gsf tracks
00172 //    MonitorElement * h1_ambiguousTracks ;
00173 //    MonitorElement * h2ele_ambiguousTracksVsEta ;
00174 //    MonitorElement * h2_ambiguousTracksVsPhi ;
00175 //    MonitorElement * h2_ambiguousTracksVsPt ;
00176     MonitorElement * h1_chi2 ;
00177     MonitorElement * py_chi2VsEta ;
00178     MonitorElement * py_chi2VsPhi ;
00179 //    MonitorElement * h2_chi2VsPt ;
00180     MonitorElement * h1_foundHits ;
00181     MonitorElement * py_foundHitsVsEta ;
00182     MonitorElement * py_foundHitsVsPhi ;
00183 //    MonitorElement * h2_foundHitsVsPt ;
00184     MonitorElement * h1_lostHits ;
00185     MonitorElement * py_lostHitsVsEta ;
00186     MonitorElement * py_lostHitsVsPhi ;
00187 //    MonitorElement * h2_lostHitsVsPt ;
00188 
00189     // electron matching and ID
00190     //MonitorElement * h_EopOut ;
00191     //MonitorElement * h_dEtaCl_propOut ;
00192     //MonitorElement * h_dPhiCl_propOut ;
00193 //    MonitorElement * h1_Eop ;
00194 //    MonitorElement * h2_EopVsEta ;
00195     MonitorElement * h1_Eop_barrel ;
00196     MonitorElement * h1_Eop_endcaps ;
00197     MonitorElement * py_EopVsPhi ;
00198 //    MonitorElement * h1_EopVsPt ;
00199 //    MonitorElement * h1_EeleOPout ;
00200 //    MonitorElement * h2_EeleOPoutVsEta ;
00201     MonitorElement * h1_EeleOPout_barrel ;
00202     MonitorElement * h1_EeleOPout_endcaps ;
00203 //    MonitorElement * h2_EeleOPoutVsPhi ;
00204 //    MonitorElement * h2_EeleOPoutVsPt ;
00205 //    MonitorElement * h1_dEtaSc_propVtx ;
00206 //    MonitorElement * h2_dEtaSc_propVtxVsEta ;
00207     MonitorElement * h1_dEtaSc_propVtx_barrel ;
00208     MonitorElement * h1_dEtaSc_propVtx_endcaps ;
00209     MonitorElement * py_dEtaSc_propVtxVsPhi ;
00210 //    MonitorElement * h2_dEtaSc_propVtxVsPt ;
00211 //    MonitorElement * h1_dEtaEleCl_propOut ;
00212 //    MonitorElement * h2_dEtaEleCl_propOutVsEta ;
00213     MonitorElement * h1_dEtaEleCl_propOut_barrel ;
00214     MonitorElement * h1_dEtaEleCl_propOut_endcaps ;
00215 //    MonitorElement * h2_dEtaEleCl_propOutVsPhi ;
00216 //    MonitorElement * h2_dEtaEleCl_propOutVsPt ;
00217 //    MonitorElement * h1_dPhiSc_propVtx ;
00218 //    MonitorElement * h2_dPhiSc_propVtxVsEta ;
00219     MonitorElement * h1_dPhiSc_propVtx_barrel ;
00220     MonitorElement * h1_dPhiSc_propVtx_endcaps ;
00221     MonitorElement * py_dPhiSc_propVtxVsPhi ;
00222 //    MonitorElement * h2_dPhiSc_propVtxVsPt ;
00223 //    MonitorElement * h1_dPhiEleCl_propOut ;
00224 //    MonitorElement * h2_dPhiEleCl_propOutVsEta ;
00225     MonitorElement * h1_dPhiEleCl_propOut_barrel ;
00226     MonitorElement * h1_dPhiEleCl_propOut_endcaps ;
00227 //    MonitorElement * h2_dPhiEleCl_propOutVsPhi ;
00228 //    MonitorElement * h2_dPhiEleCl_propOutVsPt ;
00229 //    MonitorElement * h1_Hoe ;
00230 //    MonitorElement * h2_HoeVsEta ;
00231     MonitorElement * h1_Hoe_barrel ;
00232     MonitorElement * h1_Hoe_endcaps ;
00233     MonitorElement * py_HoeVsPhi ;
00234 //    MonitorElement * h2_HoeVsPt ;
00235     MonitorElement * h1_sclSigEtaEta_barrel ;
00236     MonitorElement * h1_sclSigEtaEta_endcaps ;
00237 
00238     // fbrem related variables
00239     //MonitorElement * h_outerP ;
00240     //MonitorElement * h_outerP_mode ;
00241 //    MonitorElement * h_innerPt_mean ;
00242 //    MonitorElement * h_outerPt_mean ;
00243 //    MonitorElement * h_outerPt_mode ;
00244 //    MonitorElement * h_PinMnPout ;
00245 //    MonitorElement * h_PinMnPout_mode ;
00246     MonitorElement * h1_fbrem ;
00247     MonitorElement * py_fbremVsEta ;
00248     MonitorElement * py_fbremVsPhi ;
00249 //    MonitorElement * h2_fbremVsPt ;
00250     MonitorElement * h1_classes ;
00251 
00252     // pflow
00253     MonitorElement * h1_mva ;
00254     MonitorElement * h1_provenance ;
00255 
00256     // isolation
00257     MonitorElement * h1_tkSumPt_dr03 ;
00258     MonitorElement * h1_ecalRecHitSumEt_dr03 ;
00259     MonitorElement * h1_hcalTowerSumEt_dr03 ;
00260 //    MonitorElement * h1_hcalDepth1TowerSumEt_dr03 ;
00261 //    MonitorElement * h1_hcalDepth2TowerSumEt_dr03 ;
00262 //    MonitorElement * h1_tkSumPt_dr04 ;
00263 //    MonitorElement * h1_ecalRecHitSumEt_dr04 ;
00264 //    MonitorElement * h1_hcalTowerSumEt_dr04 ;
00267 
00268     // di-electron mass
00269     MonitorElement * h1_mee ;
00270     MonitorElement * h1_mee_os ;
00271 
00272 
00273     // histos for matching and matched objects
00274 
00275 //    MonitorElement * h1_matchedEle_eta ;
00276 //    MonitorElement * h1_matchedEle_eta_golden ;
00277 //    MonitorElement * h1_matchedEle_eta_shower ;
00278 //    //MonitorElement * h1_matchedEle_eta_bbrem ;
00279 //    //MonitorElement * h1_matchedEle_eta_narrow ;
00280 
00281     MonitorElement * h1_matchedObject_Eta ;
00282 //    MonitorElement * h1_matchedObject_AbsEta ;
00283     MonitorElement * h1_matchedObject_Pt ;
00284     MonitorElement * h1_matchedObject_Phi ;
00285 //    MonitorElement * h1_matchedObject_Z ;
00286 
00287 //    MonitorElement * h1_matchingObject_Num ;
00288     MonitorElement * h1_matchingObject_Eta ;
00289 //    MonitorElement * h1_matchingObject_AbsEta ;
00290 //    MonitorElement * h1_matchingObject_P ;
00291     MonitorElement * h1_matchingObject_Pt ;
00292     MonitorElement * h1_matchingObject_Phi ;
00293 //    MonitorElement * h1_matchingObject_Z ;
00294 
00295  } ;
00296 
00297 #endif
00298 
00299 
00300