CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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_
 
std::string 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 62 of file TopDiLeptonOfflineDQM.h.

Member Enumeration Documentation

different verbosity levels

Enumerator
STANDARD 
VERBOSE 
DEBUG 

Definition at line 55 of file TopDiLeptonOfflineDQM.h.

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 14 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_.

17  : label_(label),
18  eidCutValue_(0.),
19  elecIso_(nullptr),
20  elecSelect_(nullptr),
21  muonIso_(nullptr),
22  muonSelect_(nullptr),
23  jetIDSelect_(nullptr),
24  lowerEdge_(-1.),
25  upperEdge_(-1.),
26  elecMuLogged_(0),
27  diMuonLogged_(0),
28  diElecLogged_(0) {
29  // sources have to be given; this PSet is not optional
30  edm::ParameterSet sources = cfg.getParameter<edm::ParameterSet>("sources");
32  sources.getParameter<edm::InputTag>("muons"));
34  sources.getParameter<edm::InputTag>("elecs"));
36  sources.getParameter<edm::InputTag>("jets"));
37  for (edm::InputTag const& tag :
38  sources.getParameter<std::vector<edm::InputTag> >("mets"))
39  mets_.push_back(iC.consumes<edm::View<reco::MET> >(tag));
40 
41  // elecExtras are optional; they may be omitted or empty
42  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
43  edm::ParameterSet elecExtras =
44  cfg.getParameter<edm::ParameterSet>("elecExtras");
45  // select is optional; in case it's not found no
46  // selection will be applied
47  if (elecExtras.existsAs<std::string>("select")) {
49  elecExtras.getParameter<std::string>("select")));
50  }
51  // isolation is optional; in case it's not found no
52  // isolation will be applied
53  if (elecExtras.existsAs<std::string>("isolation")) {
55  elecExtras.getParameter<std::string>("isolation")));
56  }
57  // electronId is optional; in case it's not found the
58  // InputTag will remain empty
59  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
60  edm::ParameterSet elecId =
61  elecExtras.getParameter<edm::ParameterSet>("electronId");
63  elecId.getParameter<edm::InputTag>("src"));
64  eidCutValue_ = elecId.getParameter<double>("cutValue");
65  // eidPattern_= elecId.getParameter<int>("pattern");
66  }
67  }
68  // muonExtras are optional; they may be omitted or empty
69  if (cfg.existsAs<edm::ParameterSet>("muonExtras")) {
70  edm::ParameterSet muonExtras =
71  cfg.getParameter<edm::ParameterSet>("muonExtras");
72  // select is optional; in case it's not found no
73  // selection will be applied
74  if (muonExtras.existsAs<std::string>("select")) {
76  muonExtras.getParameter<std::string>("select")));
77  }
78  // isolation is optional; in case it's not found no
79  // isolation will be applied
80  if (muonExtras.existsAs<std::string>("isolation")) {
82  muonExtras.getParameter<std::string>("isolation")));
83  }
84  }
85  // jetExtras are optional; they may be omitted or empty
86  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
87  edm::ParameterSet jetExtras =
88  cfg.getParameter<edm::ParameterSet>("jetExtras");
89  // jetCorrector is optional; in case it's not found
90  // the InputTag will remain empty
91  if (jetExtras.existsAs<std::string>("jetCorrector")) {
92  jetCorrector_ = jetExtras.getParameter<std::string>("jetCorrector");
93  }
94  // read jetID information if it exists
95  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
96  edm::ParameterSet jetID =
97  jetExtras.getParameter<edm::ParameterSet>("jetID");
99  jetID.getParameter<edm::InputTag>("label"));
101  jetID.getParameter<std::string>("select")));
102  }
103  // select is optional; in case it's not found no
104  // selection will be applied (only implemented for
105  // CaloJets at the moment)
106  if (jetExtras.existsAs<std::string>("select")) {
107  jetSelect_ = jetExtras.getParameter<std::string>("select");
108  }
109  }
110  // triggerExtras are optional; they may be omitted or empty
111  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
112  edm::ParameterSet triggerExtras =
113  cfg.getParameter<edm::ParameterSet>("triggerExtras");
115  triggerExtras.getParameter<edm::InputTag>("src"));
116  elecMuPaths_ =
117  triggerExtras.getParameter<std::vector<std::string> >("pathsELECMU");
118  diMuonPaths_ =
119  triggerExtras.getParameter<std::vector<std::string> >("pathsDIMUON");
120  }
121  // massExtras is optional; in case it's not found no mass
122  // window cuts are applied for the same flavor monitor
123  // histograms
124  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
125  edm::ParameterSet massExtras =
126  cfg.getParameter<edm::ParameterSet>("massExtras");
127  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
128  upperEdge_ = massExtras.getParameter<double>("upperEdge");
129  }
130 
131  // setup the verbosity level for booking histograms;
132  // per default the verbosity level will be set to
133  // STANDARD. This will also be the chosen level in
134  // the case when the monitoring PSet is not found
136  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
137  edm::ParameterSet monitoring =
138  cfg.getParameter<edm::ParameterSet>("monitoring");
139  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
140  verbosity_ = DEBUG;
141  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
143  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
145  }
146  // and don't forget to do the histogram booking
147  directory_ = cfg.getParameter<std::string>("directory");
148 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:185
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
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
edm::EDGetTokenT< edm::View< reco::PFCandidate > > 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
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
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 77 of file TopDiLeptonOfflineDQM.h.

