CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/ElectroWeakAnalysis/WENu/interface/WenuPlots.h

Go to the documentation of this file.
00001 #ifndef WenuPlots_H
00002 #define WenuPlots_H
00003 
00004 #include <memory>
00005 
00006 #include "FWCore/Framework/interface/Frameworkfwd.h"
00007 #include "FWCore/Framework/interface/EDAnalyzer.h"
00008 
00009 #include "FWCore/Framework/interface/Event.h"
00010 #include "FWCore/Framework/interface/MakerMacros.h"
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00013 #include "FWCore/Utilities/interface/InputTag.h"
00014 #include "DataFormats/PatCandidates/interface/Electron.h"
00015 #include "DataFormats/PatCandidates/interface/MET.h"
00016 #include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
00017 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00018 
00019 //#include "DataFormats/BeamSpot/interface/BeamSpot.h"
00020 
00021 #include <vector>
00022 #include <iostream>
00023 #include "TFile.h"
00024 #include "TTree.h"
00025 #include "TString.h"
00026 #include "TH1F.h"
00027 #include "TMath.h"
00028 
00029 //
00030 // class decleration
00031 //
00032 
00033 class WenuPlots : public edm::EDAnalyzer {
00034    public:
00035       explicit WenuPlots(const edm::ParameterSet&);
00036       ~WenuPlots();
00037 
00038 
00039    private:
00040       virtual void beginJob() ;
00041       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00042       virtual void endJob() ;
00043 
00044       // ----------member data ---------------------------
00045       Bool_t CheckCuts( const pat::Electron * ele);
00046       Bool_t CheckCut( const pat::Electron *wenu, Int_t i);
00047       Bool_t CheckCutsInverse(const pat::Electron *ele);
00048       Bool_t CheckCutInv( const pat::Electron *wenu, Int_t i);
00049       Bool_t CheckCutsNminusOne(const pat::Electron *ele, Int_t jj);
00050       Double_t ReturnCandVar(const pat::Electron *ele, Int_t i);
00051       Bool_t   PassPreselectionCriteria(const pat::Electron *ele);
00052   // for the extra identifications and selections
00053   Bool_t   usePrecalcID_;
00054   std::string usePrecalcIDSign_;
00055   std::string usePrecalcIDType_;
00056   Double_t usePrecalcIDValue_;
00057   // for extra preselection criteria:
00058   Bool_t useValidFirstPXBHit_;
00059   Bool_t useConversionRejection_;
00060   Bool_t useExpectedMissingHits_;
00061   Int_t  maxNumberOfExpectedMissingHits_;
00062   Bool_t usePreselection_;
00063   std::string outputFile_;
00064   edm::InputTag wenuCollectionTag_;
00065   edm::InputTag caloJetCollectionTag_;
00066   edm::InputTag pfJetCollectionTag_;
00067   edm::InputTag   PrimaryVerticesCollection_;
00068   edm::InputTag   PrimaryVerticesCollectionBS_;
00069   TFile *histofile;
00070   //
00071   //  math::XYZPoint bspotPosition_; // comment out only if you don't use pat
00072   //
00073   // the histograms ********************
00074 
00075   TH1F *h_met;
00076   TH1F *h_met_inverse;
00077   TH1F *h_mt;
00078   TH1F *h_mt_inverse;
00079 
00080   TH1F *h_met_EB;
00081   TH1F *h_met_inverse_EB;
00082   TH1F *h_mt_EB;
00083   TH1F *h_mt_inverse_EB;
00084 
00085   TH1F *h_met_EE;
00086   TH1F *h_met_inverse_EE;
00087   TH1F *h_mt_EE;
00088   TH1F *h_mt_inverse_EE;
00089 
00090 
00091   TH1F *h_scEt;
00092   TH1F *h_scEta;
00093   TH1F *h_scPhi;
00094 
00095   TH1F *h_EB_trkiso;
00096   TH1F *h_EB_ecaliso;
00097   TH1F *h_EB_hcaliso;
00098   TH1F *h_EB_sIetaIeta;
00099   TH1F *h_EB_dphi;
00100   TH1F *h_EB_deta;
00101   TH1F *h_EB_HoE;
00102 
00103   TH1F *h_EE_trkiso;
00104   TH1F *h_EE_ecaliso;
00105   TH1F *h_EE_hcaliso;
00106   TH1F *h_EE_sIetaIeta;
00107   TH1F *h_EE_dphi;
00108   TH1F *h_EE_deta;
00109   TH1F *h_EE_HoE;
00110 
00111   //
00112   TH1F *h_trackIso_eb_NmOne;
00113   TH1F *h_trackIso_ee_NmOne;
00114   // ***********************************
00115   //
00116   // the selection cuts
00117   Double_t trackIso_EB_;
00118   Double_t ecalIso_EB_;
00119   Double_t hcalIso_EB_;
00120   //
00121   Double_t trackIso_EE_;
00122   Double_t ecalIso_EE_;
00123   Double_t hcalIso_EE_;
00124   //
00125   Double_t sihih_EB_;
00126   Double_t deta_EB_;
00127   Double_t dphi_EB_;
00128   Double_t hoe_EB_;
00129   Double_t cIso_EB_;
00130   Double_t tip_bspot_EB_;
00131   Double_t eop_EB_;
00132   //
00133   Double_t sihih_EE_;
00134   Double_t deta_EE_;
00135   Double_t dphi_EE_;
00136   Double_t hoe_EE_;
00137   Double_t cIso_EE_;
00138   Double_t tip_bspot_EE_;
00139   Double_t eop_EE_;
00140   //
00141   Double_t trackIsoUser_EB_;
00142   Double_t ecalIsoUser_EB_;
00143   Double_t hcalIsoUser_EB_;
00144   Double_t trackIsoUser_EE_;
00145   Double_t ecalIsoUser_EE_;
00146   Double_t hcalIsoUser_EE_;
00147   //
00148   Bool_t trackIso_EB_inv;
00149   Bool_t ecalIso_EB_inv;
00150   Bool_t hcalIso_EB_inv;
00151   //
00152   Bool_t trackIso_EE_inv;
00153   Bool_t ecalIso_EE_inv;
00154   Bool_t hcalIso_EE_inv;
00155   //
00156   Bool_t sihih_EB_inv;
00157   Bool_t deta_EB_inv;
00158   Bool_t dphi_EB_inv;
00159   Bool_t hoe_EB_inv;
00160   Bool_t cIso_EB_inv;
00161   Bool_t tip_bspot_EB_inv;
00162   Bool_t eop_EB_inv;
00163   //
00164   Bool_t sihih_EE_inv;
00165   Bool_t deta_EE_inv;
00166   Bool_t dphi_EE_inv;
00167   Bool_t hoe_EE_inv;
00168   Bool_t cIso_EE_inv;
00169   Bool_t tip_bspot_EE_inv;
00170   Bool_t eop_EE_inv;
00171   //
00172   Bool_t trackIsoUser_EB_inv;
00173   Bool_t ecalIsoUser_EB_inv;
00174   Bool_t hcalIsoUser_EB_inv;
00175   Bool_t trackIsoUser_EE_inv;
00176   Bool_t ecalIsoUser_EE_inv;
00177   Bool_t hcalIsoUser_EE_inv;
00178   //
00179   //
00180   Int_t nBarrelVars_;
00181   //
00182   std::vector<Double_t> CutVars_;
00183   std::vector<Bool_t> InvVars_;
00184   //
00185   // variables related to the VBTF root tuples:
00186   //
00187   Int_t runNumber, lumiSection;
00188   Long64_t eventNumber;
00189   Float_t ele_sc_energy, ele_sc_eta, ele_sc_phi, ele_sc_rho;
00190   Float_t ele_sc_gsf_et;
00191   Float_t ele_cand_et, ele_cand_eta, ele_cand_phi;
00192   Float_t ele_iso_track, ele_iso_ecal, ele_iso_hcal;
00193   Float_t ele_id_sihih, ele_id_dphi, ele_id_deta, ele_id_hoe;
00194   Float_t ele_cr_dcot, ele_cr_dist;
00195   Int_t   ele_cr_mhitsinner;
00196   Float_t ele_vx, ele_vy, ele_vz;
00197   Float_t ele_pin, ele_pout;
00198   Float_t pv_x, pv_y, pv_z;
00199   Int_t   ele_gsfCharge, ele_ctfCharge, ele_scPixCharge;
00200   Float_t ele_eop, ele_tip_bs, ele_tip_pv;
00201   Float_t event_caloMET, event_pfMET, event_tcMET;
00202   Float_t event_caloSumEt, event_pfSumEt, event_tcSumEt;
00203   Float_t event_caloMET_phi, event_pfMET_phi, event_tcMET_phi;
00204   Float_t event_caloMT, event_pfMT, event_tcMT;
00205   Float_t calojet_et[5];
00206   Float_t calojet_eta[5];
00207   Float_t calojet_phi[5];
00208   Float_t pfjet_et[5];
00209   Float_t pfjet_eta[5];
00210   Float_t pfjet_phi[5];
00211   Float_t ele2nd_sc_gsf_et;
00212   Float_t ele2nd_sc_eta;
00213   Float_t ele2nd_sc_phi;
00214   Float_t ele2nd_sc_rho;
00215   Float_t ele2nd_cand_eta;
00216   Float_t ele2nd_cand_phi;
00217   Float_t ele2nd_pin;
00218   Float_t ele2nd_pout;
00219   Int_t   ele2nd_passes_selection;
00220   Int_t   ele2nd_ecalDriven;
00221   Float_t ele_hltmatched_dr;
00222   Int_t   event_triggerDecision;
00223   Int_t event_datasetTag;
00224 
00225   TFile *WENU_VBTFpreseleFile_;
00226   TFile *WENU_VBTFselectionFile_;
00227   TTree *vbtfSele_tree;
00228   TTree *vbtfPresele_tree;
00229   std::string WENU_VBTFselectionFileName_;
00230   std::string WENU_VBTFpreseleFileName_;
00231   Bool_t includeJetInformationInNtuples_;
00232   Bool_t storeExtraInformation_;
00233   Double_t DRJetFromElectron_;
00234   Int_t DatasetTag_;
00235   // for the 2nd electron storage
00236   Bool_t storeAllSecondElectronVariables_;
00237   Float_t ele2nd_cand_et;
00238   Float_t ele2nd_iso_track, ele2nd_iso_ecal, ele2nd_iso_hcal;
00239   Float_t ele2nd_id_sihih, ele2nd_id_deta, ele2nd_id_dphi, ele2nd_id_hoe;
00240   Float_t ele2nd_cr_dcot, ele2nd_cr_dist;
00241   Float_t ele2nd_vx, ele2nd_vy, ele2nd_vz;
00242   Int_t   ele2nd_cr_mhitsinner, ele2nd_gsfCharge, ele2nd_ctfCharge, ele2nd_scPixCharge;
00243   Float_t ele2nd_eop, ele2nd_tip_bs, ele2nd_tip_pv;
00244   Float_t ele2nd_hltmatched_dr;
00245   std::vector<Int_t> VtxTracksSize;
00246   std::vector<Float_t> VtxNormalizedChi2;
00247   std::vector<Int_t> VtxTracksSizeBS;
00248   std::vector<Float_t> VtxNormalizedChi2BS;
00249   Float_t pvbs_x, pvbs_y, pvbs_z;
00250   Float_t ele_tip_pvbs, ele2nd_tip_pvbs;
00251 };
00252 
00253 #endif