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 
28 
29 class TFile;
30 class TH1D;
31 class TTree;
32 class TClonesArray;
33 namespace edm {
34  class TriggerResults;
35  class TriggerNames;
36 }
37 namespace ZCountingTrigger {
38  class TTrigger;
39 }
40 
41 class ZCounting: public DQMEDAnalyzer{
42 
43 public:
44 
45  ZCounting(const edm::ParameterSet& ps);
46  ~ZCounting() override;
47 
48  enum MuonIDTypes { NoneID, LooseID, MediumID, TightID };
49  enum MuonIsoTypes { NoneIso, TrackerIso, PFIso };
50 
51 protected:
52 
53  void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override;
54  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
55  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
56  void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup) override ;
57  void endLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup) override;
58 
59 private:
60  //other functions
61  bool isMuonTrigger(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerBits &hltBits);
62  bool isMuonTriggerObj(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerObjects &hltMatchBits);
63  bool passMuonID(const reco::Muon& muon, const reco::Vertex& vtx, const MuonIDTypes &idType);
64  bool passMuonIso(const reco::Muon& muon, const MuonIsoTypes &isoType, const float isoCut);
65 
66  // initialization from HLT menu; needs to be called on every change in HLT menu
67  void initHLT(const edm::TriggerResults&, const edm::TriggerNames&);
68 
69  // EDM object collection names
81 
82  // bacon fillers
83  std::unique_ptr<ZCountingTrigger::TTrigger> fTrigger;
84 
87  MuonIDTypes IDType_ {NoneID};
88  MuonIsoTypes IsoType_ {NoneIso};
89  double IsoCut_;
90 
91  double PtCutL1_;
92  double PtCutL2_;
93  double EtaCutL1_;
94  double EtaCutL2_;
95 
96  int MassBin_;
97  double MassMin_;
98  double MassMax_;
99 
100  int LumiBin_;
101  double LumiMin_;
102  double LumiMax_;
103 
104  int PVBin_;
105  double PVMin_;
106  double PVMax_;
107 
109  double VtxNdofCut_;
110  double VtxAbsZCut_;
111  double VtxRhoCut_;
112 
113  const double MUON_MASS = 0.105658369;
114  const double MUON_BOUND = 0.9;
115 
116  // Histograms
121 
126 
131 
134 };
135 
136 
137 #endif
MonitorElement * h_mass_Sta_fail_central
Definition: ZCounting.h:129
MonitorElement * h_mass_Sta_pass_central
Definition: ZCounting.h:127
double IsoCut_
Definition: ZCounting.h:89
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:124
double PtCutL1_
Definition: ZCounting.h:91
std::string fPVName
Definition: ZCounting.h:75
double LumiMax_
Definition: ZCounting.h:102
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
std::string fTrackName
Definition: ZCounting.h:79
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:123
edm::InputTag fHLTObjTag
Definition: ZCounting.h:71
MonitorElement * h_yield_Z
Definition: ZCounting.h:133
std::string fMuonName
Definition: ZCounting.h:77
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:118
double LumiMin_
Definition: ZCounting.h:101
void bookHistograms(fwlite::EventContainer &eventCont)
std::bitset< kNTrigObjectBit > TriggerObjects
Definition: TriggerDefs.h:9
edm::InputTag fHLTTag
Definition: ZCounting.h:72
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:80
std::string IDTypestr_
Definition: ZCounting.h:85
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:78
double VtxRhoCut_
Definition: ZCounting.h:111
MonitorElement * h_mass_Sta_pass_forward
Definition: ZCounting.h:128
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:70
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:76
int PVBin_
Definition: ZCounting.h:104
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
double VtxNTracksFitCut_
Definition: ZCounting.h:108
double VtxNdofCut_
Definition: ZCounting.h:109
MonitorElement * h_npv
Definition: ZCounting.h:132
double PtCutL2_
Definition: ZCounting.h:92
MonitorElement * h_mass_Sta_fail_forward
Definition: ZCounting.h:130
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:73
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:125
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:117
int MassBin_
Definition: ZCounting.h:96
int LumiBin_
Definition: ZCounting.h:100
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:74
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:120
HLT enums.
double EtaCutL1_
Definition: ZCounting.h:93
double MassMax_
Definition: ZCounting.h:98
double PVMax_
Definition: ZCounting.h:106
double MassMin_
Definition: ZCounting.h:97
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:122
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:83
std::string IsoTypestr_
Definition: ZCounting.h:86
double EtaCutL2_
Definition: ZCounting.h:94
double PVMin_
Definition: ZCounting.h:105
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:119
Definition: Run.h:43
double VtxAbsZCut_
Definition: ZCounting.h:110