77 {};

Member Function Documentation

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

book histograms in subdirectory directory

Definition at line 150 of file TopDiLeptonOfflineDQM.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), cond::rpcobimon::current, diMuonPaths_, directory_, elecMuPaths_, hists_, label_, loggerBinLabels(), DQMStore::IBooker::setCurrentFolder(), STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), VERBOSE, and verbosity_.

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

References hists_.

Referenced by fill().

110  {
111  return hists_.find(histName.c_str()) != hists_.end();
112  };
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 256 of file TopDiLeptonOfflineDQM.h.

References DIELEC, DIMUON, ELECMU, and NONE.

Referenced by fill().

258  {
260  if (muons.size() > 1) {
261  type = DIMUON;
262  } else if (elecs.size() > 1) {
263  type = DIELEC;
264  } else if (!elecs.empty() && !muons.empty()) {
265  type = ELECMU;
266  }
267  return type;
268 }
type
Definition: HCALResponse.h:21
tuple muons
Definition: patZpeak.py:38
void MonitorEnsemble::fill ( const edm::Event event,
const edm::EventSetup setup 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 334 of file TopDiLeptonOfflineDQM.cc.

References RecoTauCleanerPlugins::charge, mvaPFMET_cff::corrector, decayChannel(), reco::deltaPhi(), reco::deltaR(), DIELEC, diElecLogged_, DIMUON, diMuonLogged_, diMuonPaths_, eidCutValue_, elecIso_, ELECMU, elecMuLogged_, elecMuPaths_, elecs_, elecSelect_, electronId_, reco::LeafCandidate::et(), eta(), edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), hists_, customizeTrackingMonitorSeedNumber::idx, edm::Ref< C, T, F >::isNull(), edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), edm::eventsetup::EventSetupRecordKey::makeKey(), bookConverter::max, objects.METAnalyzer::met, mets_, VarParsing::mult, metsig::muon, muonIso_, patZpeak::muons, muons_, muonSelect_, muon::overlap(), phi, EnergyCorrector::pt, reco::LeafCandidate::pt(), edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, triggerTable_, and upperEdge_.

Referenced by fill().

