CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TopDiLeptonOffline::MonitorEnsemble Class Reference

#include <TopDiLeptonOfflineDQM.h>

Public Types

enum  DecayChannel { NONE, DIMUON, DIELEC, ELECMU }
 different decay channels More...
 
enum  Level { STANDARD, VERBOSE, DEBUG }
 different verbosity levels More...
 
typedef
reco::LeafCandidate::LorentzVector 
LorentzVector
 

Public Member Functions

void book (DQMStore::IBooker &ibooker)
 book histograms in subdirectory directory More...
 
void fill (const edm::Event &event, const edm::EventSetup &setup)
 fill monitor histograms with electronId and jetCorrections More...
 
 MonitorEnsemble (const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 ~MonitorEnsemble ()
 default destructor More...
 

Private Member Functions

bool booked (const std::string histName) const
 check if histogram was booked More...
 
DecayChannel decayChannel (const std::vector< const reco::PFCandidate * > &muons, const std::vector< const reco::PFCandidate * > &elecs) const
 determine dileptonic decay channel More...
 
void fill (const edm::Event &event, const edm::TriggerResults &triggerTable, std::string channel, const std::vector< std::string > labels) const
 fill trigger monitoring histograms More...
 
void fill (const std::string histName, double value) const
 fill histogram if it had been booked before More...
 
void fill (const std::string histName, double xValue, double yValue) const
 fill histogram if it had been booked before (2-dim version) More...
 
void fill (const std::string histName, double xValue, double yValue, double zValue) const
 fill histogram if it had been booked before (2-dim version) More...
 
void loggerBinLabels (std::string hist)
 set labels for event logging histograms More...
 
std::string monitorPath (const std::string &label) const
 
std::string selectionPath (const std::string &label) const
 
void triggerBinLabels (std::string channel, const std::vector< std::string > labels)
 set configurable labels for trigger monitoring histograms More...
 

Private Attributes

int diElecLogged_
 
int diMuonLogged_
 
std::vector< std::string > diMuonPaths_
 trigger paths for di muon channel More...
 
std::string directory_
 
double eidCutValue_
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate > > 
elecIso_
 extra isolation criterion on electron More...
 
int elecMuLogged_
 number of logged interesting events More...
 
std::vector< std::string > elecMuPaths_
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
elecs_
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate > > 
elecSelect_
 extra selection on electrons More...
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
electronId_
 electronId label More...
 
std::map< std::string,
MonitorElement * > 
hists_
 
edm::ESGetToken< JetCorrector,
JetCorrectionsRecord
jetCorrector_
 jetCorrector More...
 
edm::EDGetTokenT
< reco::JetIDValueMap
jetIDLabel_
 jetID as an extra selection type More...
 
std::unique_ptr
< StringCutObjectSelector
< reco::JetID > > 
jetIDSelect_
 extra jetID selection on calo jets More...
 
edm::EDGetTokenT< edm::View
< reco::Jet > > 
jets_
 input sources for monitoring More...
 
std::string jetSelect_
 
std::string label_
 instance label More...
 
double lowerEdge_
 mass window upper and lower edge More...
 
std::vector< edm::EDGetTokenT
< edm::View< reco::MET > > > 
mets_
 considers a vector of METs More...
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate, true > > 
muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
muons_
 
std::unique_ptr
< StringCutObjectSelector
< reco::PFCandidate, true > > 
muonSelect_
 extra selection on muons More...
 
edm::EDGetTokenT
< edm::TriggerResults
triggerTable_
 trigger table More...
 
double upperEdge_
 
Level verbosity_
 verbosity level for booking More...
 

Detailed Description

Definition at line 52 of file TopDiLeptonOfflineDQM.h.

Member Typedef Documentation

make clear which LorentzVector to use for jet, electrons and muon buffering

Definition at line 58 of file TopDiLeptonOfflineDQM.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

MonitorEnsemble::MonitorEnsemble ( const char *  label,
const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)

default contructor MonitorEnsemble(const char* label, const edm::ParameterSet& cfg);

Definition at line 18 of file TopDiLeptonOfflineDQM.cc.

References DEBUG, diMuonPaths_, directory_, eidCutValue_, elecIso_, elecMuPaths_, elecs_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), jetCorrector_, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, mets_, muonIso_, muons_, muonSelect_, STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, triggerTable_, upperEdge_, VERBOSE, and verbosity_.

