CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/RecoEgamma/Examples/plugins/DQMAnalyzer.h

Go to the documentation of this file.
00001 #ifndef DQMAnalyzer_h
00002 #define DQMAnalyzer_h
00003 
00004 //
00005 // Package:         RecoEgamma/Examples
00006 // Class:           GsfElectronDataAnalyzer
00007 //
00008 
00009 //
00010 // Original Author:  Ursula Berthon, Claude Charlot
00011 //         Created:  Mon Mar 27 13:22:06 CEST 2006
00012 // $Id: DQMAnalyzer.h,v 1.6 2012/09/13 20:08:31 wdd Exp $
00013 //
00014 //
00015 
00016 
00017 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00018 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00019 
00020 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00021 #include "DataFormats/Common/interface/Handle.h"
00022 
00023 #include "FWCore/Framework/interface/EDAnalyzer.h"
00024 #include "FWCore/Framework/interface/Event.h"
00025 #include "FWCore/Framework/interface/ESHandle.h"
00026 #include "FWCore/Framework/interface/EventSetup.h"
00027 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00028 #include "FWCore/Utilities/interface/InputTag.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 DQMAnalyzer : public edm::EDAnalyzer
00039 {
00040  public:
00041 
00042   explicit DQMAnalyzer( const edm::ParameterSet & conf ) ;
00043 
00044   virtual ~DQMAnalyzer() ;
00045 
00046   virtual void beginJob() ;
00047   virtual void endJob() ;
00048   virtual void analyze( const edm::Event & e, const edm::EventSetup & c) ;
00049 
00050  private:
00051 
00052    //=========================================
00053    // parameters
00054    //=========================================
00055 
00056   std::string outputFile_;
00057   edm::InputTag electronCollection_;
00058   edm::InputTag matchingObjectCollection_;
00059   edm::InputTag beamSpot_;
00060   std::string matchingCondition_;
00061   //std::string type_;
00062   bool readAOD_;
00063 
00064   // matching
00065   double maxPtMatchingObject_;
00066   double maxAbsEtaMatchingObject_;
00067   double deltaR_;
00068 
00069   // tag and probe
00070   int Selection_;
00071   double massLow_;
00072   double massHigh_;
00073   bool TPchecksign_;
00074   bool TAGcheckclass_;
00075   bool PROBEetcut_;
00076   bool PROBEcheckclass_;
00077 
00078   // electron selection
00079   double minEt_;
00080   double minPt_;
00081   double maxAbsEta_;
00082   bool isEB_;
00083   bool isEE_;
00084   bool isNotEBEEGap_;
00085   bool isEcalDriven_;
00086   bool isTrackerDriven_;
00087   double eOverPMinBarrel_;
00088   double eOverPMaxBarrel_;
00089   double eOverPMinEndcaps_;
00090   double eOverPMaxEndcaps_;
00091   double dEtaMinBarrel_;
00092   double dEtaMaxBarrel_;
00093   double dEtaMinEndcaps_;
00094   double dEtaMaxEndcaps_;
00095   double dPhiMinBarrel_;
00096   double dPhiMaxBarrel_;
00097   double dPhiMinEndcaps_;
00098   double dPhiMaxEndcaps_;
00099   double sigIetaIetaMinBarrel_;
00100   double sigIetaIetaMaxBarrel_;
00101   double sigIetaIetaMinEndcaps_;
00102   double sigIetaIetaMaxEndcaps_;
00103   double hadronicOverEmMaxBarrel_;
00104   double hadronicOverEmMaxEndcaps_;
00105   double mvaMin_;
00106   double tipMaxBarrel_;
00107   double tipMaxEndcaps_;
00108   double tkIso03Max_;
00109   double hcalIso03Depth1MaxBarrel_;
00110   double hcalIso03Depth1MaxEndcaps_;
00111   double hcalIso03Depth2MaxEndcaps_;
00112   double ecalIso03MaxBarrel_;
00113   double ecalIso03MaxEndcaps_;
00114 
00115   // for trigger
00116   edm::InputTag triggerResults_;
00117   std::vector<std::string > HLTPathsByName_;
00118 
00119   // histos limits and binning
00120   int nbineta; int nbineta2D; double etamin; double etamax;
00121   int nbinphi; int nbinphi2D; double phimin; double phimax;
00122   int nbinpt; int nbinpteff; int nbinpt2D; double ptmax;
00123   int nbinp; int nbinp2D; double pmax;
00124   int nbineop; int nbineop2D; double eopmax; double eopmaxsht;
00125   int nbindeta; double detamin; double detamax;
00126   int nbindphi; double dphimin; double dphimax;
00127   int nbindetamatch; int nbindetamatch2D; double detamatchmin; double detamatchmax;
00128   int nbindphimatch; int nbindphimatch2D; double dphimatchmin; double dphimatchmax;
00129   int nbinfhits; double fhitsmax;
00130   int nbinlhits; double lhitsmax;
00131   int nbinxyz;
00132   int nbinpoptrue; double poptruemin; double poptruemax;
00133   int nbinmee; double meemin; double meemax;
00134   int nbinhoe; double hoemin; double hoemax;
00135 
00136 
00137   //=========================================
00138   // usual attributes and methods
00139   //=========================================
00140 
00141 
00142   unsigned int nEvents_ ;
00143 
00144   bool selected( const reco::GsfElectronCollection::const_iterator & gsfIter , double vertexTIP ) ;
00145   bool generalCut( const reco::GsfElectronCollection::const_iterator & gsfIter) ;
00146   bool etCut( const reco::GsfElectronCollection::const_iterator & gsfIter ) ;
00147   bool isolationCut( const reco::GsfElectronCollection::const_iterator & gsfIter, double vertexTIP ) ;
00148   bool idCut( const reco::GsfElectronCollection::const_iterator & gsfIter ) ;
00149 
00150   bool trigger( const edm::Event & e ) ;
00151   unsigned int nAfterTrigger_;
00152   std::vector<unsigned int> HLTPathsByIndex_;
00153 
00154   TrajectoryStateTransform transformer_;
00155   edm::ESHandle<TrackerGeometry> pDD;
00156   edm::ESHandle<MagneticField> theMagField;
00157 
00158   TFile * histfile_ ;
00159   TTree * tree_ ;
00160 
00161   float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10] ;
00162   float superclusterEnergy[10], superclusterEta[10], superclusterPhi[10], superclusterEt[10] ;
00163   float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10] ;
00164 
00165 
00166   //=========================================
00167   // histograms
00168   //=========================================
00169 
00170   TH1F *h_matchingObjectNum;
00171 
00172   TH1F *h_matchingObjectEta;
00173   TH1F *h_matchingObjectAbsEta;
00174   TH1F *h_matchingObjectP;
00175   TH1F *h_matchingObjectPt;
00176   TH1F *h_matchingObjectPhi;
00177   TH1F *h_matchingObjectZ;
00178 
00179   TH1F *h_ele_matchingObjectEta_matched;
00180   TH1F *h_ele_matchingObjectAbsEta_matched;
00181   TH1F *h_ele_matchingObjectPt_matched;
00182   TH1F *h_ele_matchingObjectPhi_matched;
00183   TH1F *h_ele_matchingObjectZ_matched;
00184 
00185   //TH1F *h_ele_vertexP;
00186   TH1F *h_ele_vertexPt;
00187   TH1F *h_ele_Et;
00188   TH1F *h_ele_vertexEta;
00189   //TH1F *h_ele_vertexAbsEta;
00190   TH1F *h_ele_vertexPhi;
00191   TH1F *h_ele_vertexX;
00192   TH1F *h_ele_vertexY;
00193   TH1F *h_ele_vertexZ;
00194   TH1F *h_ele_vertexTIP;
00195   TH1F *h_ele_charge;
00196 
00197   TH1F *histNum_;
00198 
00199   TH1F *histSclEn_ ;
00200   TH1F *histSclEt_ ;
00201   TH1F *histSclEta_ ;
00202   TH1F *histSclPhi_ ;
00203   TH1F *histSclSigEtaEta_ ;
00204 
00205   TH1F *h_ele_ambiguousTracks;
00206   TH2F *h_ele_ambiguousTracksVsEta;
00207   TH2F *h_ele_ambiguousTracksVsPhi;
00208   TH2F *h_ele_ambiguousTracksVsPt;
00209   TH1F *h_ele_foundHits;
00210 //  TH1F *h_ele_foundHits_barrel;
00211 //  TH1F *h_ele_foundHits_endcaps;
00212   TH2F *h_ele_foundHitsVsEta;
00213   TH2F *h_ele_foundHitsVsPhi;
00214   TH2F *h_ele_foundHitsVsPt;
00215   TH1F *h_ele_lostHits;
00216 //  TH1F *h_ele_lostHits_barrel;
00217 //  TH1F *h_ele_lostHits_endcaps;
00218   TH2F *h_ele_lostHitsVsEta;
00219   TH2F *h_ele_lostHitsVsPhi;
00220   TH2F *h_ele_lostHitsVsPt;
00221   TH1F *h_ele_chi2;
00222 //  TH1F *h_ele_chi2_barrel_;
00223 //  TH1F *h_ele_chi2_endcaps_;
00224   TH2F *h_ele_chi2VsEta;
00225   TH2F *h_ele_chi2VsPhi;
00226   TH2F *h_ele_chi2VsPt;
00227 
00228   TH1F *h_ele_EoP;
00229 //  TH1F *h_ele_EoPout;
00230   TH1F *h_ele_EeleOPout;
00231   TH1F *h_ele_dEtaSc_propVtx;
00232   TH1F *h_ele_dPhiSc_propVtx;
00233   TH1F *h_ele_dEtaCl_propOut;
00234   TH1F *h_ele_dPhiCl_propOut;
00235   TH1F *h_ele_dEtaEleCl_propOut;
00236   TH1F *h_ele_dPhiEleCl_propOut;
00237 //  TH1F *h_ele_dPhiEleCl_propOut_barrel;
00238 //  TH1F *h_ele_dPhiEleCl_propOut_endcaps;
00239   TH1F *h_ele_HoE;
00240   TH1F *h_ele_outerP;
00241   TH1F *h_ele_outerP_mode;
00242   TH1F *h_ele_outerPt;
00243   TH1F *h_ele_outerPt_mode;
00244 
00245   TH1F *h_ele_PinMnPout;
00246   TH1F *h_ele_PinMnPout_mode;
00247 
00248   TH1F *h_ele_mva;
00249   TH1F *h_ele_provenance;
00250 
00251   TH1F *h_ele_tkSumPt_dr03;
00252   TH1F *h_ele_ecalRecHitSumEt_dr03;
00253   TH1F *h_ele_hcalDepth1TowerSumEt_dr03;
00254   TH1F *h_ele_hcalDepth2TowerSumEt_dr03;
00255   TH1F *h_ele_tkSumPt_dr04;
00256   TH1F *h_ele_ecalRecHitSumEt_dr04;
00257   TH1F *h_ele_hcalDepth1TowerSumEt_dr04;
00258   TH1F *h_ele_hcalDepth2TowerSumEt_dr04;
00259 
00260   TH1F *h_ele_mee_os;
00261 
00262   // OBSOLETE
00263   //  TH1F *h_ele_PtoPtmatchingObject_matched; //OBSOLETE ?
00264   //  TH1F *h_ele_PtoPtmatchingObject_barrel_matched; //OBSOLETE ?
00265   //  TH1F *h_ele_PtoPtmatchingObject_endcaps_matched; //OBSOLETE ?
00266   //  TH1F *h_ele_PoPmatchingObject_matched; //OBSOLETE ?
00267   //  TH1F *h_ele_PoPmatchingObject_barrel_matched; //OBSOLETE ?
00268   //  TH1F *h_ele_PoPmatchingObject_endcaps_matched; //OBSOLETE ?
00269   //  TH1F *h_ele_EtaMnEtamatchingObject_matched; //OBSOLETE ?
00270   //  TH1F *h_ele_PhiMnPhimatchingObject_matched; //OBSOLETE ?
00271   //  TH1F *h_ele_PhiMnPhimatchingObject2_matched; //OBSOLETE ?
00272 
00273  };
00274 
00275 #endif