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)
 default contructor More...
 
 ~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::Muon * > &muons, const std::vector< const reco::GsfElectron * > &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...
 
int eidPattern_
 
StringCutObjectSelector
< reco::GsfElectron > * 
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::GsfElectron > > 
elecs_
 
StringCutObjectSelector
< reco::GsfElectron > * 
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::Muon > * 
muonIso_
 extra isolation criterion on muon More...
 
edm::EDGetTokenT< edm::View
< reco::Muon > > 
muons_
 
StringCutObjectSelector
< reco::Muon > * 
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 41 of file TopDiLeptonOfflineDQM.h.

Member Typedef Documentation

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

Definition at line 47 of file TopDiLeptonOfflineDQM.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

default contructor

Definition at line 13 of file TopDiLeptonOfflineDQM.cc.

References book(), DEBUG, diMuonPaths_, eidPattern_, 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_.

13  :
16  {
17  // sources have to be given; this PSet is not optional
18  edm::ParameterSet sources=cfg.getParameter<edm::ParameterSet>("sources");
20  elecs_ = iC.consumes<edm::View<reco::GsfElectron> >(sources.getParameter<edm::InputTag>("elecs"));
21  jets_ = iC.consumes<edm::View<reco::Jet> >(sources.getParameter<edm::InputTag>("jets"));
22  for (edm::InputTag const & tag : sources.getParameter<std::vector<edm::InputTag> >("mets"))
23  mets_.push_back( iC.consumes<edm::View<reco::MET> >(tag) );
24 
25  // elecExtras are optional; they may be omitted or empty
26  if( cfg.existsAs<edm::ParameterSet>("elecExtras") ){
27  edm::ParameterSet elecExtras=cfg.getParameter<edm::ParameterSet>("elecExtras");
28  // select is optional; in case it's not found no
29  // selection will be applied
30  if( elecExtras.existsAs<std::string>("select") ){
32  }
33  // isolation is optional; in case it's not found no
34  // isolation will be applied
35  if( elecExtras.existsAs<std::string>("isolation") ){
37  }
38  // electronId is optional; in case it's not found the
39  // InputTag will remain empty
40  if( elecExtras.existsAs<edm::ParameterSet>("electronId") ){
41  edm::ParameterSet elecId=elecExtras.getParameter<edm::ParameterSet>("electronId");
43  eidPattern_= elecId.getParameter<int>("pattern");
44  }
45  }
46  // muonExtras are optional; they may be omitted or empty
47  if( cfg.existsAs<edm::ParameterSet>("muonExtras") ){
48  edm::ParameterSet muonExtras=cfg.getParameter<edm::ParameterSet>("muonExtras");
49  // select is optional; in case it's not found no
50  // selection will be applied
51  if( muonExtras.existsAs<std::string>("select") ){
53  }
54  // isolation is optional; in case it's not found no
55  // isolation will be applied
56  if( muonExtras.existsAs<std::string>("isolation") ){
58  }
59  }
60  // jetExtras are optional; they may be omitted or empty
61  if( cfg.existsAs<edm::ParameterSet>("jetExtras") ){
62  edm::ParameterSet jetExtras=cfg.getParameter<edm::ParameterSet>("jetExtras");
63  // jetCorrector is optional; in case it's not found
64  // the InputTag will remain empty
65  if( jetExtras.existsAs<std::string>("jetCorrector") ){
66  jetCorrector_= jetExtras.getParameter<std::string>("jetCorrector");
67  }
68  // read jetID information if it exists
69  if(jetExtras.existsAs<edm::ParameterSet>("jetID")){
73  }
74  // select is optional; in case it's not found no
75  // selection will be applied (only implemented for
76  // CaloJets at the moment)
77  if( jetExtras.existsAs<std::string>("select") ){
78  jetSelect_= jetExtras.getParameter<std::string>("select");
79  }
80  }
81  // triggerExtras are optional; they may be omitted or empty
82  if( cfg.existsAs<edm::ParameterSet>("triggerExtras") ){
83  edm::ParameterSet triggerExtras=cfg.getParameter<edm::ParameterSet>("triggerExtras");
85  elecMuPaths_ =triggerExtras.getParameter<std::vector<std::string> >("pathsELECMU");
86  diMuonPaths_ =triggerExtras.getParameter<std::vector<std::string> >("pathsDIMUON");
87  }
88  // massExtras is optional; in case it's not found no mass
89  // window cuts are applied for the same flavor monitor
90  // histograms
91  if( cfg.existsAs<edm::ParameterSet>("massExtras") ){
92  edm::ParameterSet massExtras=cfg.getParameter<edm::ParameterSet>("massExtras");
93  lowerEdge_= massExtras.getParameter<double>("lowerEdge");
94  upperEdge_= massExtras.getParameter<double>("upperEdge");
95  }
96 
97  // setup the verbosity level for booking histograms;
98  // per default the verbosity level will be set to
99  // STANDARD. This will also be the chosen level in
100  // the case when the monitoring PSet is not found
102  if( cfg.existsAs<edm::ParameterSet>("monitoring") ){
103  edm::ParameterSet monitoring=cfg.getParameter<edm::ParameterSet>("monitoring");
104  if(monitoring.getParameter<std::string>("verbosity") == "DEBUG" )
105  verbosity_= DEBUG;
106  if(monitoring.getParameter<std::string>("verbosity") == "VERBOSE" )
108  if(monitoring.getParameter<std::string>("verbosity") == "STANDARD")
110  }
111  // and don't forget to do the histogram booking
112  book(cfg.getParameter<std::string>("directory"));
113  }
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::Muon > > muons_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
StringCutObjectSelector< reco::Muon > * 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_
void book(std::string directory)
book histograms in subdirectory directory
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
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::JetID > * jetIDSelect_
extra jetID selection on calo jets
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
TopDiLeptonOffline::MonitorEnsemble::~MonitorEnsemble ( )
inline