19  : label_(label),
20  eidCutValue_(0.),
21  elecIso_(nullptr),
22  elecSelect_(nullptr),
23  muonIso_(nullptr),
24  muonSelect_(nullptr),
25  jetIDSelect_(nullptr),
26  lowerEdge_(-1.),
27  upperEdge_(-1.),
28  elecMuLogged_(0),
29  diMuonLogged_(0),
30  diElecLogged_(0) {
31  // sources have to be given; this PSet is not optional
32  edm::ParameterSet sources = cfg.getParameter<edm::ParameterSet>("sources");
34  elecs_ = iC.consumes<edm::View<reco::PFCandidate>>(sources.getParameter<edm::InputTag>("elecs"));
35  jets_ = iC.consumes<edm::View<reco::Jet>>(sources.getParameter<edm::InputTag>("jets"));
36  for (edm::InputTag const& tag : sources.getParameter<std::vector<edm::InputTag>>("mets"))
37  mets_.push_back(iC.consumes<edm::View<reco::MET>>(tag));
38 
39  // elecExtras are optional; they may be omitted or empty
40  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
41  edm::ParameterSet elecExtras = cfg.getParameter<edm::ParameterSet>("elecExtras");
42  // select is optional; in case it's not found no
43  // selection will be applied
44  if (elecExtras.existsAs<std::string>("select")) {
45  elecSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
46  elecExtras.getParameter<std::string>("select"));
47  }
48  // isolation is optional; in case it's not found no
49  // isolation will be applied
50  if (elecExtras.existsAs<std::string>("isolation")) {
51  elecIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate>>(
52  elecExtras.getParameter<std::string>("isolation"));
53  }
54  // electronId is optional; in case it's not found the
55  // InputTag will remain empty
56  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
57  edm::ParameterSet elecId = elecExtras.getParameter<edm::ParameterSet>("electronId");
59  eidCutValue_ = elecId.getParameter<double>("cutValue");
60  // eidPattern_= elecId.getParameter<int>("pattern");
61  }
62  }
63  // muonExtras are optional; they may be omitted or empty
64  if (cfg.existsAs<edm::ParameterSet>("muonExtras")) {
65  edm::ParameterSet muonExtras = cfg.getParameter<edm::ParameterSet>("muonExtras");
66  // select is optional; in case it's not found no
67  // selection will be applied
68  if (muonExtras.existsAs<std::string>("select")) {
69  muonSelect_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
70  muonExtras.getParameter<std::string>("select"));
71  }
72  // isolation is optional; in case it's not found no
73  // isolation will be applied
74  if (muonExtras.existsAs<std::string>("isolation")) {
75  muonIso_ = std::make_unique<StringCutObjectSelector<reco::PFCandidate, true>>(
76  muonExtras.getParameter<std::string>("isolation"));
77  }
78  }
79  // jetExtras are optional; they may be omitted or empty
80  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
81  edm::ParameterSet jetExtras = cfg.getParameter<edm::ParameterSet>("jetExtras");
82  // jetCorrector is optional; in case it's not found
83  // the InputTag will remain empty
84  if (jetExtras.existsAs<std::string>("jetCorrector")) {
85  jetCorrector_ = iC.esConsumes(edm::ESInputTag("", jetExtras.getParameter<std::string>("jetCorrector")));
86  }
87  // read jetID information if it exists
88  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
89  edm::ParameterSet jetID = jetExtras.getParameter<edm::ParameterSet>("jetID");
91  jetIDSelect_ =
92  std::make_unique<StringCutObjectSelector<reco::JetID>>(jetID.getParameter<std::string>("select"));
93  }
94  // select is optional; in case it's not found no
95  // selection will be applied (only implemented for
96  // CaloJets at the moment)
97  if (jetExtras.existsAs<std::string>("select")) {
98  jetSelect_ = jetExtras.getParameter<std::string>("select");
99  }
100  }
101  // triggerExtras are optional; they may be omitted or empty
102  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
103  edm::ParameterSet triggerExtras = cfg.getParameter<edm::ParameterSet>("triggerExtras");
105  elecMuPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsELECMU");
106  diMuonPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsDIMUON");
107  }
108  // massExtras is optional; in case it's not found no mass
109  // window cuts are applied for the same flavor monitor
110  // histograms
111  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
112  edm::ParameterSet massExtras = cfg.getParameter<edm::ParameterSet>("massExtras");
113  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
114  upperEdge_ = massExtras.getParameter<double>("upperEdge");
115  }
116 
117  // setup the verbosity level for booking histograms;
118  // per default the verbosity level will be set to
119  // STANDARD. This will also be the chosen level in
120  // the case when the monitoring PSet is not found
122  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
123  edm::ParameterSet monitoring = cfg.getParameter<edm::ParameterSet>("monitoring");
124  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
125  verbosity_ = DEBUG;
126  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
128  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
130  }
131  // and don't forget to do the histogram booking
132  directory_ = cfg.getParameter<std::string>("directory");
133  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
char const * label
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
double lowerEdge_
mass window upper and lower edge
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::vector< std::string > elecMuPaths_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::ESGetToken< JetCorrector, JetCorrectionsRecord > jetCorrector_
jetCorrector
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
TopDiLeptonOffline::MonitorEnsemble::~MonitorEnsemble ( )
inline

default destructor

Definition at line 67 of file TopDiLeptonOfflineDQM.h.

67 {};

Member Function Documentation

void MonitorEnsemble::book ( DQMStore::IBooker ibooker)

book histograms in subdirectory directory

Definition at line 135 of file TopDiLeptonOfflineDQM.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), diMuonPaths_, directory_, elecMuPaths_, hists_, label_, loggerBinLabels(), dqm::implementation::NavigatorBase::setCurrentFolder(), STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), VERBOSE, and verbosity_.

