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 (std::string directory)
 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...
 
double eidCutValue_
 
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_
 
StringCutObjectSelector
< reco::PFCandidate > * 
elecSelect_
 extra selection on electrons More...
 
edm::EDGetTokenT
< edm::ValueMap< float > > 
electronId_
 electronId label More...
 
std::map< std::string,
MonitorElement * > 
hists_
 histogram container More...
 
std::string jetCorrector_
 jetCorrector More...
 
edm::EDGetTokenT
< reco::JetIDValueMap
jetIDLabel_
 jetID as an extra selection type More...
 
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...
 
StringCutObjectSelector
< reco::PFCandidate, true > * 
muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View
< reco::PFCandidate > > 
muons_
 
StringCutObjectSelector
< reco::PFCandidate, true > * 
muonSelect_
 extra selection on muons More...
 
DQMStorestore_
 storage manager 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 book(), DEBUG, diMuonPaths_, eidCutValue_, elecIso_, elecMuPaths_, elecs_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), jetCorrector_, bTagSequences_cff::jetID, 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_(0),
20  elecSelect_(0),
21  muonIso_(0),
22  muonSelect_(0),
23  jetIDSelect_(0),
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")) {
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  book(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:184
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
StringCutObjectSelector< reco::PFCandidate > * elecIso_
extra isolation criterion on electron
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_
StringCutObjectSelector< reco::PFCandidate, true > * muonIso_
extra isolation criterion on muon
void book(std::string directory)
book histograms in subdirectory directory
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
StringCutObjectSelector< reco::PFCandidate, true > * muonSelect_
extra selection on muons
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
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 ( std::string  directory)

book histograms in subdirectory directory

Definition at line 150 of file TopDiLeptonOfflineDQM.cc.

References cond::rpcobimon::current, diMuonPaths_, elecMuPaths_, hists_, label_, loggerBinLabels(), cppFunctionSkipper::operator, STANDARD, store_, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), VERBOSE, and verbosity_.

Referenced by MonitorEnsemble().

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

References DIELEC, DIMUON, ELECMU, and NONE.

Referenced by fill().

257  {
259  if (muons.size() > 1) {
260  type = DIMUON;
261  } else if (elecs.size() > 1) {
262  type = DIELEC;
263  } else if (!elecs.empty() && !muons.empty()) {
264  type = ELECMU;
265  }
266  return type;
267 }
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 341 of file TopDiLeptonOfflineDQM.cc.

References 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_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), edm::eventsetup::EventSetupRecordKey::makeKey(), max(), caloMETBenchmarkGeneric_cfi::met, mets_, VarParsing::mult, trackingTruthProducerFastSim_cfi::muon, muonIso_, patZpeak::muons, muons_, muonSelect_, muon::overlap(), phi, RecoTauCleanerPlugins::pt, reco::LeafCandidate::pt(), edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, triggerTable_, and upperEdge_.

Referenced by fill().

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

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

238  {
239  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
240  if (accept(event, triggerTable, monitorPath(labels[idx]))) {
241  fill((channel + "Mon_").c_str(), idx + 0.5);
242  // take care to fill triggerMon_ before evts is being called
243  int evts = hists_.find((channel + "Mon_").c_str())
244  ->second->getBinContent(idx + 1);
245  double value = hists_.find((channel + "Eff_").c_str())
246  ->second->getBinContent(idx + 1);
247  fill(
248  (channel + "Eff_").c_str(), idx + 0.5,
249  1. / evts * (accept(event, triggerTable, selectionPath(labels[idx])) -
250  value));
251  }
252  }
253 }
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_
histogram container
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_
histogram container
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_
histogram container
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_
histogram container
void MonitorEnsemble::loggerBinLabels ( std::string  hist)
inlineprivate

set labels for event logging histograms

Definition at line 198 of file TopDiLeptonOfflineDQM.h.

References hists_.

Referenced by book().

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

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

Referenced by book().

224  {
225  for (unsigned int idx = 0; idx < labels.size(); ++idx) {
226  hists_[(channel + "Mon_").c_str()]
227  ->setBinLabel(idx + 1, "[" + monitorPath(labels[idx]) + "]", 1);
228  hists_[(channel + "Eff_").c_str()]
229  ->setBinLabel(idx + 1, "[" + selectionPath(labels[idx]) + "]|[" +
230  monitorPath(labels[idx]) + "]",
231  1);
232  }
233 }
std::string selectionPath(const std::string &label) const
std::string monitorPath(const std::string &label) const
std::map< std::string, MonitorElement * > hists_
histogram container
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().

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().

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().

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

histogram container

Definition at line 195 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().

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().

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().

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().

DQMStore* TopDiLeptonOffline::MonitorEnsemble::store_
private

storage manager

Definition at line 193 of file TopDiLeptonOfflineDQM.h.

Referenced by book().

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().