default destructor

Definition at line 56 of file TopDiLeptonOfflineDQM.h.

56 {};

Member Function Documentation

void MonitorEnsemble::book ( std::string  directory)

book histograms in subdirectory directory

Definition at line 116 of file TopDiLeptonOfflineDQM.cc.

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

Referenced by MonitorEnsemble().

117  {
118  //set up the current directory path
122 
123  // determine number of bins for trigger monitoring
124  unsigned int nElecMu=elecMuPaths_.size();
125  unsigned int nDiMuon=diMuonPaths_.size();
126 
127  // --- [STANDARD] --- //
128  //Run Number
129  hists_["RunNumb_" ] = store_->book1D("RunNumber" , "Run Nr." , 1.e4, 1.5e5, 3.e5);
130  // invariant mass of opposite charge lepton pair (only filled for same flavor)
131  hists_["invMass_" ] = store_->book1D("InvMass" , "M(lep1, lep2)" , 80, 0., 320.);
132  // invariant mass of opposite charge lepton pair (only filled for same flavor)
133  hists_["invMassLog_" ] = store_->book1D("InvMassLog" , "log_{10}(M(lep1, lep2))" , 80, .1, 2.5);
134  // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor)
135  hists_["invMassWC_" ] = store_->book1D("InvMassWC" , "M_{WC}(L1, L2)" , 80, 0., 320.);
136  // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor)
137  hists_["invMassWCLog_"] = store_->book1D("InvMassLogWC", "log_{10}(M_{WC})" , 80, .1, 2.5);
138  // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon
139  hists_["decayChannel_"] = store_->book1D("DecayChannel", "Decay Channel" , 3, 0, 3);
140  // trigger efficiency estimates for the electron muon channel
141  hists_["elecMuEff_" ] = store_->book1D("ElecMuEff" , "Eff(e/#mu paths)" , nElecMu, 0., nElecMu);
142  // monitored trigger occupancy for the electron muon channel
143  hists_["elecMuMon_" ] = store_->book1D("ElecMuMon" , "Mon(e/#mu paths)" , nElecMu, 0., nElecMu);
144  // trigger efficiency estimates for the di muon channel
145  hists_["diMuonEff_" ] = store_->book1D("DiMuonEff" , "Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
146  // monitored trigger occupancy for the di muon channel
147  hists_["diMuonMon_" ] = store_->book1D("DiMuonMon" , "Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
148  // pt of the leading lepton
149  hists_["lep1Pt_" ] = store_->book1D("Lep1Pt" , "pt(lep1)" , 50, 0., 200.);
150  // pt of the 2. leading lepton
151  hists_["lep2Pt_" ] = store_->book1D("Lep2Pt" , "pt(lep2)" , 50, 0., 200.);
152  // multiplicity of jets with pt>30 (corrected to L2+L3)
153  hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 21, -0.5, 20.5);
154  // MET (calo)
155  hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.);
156 
157  // set bin labels for trigger monitoring
160  // set bin labels for decayChannel_
161  hists_["decayChannel_"]->setBinLabel( 1, "#mu e" , 1);
162  hists_["decayChannel_"]->setBinLabel( 2, "#mu #mu", 1);
163  hists_["decayChannel_"]->setBinLabel( 3, "e e" , 1);
164 
165  if( verbosity_==STANDARD) return;
166 
167  // --- [VERBOSE] --- //
168  // mean eta of the candidate leptons
169  hists_["sumEtaL1L2_" ] = store_->book1D("SumEtaL1L2" , "<#eta>(lep1, lep2)" , 100, -5., 5.);
170  // deltaEta between the 2 candidate leptons
171  hists_["dEtaL1L2_" ] = store_->book1D("DEtaL1L2" , "#Delta#eta(lep1,lep2)" , 80, -4., 4.);
172  // deltaPhi between the 2 candidate leptons
173  hists_["dPhiL1L2_" ] = store_->book1D("DPhiL1L2" , "#Delta#phi(lep1,lep2)" , 64, -3.2, 3.2);
174  // pt of the candidate electron (depending on the decay channel)
175  hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 200.);
176  // relative isolation of the candidate electron (depending on the decay channel)
177  hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.);
178  // pt of the canddiate muon (depending on the decay channel)
179  hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 200.);
180  // relative isolation of the candidate muon (depending on the decay channel)
181  hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.);
182  // pt of the 1. leading jet (corrected to L2+L3)
183  hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.);
184  // pt of the 2. leading jet (corrected to L2+L3)
185  hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.);
186  // MET (PF)
187  hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.);
188  // MET (TC)
189  hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.);
190  // dz for muons (to suppress cosmis)
191  hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.);
192  // dxy for muons (to suppress cosmics)
193  hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -1., 1., 50, -1., 1.);
194  // lepton multiplicity after std isolation
195  hists_["lepMultIso_" ] = store_->book2D("LepMultIso" , "N_{Iso}(e) vs N_{Iso}(#mu)" , 5, 0., 5., 5, 0., 5.);
196 
197  // set axes titles for dxy for muons
198  hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2);
199  // set axes titles for lepton multiplicity after std isolation
200  hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(#mu)", 1); hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(elec)", 2);
201 
202  if( verbosity_==VERBOSE) return;
203 
204  // --- [DEBUG] --- //
205  // electron multiplicity after std isolation
206  hists_["elecMultIso_" ] = store_->book1D("ElecMultIso" , "N_{Iso}(e)" , 11, -0.5, 10.5);
207  // muon multiplicity after std isolation
208  hists_["muonMultIso_" ] = store_->book1D("MuonMultIso" , "N_{Iso}(#mu)" , 11, -0.5, 10.5);
209  // calo isolation of the candidate muon (depending on the decay channel)
210  hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Cal}(#mu)" , 50, 0., 1.);
211  // track isolation of the candidate muon (depending on the decay channel)
212  hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.);
213  // calo isolation of the candidate electron (depending on the decay channel)
214  hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Cal}(e)" , 50, 0., 1.);
215  // track isolation of the candidate electron (depending on the decay channel)
216  hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.);
217  // eta of the leading jet
218  hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -5., 5.);
219  // eta of the 2. leading jet
220  hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -5., 5.);
221  // pt of the 1. leading jet (not corrected)
222  hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.);
223  // pt of the 2. leading jet (not corrected)
224  hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.);
225  // deltaEta between the 2 leading jets
226  hists_["dEtaJet1Jet2_"] = store_->book1D("DEtaJet1Jet2", "#Delta#eta(jet1,jet2)" , 80, -4., 4.);
227  // deltaEta between the lepton and the leading jet
228  hists_["dEtaJet1Lep1_"] = store_->book1D("DEtaJet1Lep1", "#Delta#eta(jet1,lep1)" , 80, -4., 4.);
229  // deltaEta between the lepton and MET
230  hists_["dEtaLep1MET_" ] = store_->book1D("DEtaLep1MET" , "#Delta#eta(lep1,MET)" , 80, -4., 4.);
231  // deltaEta between leading jet and MET
232  hists_["dEtaJet1MET_" ] = store_->book1D("DEtaJet1MET" , "#Delta#eta(jet1,MET)" , 80, -4., 4.);
233  // deltaPhi of 2 leading jets
234  hists_["dPhiJet1Jet2_"] = store_->book1D("DPhiJet1Jet2", "#Delta#phi(jet1,jet2)" , 64, -3.2, 3.2);
235  // deltaPhi of 1. lepton and 1. jet
236  hists_["dPhiJet1Lep1_"] = store_->book1D("DPhiJet1Lep1", "#Delta#phi(jet1,lep1)" , 64, -3.2, 3.2);
237  // deltaPhi of 1. lepton and MET
238  hists_["dPhiLep1MET_" ] = store_->book1D("DPhiLep1MET" , "#Delta#phi(lep1,MET)" , 64, -3.2, 3.2);
239  // deltaPhi of 1. jet and MET
240  hists_["dPhiJet1MET_" ] = store_->book1D("DPhiJet1MET" , "#Delta#phi(jet1,MET)" , 64, -3.2, 3.2);
241  // selected dimuon events
242  hists_["diMuonLogger_"] = store_->book2D("DiMuonLogger", "Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.);
243  // selected dielec events
244  hists_["diElecLogger_"] = store_->book2D("DiElecLogger", "Logged DiElec Events" , 8, 0., 8., 10, 0., 10.);
245  // selected elemu events
246  hists_["elecMuLogger_"] = store_->book2D("ElecMuLogger", "Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.);
247 
248  // set bin labels for trigger monitoring
249  loggerBinLabels(std::string("diMuonLogger_"));
250  loggerBinLabels(std::string("diElecLogger_"));
251  loggerBinLabels(std::string("elecMuLogger_"));
252  return;
253  }
Level verbosity_
verbosity level for booking
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
void loggerBinLabels(std::string hist)
set labels for event logging histograms
std::map< std::string, MonitorElement * > hists_
histogram container
std::vector< std::string > elecMuPaths_
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
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 81 of file TopDiLeptonOfflineDQM.h.

References hists_.

Referenced by fill().

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

determine dileptonic decay channel

Definition at line 209 of file TopDiLeptonOfflineDQM.h.

References DIELEC, DIMUON, ELECMU, and NONE.

Referenced by fill().

210  {
212  if( muons.size()>1 ){ type=DIMUON; } else if( elecs.size()>1 ){ type=DIELEC; } else if( !elecs.empty() && !muons.empty() ){ type=ELECMU; }
213  return type;
214  }
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 256 of file TopDiLeptonOfflineDQM.cc.

References DeDxDiscriminatorTools::charge(), decayChannel(), reco::deltaPhi(), reco::deltaR(), DIELEC, diElecLogged_, DIMUON, diMuonLogged_, diMuonPaths_, eidPattern_, 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::EDGetTokenT< T >::isUninitialized(), metsig::jet, jetCorrector_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), CaloMET_cfi::met, mets_, VarParsing::mult, metsig::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().