135  {
136  // set up the current directory path
137  std::string current(directory_);
138  current += label_;
139  ibooker.setCurrentFolder(current);
140 
141  // determine number of bins for trigger monitoring
142  unsigned int nElecMu = elecMuPaths_.size();
143  unsigned int nDiMuon = diMuonPaths_.size();
144 
145  // --- [STANDARD] --- //
146  // Run Number
147  hists_["RunNumb_"] = ibooker.book1D("RunNumber", "Run Nr.", 1.e4, 1.5e5, 3.e5);
148  // invariant mass of opposite charge lepton pair (only filled for same flavor)
149  hists_["invMass_"] = ibooker.book1D("InvMass", "M(lep1, lep2)", 80, 0., 320.);
150  // invariant mass of opposite charge lepton pair (only filled for same flavor)
151  hists_["invMassLog_"] = ibooker.book1D("InvMassLog", "log_{10}(M(lep1, lep2))", 80, .1, 2.5);
152  // invariant mass of same charge lepton pair (log10 for low mass region, only
153  // filled for same flavor)
154  hists_["invMassWC_"] = ibooker.book1D("InvMassWC", "M_{WC}(L1, L2)", 80, 0., 320.);
155  // invariant mass of same charge lepton pair (log10 for low mass region, only
156  // filled for same flavor)
157  hists_["invMassWCLog_"] = ibooker.book1D("InvMassLogWC", "log_{10}(M_{WC})", 80, .1, 2.5);
158  // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon
159  hists_["decayChannel_"] = ibooker.book1D("DecayChannel", "Decay Channel", 3, 0, 3);
160  // trigger efficiency estimates for the electron muon channel
161  hists_["elecMuEff_"] = ibooker.book1D("ElecMuEff", "Eff(e/#mu paths)", nElecMu, 0., nElecMu);
162  // monitored trigger occupancy for the electron muon channel
163  hists_["elecMuMon_"] = ibooker.book1D("ElecMuMon", "Mon(e/#mu paths)", nElecMu, 0., nElecMu);
164  // trigger efficiency estimates for the di muon channel
165  hists_["diMuonEff_"] = ibooker.book1D("DiMuonEff", "Eff(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
166  // monitored trigger occupancy for the di muon channel
167  hists_["diMuonMon_"] = ibooker.book1D("DiMuonMon", "Mon(#mu/#mu paths)", nDiMuon, 0., nDiMuon);
168  // pt of the leading lepton
169  hists_["lep1Pt_"] = ibooker.book1D("Lep1Pt", "pt(lep1)", 50, 0., 200.);
170  // pt of the 2. leading lepton
171  hists_["lep2Pt_"] = ibooker.book1D("Lep2Pt", "pt(lep2)", 50, 0., 200.);
172  // multiplicity of jets with pt>30 (corrected to L2+L3)
173  hists_["jetMult_"] = ibooker.book1D("JetMult", "N_{30}(jet)", 21, -0.5, 20.5);
174  // MET (calo)
175  hists_["metCalo_"] = ibooker.book1D("METCalo", "MET_{Calo}", 50, 0., 200.);
176 
177  // set bin labels for trigger monitoring
180  // set bin labels for decayChannel_
181  hists_["decayChannel_"]->setBinLabel(1, "#mu e", 1);
182  hists_["decayChannel_"]->setBinLabel(2, "#mu #mu", 1);
183  hists_["decayChannel_"]->setBinLabel(3, "e e", 1);
184 
185  if (verbosity_ == STANDARD)
186  return;
187 
188  // --- [VERBOSE] --- //
189  // mean eta of the candidate leptons
190  hists_["sumEtaL1L2_"] = ibooker.book1D("SumEtaL1L2", "<#eta>(lep1, lep2)", 100, -5., 5.);
191  // deltaEta between the 2 candidate leptons
192  hists_["dEtaL1L2_"] = ibooker.book1D("DEtaL1L2", "#Delta#eta(lep1,lep2)", 80, -4., 4.);
193  // deltaPhi between the 2 candidate leptons
194  hists_["dPhiL1L2_"] = ibooker.book1D("DPhiL1L2", "#Delta#phi(lep1,lep2)", 64, -3.2, 3.2);
195  // pt of the candidate electron (depending on the decay channel)
196  hists_["elecPt_"] = ibooker.book1D("ElecPt", "pt(e)", 50, 0., 200.);
197  // relative isolation of the candidate electron (depending on the decay
198  // channel)
199  hists_["elecRelIso_"] = ibooker.book1D("ElecRelIso", "Iso_{Rel}(e)", 50, 0., 1.);
200  // pt of the canddiate muon (depending on the decay channel)
201  hists_["muonPt_"] = ibooker.book1D("MuonPt", "pt(#mu)", 50, 0., 200.);
202  // relative isolation of the candidate muon (depending on the decay channel)
203  hists_["muonRelIso_"] = ibooker.book1D("MuonRelIso", "Iso_{Rel}(#mu) (#Delta#beta Corrected)", 50, 0., 1.);
204  // pt of the 1. leading jet (corrected to L2+L3)
205  hists_["jet1Pt_"] = ibooker.book1D("Jet1Pt", "pt_{L2L3}(jet1)", 60, 0., 300.);
206  // pt of the 2. leading jet (corrected to L2+L3)
207  hists_["jet2Pt_"] = ibooker.book1D("Jet2Pt", "pt_{L2L3}(jet2)", 60, 0., 300.);
208  // MET (PF)
209  hists_["metPflow_"] = ibooker.book1D("METPflow", "MET_{Pflow}", 50, 0., 200.);
210  // MET (TC)
211  hists_["metTC_"] = ibooker.book1D("METTC", "MET_{TC}", 50, 0., 200.);
212  // dz for muons (to suppress cosmis)
213  hists_["muonDelZ_"] = ibooker.book1D("MuonDelZ", "d_{z}(#mu)", 50, -25., 25.);
214  // dxy for muons (to suppress cosmics)
215  hists_["muonDelXY_"] = ibooker.book2D("MuonDelXY", "d_{xy}(#mu)", 50, -1., 1., 50, -1., 1.);
216  // lepton multiplicity after std isolation
217  hists_["lepMultIso_"] = ibooker.book2D("LepMultIso", "N_{Iso}(e) vs N_{Iso}(#mu)", 5, 0., 5., 5, 0., 5.);
218 
219  // set axes titles for dxy for muons
220  hists_["muonDelXY_"]->setAxisTitle("x [cm]", 1);
221  hists_["muonDelXY_"]->setAxisTitle("y [cm]", 2);
222  // set axes titles for lepton multiplicity after std isolation
223  hists_["lepMultIso_"]->setAxisTitle("N_{Iso}(#mu)", 1);
224  hists_["lepMultIso_"]->setAxisTitle("N_{Iso}(elec)", 2);
225 
226  if (verbosity_ == VERBOSE)
227  return;
228 
229  // --- [DEBUG] --- //
230  // electron multiplicity after std isolation
231  hists_["elecMultIso_"] = ibooker.book1D("ElecMultIso", "N_{Iso}(e)", 11, -0.5, 10.5);
232  // muon multiplicity after std isolation
233  hists_["muonMultIso_"] = ibooker.book1D("MuonMultIso", "N_{Iso}(#mu)", 11, -0.5, 10.5);
234  // charged hadron isolation component of the candidate muon (depending on the
235  // decay channel)
236  hists_["muonChHadIso_"] = ibooker.book1D("MuonChHadIsoComp", "ChHad_{IsoComponent}(#mu)", 50, 0., 5.);
237  // neutral hadron isolation component of the candidate muon (depending on the
238  // decay channel)
239  hists_["muonNeHadIso_"] = ibooker.book1D("MuonNeHadIsoComp", "NeHad_{IsoComponent}(#mu)", 50, 0., 5.);
240  // photon isolation component of the candidate muon (depending on the decay
241  // channel)
242  hists_["muonPhIso_"] = ibooker.book1D("MuonPhIsoComp", "Photon_{IsoComponent}(#mu)", 50, 0., 5.);
243  // charged hadron isolation component of the candidate electron (depending on
244  // the decay channel)
245  hists_["elecChHadIso_"] = ibooker.book1D("ElectronChHadIsoComp", "ChHad_{IsoComponent}(e)", 50, 0., 5.);
246  // neutral hadron isolation component of the candidate electron (depending on
247  // the decay channel)
248  hists_["elecNeHadIso_"] = ibooker.book1D("ElectronNeHadIsoComp", "NeHad_{IsoComponent}(e)", 50, 0., 5.);
249  // photon isolation component of the candidate electron (depending on the
250  // decay channel)
251  hists_["elecPhIso_"] = ibooker.book1D("ElectronPhIsoComp", "Photon_{IsoComponent}(e)", 50, 0., 5.);
252  // eta of the leading jet
253  hists_["jet1Eta_"] = ibooker.book1D("Jet1Eta", "#eta(jet1)", 30, -5., 5.);
254  // eta of the 2. leading jet
255  hists_["jet2Eta_"] = ibooker.book1D("Jet2Eta", "#eta(jet2)", 30, -5., 5.);
256  // pt of the 1. leading jet (not corrected)
257  hists_["jet1PtRaw_"] = ibooker.book1D("Jet1PtRaw", "pt_{Raw}(jet1)", 60, 0., 300.);
258  // pt of the 2. leading jet (not corrected)
259  hists_["jet2PtRaw_"] = ibooker.book1D("Jet2PtRaw", "pt_{Raw}(jet2)", 60, 0., 300.);
260  // deltaEta between the 2 leading jets
261  hists_["dEtaJet1Jet2_"] = ibooker.book1D("DEtaJet1Jet2", "#Delta#eta(jet1,jet2)", 80, -4., 4.);
262  // deltaEta between the lepton and the leading jet
263  hists_["dEtaJet1Lep1_"] = ibooker.book1D("DEtaJet1Lep1", "#Delta#eta(jet1,lep1)", 80, -4., 4.);
264  // deltaEta between the lepton and MET
265  hists_["dEtaLep1MET_"] = ibooker.book1D("DEtaLep1MET", "#Delta#eta(lep1,MET)", 80, -4., 4.);
266  // deltaEta between leading jet and MET
267  hists_["dEtaJet1MET_"] = ibooker.book1D("DEtaJet1MET", "#Delta#eta(jet1,MET)", 80, -4., 4.);
268  // deltaPhi of 2 leading jets
269  hists_["dPhiJet1Jet2_"] = ibooker.book1D("DPhiJet1Jet2", "#Delta#phi(jet1,jet2)", 64, -3.2, 3.2);
270  // deltaPhi of 1. lepton and 1. jet
271  hists_["dPhiJet1Lep1_"] = ibooker.book1D("DPhiJet1Lep1", "#Delta#phi(jet1,lep1)", 64, -3.2, 3.2);
272  // deltaPhi of 1. lepton and MET
273  hists_["dPhiLep1MET_"] = ibooker.book1D("DPhiLep1MET", "#Delta#phi(lep1,MET)", 64, -3.2, 3.2);
274  // deltaPhi of 1. jet and MET
275  hists_["dPhiJet1MET_"] = ibooker.book1D("DPhiJet1MET", "#Delta#phi(jet1,MET)", 64, -3.2, 3.2);
276  // selected dimuon events
277  hists_["diMuonLogger_"] = ibooker.book2D("DiMuonLogger", "Logged DiMuon Events", 8, 0., 8., 10, 0., 10.);
278  // selected dielec events
279  hists_["diElecLogger_"] = ibooker.book2D("DiElecLogger", "Logged DiElec Events", 8, 0., 8., 10, 0., 10.);
280  // selected elemu events
281  hists_["elecMuLogger_"] = ibooker.book2D("ElecMuLogger", "Logged ElecMu Events", 8, 0., 8., 10, 0., 10.);
282 
283  // set bin labels for trigger monitoring
284  loggerBinLabels(std::string("diMuonLogger_"));
285  loggerBinLabels(std::string("diElecLogger_"));
286  loggerBinLabels(std::string("elecMuLogger_"));
287  return;
288  }
Level verbosity_
verbosity level for booking
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
void loggerBinLabels(std::string hist)
set labels for event logging histograms
std::vector< std::string > elecMuPaths_
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
std::map< std::string, MonitorElement * > hists_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
bool TopDiLeptonOffline::MonitorEnsemble::booked ( const std::string  histName) const
inlineprivate

check if histogram was booked

Definition at line 96 of file TopDiLeptonOfflineDQM.h.

References hists_.

Referenced by fill().

96 { return hists_.find(histName) != hists_.end(); };
std::map< std::string, MonitorElement * > hists_
MonitorEnsemble::DecayChannel MonitorEnsemble::decayChannel ( const std::vector< const reco::PFCandidate * > &  muons,
const std::vector< const reco::PFCandidate * > &  elecs 
) const
inlineprivate

determine dileptonic decay channel

Definition at line 231 of file TopDiLeptonOfflineDQM.h.

References DIELEC, DIMUON, ELECMU, and NONE.

Referenced by fill().

232  {
234  if (muons.size() > 1) {
235  type = DIMUON;
236  } else if (elecs.size() > 1) {
237  type = DIELEC;
238  } else if (!elecs.empty() && !muons.empty()) {
239  type = ELECMU;
240  }
241  return type;
242  }
tuple muons
Definition: patZpeak.py:39
void MonitorEnsemble::fill ( const edm::Event event,
const edm::EventSetup setup 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 290 of file TopDiLeptonOfflineDQM.cc.

References RecoTauCleanerPlugins::charge, pfClustersFromHGC3DClusters_cfi::corrector, decayChannel(), reco::deltaPhi(), reco::deltaR(), DIELEC, diElecLogged_, DIMUON, diMuonLogged_, diMuonPaths_, eidCutValue_, elecIso_, ELECMU, elecMuLogged_, elecMuPaths_, elecs_, elecSelect_, electronId_, reco::LeafCandidate::et(), PVValHelper::eta, edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByToken(), edm::EventSetup::getData(), edm::ESGetToken< T, R >::hasValidIndex(), hists_, edm::ESGetToken< T, R >::isInitialized(), edm::Ref< C, T, F >::isNull(), edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), ResonanceBuilder::mass, SiStripPI::max, objects.METAnalyzer::met, mets_, VarParsing::mult, HLT_FULL_cff::muon, muonIso_, patZpeak::muons, muons_, muonSelect_, muon::overlap(), DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, triggerTable_, upperEdge_, and trackerHitRTTI::vector.

Referenced by fill().

290  {
291  // fetch trigger event if configured such
294  if (!event.getByToken(triggerTable_, triggerTable))
295  return;
296  }
297  /*
298  ------------------------------------------------------------
299 
300  Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy
301  value=5.0)
302 
303  ------------------------------------------------------------
304  */
305 
306  if (!event.eventAuxiliary().run())
307  return;
308  fill("RunNumb_", event.eventAuxiliary().run());
309 
310  double dummy = 5.;
311  fill("InstLumi_", dummy);
312 
313  /*
314  ------------------------------------------------------------
315 
316  Muon Selection
317 
318  ------------------------------------------------------------
319  */
320 
321  std::vector<const reco::PFCandidate*> isoMuons;
322 
325 
326  if (!event.getByToken(muons_, muons))
327  return;
328 
329  for (edm::View<reco::PFCandidate>::const_iterator muonit = muons->begin(); muonit != muons->end(); ++muonit) {
330  if (muonit->muonRef().isNull())
331  continue;
332  reco::MuonRef muon = muonit->muonRef();
333 
334  if (muon->innerTrack().isNull())
335  continue;
336 
337  if (muon->isGlobalMuon()) {
338  fill("muonDelZ_", muon->innerTrack()->vz()); // CB using inner track!
339  fill("muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
340 
341  // apply selection
342  if (!muonSelect_ || (*muonSelect_)(*muonit)) {
343  double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
344  double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
345  double phoEt = muon->pfIsolationR04().sumPhotonEt;
346 
347  double pfRelIso = (chHadPt + std::max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
348  muon->pt(); // CB dBeta corrected iso!
349 
350  fill("muonRelIso_", pfRelIso);
351 
352  fill("muonChHadIso_", chHadPt);
353  fill("muonNeHadIso_", neHadEt);
354  fill("muonPhIso_", phoEt);
355 
356  if (!muonIso_ || (*muonIso_)(*muonit))
357  isoMuons.push_back(&(*muonit));
358  }
359  }
360  }
361 
362  fill("muonMultIso_", isoMuons.size());
363 
364  /*
365  ------------------------------------------------------------
366 
367  Electron Selection
368 
369  ------------------------------------------------------------
370  */
371 
372  // buffer isolated electronss
373  std::vector<const reco::PFCandidate*> isoElecs;
375  if (!electronId_.isUninitialized()) {
376  if (!event.getByToken(electronId_, electronId))
377  return;
378  }
380  if (!event.getByToken(elecs_, elecs))
381  return;
382 
383  for (edm::View<reco::PFCandidate>::const_iterator elec = elecs->begin(); elec != elecs->end(); ++elec) {
384  if (elec->gsfElectronRef().isNull()) {
385  continue;
386  }
387  reco::GsfElectronRef gsf_el = elec->gsfElectronRef();
388  // restrict to electrons with good electronId
389  if (electronId_.isUninitialized() ? true : ((double)(*electronId)[gsf_el] >= eidCutValue_)) {
390  // apply preselection
391  if (!elecSelect_ || (*elecSelect_)(*elec)) {
392  double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
393  double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
394  double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
395  double el_pfRelIso =
396  (el_ChHadIso + std::max(0., el_NeHadIso + el_PhIso - 0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
397  gsf_el->pt();
398  fill("elecRelIso_", el_pfRelIso);
399  fill("elecChHadIso_", el_ChHadIso);
400  fill("elecNeHadIso_", el_NeHadIso);
401  fill("elecPhIso_", el_PhIso);
402  if (!elecIso_ || (*elecIso_)(*elec))
403  isoElecs.push_back(&(*elec));
404  }
405  }
406  }
407  fill("elecMultIso_", isoElecs.size());
408 
409  /*
410  ------------------------------------------------------------
411 
412  Jet Selection
413 
414  ------------------------------------------------------------
415  */
416 
417  const JetCorrector* corrector = nullptr;
419  // check whether a jet correcto is in the event setup or not
420  if (setup.find(edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>())) {
421  corrector = &setup.getData(jetCorrector_);
422  } else {
423  edm::LogVerbatim("TopDiLeptonOfflineDQM") << "\n"
424  << "-----------------------------------------------------------------"
425  "-------------------- \n"
426  << " No JetCorrectionsRecord available from EventSetup: "
427  " \n"
428  << " - Jets will not be corrected. "
429  " \n"
430  << " - If you want to change this add the following lines to your "
431  "cfg file: \n"
432  << " "
433  " \n"
434  << " ## load jet corrections "
435  " \n"
436  << " "
437  "process.load(\"JetMETCorrections.Configuration."
438  "JetCorrectionServicesAllAlgos_cff\") \n"
439  << " process.prefer(\"ak5CaloL2L3\") "
440  " \n"
441  << " "
442  " \n"
443  << "-----------------------------------------------------------------"
444  "-------------------- \n";
445  }
446  }
447 
448  unsigned int mult = 0;
449  // buffer leadingJets
450  std::vector<reco::Jet> leadingJets;
452  if (!event.getByToken(jets_, jets))
453  return;
454 
456  if (jetIDSelect_) {
457  if (!event.getByToken(jetIDLabel_, jetID))
458  return;
459  }
460 
461  for (edm::View<reco::Jet>::const_iterator jet = jets->begin(); jet != jets->end(); ++jet) {
462  unsigned int idx = jet - jets->begin();
463  if (jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
464  if (!(*jetIDSelect_)((*jetID)[jets->refAt(idx)]))
465  continue;
466  }
467  // chekc additional jet selection for calo, pf and bare reco jets
468  if (dynamic_cast<const reco::CaloJet*>(&*jet)) {
469  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet);
470  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
472  if (!jetSelect(sel)) {
473  continue;
474  }
475  } else if (dynamic_cast<const reco::PFJet*>(&*jet)) {
476  reco::PFJet sel = dynamic_cast<const reco::PFJet&>(*jet);
477  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
479  if (!jetSelect(sel))
480  continue;
481  } else {
482  reco::Jet sel = *jet;
483  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
485  if (!jetSelect(sel))
486  continue;
487  }
488  // check for overlaps
489  bool overlap = false;
490  for (std::vector<const reco::PFCandidate*>::const_iterator elec = isoElecs.begin(); elec != isoElecs.end();
491  ++elec) {
492  if (reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi()) < 0.4) {
493  overlap = true;
494  break;
495  }
496  }
497  if (overlap) {
498  continue;
499  }
500  // prepare jet to fill monitor histograms
501  reco::Jet monitorJet = *jet;
502  monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
503  ++mult; // determine jet multiplicity
504  if (idx == 0) {
505  leadingJets.push_back(monitorJet);
506  fill("jet1Pt_", monitorJet.pt());
507  fill("jet1PtRaw_", jet->pt());
508  fill("jet1Eta_", jet->eta());
509  }
510  if (idx == 1) {
511  leadingJets.push_back(monitorJet);
512  fill("jet2Pt_", monitorJet.pt());
513  fill("jet2PtRaw_", jet->pt());
514  fill("jet2Eta_", jet->eta());
515  }
516  }
517  if (leadingJets.size() > 1) {
518  fill("dEtaJet1Jet2_", leadingJets[0].eta() - leadingJets[1].eta());
519  fill("dPhiJet1Jet2_", reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi()));
520  if (!isoMuons.empty()) {
521  if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
522  fill("dEtaJet1Lep1_", isoMuons[0]->eta() - leadingJets[0].eta());
523  fill("dPhiJet1Lep1_", reco::deltaPhi(isoMuons[0]->phi(), leadingJets[0].phi()));
524  }
525  }
526  if (!isoElecs.empty()) {
527  if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
528  fill("dEtaJet1Lep1_", isoElecs[0]->eta() - leadingJets[0].eta());
529  fill("dPhiJet1Lep1_", reco::deltaPhi(isoElecs[0]->phi(), leadingJets[0].phi()));
530  }
531  }
532  }
533  fill("jetMult_", mult);
534 
535  /*
536  ------------------------------------------------------------
537 
538  MET Selection
539 
540  ------------------------------------------------------------
541  */
542 
543  // buffer for event logging
544  reco::MET caloMET;
545  for (std::vector<edm::EDGetTokenT<edm::View<reco::MET>>>::const_iterator met_ = mets_.begin(); met_ != mets_.end();
546  ++met_) {
548  if (!event.getByToken(*met_, met))
549  continue;
550 
551  if (met->begin() != met->end()) {
552  unsigned int idx = met_ - mets_.begin();
553  if (idx == 0) {
554  caloMET = *met->begin();
555  fill("metCalo_", met->begin()->et());
556  if (!leadingJets.empty()) {
557  fill("dEtaJet1MET_", leadingJets[0].eta() - met->begin()->eta());
558  fill("dPhiJet1MET_", reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi()));
559  }
560  if (!isoMuons.empty()) {
561  if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
562  fill("dEtaLep1MET_", isoMuons[0]->eta() - met->begin()->eta());
563  fill("dPhiLep1MET_", reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi()));
564  }
565  }
566  if (!isoElecs.empty()) {
567  if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
568  fill("dEtaLep1MET_", isoElecs[0]->eta() - met->begin()->eta());
569  fill("dPhiLep1MET_", reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi()));
570  }
571  }
572  }
573  if (idx == 1) {
574  fill("metTC_", met->begin()->et());
575  }
576  if (idx == 2) {
577  fill("metPflow_", met->begin()->et());
578  }
579  }
580  }
581 
582  /*
583  ------------------------------------------------------------
584 
585  Event Monitoring
586 
587  ------------------------------------------------------------
588  */
589 
590  // check number of isolated leptons
591  fill("lepMultIso_", isoMuons.size(), isoElecs.size());
592  // ELECMU channel
593  if (decayChannel(isoMuons, isoElecs) == ELECMU) {
594  fill("decayChannel_", 0.5);
595  double mass = (isoElecs[0]->p4() + isoMuons[0]->p4()).mass();
596  if ((lowerEdge_ == -1. && upperEdge_ == -1.) || (lowerEdge_ < mass && mass < upperEdge_)) {
597  fill("dEtaL1L2_", isoElecs[0]->eta() - isoMuons[0]->eta());
598  fill("sumEtaL1L2_", (isoElecs[0]->eta() + isoMuons[0]->eta()) / 2);
599  fill("dPhiL1L2_", reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta()));
600  fill("elecPt_", isoElecs[0]->pt());
601  fill("muonPt_", isoMuons[0]->pt());
602  fill("lep1Pt_", isoElecs[0]->pt() > isoMuons[0]->pt() ? isoElecs[0]->pt() : isoMuons[0]->pt());
603  fill("lep2Pt_", isoElecs[0]->pt() > isoMuons[0]->pt() ? isoMuons[0]->pt() : isoElecs[0]->pt());
604  // fill plots for trigger monitoring
606  fill(event, *triggerTable, "elecMu", elecMuPaths_);
607  if (elecMuLogged_ <= hists_.find("elecMuLogger_")->second->getNbinsY()) {
608  // log runnumber, lumi block, event number & some
609  // more pysics infomation for interesting events
610  fill("elecMuLogger_", 0.5, elecMuLogged_ + 0.5, event.eventAuxiliary().run());
611  fill("elecMuLogger_", 1.5, elecMuLogged_ + 0.5, event.eventAuxiliary().luminosityBlock());
612  fill("elecMuLogger_", 2.5, elecMuLogged_ + 0.5, event.eventAuxiliary().event());
613  fill("elecMuLogger_", 3.5, elecMuLogged_ + 0.5, isoMuons[0]->pt());
614  fill("elecMuLogger_", 4.5, elecMuLogged_ + 0.5, isoElecs[0]->pt());
615  if (!leadingJets.empty())
616  fill("elecMuLogger_", 5.5, elecMuLogged_ + 0.5, leadingJets[0].pt());
617  if (leadingJets.size() > 1)
618  fill("elecMuLogger_", 6.5, elecMuLogged_ + 0.5, leadingJets[1].pt());
619  fill("elecMuLogger_", 7.5, elecMuLogged_ + 0.5, caloMET.et());
620  ++elecMuLogged_;
621  }
622  }
623  }
624 
625  // DIMUON channel
626  if (decayChannel(isoMuons, isoElecs) == DIMUON) {
627  fill("decayChannel_", 1.5);
628  int charge = isoMuons[0]->charge() * isoMuons[1]->charge();
629  double mass = (isoMuons[0]->p4() + isoMuons[1]->p4()).mass();
630 
631  fill(charge < 0 ? "invMass_" : "invMassWC_", mass);
632  fill(charge < 0 ? "invMassLog_" : "invMassWCLog_", log10(mass));
633  if ((lowerEdge_ == -1. && upperEdge_ == -1.) || (lowerEdge_ < mass && mass < upperEdge_)) {
634  fill("dEtaL1L2_", isoMuons[0]->eta() - isoMuons[1]->eta());
635  fill("sumEtaL1L2_", (isoMuons[0]->eta() + isoMuons[1]->eta()) / 2);
636  fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(), isoMuons[1]->phi()));
637  fill("muonPt_", isoMuons[0]->pt());
638  fill("muonPt_", isoMuons[1]->pt());
639  fill("lep1Pt_", isoMuons[0]->pt());
640  fill("lep2Pt_", isoMuons[1]->pt());
641  // fill plots for trigger monitoring
643  fill(event, *triggerTable, "diMuon", diMuonPaths_);
644  if (diMuonLogged_ <= hists_.find("diMuonLogger_")->second->getNbinsY()) {
645  // log runnumber, lumi block, event number & some
646  // more pysics infomation for interesting events
647  fill("diMuonLogger_", 0.5, diMuonLogged_ + 0.5, event.eventAuxiliary().run());
648  fill("diMuonLogger_", 1.5, diMuonLogged_ + 0.5, event.eventAuxiliary().luminosityBlock());
649  fill("diMuonLogger_", 2.5, diMuonLogged_ + 0.5, event.eventAuxiliary().event());
650  fill("diMuonLogger_", 3.5, diMuonLogged_ + 0.5, isoMuons[0]->pt());
651  fill("diMuonLogger_", 4.5, diMuonLogged_ + 0.5, isoMuons[1]->pt());
652  if (!leadingJets.empty())
653  fill("diMuonLogger_", 5.5, diMuonLogged_ + 0.5, leadingJets[0].pt());
654  if (leadingJets.size() > 1)
655  fill("diMuonLogger_", 6.5, diMuonLogged_ + 0.5, leadingJets[1].pt());
656  fill("diMuonLogger_", 7.5, diMuonLogged_ + 0.5, caloMET.et());
657  ++diMuonLogged_;
658  }
659  }
660  }
661 
662  // DIELEC channel
663  if (decayChannel(isoMuons, isoElecs) == DIELEC) {
664  fill("decayChannel_", 2.5);
665  int charge = isoElecs[0]->charge() * isoElecs[1]->charge();
666  double mass = (isoElecs[0]->p4() + isoElecs[1]->p4()).mass();
667  fill(charge < 0 ? "invMass_" : "invMassWC_", mass);
668  fill(charge < 0 ? "invMassLog_" : "invMassWCLog_", log10(mass));
669  if ((lowerEdge_ == -1. && upperEdge_ == -1.) || (lowerEdge_ < mass && mass < upperEdge_)) {
670  fill("dEtaL1L2_", isoElecs[0]->eta() - isoElecs[1]->eta());
671  fill("sumEtaL1L2_", (isoElecs[0]->eta() + isoElecs[1]->eta()) / 2);
672  fill("dPhiL1L2_", reco::deltaPhi(isoElecs[0]->phi(), isoElecs[1]->phi()));
673  fill("elecPt_", isoElecs[0]->pt());
674  fill("elecPt_", isoElecs[1]->pt());
675  fill("lep1Pt_", isoElecs[0]->pt());
676  fill("lep2Pt_", isoElecs[1]->pt());
677  if (diElecLogged_ <= hists_.find("diElecLogger_")->second->getNbinsY()) {
678  // log runnumber, lumi block, event number & some
679  // more pysics infomation for interesting events
680  fill("diElecLogger_", 0.5, diElecLogged_ + 0.5, event.eventAuxiliary().run());
681  fill("diElecLogger_", 1.5, diElecLogged_ + 0.5, event.eventAuxiliary().luminosityBlock());
682  fill("diElecLogger_", 2.5, diElecLogged_ + 0.5, event.eventAuxiliary().event());
683  fill("diElecLogger_", 3.5, diElecLogged_ + 0.5, isoElecs[0]->pt());
684  fill("diElecLogger_", 4.5, diElecLogged_ + 0.5, isoElecs[1]->pt());
685  if (!leadingJets.empty())
686  fill("diElecLogger_", 5.5, diElecLogged_ + 0.5, leadingJets[0].pt());
687  if (leadingJets.size() > 1)
688  fill("diElecLogger_", 6.5, diElecLogged_ + 0.5, leadingJets[1].pt());
689  fill("diElecLogger_", 7.5, diElecLogged_ + 0.5, caloMET.et());
690  ++diElecLogged_;
691  }
692  }
693  }
694  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
Definition: EventSetup.h:178
Log< level::Info, true > LogVerbatim
Jets made from CaloTowers.
Definition: CaloJet.h:27
virtual void scaleEnergy(double fScale)
scale energy of the jet
double pt() const final
transverse momentum
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
Base class for all types of Jets.
Definition: Jet.h:20
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
RunNumber_t run() const
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
EventAuxiliary const & eventAuxiliary() const override
Definition: Event.h:95
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Jets made from PFObjects.
Definition: PFJet.h:20
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
Definition: MET.h:41
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
double lowerEdge_
mass window upper and lower edge
vector< PseudoJet > jets
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::vector< std::string > elecMuPaths_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecSelect_
extra selection on electrons
bool isNull() const
Checks for null.
Definition: Ref.h:235
constexpr bool isInitialized() const noexcept
Definition: ESGetToken.h:72
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
std::map< std::string, MonitorElement * > hists_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::ESGetToken< JetCorrector, JetCorrectionsRecord > jetCorrector_
jetCorrector
double et() const final
transverse energy
tuple muons
Definition: patZpeak.py:39
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
DecayChannel decayChannel(const std::vector< const reco::PFCandidate * > &muons, const std::vector< const reco::PFCandidate * > &elecs) const
determine dileptonic decay channel
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonIso_
extra isolation criterion on muon
constexpr bool hasValidIndex() const noexcept
Definition: ESGetToken.h:74
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
void MonitorEnsemble::fill ( const edm::Event event,
const edm::TriggerResults triggerTable,
std::string  channel,
const std::vector< std::string >  labels 
) const
inlineprivate