335  {
336  // fetch trigger event if configured such
339  if (!event.getByToken(triggerTable_, triggerTable)) return;
340  }
341  /*
342  ------------------------------------------------------------
343 
344  Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy
345  value=5.0)
346 
347  ------------------------------------------------------------
348  */
349 
350  if (!event.eventAuxiliary().run()) return;
351  fill("RunNumb_", event.eventAuxiliary().run());
352 
353  double dummy = 5.;
354  fill("InstLumi_", dummy);
355 
356  /*
357  ------------------------------------------------------------
358 
359  Muon Selection
360 
361  ------------------------------------------------------------
362  */
363 
364  std::vector<const reco::PFCandidate*> isoMuons;
365 
368 
369  if (!event.getByToken(muons_, muons)) return;
370 
371  for (edm::View<reco::PFCandidate>::const_iterator muonit = muons->begin();
372  muonit != muons->end(); ++muonit) {
373 
374  if (muonit->muonRef().isNull()) continue;
375  reco::MuonRef muon = muonit->muonRef();
376 
377  if (muon->innerTrack().isNull()) continue;
378 
379  if (muon->isGlobalMuon()) {
380  fill("muonDelZ_", muon->innerTrack()->vz()); // CB using inner track!
381  fill("muonDelXY_", muon->innerTrack()->vx(), muon->innerTrack()->vy());
382 
383  // apply selection
384  if (!muonSelect_ || (*muonSelect_)(*muonit)) {
385 
386  double chHadPt = muon->pfIsolationR04().sumChargedHadronPt;
387  double neHadEt = muon->pfIsolationR04().sumNeutralHadronEt;
388  double phoEt = muon->pfIsolationR04().sumPhotonEt;
389 
390  double pfRelIso =
391  (chHadPt +
392  max(0., neHadEt + phoEt - 0.5 * muon->pfIsolationR04().sumPUPt)) /
393  muon->pt(); // CB dBeta corrected iso!
394 
395  fill("muonRelIso_", pfRelIso);
396 
397  fill("muonChHadIso_", chHadPt);
398  fill("muonNeHadIso_", neHadEt);
399  fill("muonPhIso_", phoEt);
400 
401  if (!muonIso_ || (*muonIso_)(*muonit)) isoMuons.push_back(&(*muonit));
402  }
403  }
404  }
405 
406  fill("muonMultIso_", isoMuons.size());
407 
408  /*
409  ------------------------------------------------------------
410 
411  Electron Selection
412 
413  ------------------------------------------------------------
414  */
415 
416  // buffer isolated electronss
417  std::vector<const reco::PFCandidate*> isoElecs;
419  if (!electronId_.isUninitialized()) {
420  if (!event.getByToken(electronId_, electronId)) return;
421  }
423  if (!event.getByToken(elecs_, elecs)) return;
424 
425  for (edm::View<reco::PFCandidate>::const_iterator elec = elecs->begin();
426  elec != elecs->end(); ++elec) {
427  if (elec->gsfElectronRef().isNull()) {
428  continue;
429  }
430  reco::GsfElectronRef gsf_el = elec->gsfElectronRef();
431  // restrict to electrons with good electronId
432  if (electronId_.isUninitialized() ? true : ((double)(*electronId)[gsf_el] >=
433  eidCutValue_)) {
434  // apply preselection
435  if (!elecSelect_ || (*elecSelect_)(*elec)) {
436  double el_ChHadIso = gsf_el->pfIsolationVariables().sumChargedHadronPt;
437  double el_NeHadIso = gsf_el->pfIsolationVariables().sumNeutralHadronEt;
438  double el_PhIso = gsf_el->pfIsolationVariables().sumPhotonEt;
439  double el_pfRelIso =
440  (el_ChHadIso +
441  max(0., el_NeHadIso + el_PhIso -
442  0.5 * gsf_el->pfIsolationVariables().sumPUPt)) /
443  gsf_el->pt();
444  fill("elecRelIso_", el_pfRelIso);
445  fill("elecChHadIso_", el_ChHadIso);
446  fill("elecNeHadIso_", el_NeHadIso);
447  fill("elecPhIso_", el_PhIso);
448  if (!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec));
449  }
450  }
451  }
452  fill("elecMultIso_", isoElecs.size());
453 
454  /*
455  ------------------------------------------------------------
456 
457  Jet Selection
458 
459  ------------------------------------------------------------
460  */
461 
462  const JetCorrector* corrector = 0;
463  if (!jetCorrector_.empty()) {
464  // check whether a jet correcto is in the event setup or not
466  JetCorrectionsRecord>())) {
467  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
468  } else {
469  edm::LogVerbatim("TopDiLeptonOfflineDQM")
470  << "\n"
471  << "-----------------------------------------------------------------"
472  "-------------------- \n"
473  << " No JetCorrectionsRecord available from EventSetup: "
474  " \n"
475  << " - Jets will not be corrected. "
476  " \n"
477  << " - If you want to change this add the following lines to your "
478  "cfg file: \n"
479  << " "
480  " \n"
481  << " ## load jet corrections "
482  " \n"
483  << " "
484  "process.load(\"JetMETCorrections.Configuration."
485  "JetCorrectionServicesAllAlgos_cff\") \n"
486  << " process.prefer(\"ak5CaloL2L3\") "
487  " \n"
488  << " "
489  " \n"
490  << "-----------------------------------------------------------------"
491  "-------------------- \n";
492  }
493  }
494 
495  unsigned int mult = 0;
496  // buffer leadingJets
497  std::vector<reco::Jet> leadingJets;
499  if (!event.getByToken(jets_, jets)) return;
500 
502  if (jetIDSelect_) {
503  if (!event.getByToken(jetIDLabel_, jetID)) return;
504  }
505 
506  for (edm::View<reco::Jet>::const_iterator jet = jets->begin();
507  jet != jets->end(); ++jet) {
508  unsigned int idx = jet - jets->begin();
509  if (jetIDSelect_ &&
510  dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())) {
511  if (!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
512  }
513  // chekc additional jet selection for calo, pf and bare reco jets
514  if (dynamic_cast<const reco::CaloJet*>(&*jet)) {
515  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet);
516  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
518  if (!jetSelect(sel)) {
519  continue;
520  }
521  } else if (dynamic_cast<const reco::PFJet*>(&*jet)) {
522  reco::PFJet sel = dynamic_cast<const reco::PFJet&>(*jet);
523  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
525  if (!jetSelect(sel)) continue;
526  } else {
527  reco::Jet sel = *jet;
528  sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
530  if (!jetSelect(sel)) continue;
531  }
532  // check for overlaps
533  bool overlap = false;
534  for (std::vector<const reco::PFCandidate*>::const_iterator elec =
535  isoElecs.begin();
536  elec != isoElecs.end(); ++elec) {
537  if (reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi()) <
538  0.4) {
539  overlap = true;
540  break;
541  }
542  }
543  if (overlap) {
544  continue;
545  }
546  // prepare jet to fill monitor histograms
547  reco::Jet monitorJet = *jet;
548  monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
549  ++mult; // determine jet multiplicity
550  if (idx == 0) {
551  leadingJets.push_back(monitorJet);
552  fill("jet1Pt_", monitorJet.pt());
553  fill("jet1PtRaw_", jet->pt());
554  fill("jet1Eta_", jet->eta());
555  }
556  if (idx == 1) {
557  leadingJets.push_back(monitorJet);
558  fill("jet2Pt_", monitorJet.pt());
559  fill("jet2PtRaw_", jet->pt());
560  fill("jet2Eta_", jet->eta());
561  }
562  }
563  if (leadingJets.size() > 1) {
564  fill("dEtaJet1Jet2_", leadingJets[0].eta() - leadingJets[1].eta());
565  fill("dPhiJet1Jet2_",
566  reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi()));
567  if (!isoMuons.empty()) {
568  if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
569  fill("dEtaJet1Lep1_", isoMuons[0]->eta() - leadingJets[0].eta());
570  fill("dPhiJet1Lep1_",
571  reco::deltaPhi(isoMuons[0]->phi(), leadingJets[0].phi()));
572  }
573  }
574  if (!isoElecs.empty()) {
575  if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
576  fill("dEtaJet1Lep1_", isoElecs[0]->eta() - leadingJets[0].eta());
577  fill("dPhiJet1Lep1_",
578  reco::deltaPhi(isoElecs[0]->phi(), leadingJets[0].phi()));
579  }
580  }
581  }
582  fill("jetMult_", mult);
583 
584  /*
585  ------------------------------------------------------------
586 
587  MET Selection
588 
589  ------------------------------------------------------------
590  */
591 
592  // buffer for event logging
593  reco::MET caloMET;
594  for (std::vector<edm::EDGetTokenT<edm::View<reco::MET> > >::const_iterator
595  met_ = mets_.begin();
596  met_ != mets_.end(); ++met_) {
597 
599  if (!event.getByToken(*met_, met)) continue;
600 
601  if (met->begin() != met->end()) {
602  unsigned int idx = met_ - mets_.begin();
603  if (idx == 0) {
604  caloMET = *met->begin();
605  fill("metCalo_", met->begin()->et());
606  if (!leadingJets.empty()) {
607  fill("dEtaJet1MET_", leadingJets[0].eta() - met->begin()->eta());
608  fill("dPhiJet1MET_",
609  reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi()));
610  }
611  if (!isoMuons.empty()) {
612  if (isoElecs.empty() || isoMuons[0]->pt() > isoElecs[0]->pt()) {
613  fill("dEtaLep1MET_", isoMuons[0]->eta() - met->begin()->eta());
614  fill("dPhiLep1MET_",
615  reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi()));
616  }
617  }
618  if (!isoElecs.empty()) {
619  if (isoMuons.empty() || isoElecs[0]->pt() > isoMuons[0]->pt()) {
620  fill("dEtaLep1MET_", isoElecs[0]->eta() - met->begin()->eta());
621  fill("dPhiLep1MET_",
622  reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi()));
623  }
624  }
625  }
626  if (idx == 1) {
627  fill("metTC_", met->begin()->et());
628  }
629  if (idx == 2) {
630  fill("metPflow_", met->begin()->et());
631  }
632  }
633  }
634 
635  /*
636  ------------------------------------------------------------
637 
638  Event Monitoring
639 
640  ------------------------------------------------------------
641  */
642 
643  // check number of isolated leptons
644  fill("lepMultIso_", isoMuons.size(), isoElecs.size());
645  // ELECMU channel
646  if (decayChannel(isoMuons, isoElecs) == ELECMU) {
647  fill("decayChannel_", 0.5);
648  double mass = (isoElecs[0]->p4() + isoMuons[0]->p4()).mass();
649  if ((lowerEdge_ == -1. && upperEdge_ == -1.) ||
650  (lowerEdge_ < mass && mass < upperEdge_)) {
651 
652  fill("dEtaL1L2_", isoElecs[0]->eta() - isoMuons[0]->eta());
653  fill("sumEtaL1L2_", (isoElecs[0]->eta() + isoMuons[0]->eta()) / 2);
654  fill("dPhiL1L2_", reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta()));
655  fill("elecPt_", isoElecs[0]->pt());
656  fill("muonPt_", isoMuons[0]->pt());
657  fill("lep1Pt_", isoElecs[0]->pt() > isoMuons[0]->pt()
658  ? isoElecs[0]->pt()
659  : isoMuons[0]->pt());
660  fill("lep2Pt_", isoElecs[0]->pt() > isoMuons[0]->pt()
661  ? isoMuons[0]->pt()
662  : isoElecs[0]->pt());
663  // fill plots for trigger monitoring
665  fill(event, *triggerTable, "elecMu", elecMuPaths_);
666  if (elecMuLogged_ <= hists_.find("elecMuLogger_")->second->getNbinsY()) {
667  // log runnumber, lumi block, event number & some
668  // more pysics infomation for interesting events
669  fill("elecMuLogger_", 0.5, elecMuLogged_ + 0.5,
670  event.eventAuxiliary().run());
671  fill("elecMuLogger_", 1.5, elecMuLogged_ + 0.5,
672  event.eventAuxiliary().luminosityBlock());
673  fill("elecMuLogger_", 2.5, elecMuLogged_ + 0.5,
674  event.eventAuxiliary().event());
675  fill("elecMuLogger_", 3.5, elecMuLogged_ + 0.5, isoMuons[0]->pt());
676  fill("elecMuLogger_", 4.5, elecMuLogged_ + 0.5, isoElecs[0]->pt());
677  if (leadingJets.size() > 0)
678  fill("elecMuLogger_", 5.5, elecMuLogged_ + 0.5, leadingJets[0].pt());
679  if (leadingJets.size() > 1)
680  fill("elecMuLogger_", 6.5, elecMuLogged_ + 0.5, leadingJets[1].pt());
681  fill("elecMuLogger_", 7.5, elecMuLogged_ + 0.5, caloMET.et());
682  ++elecMuLogged_;
683  }
684  }
685  }
686 
687  // DIMUON channel
688  if (decayChannel(isoMuons, isoElecs) == DIMUON) {
689  fill("decayChannel_", 1.5);
690  int charge = isoMuons[0]->charge() * isoMuons[1]->charge();
691  double mass = (isoMuons[0]->p4() + isoMuons[1]->p4()).mass();
692 
693  fill(charge < 0 ? "invMass_" : "invMassWC_", mass);
694  fill(charge < 0 ? "invMassLog_" : "invMassWCLog_", log10(mass));
695  if ((lowerEdge_ == -1. && upperEdge_ == -1.) ||
696  (lowerEdge_ < mass && mass < upperEdge_)) {
697  fill("dEtaL1L2_", isoMuons[0]->eta() - isoMuons[1]->eta());
698  fill("sumEtaL1L2_", (isoMuons[0]->eta() + isoMuons[1]->eta()) / 2);
699  fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(), isoMuons[1]->phi()));
700  fill("muonPt_", isoMuons[0]->pt());
701  fill("muonPt_", isoMuons[1]->pt());
702  fill("lep1Pt_", isoMuons[0]->pt());
703  fill("lep2Pt_", isoMuons[1]->pt());
704  // fill plots for trigger monitoring
706  fill(event, *triggerTable, "diMuon", diMuonPaths_);
707  if (diMuonLogged_ <= hists_.find("diMuonLogger_")->second->getNbinsY()) {
708  // log runnumber, lumi block, event number & some
709  // more pysics infomation for interesting events
710  fill("diMuonLogger_", 0.5, diMuonLogged_ + 0.5,
711  event.eventAuxiliary().run());
712  fill("diMuonLogger_", 1.5, diMuonLogged_ + 0.5,
713  event.eventAuxiliary().luminosityBlock());
714  fill("diMuonLogger_", 2.5, diMuonLogged_ + 0.5,
715  event.eventAuxiliary().event());
716  fill("diMuonLogger_", 3.5, diMuonLogged_ + 0.5, isoMuons[0]->pt());
717  fill("diMuonLogger_", 4.5, diMuonLogged_ + 0.5, isoMuons[1]->pt());
718  if (leadingJets.size() > 0)
719  fill("diMuonLogger_", 5.5, diMuonLogged_ + 0.5, leadingJets[0].pt());
720  if (leadingJets.size() > 1)
721  fill("diMuonLogger_", 6.5, diMuonLogged_ + 0.5, leadingJets[1].pt());
722  fill("diMuonLogger_", 7.5, diMuonLogged_ + 0.5, caloMET.et());
723  ++diMuonLogged_;
724  }
725  }
726  }
727 
728  // DIELEC channel
729  if (decayChannel(isoMuons, isoElecs) == DIELEC) {
730  fill("decayChannel_", 2.5);
731  int charge = isoElecs[0]->charge() * isoElecs[1]->charge();
732  double mass = (isoElecs[0]->p4() + isoElecs[1]->p4()).mass();
733  fill(charge < 0 ? "invMass_" : "invMassWC_", mass);
734  fill(charge < 0 ? "invMassLog_" : "invMassWCLog_", log10(mass));
735  if ((lowerEdge_ == -1. && upperEdge_ == -1.) ||
736  (lowerEdge_ < mass && mass < upperEdge_)) {
737  fill("dEtaL1L2_", isoElecs[0]->eta() - isoElecs[1]->eta());
738  fill("sumEtaL1L2_", (isoElecs[0]->eta() + isoElecs[1]->eta()) / 2);
739  fill("dPhiL1L2_", reco::deltaPhi(isoElecs[0]->phi(), isoElecs[1]->phi()));
740  fill("elecPt_", isoElecs[0]->pt());
741  fill("elecPt_", isoElecs[1]->pt());
742  fill("lep1Pt_", isoElecs[0]->pt());
743  fill("lep2Pt_", isoElecs[1]->pt());
744  if (diElecLogged_ <= hists_.find("diElecLogger_")->second->getNbinsY()) {
745  // log runnumber, lumi block, event number & some
746  // more pysics infomation for interesting events
747  fill("diElecLogger_", 0.5, diElecLogged_ + 0.5,
748  event.eventAuxiliary().run());
749  fill("diElecLogger_", 1.5, diElecLogged_ + 0.5,
750  event.eventAuxiliary().luminosityBlock());
751  fill("diElecLogger_", 2.5, diElecLogged_ + 0.5,
752  event.eventAuxiliary().event());
753  fill("diElecLogger_", 3.5, diElecLogged_ + 0.5, isoElecs[0]->pt());
754  fill("diElecLogger_", 4.5, diElecLogged_ + 0.5, isoElecs[1]->pt());
755  if (leadingJets.size() > 0)
756  fill("diElecLogger_", 5.5, diElecLogged_ + 0.5, leadingJets[0].pt());
757  if (leadingJets.size() > 1)
758  fill("diElecLogger_", 6.5, diElecLogged_ + 0.5, leadingJets[1].pt());
759  fill("diElecLogger_", 7.5, diElecLogged_ + 0.5, caloMET.et());
760  ++diElecLogged_;
761  }
762  }
763  }
764 }
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void scaleEnergy(double fScale)
scale energy of the jet
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
virtual double et() const
transverse energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
Base class for all types of Jets.
Definition: Jet.h:20
RunNumber_t run() const
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
T eta() const
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Jets made from PFObjects.
Definition: PFJet.h:21
virtual double pt() const
transverse momentum
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
tuple corrector
Definition: mvaPFMET_cff.py:88
Definition: MET.h:42
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:247
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:69
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
std::map< std::string, MonitorElement * > hists_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
tuple muons
Definition: patZpeak.py:38
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
static EventSetupRecordKey makeKey()
bool isUninitialized() const
Definition: EDGetToken.h:71
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
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
Definition: DDAxes.h:10
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 236 of file TopDiLeptonOfflineDQM.h.

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

