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
84 
85  // Muons
88  std::vector<std::string> fMuonHLTNames;
89  std::vector<std::string> fMuonHLTObjectNames;
90 
91  // Tracks
94 
95  // Electrons
100 
101 
102 
105 
108 
111 
112 
113 
114  // bacon fillers
115  std::unique_ptr<ZCountingTrigger::TTrigger> fTrigger;
116 
119  MuonIDTypes IDType_ {NoneID};
120  MuonIsoTypes IsoType_ {NoneIso};
121  double IsoCut_;
122 
123  double PtCutL1_;
124  double PtCutL2_;
125  double EtaCutL1_;
126  double EtaCutL2_;
127 
128  int MassBin_;
129  double MassMin_;
130  double MassMax_;
131 
132  int LumiBin_;
133  double LumiMin_;
134  double LumiMax_;
135 
136  int PVBin_;
137  double PVMin_;
138  double PVMax_;
139 
141  double VtxNdofCut_;
142  double VtxAbsZCut_;
143  double VtxRhoCut_;
144 
145  const double MUON_MASS = 0.105658369;
146  const double MUON_BOUND = 0.9;
147 
148 
149  const float ELECTRON_MASS = 0.000511;
150 
151  const float ELE_PT_CUT_TAG;
152  const float ELE_PT_CUT_PROBE;
153  const float ELE_ETA_CUT_TAG;
154  const float ELE_ETA_CUT_PROBE;
155  const float ELE_MASS_CUT_LOW;
156  const float ELE_MASS_CUT_HIGH;
157 
159  const float ELE_ETA_CRACK_LOW = 1.4442;
160  const float ELE_ETA_CRACK_HIGH = 1.56;
161  // Electron-specific members
163 
164 
165  // Muon Histograms
170 
175 
180 
186 
187  // Electron Histograms
192 
197 
198 
202 };
203 
204 
205 #endif
MonitorElement * h_mass_Glo_pass_forward
Definition: ZCounting.h:177
MonitorElement * h_mass_Glo_fail_forward
Definition: ZCounting.h:179
double IsoCut_
Definition: ZCounting.h:121
edm::InputTag fRhoTag
Definition: ZCounting.h:103
edm::InputTag fBeamspotTag
Definition: ZCounting.h:106
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:173
double PtCutL1_
Definition: ZCounting.h:123
std::string fPVName
Definition: ZCounting.h:82
double LumiMax_
Definition: ZCounting.h:134
std::string fSCName
Definition: ZCounting.h:98
std::string fTrackName
Definition: ZCounting.h:92
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:172
std::vector< std::string > fMuonHLTNames
Definition: ZCounting.h:88
edm::InputTag fHLTObjTag
Definition: ZCounting.h:78
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
Definition: ZCounting.h:97
std::string fMuonName
Definition: ZCounting.h:86
edm::InputTag fConversionTag
Definition: ZCounting.h:109
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:167
ElectronIdentifier EleID_
Definition: ZCounting.h:162
const float ELE_ETA_CUT_TAG
Definition: ZCounting.h:153
MonitorElement * h_ee_mass_HLT_fail_central
Definition: ZCounting.h:194
MonitorElement * h_mass_yield_Z
Definition: ZCounting.h:183
MonitorElement * h_mass_Glo_pass_central
Definition: ZCounting.h:176
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
double LumiMin_
Definition: ZCounting.h:133
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:195
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:93
std::string IDTypestr_
Definition: ZCounting.h:117
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:87
double VtxRhoCut_
Definition: ZCounting.h:143
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:77
const float ELE_MASS_CUT_HIGH
Definition: ZCounting.h:156
const std::string ELE_ID_WP
Definition: ZCounting.h:158
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:83
MonitorElement * h_yieldEE_Z
Definition: ZCounting.h:185
int PVBin_
Definition: ZCounting.h:136
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
const float ELE_PT_CUT_PROBE
Definition: ZCounting.h:152
double VtxNTracksFitCut_
Definition: ZCounting.h:140
MonitorElement * h_npv_yield_Z
Definition: ZCounting.h:182
MonitorElement * h_ee_yield_Z_eeee
Definition: ZCounting.h:201
MonitorElement * h_ee_yield_Z_ebee
Definition: ZCounting.h:200
double VtxNdofCut_
Definition: ZCounting.h:141
MonitorElement * h_ee_mass_HLT_fail_forward
Definition: ZCounting.h:196
MonitorElement * h_npv
Definition: ZCounting.h:181
double PtCutL2_
Definition: ZCounting.h:124
const float ELE_MASS_CUT_LOW
Definition: ZCounting.h:155
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:80
MonitorElement * h_ee_mass_id_pass_forward
Definition: ZCounting.h:190
MonitorElement * h_ee_mass_HLT_pass_central
Definition: ZCounting.h:193
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:174
MonitorElement * h_ee_yield_Z_ebeb
Definition: ZCounting.h:199
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:166
const float ELE_ETA_CUT_PROBE
Definition: ZCounting.h:154
int MassBin_
Definition: ZCounting.h:128
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
Definition: ZCounting.h:110
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
int LumiBin_
Definition: ZCounting.h:132
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:81
MonitorElement * h_ee_mass_id_pass_central
Definition: ZCounting.h:188
std::string fElectronName
Definition: ZCounting.h:96
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:169
HLT enums.
double EtaCutL1_
Definition: ZCounting.h:125
MonitorElement * h_ee_mass_id_fail_forward
Definition: ZCounting.h:191
edm::EDGetTokenT< double > fRhoToken
Definition: ZCounting.h:104
MonitorElement * h_yieldBB_Z
Definition: ZCounting.h:184
std::vector< std::string > fMuonHLTObjectNames
Definition: ZCounting.h:89
MonitorElement * h_ee_mass_id_fail_central
Definition: ZCounting.h:189
double MassMax_
Definition: ZCounting.h:130
double PVMax_
Definition: ZCounting.h:138
MonitorElement * h_mass_Glo_fail_central
Definition: ZCounting.h:178
double MassMin_
Definition: ZCounting.h:129
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
Definition: ZCounting.h:107
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:171
const float ELE_PT_CUT_TAG
Definition: ZCounting.h:151
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:115
std::string IsoTypestr_
Definition: ZCounting.h:118
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Definition: ZCounting.h:99
double EtaCutL2_
Definition: ZCounting.h:126
double PVMin_
Definition: ZCounting.h:137
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:168
Definition: Run.h:45
double VtxAbsZCut_
Definition: ZCounting.h:142