PageRenderTime 35ms CodeModel.GetById 12ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

/ElectroWeakAnalysis/ZEE/interface/ZeePlots.h

https://github.com/aivanov-cern/cmssw
C Header | 304 lines | 193 code | 57 blank | 54 comment | 0 complexity | 76c418bf37b57d5f3ce59cdfe273230c MD5 | raw file
  1#ifndef ZeePlots_H
  2#define ZeePlots_H
  3
  4#include <memory>
  5
  6#include "FWCore/Framework/interface/Frameworkfwd.h"
  7#include "FWCore/Framework/interface/EDAnalyzer.h"
  8
  9#include "FWCore/Framework/interface/Event.h"
 10#include "FWCore/Framework/interface/MakerMacros.h"
 11#include "FWCore/ParameterSet/interface/ParameterSet.h"
 12#include "FWCore/MessageLogger/interface/MessageLogger.h"
 13#include "FWCore/Utilities/interface/InputTag.h"
 14#include "DataFormats/PatCandidates/interface/Electron.h"
 15#include "DataFormats/PatCandidates/interface/MET.h"
 16#include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
 17#include "DataFormats/EgammaCandidates/interface/Electron.h"
 18#include "DataFormats/Math/interface/Vector3D.h"
 19
 20#include <vector>
 21#include <iostream>
 22#include "TFile.h"
 23#include "TTree.h"
 24#include "TString.h"
 25#include "TLorentzVector.h"
 26#include "TH1F.h"
 27#include "TMath.h"
 28
 29//
 30// class decleration
 31//
 32
 33class ZeePlots : public edm::EDAnalyzer {
 34public:
 35    explicit ZeePlots( const edm::ParameterSet& );
 36    ~ZeePlots();
 37
 38
 39private:
 40    virtual void beginJob() ;
 41    virtual void analyze( const edm::Event&, const edm::EventSetup& );
 42    virtual void endJob() ;
 43
 44    // ----------member data ---------------------------
 45
 46    // for the 1st leg
 47    Bool_t CheckCuts1( const pat::Electron* );
 48    Bool_t CheckCut1( const pat::Electron* , Int_t );
 49    Bool_t CheckCuts1Inverse( const pat::Electron* );
 50    Bool_t CheckCut1Inv( const pat::Electron* , Int_t );
 51    Bool_t CheckCuts1NminusOne( const pat::Electron* , Int_t );
 52
 53    // for the 2nd leg
 54    Bool_t CheckCuts2( const pat::Electron* );
 55    Bool_t CheckCut2( const pat::Electron* , Int_t );
 56    Bool_t CheckCuts2Inverse( const pat::Electron* );
 57    Bool_t CheckCut2Inv( const pat::Electron* , Int_t );
 58    Bool_t CheckCuts2NminusOne( const pat::Electron* , Int_t );
 59
 60    Double_t  ReturnCandVar( const pat::Electron* , Int_t );
 61    
 62    Bool_t    PassPreselectionCriteria1( const pat::Electron* );
 63    Bool_t    PassPreselectionCriteria2( const pat::Electron* );
 64
 65    Bool_t   useSameSelectionOnBothElectrons_ ;
 66
 67    // for the extra identifications and selections
 68    Bool_t        usePrecalcID1_;
 69    std::string   usePrecalcIDSign1_;
 70    std::string   usePrecalcIDType1_;
 71    Double_t      usePrecalcIDValue1_;
 72
 73    Bool_t        usePrecalcID2_;
 74    std::string   usePrecalcIDSign2_;
 75    std::string   usePrecalcIDType2_;
 76    Double_t      usePrecalcIDValue2_;
 77
 78    // for extra preselection criteria:
 79    Bool_t usePreselection1_;
 80    Bool_t useValidFirstPXBHit1_     ;
 81    Bool_t useConversionRejection1_     ;
 82    Bool_t useExpectedMissingHits1_     ;
 83    Bool_t maxNumberOfExpectedMissingHits1_     ;
 84    //    
 85    Bool_t usePreselection2_;
 86    Bool_t useValidFirstPXBHit2_    ;
 87    Bool_t useConversionRejection2_    ;
 88    Bool_t useExpectedMissingHits2_    ;
 89    Bool_t maxNumberOfExpectedMissingHits2_    ;
 90
 91    //  other
 92    std::string outputFile_;
 93    edm::InputTag zeeCollectionTag_;
 94    edm::InputTag caloJetCollectionTag_;
 95    edm::InputTag pfJetCollectionTag_;
 96
 97    TFile *histofile;
 98
 99    // the histograms
100    TH1F *h_mee;
101    TH1F *h_mee_EBEB;
102    TH1F *h_mee_EBEE;
103    TH1F *h_mee_EEEE;
104    TH1F *h_Zcand_PT;
105    TH1F *h_Zcand_Y;
106
107    TH1F *h_e_PT;
108    TH1F *h_e_ETA;
109    TH1F *h_e_PHI;
110
111    TH1F *h_EB_trkiso;
112    TH1F *h_EB_ecaliso;
113    TH1F *h_EB_hcaliso;
114    TH1F *h_EB_sIetaIeta;
115    TH1F *h_EB_dphi;
116    TH1F *h_EB_deta;
117    TH1F *h_EB_HoE;
118
119    TH1F *h_EE_trkiso;
120    TH1F *h_EE_ecaliso;
121    TH1F *h_EE_hcaliso;
122    TH1F *h_EE_sIetaIeta;
123    TH1F *h_EE_dphi;
124    TH1F *h_EE_deta;
125    TH1F *h_EE_HoE;
126
127    //
128    TH1F *h_trackIso_eb_NmOne;
129    TH1F *h_trackIso_ee_NmOne;
130
131    // ***********************************
132    //
133    // the selection cuts
134
135//      /*  Electron 0  */
136//     Double_t trackIso0_EB_          ; Double_t trackIso0_EE_          ; 
137//     Double_t ecalIso0_EB_           ; Double_t ecalIso0_EE_           ; 
138//     Double_t hcalIso0_EB_           ; Double_t hcalIso0_EE_           ; 
139// 
140//     Double_t sihih0_EB_             ; Double_t sihih0_EE_             ; 
141//     Double_t dphi0_EB_              ; Double_t dphi0_EE_              ; 
142//     Double_t deta0_EB_              ; Double_t deta0_EE_              ; 
143//     Double_t hoe0_EB_               ; Double_t hoe0_EE_               ; 
144//     Double_t cIso0_EB_              ; Double_t cIso0_EE_              ; 
145//     Double_t tip_bspot0_EB_         ; Double_t tip_bspot0_EE_         ; 
146//     Double_t eop0_EB_               ; Double_t eop0_EE_               ; 
147// 
148//     Double_t trackIsoUser0_EB_      ; Double_t trackIsoUser0_EE_      ; 
149//     Double_t ecalIsoUser0_EB_       ; Double_t ecalIsoUser0_EE_       ; 
150//     Double_t hcalIsoUser0_EB_       ; Double_t hcalIsoUser0_EE_       ; 
151//     //.................................................................                                         
152//     Bool_t   trackIso0_EB_inv       ; Bool_t   trackIso0_EE_inv       ; 
153//     Bool_t   ecalIso0_EB_inv        ; Bool_t   ecalIso0_EE_inv        ; 
154//     Bool_t   hcalIso0_EB_inv        ; Bool_t   hcalIso0_EE_inv        ; 
155// 
156//     Bool_t   sihih0_EB_inv          ; Bool_t   sihih0_EE_inv          ; 
157//     Bool_t   dphi0_EB_inv           ; Bool_t   dphi0_EE_inv           ; 
158//     Bool_t   deta0_EB_inv           ; Bool_t   deta0_EE_inv           ; 
159//     Bool_t   hoe0_EB_inv            ; Bool_t   hoe0_EE_inv            ; 
160//     Bool_t   cIso0_EB_inv           ; Bool_t   cIso0_EE_inv           ; 
161//     Bool_t   tip_bspot0_EB_inv      ; Bool_t   tip_bspot0_EE_inv      ; 
162//     Bool_t   eop0_EB_inv            ; Bool_t   eop0_EE_inv            ; 
163// 
164//     Bool_t   trackIsoUser0_EB_inv   ; Bool_t   trackIsoUser0_EE_inv   ; 
165//     Bool_t   ecalIsoUser0_EB_inv    ; Bool_t   ecalIsoUser0_EE_inv    ; 
166//     Bool_t   hcalIsoUser0_EB_inv    ; Bool_t   hcalIsoUser0_EE_inv    ; 
167
168    /*  Electron 1  */
169    Double_t trackIso1_EB_          ; Double_t trackIso1_EE_          ; 
170    Double_t ecalIso1_EB_           ; Double_t ecalIso1_EE_           ; 
171    Double_t hcalIso1_EB_           ; Double_t hcalIso1_EE_           ; 
172
173    Double_t sihih1_EB_             ; Double_t sihih1_EE_             ; 
174    Double_t dphi1_EB_              ; Double_t dphi1_EE_              ; 
175    Double_t deta1_EB_              ; Double_t deta1_EE_              ; 
176    Double_t hoe1_EB_               ; Double_t hoe1_EE_               ; 
177    Double_t cIso1_EB_              ; Double_t cIso1_EE_              ; 
178    Double_t tip_bspot1_EB_         ; Double_t tip_bspot1_EE_         ; 
179    Double_t eop1_EB_               ; Double_t eop1_EE_               ; 
180
181    Double_t trackIsoUser1_EB_      ; Double_t trackIsoUser1_EE_      ; 
182    Double_t ecalIsoUser1_EB_       ; Double_t ecalIsoUser1_EE_       ; 
183    Double_t hcalIsoUser1_EB_       ; Double_t hcalIsoUser1_EE_       ; 
184    //.................................................................                                         
185    Bool_t   trackIso1_EB_inv       ; Bool_t   trackIso1_EE_inv       ; 
186    Bool_t   ecalIso1_EB_inv        ; Bool_t   ecalIso1_EE_inv        ; 
187    Bool_t   hcalIso1_EB_inv        ; Bool_t   hcalIso1_EE_inv        ; 
188
189    Bool_t   sihih1_EB_inv          ; Bool_t   sihih1_EE_inv          ; 
190    Bool_t   dphi1_EB_inv           ; Bool_t   dphi1_EE_inv           ; 
191    Bool_t   deta1_EB_inv           ; Bool_t   deta1_EE_inv           ; 
192    Bool_t   hoe1_EB_inv            ; Bool_t   hoe1_EE_inv            ; 
193    Bool_t   cIso1_EB_inv           ; Bool_t   cIso1_EE_inv           ; 
194    Bool_t   tip_bspot1_EB_inv      ; Bool_t   tip_bspot1_EE_inv      ; 
195    Bool_t   eop1_EB_inv            ; Bool_t   eop1_EE_inv            ; 
196
197    Bool_t   trackIsoUser1_EB_inv   ; Bool_t   trackIsoUser1_EE_inv   ; 
198    Bool_t   ecalIsoUser1_EB_inv    ; Bool_t   ecalIsoUser1_EE_inv    ; 
199    Bool_t   hcalIsoUser1_EB_inv    ; Bool_t   hcalIsoUser1_EE_inv    ; 
200
201    /*  Electron 2  */
202    Double_t trackIso2_EB_          ; Double_t trackIso2_EE_          ; 
203    Double_t ecalIso2_EB_           ; Double_t ecalIso2_EE_           ; 
204    Double_t hcalIso2_EB_           ; Double_t hcalIso2_EE_           ; 
205
206    Double_t sihih2_EB_             ; Double_t sihih2_EE_             ; 
207    Double_t dphi2_EB_              ; Double_t dphi2_EE_              ; 
208    Double_t deta2_EB_              ; Double_t deta2_EE_              ; 
209    Double_t hoe2_EB_               ; Double_t hoe2_EE_               ; 
210    Double_t cIso2_EB_              ; Double_t cIso2_EE_              ; 
211    Double_t tip_bspot2_EB_         ; Double_t tip_bspot2_EE_         ; 
212    Double_t eop2_EB_               ; Double_t eop2_EE_               ; 
213
214    Double_t trackIsoUser2_EB_      ; Double_t trackIsoUser2_EE_      ; 
215    Double_t ecalIsoUser2_EB_       ; Double_t ecalIsoUser2_EE_       ; 
216    Double_t hcalIsoUser2_EB_       ; Double_t hcalIsoUser2_EE_       ; 
217    //.................................................................                                         
218    Bool_t   trackIso2_EB_inv       ; Bool_t   trackIso2_EE_inv       ; 
219    Bool_t   ecalIso2_EB_inv        ; Bool_t   ecalIso2_EE_inv        ; 
220    Bool_t   hcalIso2_EB_inv        ; Bool_t   hcalIso2_EE_inv        ; 
221
222    Bool_t   sihih2_EB_inv          ; Bool_t   sihih2_EE_inv          ; 
223    Bool_t   dphi2_EB_inv           ; Bool_t   dphi2_EE_inv           ; 
224    Bool_t   deta2_EB_inv           ; Bool_t   deta2_EE_inv           ; 
225    Bool_t   hoe2_EB_inv            ; Bool_t   hoe2_EE_inv            ; 
226    Bool_t   cIso2_EB_inv           ; Bool_t   cIso2_EE_inv           ; 
227    Bool_t   tip_bspot2_EB_inv      ; Bool_t   tip_bspot2_EE_inv      ; 
228    Bool_t   eop2_EB_inv            ; Bool_t   eop2_EE_inv            ; 
229
230    Bool_t   trackIsoUser2_EB_inv   ; Bool_t   trackIsoUser2_EE_inv   ; 
231    Bool_t   ecalIsoUser2_EB_inv    ; Bool_t   ecalIsoUser2_EE_inv    ; 
232    Bool_t   hcalIsoUser2_EB_inv    ; Bool_t   hcalIsoUser2_EE_inv    ; 
233
234    Int_t nBarrelVars_;
235    
236    std::vector<Double_t> CutVars1_ ;
237    std::vector<Double_t> CutVars2_ ;
238
239    std::vector<Bool_t> InvVars1_ ;
240    std::vector<Bool_t> InvVars2_ ;
241    
242    //
243    // variables related to the VBTF root tuples:
244    //
245    Int_t runNumber, lumiSection;
246
247    Long64_t eventNumber;
248
249    Float_t ele1_sc_energy, ele1_sc_eta, ele1_sc_phi;
250    Float_t ele1_sc_gsf_et;
251    Float_t ele1_cand_et, ele1_cand_eta, ele1_cand_phi;
252    Float_t ele1_iso_track, ele1_iso_ecal, ele1_iso_hcal;
253    Float_t ele1_id_sihih, ele1_id_dphi, ele1_id_deta, ele1_id_hoe;
254    Float_t ele1_cr_mhitsinner, ele1_cr_dcot, ele1_cr_dist;
255    Float_t ele1_vx, ele1_vy, ele1_vz;
256
257    Float_t pv_x1, pv_y1, pv_z1;
258
259    Int_t   ele1_gsfCharge, ele1_ctfCharge, ele1_scPixCharge;
260    Float_t ele1_eop, ele1_tip_bs, ele1_tip_pv;
261
262    Float_t ele2_sc_energy, ele2_sc_eta, ele2_sc_phi;
263    Float_t ele2_sc_gsf_et;
264    Float_t ele2_cand_et, ele2_cand_eta, ele2_cand_phi;
265    Float_t ele2_iso_track, ele2_iso_ecal, ele2_iso_hcal;
266    Float_t ele2_id_sihih, ele2_id_dphi, ele2_id_deta, ele2_id_hoe;
267    Float_t ele2_cr_mhitsinner, ele2_cr_dcot, ele2_cr_dist;
268    Float_t ele2_vx, ele2_vy, ele2_vz;
269
270    Float_t pv_x2, pv_y2, pv_z2;
271
272    Int_t   ele2_gsfCharge, ele2_ctfCharge, ele2_scPixCharge;
273    Float_t ele2_eop, ele2_tip_bs, ele2_tip_pv;
274
275    Float_t event_caloMET, event_pfMET, event_tcMET;
276    Float_t event_caloMET_phi, event_pfMET_phi, event_tcMET_phi;
277
278    Float_t event_Mee;
279
280    Float_t calojet_et[5];
281    Float_t calojet_eta[5];
282    Float_t calojet_phi[5];
283    Float_t pfjet_et[5];
284    Float_t pfjet_eta[5];
285    Float_t pfjet_phi[5];
286    
287    Int_t event_datasetTag;
288
289    TFile *ZEE_VBTFpreseleFile_;
290    TFile *ZEE_VBTFselectionFile_;
291    
292    TTree *vbtfSele_tree;
293    TTree *vbtfPresele_tree;
294    
295    std::string ZEE_VBTFselectionFileName_;
296    std::string ZEE_VBTFpreseleFileName_;
297    
298    Bool_t includeJetInformationInNtuples_;
299    Double_t DRJetFromElectron_;
300    Int_t DatasetTag_;
301    
302};
303
304#endif