257  {
258  // fetch trigger event if configured such
261  if( !event.getByToken(triggerTable_, triggerTable) ) return;
262  }
263  /*
264  ------------------------------------------------------------
265 
266  Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy value=5.0)
267 
268  ------------------------------------------------------------
269  */
270 
271  if (!event.eventAuxiliary().run()) return;
272  fill("RunNumb_", event.eventAuxiliary().run());
273 
274  double dummy=5.; fill("InstLumi_", dummy);
275 
276 
277  /*
278  ------------------------------------------------------------
279 
280  Muon Selection
281 
282  ------------------------------------------------------------
283  */
284 
285  // buffer isolated muons
286  std::vector<const reco::Muon*> isoMuons;
287 
289  if( !event.getByToken(muons_, muons) ) return;
290 
291  for(edm::View<reco::Muon>::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){
292  // restrict to globalMuons
293  if( muon->isGlobalMuon() ){
294  fill("muonDelZ_" , muon->globalTrack()->vz());
295  fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy());
296  // apply preselection
297  if(!muonSelect_ || (*muonSelect_)(*muon)){
298  double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt);
299  double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt);
300  double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt();
301  fill("muonTrkIso_" , isolationTrk); fill("muonCalIso_" , isolationCal); fill("muonRelIso_" , isolationRel);
302  if(!muonIso_ || (*muonIso_)(*muon)) isoMuons.push_back(&(*muon));
303  }
304  }
305  }
306  fill("muonMultIso_", isoMuons.size());
307 
308  /*
309  ------------------------------------------------------------
310 
311  Electron Selection
312 
313  ------------------------------------------------------------
314  */
315 
316  // buffer isolated electronss
317  std::vector<const reco::GsfElectron*> isoElecs;
320  if( !event.getByToken(electronId_, electronId) ) return;
321  }
323  if( !event.getByToken(elecs_, elecs) ) return;
324 
325  for(edm::View<reco::GsfElectron>::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){
326  // restrict to electrons with good electronId
327  int idx = elec-elecs->begin();
328  if( electronId_.isUninitialized() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){
329  // apply preselection
330  if(!elecSelect_ || (*elecSelect_)(*elec)){
331  double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt());
332  double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt());
333  double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
334  fill("elecTrkIso_" , isolationTrk); fill("elecCalIso_" , isolationCal); fill("elecRelIso_" , isolationRel);
335  if(!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec));
336  }
337  }
338  }
339  fill("elecMultIso_", isoElecs.size());
340 
341  /*
342  ------------------------------------------------------------
343 
344  Jet Selection
345 
346  ------------------------------------------------------------
347  */
348 
349  const JetCorrector* corrector=0;
350  if(!jetCorrector_.empty()){
351  // check whether a jet correcto is in the event setup or not
352  if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
353  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
354  }
355  else{
356  edm::LogVerbatim( "TopDiLeptonOfflineDQM" )
357  << "\n"
358  << "------------------------------------------------------------------------------------- \n"
359  << " No JetCorrectionsRecord available from EventSetup: \n"
360  << " - Jets will not be corrected. \n"
361  << " - If you want to change this add the following lines to your cfg file: \n"
362  << " \n"
363  << " ## load jet corrections \n"
364  << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
365  << " process.prefer(\"ak4CaloL2L3\") \n"
366  << " \n"
367  << "------------------------------------------------------------------------------------- \n";
368  }
369  }
370 
371  unsigned int mult=0;
372  // buffer leadingJets
373  std::vector<reco::Jet> leadingJets;
375  if( !event.getByToken(jets_, jets) ) return;
376 
378  if(jetIDSelect_){
379  if( !event.getByToken(jetIDLabel_, jetID) ) return;
380  }
381 
382  for(edm::View<reco::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){
383  unsigned int idx=jet-jets->begin();
384  if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
385  if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
386  }
387  // chekc additional jet selection for calo, pf and bare reco jets
388  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
389  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
390  StringCutObjectSelector<reco::CaloJet> jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;}
391  }
392  else if(dynamic_cast<const reco::PFJet*>(&*jet)){
393  reco::PFJet sel= dynamic_cast<const reco::PFJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
394  StringCutObjectSelector<reco::PFJet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
395  }
396  else{
397  reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
398  StringCutObjectSelector<reco::Jet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
399  }
400  // check for overlaps
401  bool overlap=false;
402  for(std::vector<const reco::GsfElectron*>::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
403  if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;}
404  } if(overlap){continue;}
405  // prepare jet to fill monitor histograms
406  reco::Jet monitorJet=*jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
407  ++mult; // determine jet multiplicity
408  if(idx==0) {
409  leadingJets.push_back(monitorJet);
410  fill("jet1Pt_" , monitorJet.pt());
411  fill("jet1PtRaw_" , jet->pt() );
412  fill("jet1Eta_" , jet->eta());
413  }
414  if(idx==1) {
415  leadingJets.push_back(monitorJet);
416  fill("jet2Pt_" , monitorJet.pt());
417  fill("jet2PtRaw_" , jet->pt() );
418  fill("jet2Eta_" , jet->eta());
419  }
420  }
421  if(leadingJets.size()>1){
422  fill("dEtaJet1Jet2_" , leadingJets[0].eta()-leadingJets[1].eta());
423  fill("dPhiJet1Jet2_" , reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi()));
424  if( !isoMuons.empty() ){
425  if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){
426  fill("dEtaJet1Lep1_" , isoMuons[0]->eta()-leadingJets[0].eta());
427  fill("dPhiJet1Lep1_" , reco::deltaPhi(isoMuons[0]->phi() , leadingJets[0].phi()));
428  }
429  }
430  if( !isoElecs.empty() ){
431  if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){
432  fill("dEtaJet1Lep1_" , isoElecs[0]->eta()-leadingJets[0].eta());
433  fill("dPhiJet1Lep1_" , reco::deltaPhi(isoElecs[0]->phi() , leadingJets[0].phi()));
434  }
435  }
436  }
437  fill("jetMult_", mult);
438 
439  /*
440  ------------------------------------------------------------
441 
442  MET Selection
443 
444  ------------------------------------------------------------
445  */
446 
447  // buffer for event logging
448  reco::MET caloMET;
449  //for(std::vector<edm::InputTag>::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){
450  for(std::vector<edm::EDGetTokenT<edm::View<reco::MET> > >::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){
451 
453  if( !event.getByToken(*met_, met) ) continue;
454 
455  if(met->begin()!=met->end()){
456  unsigned int idx=met_-mets_.begin();
457  if(idx==0){
458  caloMET=*met->begin();
459  fill("metCalo_", met->begin()->et());
460  if(!leadingJets.empty()){
461  fill("dEtaJet1MET_" , leadingJets[0].eta()-met->begin()->eta());
462  fill("dPhiJet1MET_" , reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi()));
463  }
464  if( !isoMuons.empty() ){
465  if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){
466  fill("dEtaLep1MET_" , isoMuons[0]->eta()-met->begin()->eta());
467  fill("dPhiLep1MET_" , reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi()));
468  }
469  }
470  if( !isoElecs.empty() ){
471  if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){
472  fill("dEtaLep1MET_" , isoElecs[0]->eta()-met->begin()->eta());
473  fill("dPhiLep1MET_" , reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi()));
474  }
475  }
476  }
477  if(idx==1){ fill("metTC_" , met->begin()->et());}
478  if(idx==2){ fill("metPflow_", met->begin()->et());}
479  }
480  }
481 
482 
483  /*
484  ------------------------------------------------------------
485 
486  Event Monitoring
487 
488  ------------------------------------------------------------
489  */
490 
491  // check number of isolated leptons
492  fill("lepMultIso_", isoMuons.size(), isoElecs.size());
493  // ELECMU channel
494  if( decayChannel(isoMuons, isoElecs) == ELECMU ){
495  fill("decayChannel_", 0.5);
496  double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass();
497  if( (lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
498 
499  fill("dEtaL1L2_" , isoElecs[0]->eta()-isoMuons[0]->eta());
500  fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoMuons[0]->eta())/2);
501  fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta()));
502  fill("elecPt_", isoElecs[0]->pt()); fill("muonPt_", isoMuons[0]->pt());
503  fill("lep1Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoElecs[0]->pt() : isoMuons[0]->pt());
504  fill("lep2Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoMuons[0]->pt() : isoElecs[0]->pt());
505  // fill plots for trigger monitoring
506  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "elecMu", elecMuPaths_);
507  if(elecMuLogged_<=hists_.find("elecMuLogger_")->second->getNbinsY()){
508  // log runnumber, lumi block, event number & some
509  // more pysics infomation for interesting events
510  fill("elecMuLogger_", 0.5, elecMuLogged_+0.5, event.eventAuxiliary().run());
511  fill("elecMuLogger_", 1.5, elecMuLogged_+0.5, event.eventAuxiliary().luminosityBlock());
512  fill("elecMuLogger_", 2.5, elecMuLogged_+0.5, event.eventAuxiliary().event());
513  fill("elecMuLogger_", 3.5, elecMuLogged_+0.5, isoMuons[0]->pt());
514  fill("elecMuLogger_", 4.5, elecMuLogged_+0.5, isoElecs[0]->pt());
515  if(leadingJets.size()>0) fill("elecMuLogger_", 5.5, elecMuLogged_+0.5, leadingJets[0].pt());
516  if(leadingJets.size()>1) fill("elecMuLogger_", 6.5, elecMuLogged_+0.5, leadingJets[1].pt());
517  fill("elecMuLogger_", 7.5, elecMuLogged_+0.5, caloMET.et());
518  ++elecMuLogged_;
519  }
520  }
521  }
522 
523  // DIMUON channel
524  if( decayChannel(isoMuons, isoElecs) == DIMUON ){
525  fill("decayChannel_", 1.5);
526  int charge = isoMuons[0]->charge()*isoMuons[1]->charge();
527  double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass();
528 
529  fill(charge<0 ? "invMass_" : "invMassWC_" , mass );
530  fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass));
531  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
532  fill("dEtaL1L2_" , isoMuons[0]->eta()-isoMuons[1]->eta() );
533  fill("sumEtaL1L2_", (isoMuons[0]->eta()+isoMuons[1]->eta())/2);
534  fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(),isoMuons[1]->phi()) );
535  fill("muonPt_", isoMuons[0]->pt()); fill("muonPt_", isoMuons[1]->pt());
536  fill("lep1Pt_", isoMuons[0]->pt()); fill("lep2Pt_", isoMuons[1]->pt());
537  // fill plots for trigger monitoring
538  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "diMuon", diMuonPaths_);
539  if(diMuonLogged_<=hists_.find("diMuonLogger_")->second->getNbinsY()){
540  // log runnumber, lumi block, event number & some
541  // more pysics infomation for interesting events
542  fill("diMuonLogger_", 0.5, diMuonLogged_+0.5, event.eventAuxiliary().run());
543  fill("diMuonLogger_", 1.5, diMuonLogged_+0.5, event.eventAuxiliary().luminosityBlock());
544  fill("diMuonLogger_", 2.5, diMuonLogged_+0.5, event.eventAuxiliary().event());
545  fill("diMuonLogger_", 3.5, diMuonLogged_+0.5, isoMuons[0]->pt());
546  fill("diMuonLogger_", 4.5, diMuonLogged_+0.5, isoMuons[1]->pt());
547  if(leadingJets.size()>0) fill("diMuonLogger_", 5.5, diMuonLogged_+0.5, leadingJets[0].pt());
548  if(leadingJets.size()>1) fill("diMuonLogger_", 6.5, diMuonLogged_+0.5, leadingJets[1].pt());
549  fill("diMuonLogger_", 7.5, diMuonLogged_+0.5, caloMET.et());
550  ++diMuonLogged_;
551  }
552  }
553  }
554 
555  // DIELEC channel
556  if( decayChannel(isoMuons, isoElecs) == DIELEC ){
557  fill("decayChannel_", 2.5);
558  int charge = isoElecs[0]->charge()*isoElecs[1]->charge();
559  double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass();
560  fill(charge<0 ? "invMass_" : "invMassWC_" , mass );
561  fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass));
562  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
563  fill("dEtaL1L2_" , isoElecs[0]->eta()-isoElecs[1]->eta() );
564  fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoElecs[1]->eta())/2);
565  fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(),isoElecs[1]->phi()) );
566  fill("elecPt_", isoElecs[0]->pt()); fill("elecPt_", isoElecs[1]->pt());
567  fill("lep1Pt_", isoElecs[0]->pt()); fill("lep2Pt_", isoElecs[1]->pt());
568  if(diElecLogged_<=hists_.find("diElecLogger_")->second->getNbinsY()){
569  // log runnumber, lumi block, event number & some
570  // more pysics infomation for interesting events
571  fill("diElecLogger_", 0.5, diElecLogged_+0.5, event.eventAuxiliary().run());
572  fill("diElecLogger_", 1.5, diElecLogged_+0.5, event.eventAuxiliary().luminosityBlock());
573  fill("diElecLogger_", 2.5, diElecLogged_+0.5, event.eventAuxiliary().event());
574  fill("diElecLogger_", 3.5, diElecLogged_+0.5, isoElecs[0]->pt());
575  fill("diElecLogger_", 4.5, diElecLogged_+0.5, isoElecs[1]->pt());
576  if(leadingJets.size()>0) fill("diElecLogger_", 5.5, diElecLogged_+0.5, leadingJets[0].pt());
577  if(leadingJets.size()>1) fill("diElecLogger_", 6.5, diElecLogged_+0.5, leadingJets[1].pt());
578  fill("diElecLogger_", 7.5, diElecLogged_+0.5, caloMET.et());
579  ++diElecLogged_;
580  }
581  }
582  }
583  }
virtual double et() const GCC11_FINAL
transverse energy
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:4
Jets made from CaloTowers.
Definition: CaloJet.h:29
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
Base class for all types of Jets.
Definition: Jet.h:20
DecayChannel decayChannel(const std::vector< const reco::Muon * > &muons, const std::vector< const reco::GsfElectron * > &elecs) const
determine dileptonic decay channel
RunNumber_t run() const
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:444
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
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::GsfElectron > > elecs_
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::map< std::string, MonitorElement * > hists_
histogram container
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
Definition: MET.h:39
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_
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:72
int elecMuLogged_
number of logged interesting events
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
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
bool isUninitialized() const
Definition: EDGetToken.h:71
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
virtual float pt() const GCC11_FINAL
transverse momentum
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
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 195 of file TopDiLeptonOfflineDQM.h.

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