fill trigger monitoring histograms

Definition at line 215 of file TopDiLeptonOfflineDQM.h.

References accept(), fill(), hists_, monitorPath(), selectionPath(), and relativeConstraints::value.

218  {
219  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
220  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
221  fill(channel + "Mon_", idx + 0.5);
222  // take care to fill triggerMon_ before evts is being called
223  int evts = hists_.find(channel + "Mon_")->second->getBinContent(idx + 1);
224  double value = hists_.find(channel + "Eff_")->second->getBinContent(idx + 1);
225  fill(
226  channel + "Eff_", idx + 0.5, 1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) - value));
227  }
228  }
229  }
std::string selectionPath(const std::string &label) const
std::string monitorPath(const std::string &label) const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
std::map< std::string, MonitorElement * > hists_
void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 98 of file TopDiLeptonOfflineDQM.h.

References booked(), and hists_.

98  {
99  if (booked(histName))
100  hists_.find(histName)->second->Fill(value);
101  };
bool booked(const std::string histName) const
check if histogram was booked
std::map< std::string, MonitorElement * > hists_
void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  xValue,
double  yValue 
) const
inlineprivate

fill histogram if it had been booked before (2-dim version)

Definition at line 103 of file TopDiLeptonOfflineDQM.h.

References booked(), and hists_.