239  {
240  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
241  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
242  fill((channel + "Mon_").c_str(), idx + 0.5);
243  // take care to fill triggerMon_ before evts is being called
244  int evts = hists_.find((channel + "Mon_").c_str())
245  ->second->getBinContent(idx + 1);
246  double value = hists_.find((channel + "Eff_").c_str())
247  ->second->getBinContent(idx + 1);
248  fill(
249  (channel + "Eff_").c_str(), idx + 0.5,
250  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
251  value));
252  }
253  }
254 }
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:25
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
std::map< std::string, MonitorElement * > hists_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void TopDiLeptonOffline::MonitorEnsemble::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 114 of file TopDiLeptonOfflineDQM.h.

References booked(), hists_, and edm::second().

114  {
115  if (booked(histName.c_str()))
116  hists_.find(histName.c_str())->second->Fill(value);
117  };
bool booked(const std::string histName) const
check if histogram was booked
U second(std::pair< T, U > const &p)
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 119 of file TopDiLeptonOfflineDQM.h.

References booked(), hists_, and edm::second().

119  {
120  if (booked(histName.c_str()))
121  hists_.find(histName.c_str())->second->Fill(xValue, yValue);
122  };
bool booked(const std::string histName) const
check if histogram was booked
U second(std::pair< T, U > const &p)
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 124 of file TopDiLeptonOfflineDQM.h.