196  {
197  for(unsigned int idx=0; idx<labels.size(); ++idx){
198  if( accept(event, triggerTable, monitorPath(labels[idx])) ){
199  fill((channel+"Mon_").c_str(), idx+0.5 );
200  // take care to fill triggerMon_ before evts is being called
201  int evts = hists_.find((channel+"Mon_").c_str())->second->getBinContent(idx+1);
202  double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1);
203  fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(accept(event, triggerTable, selectionPath(labels[idx]))-value));
204  }
205  }
206  }
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:26
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 83 of file TopDiLeptonOfflineDQM.h.

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

83 { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); };
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 85 of file TopDiLeptonOfflineDQM.h.

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

85 { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); };
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 87 of file TopDiLeptonOfflineDQM.h.

87 { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); };
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 159 of file TopDiLeptonOfflineDQM.h.

References hists_.

Referenced by book().

160  {
161  // set axes titles for selected events
162  hists_[hist.c_str()]->getTH1()->SetOption("TEXT");
163  hists_[hist.c_str()]->setBinLabel( 1 , "Run" , 1);
164  hists_[hist.c_str()]->setBinLabel( 2 , "Block" , 1);
165  hists_[hist.c_str()]->setBinLabel( 3 , "Event" , 1);
166  hists_[hist.c_str()]->setBinLabel( 6 , "pt_{L2L3}(jet1)" , 1);
167  hists_[hist.c_str()]->setBinLabel( 7 , "pt_{L2L3}(jet2)" , 1);
168  hists_[hist.c_str()]->setBinLabel( 8 , "MET_{Calo}" , 1);
169  hists_[hist.c_str()]->setAxisTitle("logged evts" , 2);
170 
171  if(hist=="diMuonLogger_"){
172  hists_[hist.c_str()]->setBinLabel( 4 , "pt(muon)" , 1);
173  hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1);
174  }
175  if(hist=="diElecLogger_"){
176  hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1);
177  hists_[hist.c_str()]->setBinLabel( 5 , "pt(elec)" , 1);
178  }
179  if(hist=="elecMuLogger_"){
180  hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1);
181  hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1);
182  }
183  }
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 66 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

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

