CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/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     TrajectoryStateTransform transformer_ ;
00130     edm::ESHandle<TrackerGeometry> pDD;
00131     edm::ESHandle<MagneticField> theMagField;
00132 
00133     float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10];
00134     float superclusterEnergy[10], superclusterEta[10], superclusterPhi[10], superclusterEt[10];
00135     float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10];
00136 
00137     //=========================================
00138     // histograms
00139     //=========================================
00140 
00141     // general
00142     MonitorElement * h2_beamSpotXvsY ;
00143     MonitorElement * py_nElectronsVsLs ;
00144     MonitorElement * py_nClustersVsLs ;
00145     MonitorElement * py_nGsfTracksVsLs ;
00146     MonitorElement * py_nTracksVsLs ;
00147     MonitorElement * py_nVerticesVsLs ;
00148     MonitorElement * h1_triggers ;
00149 
00150     // basic quantities
00151 //    MonitorElement * h1_num_ ; // number of electrons in a single event
00152 //    MonitorElement * h1_charge ;
00153 //    MonitorElement * h1_vertexP ;
00154 //    MonitorElement * h1_Et ;
00155 //    MonitorElement * h1_vertexTIP ;
00156 //    MonitorElement * h1_vertexPhi ;
00157 //    MonitorElement * h1_vertexX ;
00158 //    MonitorElement * h1_vertexY ;
00159     MonitorElement * h1_vertexPt_barrel ;
00160     MonitorElement * h1_vertexPt_endcaps ;
00161     MonitorElement * h1_vertexEta ;
00162     MonitorElement * h2_vertexEtaVsPhi ;
00163     MonitorElement * h2_vertexXvsY ;
00164     MonitorElement * h1_vertexZ ;
00165 
00166     // super-clusters
00167 //    MonitorElement * h1_sclEn ;
00168 //    MonitorElement * h1_sclEta ;
00169 //    MonitorElement * h1_sclPhi ;
00170     MonitorElement * h1_sclEt ;
00171 
00172     // gsf tracks
00173 //    MonitorElement * h1_ambiguousTracks ;
00174 //    MonitorElement * h2ele_ambiguousTracksVsEta ;
00175 //    MonitorElement * h2_ambiguousTracksVsPhi ;
00176 //    MonitorElement * h2_ambiguousTracksVsPt ;
00177     MonitorElement * h1_chi2 ;
00178     MonitorElement * py_chi2VsEta ;
00179     MonitorElement * py_chi2VsPhi ;
00180 //    MonitorElement * h2_chi2VsPt ;
00181     MonitorElement * h1_foundHits ;
00182     MonitorElement * py_foundHitsVsEta ;
00183     MonitorElement * py_foundHitsVsPhi ;
00184 //    MonitorElement * h2_foundHitsVsPt ;
00185     MonitorElement * h1_lostHits ;
00186     MonitorElement * py_lostHitsVsEta ;
00187     MonitorElement * py_lostHitsVsPhi ;
00188 //    MonitorElement * h2_lostHitsVsPt ;
00189 
00190     // electron matching and ID
00191     //MonitorElement * h_EopOut ;
00192     //MonitorElement * h_dEtaCl_propOut ;
00193     //MonitorElement * h_dPhiCl_propOut ;
00194 //    MonitorElement * h1_Eop ;
00195 //    MonitorElement * h2_EopVsEta ;
00196     MonitorElement * h1_Eop_barrel ;
00197     MonitorElement * h1_Eop_endcaps ;
00198     MonitorElement * py_EopVsPhi ;
00199 //    MonitorElement * h1_EopVsPt ;
00200 //    MonitorElement * h1_EeleOPout ;
00201 //    MonitorElement * h2_EeleOPoutVsEta ;
00202     MonitorElement * h1_EeleOPout_barrel ;
00203     MonitorElement * h1_EeleOPout_endcaps ;
00204 //    MonitorElement * h2_EeleOPoutVsPhi ;
00205 //    MonitorElement * h2_EeleOPoutVsPt ;
00206 //    MonitorElement * h1_dEtaSc_propVtx ;
00207 //    MonitorElement * h2_dEtaSc_propVtxVsEta ;
00208     MonitorElement * h1_dEtaSc_propVtx_barrel ;
00209     MonitorElement * h1_dEtaSc_propVtx_endcaps ;
00210     MonitorElement * py_dEtaSc_propVtxVsPhi ;
00211 //    MonitorElement * h2_dEtaSc_propVtxVsPt ;
00212 //    MonitorElement * h1_dEtaEleCl_propOut ;
00213 //    MonitorElement * h2_dEtaEleCl_propOutVsEta ;
00214     MonitorElement * h1_dEtaEleCl_propOut_barrel ;
00215     MonitorElement * h1_dEtaEleCl_propOut_endcaps ;
00216 //    MonitorElement * h2_dEtaEleCl_propOutVsPhi ;
00217 //    MonitorElement * h2_dEtaEleCl_propOutVsPt ;
00218 //    MonitorElement * h1_dPhiSc_propVtx ;
00219 //    MonitorElement * h2_dPhiSc_propVtxVsEta ;
00220     MonitorElement * h1_dPhiSc_propVtx_barrel ;
00221     MonitorElement * h1_dPhiSc_propVtx_endcaps ;
00222     MonitorElement * py_dPhiSc_propVtxVsPhi ;
00223 //    MonitorElement * h2_dPhiSc_propVtxVsPt ;
00224 //    MonitorElement * h1_dPhiEleCl_propOut ;
00225 //    MonitorElement * h2_dPhiEleCl_propOutVsEta ;
00226     MonitorElement * h1_dPhiEleCl_propOut_barrel ;
00227     MonitorElement * h1_dPhiEleCl_propOut_endcaps ;
00228 //    MonitorElement * h2_dPhiEleCl_propOutVsPhi ;
00229 //    MonitorElement * h2_dPhiEleCl_propOutVsPt ;
00230 //    MonitorElement * h1_Hoe ;
00231 //    MonitorElement * h2_HoeVsEta ;
00232     MonitorElement * h1_Hoe_barrel ;
00233     MonitorElement * h1_Hoe_endcaps ;
00234     MonitorElement * py_HoeVsPhi ;
00235 //    MonitorElement * h2_HoeVsPt ;
00236     MonitorElement * h1_sclSigEtaEta_barrel ;
00237     MonitorElement * h1_sclSigEtaEta_endcaps ;
00238 
00239     // fbrem related variables
00240     //MonitorElement * h_outerP ;
00241     //MonitorElement * h_outerP_mode ;
00242 //    MonitorElement * h_innerPt_mean ;
00243 //    MonitorElement * h_outerPt_mean ;
00244 //    MonitorElement * h_outerPt_mode ;
00245 //    MonitorElement * h_PinMnPout ;
00246 //    MonitorElement * h_PinMnPout_mode ;
00247     MonitorElement * h1_fbrem ;
00248     MonitorElement * py_fbremVsEta ;
00249     MonitorElement * py_fbremVsPhi ;
00250 //    MonitorElement * h2_fbremVsPt ;
00251     MonitorElement * h1_classes ;
00252 
00253     // pflow
00254     MonitorElement * h1_mva ;
00255     MonitorElement * h1_provenance ;
00256 
00257     // isolation
00258     MonitorElement * h1_tkSumPt_dr03 ;
00259     MonitorElement * h1_ecalRecHitSumEt_dr03 ;
00260     MonitorElement * h1_hcalTowerSumEt_dr03 ;
00261 //    MonitorElement * h1_hcalDepth1TowerSumEt_dr03 ;
00262 //    MonitorElement * h1_hcalDepth2TowerSumEt_dr03 ;
00263 //    MonitorElement * h1_tkSumPt_dr04 ;
00264 //    MonitorElement * h1_ecalRecHitSumEt_dr04 ;
00265 //    MonitorElement * h1_hcalTowerSumEt_dr04 ;
00268 
00269     // di-electron mass
00270     MonitorElement * h1_mee ;
00271     MonitorElement * h1_mee_os ;
00272 
00273 
00274     // histos for matching and matched objects
00275 
00276 //    MonitorElement * h1_matchedEle_eta ;
00277 //    MonitorElement * h1_matchedEle_eta_golden ;
00278 //    MonitorElement * h1_matchedEle_eta_shower ;
00279 //    //MonitorElement * h1_matchedEle_eta_bbrem ;
00280 //    //MonitorElement * h1_matchedEle_eta_narrow ;
00281 
00282     MonitorElement * h1_matchedObject_Eta ;
00283 //    MonitorElement * h1_matchedObject_AbsEta ;
00284     MonitorElement * h1_matchedObject_Pt ;
00285     MonitorElement * h1_matchedObject_Phi ;
00286 //    MonitorElement * h1_matchedObject_Z ;
00287 
00288 //    MonitorElement * h1_matchingObject_Num ;
00289     MonitorElement * h1_matchingObject_Eta ;
00290 //    MonitorElement * h1_matchingObject_AbsEta ;
00291 //    MonitorElement * h1_matchingObject_P ;
00292     MonitorElement * h1_matchingObject_Pt ;
00293     MonitorElement * h1_matchingObject_Phi ;
00294 //    MonitorElement * h1_matchingObject_Z ;
00295 
00296  } ;
00297 
00298 #endif
00299 
00300 
00301