References booked(), hists_, and edm::second().

125  {
126  if (booked(histName.c_str()))
127  hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue);
128  };
bool booked(const std::string histName) const
check if histogram was booked
U second(std::pair< T, U > const &p)
std::map< std::string, MonitorElement * > hists_
void MonitorEnsemble::loggerBinLabels ( std::string  hist)
inlineprivate

set labels for event logging histograms

Definition at line 199 of file TopDiLeptonOfflineDQM.h.

References hists_.

Referenced by book().

199  {
200  // set axes titles for selected events
201  hists_[hist.c_str()]->getTH1()->SetOption("TEXT");
202  hists_[hist.c_str()]->setBinLabel(1, "Run", 1);
203  hists_[hist.c_str()]->setBinLabel(2, "Block", 1);
204  hists_[hist.c_str()]->setBinLabel(3, "Event", 1);
205  hists_[hist.c_str()]->setBinLabel(6, "pt_{L2L3}(jet1)", 1);
206  hists_[hist.c_str()]->setBinLabel(7, "pt_{L2L3}(jet2)", 1);
207  hists_[hist.c_str()]->setBinLabel(8, "MET_{Calo}", 1);
208  hists_[hist.c_str()]->setAxisTitle("logged evts", 2);
209 
210  if (hist == "diMuonLogger_") {
211  hists_[hist.c_str()]->setBinLabel(4, "pt(muon)", 1);
212  hists_[hist.c_str()]->setBinLabel(5, "pt(muon)", 1);
213  }
214  if (hist == "diElecLogger_") {
215  hists_[hist.c_str()]->setBinLabel(4, "pt(elec)", 1);
216  hists_[hist.c_str()]->setBinLabel(5, "pt(elec)", 1);
217  }
218  if (hist == "elecMuLogger_") {
219  hists_[hist.c_str()]->setBinLabel(4, "pt(elec)", 1);
220  hists_[hist.c_str()]->setBinLabel(5, "pt(muon)", 1);
221  }
222 }
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 87 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