Referenced by fill(), and triggerBinLabels().

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

set configurable labels for trigger monitoring histograms

Definition at line 186 of file TopDiLeptonOfflineDQM.h.

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

Referenced by book().

187  {
188  for(unsigned int idx=0; idx<labels.size(); ++idx){
189  hists_[(channel+"Mon_").c_str()]->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
190  hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1);
191  }
192  }
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 151 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

int TopDiLeptonOffline::MonitorEnsemble::diMuonLogged_
private

Definition at line 151 of file TopDiLeptonOfflineDQM.h.

Referenced by fill().

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

trigger paths for di muon channel

Definition at line 111 of file TopDiLeptonOfflineDQM.h.

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

int TopDiLeptonOffline::MonitorEnsemble::eidPattern_
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 126 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

StringCutObjectSelector<reco::GsfElectron>* TopDiLeptonOffline::MonitorEnsemble::elecIso_
private

extra isolation criterion on electron

Definition at line 128 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

int TopDiLeptonOffline::MonitorEnsemble::elecMuLogged_
private

number of logged interesting events

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

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

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

Definition at line 98 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

StringCutObjectSelector<reco::GsfElectron>* TopDiLeptonOffline::MonitorEnsemble::elecSelect_
private

extra selection on electrons

Definition at line 130 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

electronId label

Definition at line 115 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

histogram container

Definition at line 155 of file TopDiLeptonOfflineDQM.h.

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

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

jetCorrector

Definition at line 138 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 141 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 143 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 96 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 146 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 148 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 102 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

StringCutObjectSelector<reco::Muon>* TopDiLeptonOffline::MonitorEnsemble::muonIso_
private

extra isolation criterion on muon

Definition at line 133 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

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

Definition at line 97 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

StringCutObjectSelector<reco::Muon>* TopDiLeptonOffline::MonitorEnsemble::muonSelect_
private

extra selection on muons

Definition at line 135 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

DQMStore* TopDiLeptonOffline::MonitorEnsemble::store_
private

storage manager

Definition at line 153 of file TopDiLeptonOfflineDQM.h.

Referenced by book().

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

trigger table

Definition at line 106 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

double TopDiLeptonOffline::MonitorEnsemble::upperEdge_
private

Definition at line 148 of file TopDiLeptonOfflineDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level TopDiLeptonOffline::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 87 of file TopDiLeptonOfflineDQM.h.

Referenced by book(), and MonitorEnsemble().