103  {
104  if (booked(histName))
105  hists_.find(histName)->second->Fill(xValue, yValue);
106  };
bool booked(const std::string histName) const
check if histogram was booked
std::map< std::string, MonitorElement * > hists_
void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  xValue,
double  yValue,
double  zValue 
) const
inlineprivate

fill histogram if it had been booked before (2-dim version)

Definition at line 108 of file TopDiLeptonOfflineDQM.h.

References booked(), and hists_.

108  {
109  if (booked(histName))
110  hists_.find(histName)->second->Fill(xValue, yValue, zValue);
111  };
bool booked(const std::string histName) const
check if histogram was booked
std::map< std::string, MonitorElement * > hists_
void MonitorEnsemble::loggerBinLabels ( std::string  hist)
inlineprivate

set labels for event logging histograms

Definition at line 182 of file TopDiLeptonOfflineDQM.h.

References gpuVertexFinder::hist, and hists_.

Referenced by book().

182  {
183  // set axes titles for selected events
184  hists_[hist]->getTH1()->SetOption("TEXT");
185  hists_[hist]->setBinLabel(1, "Run", 1);
186  hists_[hist]->setBinLabel(2, "Block", 1);
187  hists_[hist]->setBinLabel(3, "Event", 1);
188  hists_[hist]->setBinLabel(6, "pt_{L2L3}(jet1)", 1);
189  hists_[hist]->setBinLabel(7, "pt_{L2L3}(jet2)", 1);
190  hists_[hist]->setBinLabel(8, "MET_{Calo}", 1);
191  hists_[hist]->setAxisTitle("logged evts", 2);
192 
193  if (hist == "diMuonLogger_") {
194  hists_[hist]->setBinLabel(4, "pt(muon)", 1);
195  hists_[hist]->setBinLabel(5, "pt(muon)", 1);
196  }
197  if (hist == "diElecLogger_") {
198  hists_[hist]->setBinLabel(4, "pt(elec)", 1);
199  hists_[hist]->setBinLabel(5, "pt(elec)", 1);
200  }
201  if (hist == "elecMuLogger_") {
202  hists_[hist]->setBinLabel(4, "pt(elec)", 1);
203  hists_[hist]->setBinLabel(5, "pt(muon)", 1);
204  }
205  }
__shared__ Hist hist
std::map< std::string, MonitorElement * > hists_
std::string TopDiLeptonOffline::MonitorEnsemble::monitorPath ( const std::string &  label) const
inlineprivate