87  {
88  return label.substr(label.find(':') + 1);
89  };
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 92 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

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

set configurable labels for trigger monitoring histograms

Definition at line 224 of file TopDiLeptonOfflineDQM.h.

References hists_, customizeTrackingMonitorSeedNumber::idx, monitorPath(), and selectionPath().

Referenced by book().

225  {
226  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
227  hists_[(channel + "Mon_").c_str()]
228  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
229  hists_[(channel + "Eff_").c_str()]
230  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
231  monitorPath(labels[idx]) + "]",
232  1);
233  }
234 }
std::string selectionPath(const std::string &label) const
std::string monitorPath(const std::string &label) const
std::map< std::string, MonitorElement * > hists_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...

Member Data Documentation

int TopDiLeptonOffline::MonitorEnsemble::diElecLogged_
private

Definition at line 191 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

int TopDiLeptonOffline::MonitorEnsemble::diMuonLogged_
private

Definition at line 191 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

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

trigger paths for di muon channel

Definition at line 149 of file TopDiLeptonOfflineDQM.h.

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

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

Definition at line 196 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 166 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 168 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

int TopDiLeptonOffline::MonitorEnsemble::elecMuLogged_
private

number of logged interesting events

Definition at line 191 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 147 of file TopDiLeptonOfflineDQM.h.

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

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

Definition at line 138 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 170 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

electronId label

Definition at line 152 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 194 of file TopDiLeptonOfflineDQM.h.

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

std::string TopDiLeptonOffline::MonitorEnsemble::jetCorrector_
private

jetCorrector

Definition at line 179 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 181 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 183 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 136 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 186 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 188 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 141 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 173 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 137 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 176 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

trigger table

Definition at line 144 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopDiLeptonOffline::MonitorEnsemble::upperEdge_
private

Definition at line 188 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level TopDiLeptonOffline::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 128 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().