CMS 3D CMS Logo

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::JetIDValueMapjetIDLabel_
 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::TriggerResultstriggerTable_
 trigger table More...
 
double upperEdge_
 
Level verbosity_
 verbosity level for booking More...
 

Detailed Description

Definition at line 53 of file TopDiLeptonOfflineDQM.h.

Member Typedef Documentation

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

Definition at line 59 of file TopDiLeptonOfflineDQM.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

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

Definition at line 14 of file TopDiLeptonOfflineDQM.cc.

References DEBUG, diMuonPaths_, directory_, eidCutValue_, singleTopDQM_cfi::elecExtras, elecIso_, elecMuPaths_, elecs_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), jetCorrector_, singleTopDQM_cfi::jetExtras, singleTopDQM_cfi::jetID, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, singleTopDQM_cfi::massExtras, mets_, singleTopDQM_cfi::monitoring, singleTopDQM_cfi::muonExtras, muonIso_, muons_, muonSelect_, CalibrationSummaryClient_cfi::sources, STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, singleTopDQM_cfi::triggerExtras, triggerTable_, upperEdge_, VERBOSE, and verbosity_.

15  : label_(label),
16  eidCutValue_(0.),
17  elecIso_(nullptr),
18  elecSelect_(nullptr),
19  muonIso_(nullptr),
20  muonSelect_(nullptr),
21  jetIDSelect_(nullptr),
22  lowerEdge_(-1.),
23  upperEdge_(-1.),
24  elecMuLogged_(0),
25  diMuonLogged_(0),
26  diElecLogged_(0) {
27  // sources have to be given; this PSet is not optional
31  jets_ = iC.consumes<edm::View<reco::Jet>>(sources.getParameter<edm::InputTag>("jets"));
32  for (edm::InputTag const& tag : sources.getParameter<std::vector<edm::InputTag>>("mets"))
33  mets_.push_back(iC.consumes<edm::View<reco::MET>>(tag));
34 
35  // elecExtras are optional; they may be omitted or empty
36  if (cfg.existsAs<edm::ParameterSet>("elecExtras")) {
38  // select is optional; in case it's not found no
39  // selection will be applied
40  if (elecExtras.existsAs<std::string>("select")) {
41  elecSelect_.reset(
43  }
44  // isolation is optional; in case it's not found no
45  // isolation will be applied
46  if (elecExtras.existsAs<std::string>("isolation")) {
47  elecIso_.reset(
49  }
50  // electronId is optional; in case it's not found the
51  // InputTag will remain empty
52  if (elecExtras.existsAs<edm::ParameterSet>("electronId")) {
53  edm::ParameterSet elecId = elecExtras.getParameter<edm::ParameterSet>("electronId");
55  eidCutValue_ = elecId.getParameter<double>("cutValue");
56  // eidPattern_= elecId.getParameter<int>("pattern");
57  }
58  }
59  // muonExtras are optional; they may be omitted or empty
60  if (cfg.existsAs<edm::ParameterSet>("muonExtras")) {
62  // select is optional; in case it's not found no
63  // selection will be applied
64  if (muonExtras.existsAs<std::string>("select")) {
65  muonSelect_.reset(
67  }
68  // isolation is optional; in case it's not found no
69  // isolation will be applied
70  if (muonExtras.existsAs<std::string>("isolation")) {
71  muonIso_.reset(
73  }
74  }
75  // jetExtras are optional; they may be omitted or empty
76  if (cfg.existsAs<edm::ParameterSet>("jetExtras")) {
78  // jetCorrector is optional; in case it's not found
79  // the InputTag will remain empty
80  if (jetExtras.existsAs<std::string>("jetCorrector")) {
81  jetCorrector_ = jetExtras.getParameter<std::string>("jetCorrector");
82  }
83  // read jetID information if it exists
84  if (jetExtras.existsAs<edm::ParameterSet>("jetID")) {
87  jetIDSelect_.reset(new StringCutObjectSelector<reco::JetID>(jetID.getParameter<std::string>("select")));
88  }
89  // select is optional; in case it's not found no
90  // selection will be applied (only implemented for
91  // CaloJets at the moment)
92  if (jetExtras.existsAs<std::string>("select")) {
93  jetSelect_ = jetExtras.getParameter<std::string>("select");
94  }
95  }
96  // triggerExtras are optional; they may be omitted or empty
97  if (cfg.existsAs<edm::ParameterSet>("triggerExtras")) {
100  elecMuPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsELECMU");
101  diMuonPaths_ = triggerExtras.getParameter<std::vector<std::string>>("pathsDIMUON");
102  }
103  // massExtras is optional; in case it's not found no mass
104  // window cuts are applied for the same flavor monitor
105  // histograms
106  if (cfg.existsAs<edm::ParameterSet>("massExtras")) {
108  lowerEdge_ = massExtras.getParameter<double>("lowerEdge");
109  upperEdge_ = massExtras.getParameter<double>("upperEdge");
110  }
111 
112  // setup the verbosity level for booking histograms;
113  // per default the verbosity level will be set to
114  // STANDARD. This will also be the chosen level in
115  // the case when the monitoring PSet is not found
117  if (cfg.existsAs<edm::ParameterSet>("monitoring")) {
119  if (monitoring.getParameter<std::string>("verbosity") == "DEBUG")
120  verbosity_ = DEBUG;
121  if (monitoring.getParameter<std::string>("verbosity") == "VERBOSE")
122  verbosity_ = VERBOSE;
123  if (monitoring.getParameter<std::string>("verbosity") == "STANDARD")
124  verbosity_ = STANDARD;
125  }
126  // and don't forget to do the histogram booking
127  directory_ = cfg.getParameter<std::string>("directory");
128  }
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:160
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
char const * label
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
muonExtras
when omitted isolated electron multiplicity plot will be equi- valent to inclusive electron multiplic...
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
std::unique_ptr< StringCutObjectSelector< reco::PFCandidate, true > > muonSelect_
extra selection on muons
double lowerEdge_
mass window upper and lower edge
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
triggerExtras
[optional] : when omitted no mass window will be applied for the W mass befor filling the event monit...
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 > > muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
elecExtras
[optional] : when omitted all monitoring plots for primary vertices will be filled w/o extras pvExtra...
jetExtras
when omitted isolated muon multiplicity plot will be equi- valent to inclusive muon multiplicity plot...
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
monitoring
[optional] : when omitted the verbosity level is set to STANDARD
TopDiLeptonOffline::MonitorEnsemble::~MonitorEnsemble ( )
inline

default destructor

Definition at line 68 of file TopDiLeptonOfflineDQM.h.

References book(), fill(), and singleTopDQM_cfi::setup.

68 {};

Member Function Documentation

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

book histograms in subdirectory directory

Definition at line 130 of file TopDiLeptonOfflineDQM.cc.

References diMuonPaths_, directory_, vertexPlots::e4, elecMuPaths_, hists_, label_, loggerBinLabels(), STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), VERBOSE, and verbosity_.

Referenced by ~MonitorEnsemble().

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

References hists_.

Referenced by fill().

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

determine dileptonic decay channel

Definition at line 232 of file TopDiLeptonOfflineDQM.h.

References DIELEC, DIMUON, ELECMU, and NONE.

Referenced by fill(), and selectionPath().

void MonitorEnsemble::fill ( const edm::Event event,
const edm::EventSetup setup 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 285 of file TopDiLeptonOfflineDQM.cc.

References slimmedMETs_cfi::caloMET, ALCARECOTkAlJpsiMuMu_cff::charge, mitigatedMETSequence_cff::corrector, decayChannel(), reco::deltaPhi(), reco::deltaR(), DIELEC, diElecLogged_, DIMUON, diMuonLogged_, diMuonPaths_, eidCutValue_, elecIso_, ELECMU, elecMuLogged_, elecMuPaths_, singleTopDQM_cfi::elecs, elecs_, elecSelect_, topSingleLeptonDQM_PU_cfi::electronId, electronId_, reco::LeafCandidate::et(), PVValHelper::eta, edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), hists_, training_settings::idx, edm::Ref< C, T, F >::isNull(), edm::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, singleTopDQM_cfi::jetID, jetIDLabel_, jetIDSelect_, singleTopDQM_cfi::jets, jets_, jetSelect_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), EgHLTOffHistBins_cfi::mass, SiStripPI::max, BTaggingMonitor_cfi::met, mets_, VarParsing::mult, muonIso_, PDWG_BPHSkim_cff::muons, muons_, muonSelect_, goodZToMuMu_cfi::overlap, DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, triggerTable_, and upperEdge_.

Referenced by fill(), selectionPath(), and ~MonitorEnsemble().

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

References accept(), fill(), hists_, training_settings::idx, monitorPath(), and selectionPath().

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

fill histogram if it had been booked before

Definition at line 99 of file TopDiLeptonOfflineDQM.h.

References booked(), and hists_.

99  {
100  if (booked(histName))
101  hists_.find(histName)->second->Fill(value);
102  };
bool booked(const std::string histName) const
check if histogram was booked
Definition: value.py:1
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 104 of file TopDiLeptonOfflineDQM.h.

References booked(), and hists_.

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

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

Definition at line 109 of file TopDiLeptonOfflineDQM.h.

References booked(), and hists_.

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

set labels for event logging histograms

Definition at line 183 of file TopDiLeptonOfflineDQM.h.

References compare::hist, and hists_.

Referenced by book(), and selectionPath().

183  {
184  // set axes titles for selected events
185  hists_[hist]->getTH1()->SetOption("TEXT");
186  hists_[hist]->setBinLabel(1, "Run", 1);
187  hists_[hist]->setBinLabel(2, "Block", 1);
188  hists_[hist]->setBinLabel(3, "Event", 1);
189  hists_[hist]->setBinLabel(6, "pt_{L2L3}(jet1)", 1);
190  hists_[hist]->setBinLabel(7, "pt_{L2L3}(jet2)", 1);
191  hists_[hist]->setBinLabel(8, "MET_{Calo}", 1);
192  hists_[hist]->setAxisTitle("logged evts", 2);
193 
194  if (hist == "diMuonLogger_") {
195  hists_[hist]->setBinLabel(4, "pt(muon)", 1);
196  hists_[hist]->setBinLabel(5, "pt(muon)", 1);
197  }
198  if (hist == "diElecLogger_") {
199  hists_[hist]->setBinLabel(4, "pt(elec)", 1);
200  hists_[hist]->setBinLabel(5, "pt(elec)", 1);
201  }
202  if (hist == "elecMuLogger_") {
203  hists_[hist]->setBinLabel(4, "pt(elec)", 1);
204  hists_[hist]->setBinLabel(5, "pt(muon)", 1);
205  }
206  }
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 78 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

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

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

Definition at line 81 of file TopDiLeptonOfflineDQM.h.

References decayChannel(), singleTopDQM_cfi::elecs, fill(), compare::hist, SummaryClient_cfi::labels, loggerBinLabels(), PDWG_BPHSkim_cff::muons, AlCaHLTBitMon_QueryRunRegistry::string, and triggerBinLabels().

Referenced by fill(), and triggerBinLabels().

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

set configurable labels for trigger monitoring histograms

Definition at line 208 of file TopDiLeptonOfflineDQM.h.

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

Referenced by book(), and selectionPath().

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

Member Data Documentation

int TopDiLeptonOffline::MonitorEnsemble::diElecLogged_
private

Definition at line 175 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

int TopDiLeptonOffline::MonitorEnsemble::diMuonLogged_
private

Definition at line 175 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

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

trigger paths for di muon channel

Definition at line 133 of file TopDiLeptonOfflineDQM.h.

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

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

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

Referenced by fill(), and MonitorEnsemble().

int TopDiLeptonOffline::MonitorEnsemble::elecMuLogged_
private

number of logged interesting events

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

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

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

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

Referenced by fill(), and MonitorEnsemble().

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

electronId label

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

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

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

jetCorrector

Definition at line 163 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 165 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 167 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 120 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 170 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 172 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 125 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 157 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

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

Referenced by fill(), and MonitorEnsemble().

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

trigger table

Definition at line 128 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopDiLeptonOffline::MonitorEnsemble::upperEdge_
private

Definition at line 172 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level TopDiLeptonOffline::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 112 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().