deduce monitorPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 77 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

77 { return label.substr(label.find(':') + 1); };
char const * label
std::string TopDiLeptonOffline::MonitorEnsemble::selectionPath ( const std::string &  label) const
inlineprivate

deduce selectionPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 80 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

80 { return label.substr(0, label.find(':')); };
char const * label
void MonitorEnsemble::triggerBinLabels ( std::string  channel,
const std::vector< std::string >  labels 
)
inlineprivate

set configurable labels for trigger monitoring histograms

Definition at line 207 of file TopDiLeptonOfflineDQM.h.

References hists_, monitorPath(), and selectionPath().

Referenced by book().

207  {
208  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
209  hists_[channel + "Mon_"]->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
210  hists_[channel + "Eff_"]->setBinLabel(
211  idx + 1, "[" + selectionPath(labels[idx]) + "]|[" + monitorPath(labels[idx]) + "]", 1);
212  }
213  }
std::string selectionPath(const std::string &label) const
std::string monitorPath(const std::string &label) const
std::map< std::string, MonitorElement * > hists_

Member Data Documentation

int TopDiLeptonOffline::MonitorEnsemble::diElecLogged_
private

Definition at line 174 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

int TopDiLeptonOffline::MonitorEnsemble::diMuonLogged_
private

Definition at line 174 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

