CMS 3D CMS Logo

ZCounting.h
Go to the documentation of this file.
1 #ifndef ZCounting_H
2 #define ZCounting_H
3 
4 #include "FWCore/Framework/interface/MakerMacros.h" // definitions for declaring plug-in modules
5 #include "FWCore/Framework/interface/Frameworkfwd.h" // declaration of EDM types
6 #include "FWCore/Framework/interface/EDAnalyzer.h" // EDAnalyzer class
10 
11 #include <string> // string class
12 #include <cassert>
13 
20 
24 
29 
30 class TFile;
31 class TH1D;
32 class TTree;
33 class TClonesArray;
34 namespace edm {
35  class TriggerResults;
36  class TriggerNames;
37 }
38 namespace ZCountingTrigger {
39  class TTrigger;
40 }
41 
42 class ZCounting: public DQMEDAnalyzer{
43 
44 public:
45 
46  ZCounting(const edm::ParameterSet& ps);
47  ~ZCounting() override;
48 
49  enum MuonIDTypes { NoneID, LooseID, MediumID, TightID };
50  enum MuonIsoTypes { NoneIso, TrackerIso, PFIso };
51 
52 protected:
53 
54  void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override;
55  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
56  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
57 
58 private:
59  //other functions
60  void analyzeMuons(edm::Event const& e, edm::EventSetup const& eSetup);
61  void analyzeElectrons(edm::Event const& e, edm::EventSetup const& eSetup);
62  bool isMuonTrigger(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerBits &hltBits);
63  bool isMuonTriggerObj(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerObjects &hltMatchBits);
64  bool passMuonID(const reco::Muon& muon, const reco::Vertex& vtx, const MuonIDTypes &idType);
65  bool passMuonIso(const reco::Muon& muon, const MuonIsoTypes &isoType, const float isoCut);
66 
67  // Electron-specific functions
68  bool isElectronTrigger(ZCountingTrigger::TTrigger triggerMenu, TriggerBits hltBits);
69  bool isElectronTriggerObj(ZCountingTrigger::TTrigger triggerMenu, TriggerObjects hltMatchBits);
70  bool ele_probe_selection(double pt, double abseta);
71  bool ele_tag_selection(double pt, double abseta);
72 
73  // initialization from HLT menu; needs to be called on every change in HLT menu
74  void initHLT(const edm::TriggerResults&, const edm::TriggerNames&);
75 
76  // EDM object collection names
88 
89  // Electrons
94 
95 
96 
99 
102 
105 
106 
107 
108  // bacon fillers
109  std::unique_ptr<ZCountingTrigger::TTrigger> fTrigger;
110 
113  MuonIDTypes IDType_ {NoneID};
114  MuonIsoTypes IsoType_ {NoneIso};
115  double IsoCut_;
116 
117  double PtCutL1_;
118  double PtCutL2_;
119  double EtaCutL1_;
120  double EtaCutL2_;
121 
122  int MassBin_;
123  double MassMin_;
124  double MassMax_;
125 
126  int LumiBin_;
127  double LumiMin_;
128  double LumiMax_;
129 
130  int PVBin_;
131  double PVMin_;
132  double PVMax_;
133 
135  double VtxNdofCut_;
136  double VtxAbsZCut_;
137  double VtxRhoCut_;
138 
139  const double MUON_MASS = 0.105658369;
140  const double MUON_BOUND = 0.9;
141 
142 
143  const float ELECTRON_MASS = 0.000511;
144 
145  const float ELE_PT_CUT_TAG;
146  const float ELE_PT_CUT_PROBE;
147  const float ELE_ETA_CUT_TAG;
148  const float ELE_ETA_CUT_PROBE;
149  const float ELE_MASS_CUT_LOW;
150  const float ELE_MASS_CUT_HIGH;
151 
153  const float ELE_ETA_CRACK_LOW = 1.4442;
154  const float ELE_ETA_CRACK_HIGH = 1.56;
155  // Electron-specific members
157 
158 
159  // Muon Histograms
164 
169 
174 
179 
180  // Electron Histograms
185 
190 
191 
195 };
196 
197 
198 #endif
MonitorElement * h_mass_Sta_fail_central
Definition: ZCounting.h:172
MonitorElement * h_mass_Sta_pass_central
Definition: ZCounting.h:170
double IsoCut_
Definition: ZCounting.h:115
edm::InputTag fRhoTag
Definition: ZCounting.h:97
edm::InputTag fBeamspotTag
Definition: ZCounting.h:100
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:167
double PtCutL1_
Definition: ZCounting.h:117
std::string fPVName
Definition: ZCounting.h:82
double LumiMax_
Definition: ZCounting.h:128
std::string fSCName
Definition: ZCounting.h:92
std::string fTrackName
Definition: ZCounting.h:86
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:166
edm::InputTag fHLTObjTag
Definition: ZCounting.h:78
MonitorElement * h_yield_Z
Definition: ZCounting.h:176
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
Definition: ZCounting.h:91
std::string fMuonName
Definition: ZCounting.h:84
edm::InputTag fConversionTag
Definition: ZCounting.h:103
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:161
ElectronIdentifier EleID_
Definition: ZCounting.h:156
const float ELE_ETA_CUT_TAG
Definition: ZCounting.h:147
MonitorElement * h_ee_mass_HLT_fail_central
Definition: ZCounting.h:187
double LumiMin_
Definition: ZCounting.h:127
std::bitset< kNTrigObjectBit > TriggerObjects
Definition: TriggerDefs.h:9
edm::InputTag fHLTTag
Definition: ZCounting.h:79
MonitorElement * h_ee_mass_HLT_pass_forward
Definition: ZCounting.h:188
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:87
std::string IDTypestr_
Definition: ZCounting.h:111
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:85
double VtxRhoCut_
Definition: ZCounting.h:137
MonitorElement * h_mass_Sta_pass_forward
Definition: ZCounting.h:171
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:77
const float ELE_MASS_CUT_HIGH
Definition: ZCounting.h:150
const std::string ELE_ID_WP
Definition: ZCounting.h:152
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:83
MonitorElement * h_yieldEE_Z
Definition: ZCounting.h:178
int PVBin_
Definition: ZCounting.h:130
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
const float ELE_PT_CUT_PROBE
Definition: ZCounting.h:146
double VtxNTracksFitCut_
Definition: ZCounting.h:134
MonitorElement * h_ee_yield_Z_eeee
Definition: ZCounting.h:194
MonitorElement * h_ee_yield_Z_ebee
Definition: ZCounting.h:193
double VtxNdofCut_
Definition: ZCounting.h:135
MonitorElement * h_ee_mass_HLT_fail_forward
Definition: ZCounting.h:189
MonitorElement * h_npv
Definition: ZCounting.h:175
double PtCutL2_
Definition: ZCounting.h:118
MonitorElement * h_mass_Sta_fail_forward
Definition: ZCounting.h:173
const float ELE_MASS_CUT_LOW
Definition: ZCounting.h:149
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:80
MonitorElement * h_ee_mass_id_pass_forward
Definition: ZCounting.h:183
MonitorElement * h_ee_mass_HLT_pass_central
Definition: ZCounting.h:186
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:168
MonitorElement * h_ee_yield_Z_ebeb
Definition: ZCounting.h:192
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:160
const float ELE_ETA_CUT_PROBE
Definition: ZCounting.h:148
int MassBin_
Definition: ZCounting.h:122
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
Definition: ZCounting.h:104
int LumiBin_
Definition: ZCounting.h:126
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:81
MonitorElement * h_ee_mass_id_pass_central
Definition: ZCounting.h:181
std::string fElectronName
Definition: ZCounting.h:90
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:163
HLT enums.
double EtaCutL1_
Definition: ZCounting.h:119
MonitorElement * h_ee_mass_id_fail_forward
Definition: ZCounting.h:184
edm::EDGetTokenT< double > fRhoToken
Definition: ZCounting.h:98
MonitorElement * h_yieldBB_Z
Definition: ZCounting.h:177
MonitorElement * h_ee_mass_id_fail_central
Definition: ZCounting.h:182
double MassMax_
Definition: ZCounting.h:124
double PVMax_
Definition: ZCounting.h:132
double MassMin_
Definition: ZCounting.h:123
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
Definition: ZCounting.h:101
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:165
const float ELE_PT_CUT_TAG
Definition: ZCounting.h:145
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:109
std::string IsoTypestr_
Definition: ZCounting.h:112
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Definition: ZCounting.h:93
double EtaCutL2_
Definition: ZCounting.h:120
double PVMin_
Definition: ZCounting.h:131
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:162
Definition: Run.h:44
double VtxAbsZCut_
Definition: ZCounting.h:136