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  void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup) override ;
58  void endLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup) override;
59 
60 private:
61  //other functions
62  void analyzeMuons(edm::Event const& e, edm::EventSetup const& eSetup);
63  void analyzeElectrons(edm::Event const& e, edm::EventSetup const& eSetup);
64  bool isMuonTrigger(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerBits &hltBits);
65  bool isMuonTriggerObj(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerObjects &hltMatchBits);
66  bool passMuonID(const reco::Muon& muon, const reco::Vertex& vtx, const MuonIDTypes &idType);
67  bool passMuonIso(const reco::Muon& muon, const MuonIsoTypes &isoType, const float isoCut);
68 
69  // Electron-specific functions
70  bool isElectronTrigger(ZCountingTrigger::TTrigger triggerMenu, TriggerBits hltBits);
71  bool isElectronTriggerObj(ZCountingTrigger::TTrigger triggerMenu, TriggerObjects hltMatchBits);
72  bool ele_probe_selection(double pt, double abseta);
73  bool ele_tag_selection(double pt, double abseta);
74 
75  // initialization from HLT menu; needs to be called on every change in HLT menu
76  void initHLT(const edm::TriggerResults&, const edm::TriggerNames&);
77 
78  // EDM object collection names
90 
91  // Electrons
96 
97 
98 
101 
104 
107 
108 
109 
110  // bacon fillers
111  std::unique_ptr<ZCountingTrigger::TTrigger> fTrigger;
112 
115  MuonIDTypes IDType_ {NoneID};
116  MuonIsoTypes IsoType_ {NoneIso};
117  double IsoCut_;
118 
119  double PtCutL1_;
120  double PtCutL2_;
121  double EtaCutL1_;
122  double EtaCutL2_;
123 
124  int MassBin_;
125  double MassMin_;
126  double MassMax_;
127 
128  int LumiBin_;
129  double LumiMin_;
130  double LumiMax_;
131 
132  int PVBin_;
133  double PVMin_;
134  double PVMax_;
135 
137  double VtxNdofCut_;
138  double VtxAbsZCut_;
139  double VtxRhoCut_;
140 
141  const double MUON_MASS = 0.105658369;
142  const double MUON_BOUND = 0.9;
143 
144 
145  const float ELECTRON_MASS = 0.000511;
146 
147  const float ELE_PT_CUT_TAG;
148  const float ELE_PT_CUT_PROBE;
149  const float ELE_ETA_CUT_TAG;
150  const float ELE_ETA_CUT_PROBE;
151  const float ELE_MASS_CUT_LOW;
152  const float ELE_MASS_CUT_HIGH;
153 
155  const float ELE_ETA_CRACK_LOW = 1.4442;
156  const float ELE_ETA_CRACK_HIGH = 1.56;
157  // Electron-specific members
159 
160 
161  // Muon Histograms
166 
171 
176 
181 
182  // Electron Histograms
187 
192 
193 
197 };
198 
199 
200 #endif
MonitorElement * h_mass_Sta_fail_central
Definition: ZCounting.h:174
MonitorElement * h_mass_Sta_pass_central
Definition: ZCounting.h:172
double IsoCut_
Definition: ZCounting.h:117
edm::InputTag fRhoTag
Definition: ZCounting.h:99
edm::InputTag fBeamspotTag
Definition: ZCounting.h:102
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:169
double PtCutL1_
Definition: ZCounting.h:119
std::string fPVName
Definition: ZCounting.h:84
double LumiMax_
Definition: ZCounting.h:130
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
std::string fSCName
Definition: ZCounting.h:94
std::string fTrackName
Definition: ZCounting.h:88
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:168
edm::InputTag fHLTObjTag
Definition: ZCounting.h:80
MonitorElement * h_yield_Z
Definition: ZCounting.h:178
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
Definition: ZCounting.h:93
std::string fMuonName
Definition: ZCounting.h:86
edm::InputTag fConversionTag
Definition: ZCounting.h:105
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:163
ElectronIdentifier EleID_
Definition: ZCounting.h:158
const float ELE_ETA_CUT_TAG
Definition: ZCounting.h:149
MonitorElement * h_ee_mass_HLT_fail_central
Definition: ZCounting.h:189
double LumiMin_
Definition: ZCounting.h:129
void bookHistograms(fwlite::EventContainer &eventCont)
std::bitset< kNTrigObjectBit > TriggerObjects
Definition: TriggerDefs.h:9
edm::InputTag fHLTTag
Definition: ZCounting.h:81
MonitorElement * h_ee_mass_HLT_pass_forward
Definition: ZCounting.h:190
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:89
std::string IDTypestr_
Definition: ZCounting.h:113
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:87
double VtxRhoCut_
Definition: ZCounting.h:139
MonitorElement * h_mass_Sta_pass_forward
Definition: ZCounting.h:173
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:79
const float ELE_MASS_CUT_HIGH
Definition: ZCounting.h:152
const std::string ELE_ID_WP
Definition: ZCounting.h:154
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:85
MonitorElement * h_yieldEE_Z
Definition: ZCounting.h:180
int PVBin_
Definition: ZCounting.h:132
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
const float ELE_PT_CUT_PROBE
Definition: ZCounting.h:148
double VtxNTracksFitCut_
Definition: ZCounting.h:136
MonitorElement * h_ee_yield_Z_eeee
Definition: ZCounting.h:196
MonitorElement * h_ee_yield_Z_ebee
Definition: ZCounting.h:195
double VtxNdofCut_
Definition: ZCounting.h:137
MonitorElement * h_ee_mass_HLT_fail_forward
Definition: ZCounting.h:191
MonitorElement * h_npv
Definition: ZCounting.h:177
double PtCutL2_
Definition: ZCounting.h:120
MonitorElement * h_mass_Sta_fail_forward
Definition: ZCounting.h:175
const float ELE_MASS_CUT_LOW
Definition: ZCounting.h:151
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:82
MonitorElement * h_ee_mass_id_pass_forward
Definition: ZCounting.h:185
MonitorElement * h_ee_mass_HLT_pass_central
Definition: ZCounting.h:188
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:170
MonitorElement * h_ee_yield_Z_ebeb
Definition: ZCounting.h:194
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:162
const float ELE_ETA_CUT_PROBE
Definition: ZCounting.h:150
int MassBin_
Definition: ZCounting.h:124
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
Definition: ZCounting.h:106
int LumiBin_
Definition: ZCounting.h:128
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:83
MonitorElement * h_ee_mass_id_pass_central
Definition: ZCounting.h:183
std::string fElectronName
Definition: ZCounting.h:92
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:165
HLT enums.
double EtaCutL1_
Definition: ZCounting.h:121
MonitorElement * h_ee_mass_id_fail_forward
Definition: ZCounting.h:186
edm::EDGetTokenT< double > fRhoToken
Definition: ZCounting.h:100
MonitorElement * h_yieldBB_Z
Definition: ZCounting.h:179
MonitorElement * h_ee_mass_id_fail_central
Definition: ZCounting.h:184
double MassMax_
Definition: ZCounting.h:126
double PVMax_
Definition: ZCounting.h:134
double MassMin_
Definition: ZCounting.h:125
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
Definition: ZCounting.h:103
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:167
const float ELE_PT_CUT_TAG
Definition: ZCounting.h:147
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:111
std::string IsoTypestr_
Definition: ZCounting.h:114
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Definition: ZCounting.h:95
double EtaCutL2_
Definition: ZCounting.h:122
double PVMin_
Definition: ZCounting.h:133
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:164
Definition: Run.h:43
double VtxAbsZCut_
Definition: ZCounting.h:138