std::vector<std::string> TopDiLeptonOffline::MonitorEnsemble::diMuonPaths_
private

trigger paths for di muon channel

Definition at line 132 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), fill(), and MonitorEnsemble().

std::string TopDiLeptonOffline::MonitorEnsemble::directory_
private

Definition at line 179 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().

double TopDiLeptonOffline::MonitorEnsemble::eidCutValue_
private

electronId pattern we expect the following pattern: 0: fails 1: passes electron ID only 2: passes electron Isolation only 3: passes electron ID and Isolation only 4: passes conversion rejection 5: passes conversion rejection and ID 6: passes conversion rejection and Isolation 7: passes the whole selection As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID

Definition at line 149 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::elecIso_
private

extra isolation criterion on electron

Definition at line 151 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

int TopDiLeptonOffline::MonitorEnsemble::elecMuLogged_
private

number of logged interesting events

Definition at line 174 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

std::vector<std::string> TopDiLeptonOffline::MonitorEnsemble::elecMuPaths_
private

trigger paths for monitoring, expected to be of form signalPath:MonitorPath

Definition at line 130 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::View<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::elecs_
private

Definition at line 121 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::elecSelect_
private

extra selection on electrons

Definition at line 153 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::ValueMap<float> > TopDiLeptonOffline::MonitorEnsemble::electronId_
private

