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