CMS 3D CMS Logo

WenuPlots.h
Go to the documentation of this file.
1 #ifndef WenuPlots_H
2 #define WenuPlots_H
3 
4 #include <memory>
5 
8 
23 
24 //#include "DataFormats/BeamSpot/interface/BeamSpot.h"
25 
26 #include <vector>
27 #include <iostream>
28 #include "TFile.h"
29 #include "TTree.h"
30 #include "TString.h"
31 #include "TH1F.h"
32 #include "TMath.h"
33 
34 //
35 // class decleration
36 //
37 
38 class WenuPlots : public edm::EDAnalyzer {
39  public:
40  explicit WenuPlots(const edm::ParameterSet&);
41  ~WenuPlots();
42 
43 
44  private:
45  virtual void beginJob() ;
46  virtual void analyze(const edm::Event&, const edm::EventSetup&);
47  virtual void endJob() ;
48 
49  // ----------member data ---------------------------
50  Bool_t CheckCuts( const pat::Electron * ele);
51  Bool_t CheckCut( const pat::Electron *wenu, Int_t i);
52  Bool_t CheckCutsInverse(const pat::Electron *ele);
53  Bool_t CheckCutInv( const pat::Electron *wenu, Int_t i);
54  Bool_t CheckCutsNminusOne(const pat::Electron *ele, Int_t jj);
55  Double_t ReturnCandVar(const pat::Electron *ele, Int_t i);
56  Bool_t PassPreselectionCriteria(const pat::Electron *ele);
57  // for the extra identifications and selections
58  Bool_t usePrecalcID_;
62  // for extra preselection criteria:
76  TFile *histofile;
77  //
78  // math::XYZPoint bspotPosition_; // comment out only if you don't use pat
79  //
80  // the histograms ********************
81 
82  TH1F *h_met;
84  TH1F *h_mt;
85  TH1F *h_mt_inverse;
86 
87  TH1F *h_met_EB;
89  TH1F *h_mt_EB;
91 
92  TH1F *h_met_EE;
94  TH1F *h_mt_EE;
96 
97 
98  TH1F *h_scEt;
99  TH1F *h_scEta;
100  TH1F *h_scPhi;
101 
102  TH1F *h_EB_trkiso;
106  TH1F *h_EB_dphi;
107  TH1F *h_EB_deta;
108  TH1F *h_EB_HoE;
109 
110  TH1F *h_EE_trkiso;
114  TH1F *h_EE_dphi;
115  TH1F *h_EE_deta;
116  TH1F *h_EE_HoE;
117 
118  //
121  // ***********************************
122  //
123  // the selection cuts
124  Double_t trackIso_EB_;
125  Double_t ecalIso_EB_;
126  Double_t hcalIso_EB_;
127  //
128  Double_t trackIso_EE_;
129  Double_t ecalIso_EE_;
130  Double_t hcalIso_EE_;
131  //
132  Double_t sihih_EB_;
133  Double_t deta_EB_;
134  Double_t dphi_EB_;
135  Double_t hoe_EB_;
136  Double_t cIso_EB_;
137  Double_t tip_bspot_EB_;
138  Double_t eop_EB_;
139  //
140  Double_t sihih_EE_;
141  Double_t deta_EE_;
142  Double_t dphi_EE_;
143  Double_t hoe_EE_;
144  Double_t cIso_EE_;
145  Double_t tip_bspot_EE_;
146  Double_t eop_EE_;
147  //
149  Double_t ecalIsoUser_EB_;
150  Double_t hcalIsoUser_EB_;
152  Double_t ecalIsoUser_EE_;
153  Double_t hcalIsoUser_EE_;
154  //
158  //
162  //
163  Bool_t sihih_EB_inv;
164  Bool_t deta_EB_inv;
165  Bool_t dphi_EB_inv;
166  Bool_t hoe_EB_inv;
167  Bool_t cIso_EB_inv;
169  Bool_t eop_EB_inv;
170  //
171  Bool_t sihih_EE_inv;
172  Bool_t deta_EE_inv;
173  Bool_t dphi_EE_inv;
174  Bool_t hoe_EE_inv;
175  Bool_t cIso_EE_inv;
177  Bool_t eop_EE_inv;
178  //
185  //
186  //
188  //
189  std::vector<Double_t> CutVars_;
190  std::vector<Bool_t> InvVars_;
191  //
192  // variables related to the VBTF root tuples:
193  //
195  Long64_t eventNumber;
197  Float_t ele_sc_gsf_et;
203  Float_t ele_vx, ele_vy, ele_vz;
204  Float_t ele_pin, ele_pout;
205  Float_t pv_x, pv_y, pv_z;
212  Float_t calojet_et[5];
213  Float_t calojet_eta[5];
214  Float_t calojet_phi[5];
215  Float_t pfjet_et[5];
216  Float_t pfjet_eta[5];
217  Float_t pfjet_phi[5];
219  Float_t ele2nd_sc_eta;
220  Float_t ele2nd_sc_phi;
221  Float_t ele2nd_sc_rho;
224  Float_t ele2nd_pin;
225  Float_t ele2nd_pout;
231 
241  Int_t DatasetTag_;
242  // for the 2nd electron storage
244  Float_t ele2nd_cand_et;
252  std::vector<Int_t> VtxTracksSize;
253  std::vector<Float_t> VtxNormalizedChi2;
254  std::vector<Int_t> VtxTracksSizeBS;
255  std::vector<Float_t> VtxNormalizedChi2BS;
256  Float_t pvbs_x, pvbs_y, pvbs_z;
258 };
259 
260 #endif
Float_t ele_vy
Definition: WenuPlots.h:203
TH1F * h_mt_inverse_EE
Definition: WenuPlots.h:95
Float_t ele2nd_cr_dcot
Definition: WenuPlots.h:247
Double_t trackIsoUser_EB_
Definition: WenuPlots.h:148
Int_t ele2nd_ctfCharge
Definition: WenuPlots.h:249
Float_t ele2nd_id_deta
Definition: WenuPlots.h:246
Float_t ele2nd_sc_gsf_et
Definition: WenuPlots.h:218
Int_t maxNumberOfExpectedMissingHits_
Definition: WenuPlots.h:66
Double_t cIso_EE_
Definition: WenuPlots.h:144
Double_t trackIso_EB_
Definition: WenuPlots.h:124
Bool_t PassPreselectionCriteria(const pat::Electron *ele)
Definition: WenuPlots.cc:813
Float_t ele_iso_ecal
Definition: WenuPlots.h:199
std::string WENU_VBTFselectionFileName_
Definition: WenuPlots.h:236
TH1F * h_met_inverse_EB
Definition: WenuPlots.h:88
Bool_t hcalIso_EE_inv
Definition: WenuPlots.h:161
edm::EDGetTokenT< std::vector< reco::Vertex > > PrimaryVerticesCollectionBSToken_
Definition: WenuPlots.h:75
Bool_t deta_EE_inv
Definition: WenuPlots.h:172
Float_t event_caloMET
Definition: WenuPlots.h:208
Float_t ele_iso_hcal
Definition: WenuPlots.h:199
Float_t ele2nd_tip_bs
Definition: WenuPlots.h:250
Float_t ele2nd_id_hoe
Definition: WenuPlots.h:246
Double_t eop_EE_
Definition: WenuPlots.h:146
Float_t ele_eop
Definition: WenuPlots.h:207
Bool_t ecalIso_EB_inv
Definition: WenuPlots.h:156
TH1F * h_EE_trkiso
Definition: WenuPlots.h:110
Double_t trackIsoUser_EE_
Definition: WenuPlots.h:151
Int_t nBarrelVars_
Definition: WenuPlots.h:187
Float_t pfjet_eta[5]
Definition: WenuPlots.h:216
Float_t ele2nd_eop
Definition: WenuPlots.h:250
TH1F * h_EB_HoE
Definition: WenuPlots.h:108
TH1F * h_met_EB
Definition: WenuPlots.h:87
Float_t pvbs_z
Definition: WenuPlots.h:256
Int_t lumiSection
Definition: WenuPlots.h:194
Float_t event_tcMET_phi
Definition: WenuPlots.h:210
Int_t ele2nd_passes_selection
Definition: WenuPlots.h:226
TH1F * h_mt
Definition: WenuPlots.h:84
Float_t ele_vz
Definition: WenuPlots.h:203
Double_t cIso_EB_
Definition: WenuPlots.h:136
Float_t ele_pout
Definition: WenuPlots.h:204
Float_t ele_sc_rho
Definition: WenuPlots.h:196
Int_t ele2nd_scPixCharge
Definition: WenuPlots.h:249
Bool_t tip_bspot_EE_inv
Definition: WenuPlots.h:176
Float_t event_caloMET_phi
Definition: WenuPlots.h:210
Float_t ele_id_dphi
Definition: WenuPlots.h:200
TH1F * h_trackIso_ee_NmOne
Definition: WenuPlots.h:120
Bool_t tip_bspot_EB_inv
Definition: WenuPlots.h:168
Float_t ele_cr_dist
Definition: WenuPlots.h:201
edm::EDGetTokenT< reco::CaloJetCollection > caloJetCollectionToken_
Definition: WenuPlots.h:71
std::string WENU_VBTFpreseleFileName_
Definition: WenuPlots.h:237
WenuPlots(const edm::ParameterSet &)
Definition: WenuPlots.cc:56
TH1F * h_scPhi
Definition: WenuPlots.h:100
Bool_t CheckCutInv(const pat::Electron *wenu, Int_t i)
Definition: WenuPlots.cc:772
Int_t ele2nd_ecalDriven
Definition: WenuPlots.h:227
Double_t ecalIsoUser_EB_
Definition: WenuPlots.h:149
Int_t ele_gsfCharge
Definition: WenuPlots.h:206
Float_t calojet_eta[5]
Definition: WenuPlots.h:213
Bool_t includeJetInformationInNtuples_
Definition: WenuPlots.h:238
Int_t runNumber
Definition: WenuPlots.h:194
Double_t dphi_EE_
Definition: WenuPlots.h:142
Bool_t sihih_EE_inv
Definition: WenuPlots.h:171
TTree * vbtfSele_tree
Definition: WenuPlots.h:234
TH1F * h_EB_trkiso
Definition: WenuPlots.h:102
Float_t ele2nd_pout
Definition: WenuPlots.h:225
Bool_t dphi_EE_inv
Definition: WenuPlots.h:173
Bool_t hcalIsoUser_EE_inv
Definition: WenuPlots.h:184
Float_t pv_x
Definition: WenuPlots.h:205
edm::EDGetTokenT< std::vector< reco::Vertex > > PrimaryVerticesCollectionToken_
Definition: WenuPlots.h:74
Bool_t usePreselection_
Definition: WenuPlots.h:67
Float_t ele2nd_vy
Definition: WenuPlots.h:248
Float_t event_caloSumEt
Definition: WenuPlots.h:209
Double_t tip_bspot_EB_
Definition: WenuPlots.h:137
Float_t ele2nd_sc_eta
Definition: WenuPlots.h:219
Bool_t CheckCutsInverse(const pat::Electron *ele)
Definition: WenuPlots.cc:746
Float_t ele2nd_sc_phi
Definition: WenuPlots.h:220
Bool_t ecalIso_EE_inv
Definition: WenuPlots.h:160
Bool_t CheckCuts(const pat::Electron *ele)
Definition: WenuPlots.cc:717
std::vector< Double_t > CutVars_
Definition: WenuPlots.h:189
Float_t ele_sc_eta
Definition: WenuPlots.h:196
Double_t deta_EE_
Definition: WenuPlots.h:141
TH1F * h_EE_sIetaIeta
Definition: WenuPlots.h:113
Float_t ele2nd_vx
Definition: WenuPlots.h:248
Float_t ele2nd_id_sihih
Definition: WenuPlots.h:246
Float_t event_pfMET
Definition: WenuPlots.h:208
Bool_t useExpectedMissingHits_
Definition: WenuPlots.h:65
TH1F * h_EB_sIetaIeta
Definition: WenuPlots.h:105
Int_t DatasetTag_
Definition: WenuPlots.h:241
Float_t ele2nd_cand_phi
Definition: WenuPlots.h:223
Double_t hcalIso_EB_
Definition: WenuPlots.h:126
std::string usePrecalcIDSign_
Definition: WenuPlots.h:59
Float_t pv_y
Definition: WenuPlots.h:205
Float_t ele_sc_phi
Definition: WenuPlots.h:196
Double_t trackIso_EE_
Definition: WenuPlots.h:128
TH1F * h_met_EE
Definition: WenuPlots.h:92
Double_t deta_EB_
Definition: WenuPlots.h:133
TH1F * h_met
Definition: WenuPlots.h:82
edm::EDGetTokenT< reco::PFJetCollection > pfJetCollectionToken_
Definition: WenuPlots.h:73
TH1F * h_EB_ecaliso
Definition: WenuPlots.h:103
Float_t ele_id_deta
Definition: WenuPlots.h:200
Double_t hcalIsoUser_EB_
Definition: WenuPlots.h:150
TH1F * h_scEt
Definition: WenuPlots.h:98
Double_t hcalIso_EE_
Definition: WenuPlots.h:130
Float_t ele2nd_cand_et
Definition: WenuPlots.h:244
Float_t ele_cand_et
Definition: WenuPlots.h:198
Bool_t deta_EB_inv
Definition: WenuPlots.h:164
TFile * WENU_VBTFselectionFile_
Definition: WenuPlots.h:233
Bool_t hcalIsoUser_EB_inv
Definition: WenuPlots.h:181
Double_t sihih_EE_
Definition: WenuPlots.h:140
virtual void beginJob()
Definition: WenuPlots.cc:855
TH1F * h_EE_ecaliso
Definition: WenuPlots.h:111
TH1F * h_EB_hcaliso
Definition: WenuPlots.h:104
Float_t ele2nd_pin
Definition: WenuPlots.h:224
TH1F * h_met_inverse
Definition: WenuPlots.h:83
Float_t ele2nd_tip_pvbs
Definition: WenuPlots.h:257
Bool_t ecalIsoUser_EE_inv
Definition: WenuPlots.h:183
Int_t event_triggerDecision
Definition: WenuPlots.h:229
Float_t ele2nd_hltmatched_dr
Definition: WenuPlots.h:251
Bool_t eop_EE_inv
Definition: WenuPlots.h:177
Float_t pvbs_x
Definition: WenuPlots.h:256
Float_t ele2nd_sc_rho
Definition: WenuPlots.h:221
Double_t ecalIso_EB_
Definition: WenuPlots.h:125
Float_t ele2nd_cand_eta
Definition: WenuPlots.h:222
Float_t ele_hltmatched_dr
Definition: WenuPlots.h:228
Float_t ele_vx
Definition: WenuPlots.h:203
Double_t eop_EB_
Definition: WenuPlots.h:138
TH1F * h_met_inverse_EE
Definition: WenuPlots.h:93
TH1F * h_mt_inverse
Definition: WenuPlots.h:85
Double_t usePrecalcIDValue_
Definition: WenuPlots.h:61
TH1F * h_EE_dphi
Definition: WenuPlots.h:114
Double_t hcalIsoUser_EE_
Definition: WenuPlots.h:153
Bool_t trackIso_EE_inv
Definition: WenuPlots.h:159
Float_t ele_tip_pvbs
Definition: WenuPlots.h:257
edm::InputTag caloJetCollectionTag_
Definition: WenuPlots.h:70
Float_t ele_id_hoe
Definition: WenuPlots.h:200
Int_t ele_scPixCharge
Definition: WenuPlots.h:206
std::vector< Int_t > VtxTracksSizeBS
Definition: WenuPlots.h:254
Bool_t eop_EB_inv
Definition: WenuPlots.h:169
Bool_t storeAllSecondElectronVariables_
Definition: WenuPlots.h:243
Bool_t useConversionRejection_
Definition: WenuPlots.h:64
Float_t calojet_phi[5]
Definition: WenuPlots.h:214
std::vector< Int_t > VtxTracksSize
Definition: WenuPlots.h:252
Double_t ReturnCandVar(const pat::Electron *ele, Int_t i)
Definition: WenuPlots.cc:786
TH1F * h_EB_deta
Definition: WenuPlots.h:107
Float_t ele_tip_pv
Definition: WenuPlots.h:207
TFile * WENU_VBTFpreseleFile_
Definition: WenuPlots.h:232
TH1F * h_scEta
Definition: WenuPlots.h:99
Float_t ele2nd_iso_hcal
Definition: WenuPlots.h:245
Float_t pfjet_phi[5]
Definition: WenuPlots.h:217
Float_t ele_iso_track
Definition: WenuPlots.h:199
Int_t ele2nd_gsfCharge
Definition: WenuPlots.h:249
TTree * vbtfPresele_tree
Definition: WenuPlots.h:235
Int_t event_datasetTag
Definition: WenuPlots.h:230
Float_t ele_pin
Definition: WenuPlots.h:204
TH1F * h_EB_dphi
Definition: WenuPlots.h:106
edm::EDGetTokenT< pat::CompositeCandidateCollection > wenuCollectionToken_
Definition: WenuPlots.h:69
Float_t event_tcSumEt
Definition: WenuPlots.h:209
Int_t ele_cr_mhitsinner
Definition: WenuPlots.h:202
TH1F * h_trackIso_eb_NmOne
Definition: WenuPlots.h:119
Float_t pv_z
Definition: WenuPlots.h:205
Bool_t sihih_EB_inv
Definition: WenuPlots.h:163
Float_t ele2nd_iso_track
Definition: WenuPlots.h:245
Bool_t CheckCutsNminusOne(const pat::Electron *ele, Int_t jj)
Definition: WenuPlots.cc:755
Float_t ele_cand_eta
Definition: WenuPlots.h:198
Bool_t cIso_EB_inv
Definition: WenuPlots.h:167
Bool_t trackIsoUser_EE_inv
Definition: WenuPlots.h:182
Float_t pfjet_et[5]
Definition: WenuPlots.h:215
Bool_t hcalIso_EB_inv
Definition: WenuPlots.h:157
Bool_t storeExtraInformation_
Definition: WenuPlots.h:239
Bool_t hoe_EE_inv
Definition: WenuPlots.h:174
Float_t ele2nd_vz
Definition: WenuPlots.h:248
Int_t ele_ctfCharge
Definition: WenuPlots.h:206
Analysis-level electron class.
Definition: Electron.h:52
Float_t event_pfMT
Definition: WenuPlots.h:211
virtual void endJob()
Definition: WenuPlots.cc:1175
Float_t event_tcMT
Definition: WenuPlots.h:211
Bool_t useValidFirstPXBHit_
Definition: WenuPlots.h:63
edm::InputTag pfJetCollectionTag_
Definition: WenuPlots.h:72
std::string usePrecalcIDType_
Definition: WenuPlots.h:60
Float_t ele_cand_phi
Definition: WenuPlots.h:198
Bool_t ecalIsoUser_EB_inv
Definition: WenuPlots.h:180
TFile * histofile
Definition: WenuPlots.h:76
TH1F * h_EE_deta
Definition: WenuPlots.h:115
TH1F * h_mt_inverse_EB
Definition: WenuPlots.h:90
Double_t DRJetFromElectron_
Definition: WenuPlots.h:240
Float_t ele2nd_tip_pv
Definition: WenuPlots.h:250
Float_t ele2nd_cr_dist
Definition: WenuPlots.h:247
Float_t event_tcMET
Definition: WenuPlots.h:208
Float_t event_pfMET_phi
Definition: WenuPlots.h:210
Float_t pvbs_y
Definition: WenuPlots.h:256
Bool_t cIso_EE_inv
Definition: WenuPlots.h:175
Float_t event_caloMT
Definition: WenuPlots.h:211
std::string outputFile_
Definition: WenuPlots.h:68
TH1F * h_mt_EB
Definition: WenuPlots.h:89
Float_t ele2nd_id_dphi
Definition: WenuPlots.h:246
Bool_t dphi_EB_inv
Definition: WenuPlots.h:165
Float_t calojet_et[5]
Definition: WenuPlots.h:212
Double_t hoe_EB_
Definition: WenuPlots.h:135
Float_t ele_id_sihih
Definition: WenuPlots.h:200
Bool_t trackIsoUser_EB_inv
Definition: WenuPlots.h:179
Float_t ele_tip_bs
Definition: WenuPlots.h:207
std::vector< Float_t > VtxNormalizedChi2BS
Definition: WenuPlots.h:255
TH1F * h_mt_EE
Definition: WenuPlots.h:94
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: WenuPlots.cc:199
Int_t ele2nd_cr_mhitsinner
Definition: WenuPlots.h:249
Double_t tip_bspot_EE_
Definition: WenuPlots.h:145
Double_t dphi_EB_
Definition: WenuPlots.h:134
Double_t sihih_EB_
Definition: WenuPlots.h:132
Float_t ele2nd_iso_ecal
Definition: WenuPlots.h:245
std::vector< Bool_t > InvVars_
Definition: WenuPlots.h:190
Float_t ele_cr_dcot
Definition: WenuPlots.h:201
Bool_t trackIso_EB_inv
Definition: WenuPlots.h:155
Double_t ecalIsoUser_EE_
Definition: WenuPlots.h:152
Float_t ele_sc_energy
Definition: WenuPlots.h:196
Double_t ecalIso_EE_
Definition: WenuPlots.h:129
TH1F * h_EE_HoE
Definition: WenuPlots.h:116
Float_t ele_sc_gsf_et
Definition: WenuPlots.h:197
Bool_t usePrecalcID_
Definition: WenuPlots.h:58
TH1F * h_EE_hcaliso
Definition: WenuPlots.h:112
Float_t event_pfSumEt
Definition: WenuPlots.h:209
Bool_t hoe_EB_inv
Definition: WenuPlots.h:166
Double_t hoe_EE_
Definition: WenuPlots.h:143
std::vector< Float_t > VtxNormalizedChi2
Definition: WenuPlots.h:253
Long64_t eventNumber
Definition: WenuPlots.h:195
Bool_t CheckCut(const pat::Electron *wenu, Int_t i)
Definition: WenuPlots.cc:764