electronId label

Definition at line 135 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::map<std::string, MonitorElement*> TopDiLeptonOffline::MonitorEnsemble::hists_
private

storage manager histogram container

Definition at line 177 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), booked(), fill(), loggerBinLabels(), and triggerBinLabels().

edm::ESGetToken<JetCorrector, JetCorrectionsRecord> TopDiLeptonOffline::MonitorEnsemble::jetCorrector_
private

jetCorrector

Definition at line 162 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<reco::JetIDValueMap> TopDiLeptonOffline::MonitorEnsemble::jetIDLabel_
private

jetID as an extra selection type

Definition at line 164 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::JetID> > TopDiLeptonOffline::MonitorEnsemble::jetIDSelect_
private

extra jetID selection on calo jets

Definition at line 166 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::View<reco::Jet> > TopDiLeptonOffline::MonitorEnsemble::jets_
private

input sources for monitoring

Definition at line 119 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string TopDiLeptonOffline::MonitorEnsemble::jetSelect_
private

extra selection on jets (here given as std::string as it depends on the the jet type, which selections are valid and which not)

Definition at line 169 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string TopDiLeptonOffline::MonitorEnsemble::label_
private
double TopDiLeptonOffline::MonitorEnsemble::lowerEdge_
private

mass window upper and lower edge

Definition at line 171 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::vector<edm::EDGetTokenT<edm::View<reco::MET> > > TopDiLeptonOffline::MonitorEnsemble::mets_
private

considers a vector of METs

Definition at line 124 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > TopDiLeptonOffline::MonitorEnsemble::muonIso_
private

extra isolation criterion on muon

Definition at line 156 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::View<reco::PFCandidate> > TopDiLeptonOffline::MonitorEnsemble::muons_
private

Definition at line 120 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::unique_ptr<StringCutObjectSelector<reco::PFCandidate, true> > TopDiLeptonOffline::MonitorEnsemble::muonSelect_
private

extra selection on muons

Definition at line 159 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::EDGetTokenT<edm::TriggerResults> TopDiLeptonOffline::MonitorEnsemble::triggerTable_
private

trigger table

Definition at line 127 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopDiLeptonOffline::MonitorEnsemble::upperEdge_
private

Definition at line 171 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level TopDiLeptonOffline::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 111 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().