CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTOfflineDQMTopSingleLepton::MonitorSingleLepton Class Reference

#include <TopSingleLeptonHLTOfflineDQM.h>

Public Member Functions

void book (DQMStore::IBooker &store_)
 book histograms in subdirectory directory More...
 
void fill (const edm::Event &event, const edm::EventSetup &setup, const HLTConfigProvider &hltConfig, const std::vector< std::string > &triggerPaths)
 fill monitor histograms with electronId and jetCorrections More...
 
 MonitorSingleLepton (const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 default contructor More...
 
 ~MonitorSingleLepton ()=default
 default destructor More...
 

Private Member Functions

bool booked (const std::string &histName) const
 check if histogram was booked More...
 
void fill (const edm::Event &event, const edm::TriggerResults &triggerTable, const 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...
 
std::string monitorPath (const std::string &label) const
 
std::string selectionPath (const std::string &label) const
 
void triggerBinLabels (const std::string &channel, const std::vector< std::string > &labels)
 set configurable labels for trigger monitoring histograms More...
 

Private Attributes

edm::EDGetTokenT< reco::JetTagCollectionbtagEff_
 btag discriminator labels More...
 
double btagEffWP_
 btag working points More...
 
edm::EDGetTokenT< reco::JetTagCollectionbtagPur_
 
double btagPurWP_
 
edm::EDGetTokenT< reco::JetTagCollectionbtagVtx_
 
double btagVtxWP_
 
int eidPattern_
 
std::unique_ptr< StringCutObjectSelector< reco::GsfElectron > > elecIso_
 extra isolation criterion on electron More...
 
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
 input sources for monitoring More...
 
std::unique_ptr< StringCutObjectSelector< reco::GsfElectron > > elecSelect_
 extra selection on electrons More...
 
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
 electronId label More...
 
trigger::Vids electronIds_
 
trigger::VRelectron electronRefs_
 
std::string folder_
 
bool hasRawTriggerSummary
 
std::map< std::string, MonitorElement * > hists_
 histogram container More...
 
bool includeBTag_
 
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_
 
std::string jetSelect_
 
std::string label_
 instance label More...
 
int logged_
 number of logged interesting events 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...
 
trigger::Vids muonIds_
 
std::unique_ptr< StringCutObjectSelector< reco::Muon > > muonIso_
 extra isolation criterion on muon More...
 
trigger::VRmuon muonRefs_
 
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
 
std::unique_ptr< StringCutObjectSelector< reco::Muon > > muonSelect_
 extra selection on muons More...
 
trigger::Vids pfjetIds_
 
trigger::VRpfjet pfjetRefs_
 
std::string processName_
 hlt objects More...
 
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
 
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
 extra selection on primary vertices; meant to investigate the pile-up effect More...
 
std::vector< std::string > triggerPaths_
 
edm::EDGetTokenT< trigger::TriggerEventWithRefstriggerSummaryTokenAOD
 
edm::EDGetTokenT< trigger::TriggerEventWithRefstriggerSummaryTokenRAW
 
edm::EDGetTokenT< edm::TriggerResultstriggerTable_
 trigger table More...
 
double upperEdge_
 

Detailed Description

Definition at line 47 of file TopSingleLeptonHLTOfflineDQM.h.

Constructor & Destructor Documentation

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

default contructor

Definition at line 37 of file TopSingleLeptonHLTOfflineDQM.cc.

References btagEff_, btagEffWP_, btagVtx_, btagVtxWP_, eidPattern_, elecIso_, elecs_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), folder_, edm::ParameterSet::getParameter(), includeBTag_, jetCorrector_, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, RazorAnalyzer::met, TtSemiLepSignalSelMVAComputer_cfi::mets, mets_, muonIso_, muons_, muonSelect_, LaserDQM_cfg::process, processName_, pvs_, pvSelect_, AlCaHLTBitMon_QueryRunRegistry::string, triggerPaths_, triggerSummaryTokenAOD, triggerSummaryTokenRAW, triggerTable_, and upperEdge_.

37  :
38  label_(label), elecIso_(nullptr), elecSelect_(nullptr), pvSelect_(nullptr), muonIso_(nullptr), muonSelect_(nullptr), jetIDSelect_(nullptr), includeBTag_(false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
39  {
40  // sources have to be given; this PSet is not optional
41  edm::ParameterSet sources=cfg.getParameter<edm::ParameterSet>("sources");
43  elecs_= iC.consumes< edm::View<reco::GsfElectron> >(sources.getParameter<edm::InputTag>("elecs"));
44  jets_ = iC.consumes< edm::View<reco::Jet> >(sources.getParameter<edm::InputTag>("jets" ));
45 
46  const auto& mets = sources.getParameter<std::vector<edm::InputTag>>("mets");
47  for (const auto& met: mets) {
48  mets_.push_back(iC.consumes<edm::View<reco::MET>>(met));
49  }
50 
51  pvs_ = iC.consumes< edm::View<reco::Vertex> >(sources.getParameter<edm::InputTag>("pvs" ));
52 
53  // electronExtras are optional; they may be omitted or
54  // empty
55  if( cfg.existsAs<edm::ParameterSet>("elecExtras") ){
56  edm::ParameterSet elecExtras=cfg.getParameter<edm::ParameterSet>("elecExtras");
57  // select is optional; in case it's not found no
58  // selection will be applied
59  if( elecExtras.existsAs<std::string>("select") ){
60  elecSelect_= std::make_unique<StringCutObjectSelector<reco::GsfElectron>>(elecExtras.getParameter<std::string>("select"));
61  }
62  // isolation is optional; in case it's not found no
63  // isolation will be applied
64  if( elecExtras.existsAs<std::string>("isolation") ){
65  elecIso_= std::make_unique<StringCutObjectSelector<reco::GsfElectron>>(elecExtras.getParameter<std::string>("isolation"));
66  }
67  // electronId is optional; in case it's not found the
68  // InputTag will remain empty
69  if( elecExtras.existsAs<edm::ParameterSet>("electronId") ){
70  edm::ParameterSet elecId=elecExtras.getParameter<edm::ParameterSet>("electronId");
72  eidPattern_= elecId.getParameter<int>("pattern");
73  }
74  }
75  // pvExtras are optional; they may be omitted or empty
76  if(cfg.existsAs<edm::ParameterSet>("pvExtras")){
77  edm::ParameterSet pvExtras=cfg.getParameter<edm::ParameterSet>("pvExtras");
78  // select is optional; in case it's not found no
79  // selection will be applied
80  if( pvExtras.existsAs<std::string>("select") ){
81  pvSelect_= std::make_unique<StringCutObjectSelector<reco::Vertex>>(pvExtras.getParameter<std::string>("select"));
82  }
83  }
84  // muonExtras are optional; they may be omitted or empty
85  if( cfg.existsAs<edm::ParameterSet>("muonExtras") ){
86  edm::ParameterSet muonExtras=cfg.getParameter<edm::ParameterSet>("muonExtras");
87  // select is optional; in case it's not found no
88  // selection will be applied
89  if( muonExtras.existsAs<std::string>("select") ){
90  muonSelect_= std::make_unique<StringCutObjectSelector<reco::Muon>>(muonExtras.getParameter<std::string>("select"));
91  }
92  // isolation is optional; in case it's not found no
93  // isolation will be applied
94  if( muonExtras.existsAs<std::string>("isolation") ){
95  muonIso_= std::make_unique<StringCutObjectSelector<reco::Muon>>(muonExtras.getParameter<std::string>("isolation"));
96  }
97  }
98 
99  // jetExtras are optional; they may be omitted or
100  // empty
101  if( cfg.existsAs<edm::ParameterSet>("jetExtras") ){
102  edm::ParameterSet jetExtras=cfg.getParameter<edm::ParameterSet>("jetExtras");
103  // jetCorrector is optional; in case it's not found
104  // the InputTag will remain empty
105  if( jetExtras.existsAs<std::string>("jetCorrector") ){
106  jetCorrector_= jetExtras.getParameter<std::string>("jetCorrector");
107  }
108  // read jetID information if it exists
109  if(jetExtras.existsAs<edm::ParameterSet>("jetID")){
110  edm::ParameterSet jetID=jetExtras.getParameter<edm::ParameterSet>("jetID");
112  jetIDSelect_= std::make_unique<StringCutObjectSelector<reco::JetID>>(jetID.getParameter<std::string>("select"));
113  }
114  // select is optional; in case it's not found no
115  // selection will be applied (only implemented for
116  // CaloJets at the moment)
117  if( jetExtras.existsAs<std::string>("select") ){
118  jetSelect_= jetExtras.getParameter<std::string>("select");
119  }
120  // jetBDiscriminators are optional; in case they are
121  // not found the InputTag will remain empty; they
122  // consist of pairs of edm::JetFlavorAssociation's &
123  // corresponding working points
124  includeBTag_=jetExtras.existsAs<edm::ParameterSet>("jetBTaggers");
125  if( includeBTag_ ){
126  edm::ParameterSet btagEff=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("trackCountingEff");
127  btagEff_= iC.consumes< reco::JetTagCollection >(btagEff.getParameter<edm::InputTag>("label")); btagEffWP_= btagEff.getParameter<double>("workingPoint");
128 // edm::ParameterSet btagPur=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("trackCountingPur");
129 // btagPur_= iC.consumes< reco::JetTagCollection >(btagPur.getParameter<edm::InputTag>("label")); btagPurWP_= btagPur.getParameter<double>("workingPoint");
130  edm::ParameterSet btagVtx=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("secondaryVertex" );
131  btagVtx_= iC.consumes< reco::JetTagCollection >(btagVtx.getParameter<edm::InputTag>("label")); btagVtxWP_= btagVtx.getParameter<double>("workingPoint");
132  }
133  }
134 
135  // triggerExtras are optional; they may be omitted or empty
136  processName_ = "HLT";
137  if( cfg.existsAs<edm::ParameterSet>("triggerExtras") ){
138  edm::ParameterSet triggerExtras=cfg.getParameter<edm::ParameterSet>("triggerExtras");
140  processName_ = triggerExtras.getParameter<edm::InputTag>("src").process();
141  triggerPaths_=triggerExtras.getParameter<std::vector<std::string> >("paths");
142  }
143 
144  // massExtras is optional; in case it's not found no mass
145  // window cuts are applied for the same flavor monitor
146  // histograms
147  if( cfg.existsAs<edm::ParameterSet>("massExtras") ){
148  edm::ParameterSet massExtras=cfg.getParameter<edm::ParameterSet>("massExtras");
149  lowerEdge_= massExtras.getParameter<double>("lowerEdge");
150  upperEdge_= massExtras.getParameter<double>("upperEdge");
151  }
152 
153  // and don't forget to do the histogram booking
154  folder_=cfg.getParameter<std::string>("directory");
155 
156 // triggerEventWithRefsTag_ = iC.consumes< trigger::TriggerEventWithRefs >(edm::InputTag("hltTriggerSummaryRAW","",processName_));
157  triggerSummaryTokenRAW = iC.consumes <trigger::TriggerEventWithRefs>(edm::InputTag("hltTriggerSummaryRAW","",processName_));
158  triggerSummaryTokenAOD = iC.consumes <trigger::TriggerEventWithRefs>(edm::InputTag("hltTriggerSummaryAOD","",processName_));
159 
160  }
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenAOD
std::unique_ptr< StringCutObjectSelector< reco::GsfElectron > > elecSelect_
extra selection on electrons
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:186
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
input sources for monitoring
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::unique_ptr< StringCutObjectSelector< reco::Muon > > muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
met
===> hadronic RAZOR
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
std::unique_ptr< StringCutObjectSelector< reco::Muon > > muonSelect_
extra selection on muons
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
std::unique_ptr< StringCutObjectSelector< reco::GsfElectron > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::~MonitorSingleLepton ( )
default

default destructor

Member Function Documentation

void MonitorSingleLepton::book ( DQMStore::IBooker store_)

book histograms in subdirectory directory

Definition at line 163 of file TopSingleLeptonHLTOfflineDQM.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), folder_, hists_, label_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), and triggerPaths_.

164  {
165  //set up the current directory path
166  std::string current(folder_); current+=label_;
167  store_.setCurrentFolder(current);
168 
169  // determine number of bins for trigger monitoring
170  unsigned int nPaths=triggerPaths_.size();
171 
172  // number of selected primary vertices
173  hists_["pvMult_" ] = store_.book1D("PvMult" , "N_{pvs}" , 100, 0., 100.);
174  // multiplicity of jets with pt>20 (corrected to L2+L3)
175  hists_["jetMult_" ] = store_.book1D("JetMult" , "N_{20}(jet)" , 10, 0., 10.);
176  // // trigger efficiency estimates for single lepton triggers
177  // hists_["triggerEff_" ] = store_.book1D("TriggerEff" , "Eff(trigger)" , nPaths, 0., nPaths);
178  // monitored trigger occupancy for single lepton triggers
179  hists_["triggerMon_" ] = store_.book1D("TriggerMon" , "Mon(trigger)" , nPaths, 0., nPaths);
180  // W mass estimate
181  hists_["massW_" ] = store_.book1D("MassW" , "M(W)" , 60, 0., 300.);
182  // Top mass estimate
183  hists_["massTop_" ] = store_.book1D("MassTop" , "M(Top)" , 50, 0., 500.);
184  // Mlb mu
185  hists_["mMub_" ] = store_.book1D("mMub" , "m_{#mub}" , 50, 0., 500.);
186  // W mass transverse estimate mu
187  hists_["MTWm_" ] = store_.book1D("MTWm" , "M_{T}^{W}(#mu)" , 60, 0., 300.);
188  // Top mass transverse estimate mu
189  hists_["mMTT_" ] = store_.book1D("mMTT" , "M_{T}^{t}(#mu)" , 50, 0., 500.);
190  // Mlb e
191  hists_["mEb_" ] = store_.book1D("mEb" , "m_{eb}" , 50, 0., 500.);
192  // W mass transverse estimate e
193  hists_["MTWe_" ] = store_.book1D("MTWe" , "M_{T}^{W}(e)" , 60, 0., 300.);
194  // Top mass transverse estimate e
195  hists_["eMTT_" ] = store_.book1D("eMTT" , "M_{T}^{t}(e)" , 50, 0., 500.);
196  // set bin labels for trigger monitoring
198  // multiplicity of btagged jets (for track counting high efficiency) with pt(L2L3)>20
199  hists_["jetMultBEff_"] = store_.book1D("JetMultBProb", "N_{20}(b/prob)" , 10, 0., 10.);
200  // btag discriminator for track counting high efficiency for jets with pt(L2L3)>20
201  hists_["jetBDiscEff_"] = store_.book1D("JetBDiscProb", "Disc_{b/prob}(jet)", 25, 0., 2.5);
202  // multiplicity of btagged jets (for track counting high purity) with pt(L2L3)>20
203 // hists_["jetMultBPur_"] = store_.book1D("JetMultBPur", "N_{20}(b/pur)" , 10, 0., 10.);
204  // btag discriminator for track counting high purity
205 // hists_["jetBDiscPur_"] = store_.book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 100, 0., 10.);
206  // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>20
207  hists_["jetMultBVtx_"] = store_.book1D("JetMultBVtx", "N_{20}(b/vtx)" , 10, 0., 10.);
208  // btag discriminator for simple secondary vertex
209  hists_["jetBDiscVtx_"] = store_.book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.);
210  // selected events
211  hists_["eventLogger_"] = store_.book2D("EventLogger", "Logged Events" , 3, 0., 3., 4, 0., 4.);
212  // set axes titles for selected events
213  hists_["eventLogger_"]->getTH1()->SetOption("TEXT");
214  hists_["eventLogger_"]->setBinLabel( 1 , "Run" , 1);
215  hists_["eventLogger_"]->setBinLabel( 2 , "Block" , 1);
216  hists_["eventLogger_"]->setBinLabel( 3 , "Event" , 1);
217  hists_["eventLogger_"]->setAxisTitle("logged evts" , 2);
218 
219  // deltaR min between hlt iso lepton and reco iso lepton wrt eta
220  hists_["leptDeltaREta_"] = store_.book2D("DeltaRMinEtaLepton", "#Delta R_{min}(leptons) wrt #eta", 30, -3, 3, 10, 0., 0.1);
221  // deltaR min between hlt jets and reco jets wrt eta
222  hists_["jetDeltaREta_"] = store_.book2D("DeltaRMinEtaJet", "#Delta R_{min}(jets) wrt #eta", 30, -3, 3, 10, 0., 0.1);
223  // resolution in pT for matched isolated leptons
224  hists_["leptResolution_"] = store_.book1D("ResIsoLeptons", "#Delta p_{T}/p_{T}(matched leptons)", 20, 0., 0.1);
225  // resolution in pT for matched jets
226  hists_["jetResolution_"] = store_.book1D("ResIsoJets", "#Delta p_{T}/p_{T}(matched jets)", 20, 0., 0.1);
227  // matching monitoring
228  hists_["matchingMon_"] = store_.book1D("MatchingMon", "Mon(matching)", 5, 0., 5.);
229  // set axes titles for matching monitoring
230  hists_["matchingMon_"]->setBinLabel( 1 , "iso lepton" );
231  hists_["matchingMon_"]->setBinLabel( 2 , "1st jet" );
232  hists_["matchingMon_"]->setBinLabel( 3 , "2nd jet" );
233  hists_["matchingMon_"]->setBinLabel( 4 , "3rd jet" );
234  hists_["matchingMon_"]->setBinLabel( 5 , "all " );
235 
236  return;
237  }
std::map< std::string, MonitorElement * > hists_
histogram container
void triggerBinLabels(const std::string &channel, const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
bool HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::booked ( const std::string &  histName) const
inlineprivate

check if histogram was booked

Definition at line 75 of file TopSingleLeptonHLTOfflineDQM.h.

References hists_.

Referenced by fill().

75 { return hists_.find(histName)!=hists_.end(); };
std::map< std::string, MonitorElement * > hists_
histogram container
void MonitorSingleLepton::fill ( const edm::Event event,
const edm::EventSetup setup,
const HLTConfigProvider hltConfig,
const std::vector< std::string > &  triggerPaths 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 240 of file TopSingleLeptonHLTOfflineDQM.cc.

References btagEff_, btagEffWP_, btagVtx_, btagVtxWP_, JetCorrector::correction(), mitigatedMETSequence_cff::corrector, deltaR(), MillePedeFileConverter_cfg::e, eidPattern_, elecIso_, PatTopSelectionAnalyzer_cfi::elecs, elecs_, elecSelect_, electronId_, electronIds_, electronRefs_, PVValHelper::eta, trigger::TriggerEventWithRefs::filterIndex(), edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), trigger::TriggerEventWithRefs::getObjects(), hasRawTriggerSummary, hists_, mps_fire::i, training_settings::idx, includeBTag_, edm::HLTGlobalStatus::index(), createfilelist::int, trackerHitRTTI::isMatched(), edm::EDGetTokenT< T >::isUninitialized(), edm::HandleBase::isValid(), metsig::jet, jetCorrector_, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, gen::k, WDecay::kElec, WDecay::kMuon, logged_, lowerEdge_, CalculateHLT::masslb(), CalculateHLT::massTopQuark(), CalculateHLT::massWBoson(), RazorAnalyzer::met, mets_, HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), RPCpg::mu, metsig::muon, muonIds_, muonIso_, muonRefs_, extraflags_cff::muons, muons_, muonSelect_, dataset::name, jets_cff::nElectrons, jets_cff::nMuons, pfjetIds_, pfjetRefs_, processName_, EnergyCorrector::pt, MetAnalyzer::pv(), pvs_, pvSelect_, reco::Jet::scaleEnergy(), triggerObjects_cff::sel, findQualityFiles::size, CalculateHLT::tmassTopQuark(), CalculateHLT::tmassWBoson(), edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerNames(), triggerPaths_, triggerSummaryTokenAOD, triggerSummaryTokenRAW, triggerTable_, upperEdge_, and pseudoTop_cfi::wMass.

Referenced by fill(), and selectionPath().

241  {
242  // fetch trigger event if configured such
245  if( !event.getByToken(triggerTable_, triggerTable) ) return;
246  }
247 
248  /*
249  ------------------------------------------------------------
250 
251  Primary Vertex Monitoring
252 
253  ------------------------------------------------------------
254  */
255  // fill monitoring plots for primary verices
257  if( !event.getByToken(pvs_, pvs) ) {
258  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
259  << "Vertex collection not found \n";
260  return;
261  }
262  unsigned int pvMult = 0;
263  for(edm::View<reco::Vertex>::const_iterator pv=pvs->begin(); pv!=pvs->end(); ++pv){
264  if(!pvSelect_ || (*pvSelect_)(*pv))
265  pvMult++;
266  }
267  fill("pvMult_", pvMult );
268 
269  /*
270  ------------------------------------------------------------
271 
272  Electron Monitoring
273 
274  ------------------------------------------------------------
275  */
276 
277  // fill monitoring plots for electrons
278 
280  if( !event.getByToken(elecs_, elecs) ) {
281  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
282  << "Electron collection not found \n";
283  return;
284  }
285 
286 
287  // check availability of electron id
288  edm::Handle<edm::ValueMap<float> > electronId;
290  if( !event.getByToken(electronId_, electronId) ) return;
291  }
292 
293  // loop electron collection
294  unsigned int eMultIso=0;
295  std::vector<const reco::GsfElectron*> isoElecs;
297  for(edm::View<reco::GsfElectron>::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){
298  unsigned int idx = elec-elecs->begin();
299  // restrict to electrons with good electronId
300  if( electronId_.isUninitialized() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){
301  if(!elecSelect_ || (*elecSelect_)(*elec)){
302  if(!elecIso_ || (*elecIso_)(*elec)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso;}
303  }
304  }
305  }
306 
307  /*
308  ------------------------------------------------------------
309 
310  Muon Monitoring
311 
312  ------------------------------------------------------------
313  */
314 
315  // fill monitoring plots for muons
316  unsigned int mMultIso=0;
318  std::vector<const reco::Muon*> isoMuons;
319  if( !event.getByToken(muons_, muons) ) {
320  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
321  << "Muon collection not found \n";
322  return;
323  }
324  reco::Muon mu;
325  for(edm::View<reco::Muon>::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){
326  // restrict to globalMuons
327  if( muon->isGlobalMuon() ){
328  // apply preselection
329  if(!muonSelect_ || (*muonSelect_)(*muon)){
330  if(!muonIso_ || (*muonIso_)(*muon)) {if(mMultIso == 0) mu = *muon; isoMuons.push_back(&(*muon)); ++mMultIso;}
331  }
332  }
333  }
334 
335  /*
336  ------------------------------------------------------------
337 
338  Jet Monitoring
339 
340  ------------------------------------------------------------
341  */
342 
343  // check availability of the btaggers
344  edm::Handle<reco::JetTagCollection> btagEff, btagPur, btagVtx;
345  if( includeBTag_ ){
346  if( !event.getByToken(btagEff_, btagEff) ) return;
347 // if( !event.getByToken(btagPur_, btagPur) ) return;
348  if( !event.getByToken(btagVtx_, btagVtx) ) return;
349  }
350  // load jet corrector if configured such
351  const JetCorrector* corrector=nullptr;
352  if(!jetCorrector_.empty()){
353  // check whether a jet corrector is in the event setup or not
354  if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
355  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
356  }
357  else{
358  edm::LogVerbatim( "TopSingleLeptonHLTOfflineDQM" )
359  << "\n"
360  << "------------------------------------------------------------------------------------- \n"
361  << " No JetCorrectionsRecord available from EventSetup: \n"
362  << " - Jets will not be corrected. \n"
363  << " - If you want to change this add the following lines to your cfg file: \n"
364  << " \n"
365  << " ## load jet corrections \n"
366  << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
367  << " process.prefer(\"ak5CaloL2L3\") \n"
368  << " \n"
369  << "------------------------------------------------------------------------------------- \n";
370  }
371  }
372 
373  // loop jet collection
374  std::vector<reco::Jet> correctedJets;
375  unsigned int mult=0, multBEff=0, multBVtx=0; //multBPur=0;
376 
378  if( !event.getByToken(jets_, jets) ) {
379  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
380  << "Jet collection not found \n";
381  return;
382  }
383 
385  if(jetIDSelect_){
386  if( !event.getByToken(jetIDLabel_, jetID) ) return;
387  }
388  reco::Jet bJetCand;
389  for(edm::View<reco::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){
390  // check jetID for calo jets
391  unsigned int idx = jet-jets->begin();
392  if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
393  if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
394  }
395  // chekc additional jet selection for calo, pf and bare reco jets
396  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
397  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
398  StringCutObjectSelector<reco::CaloJet> jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;}
399  }
400  else if(dynamic_cast<const reco::PFJet*>(&*jet)){
401  reco::PFJet sel= dynamic_cast<const reco::PFJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
402  StringCutObjectSelector<reco::PFJet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
403  }
404  else{
405  reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
406  StringCutObjectSelector<reco::Jet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
407  }
408 
409  // prepare jet to fill monitor histograms
410  reco::Jet monitorJet = *jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
411  correctedJets.push_back(monitorJet);
412  ++mult; // determine jet multiplicity
413  if( includeBTag_ ){
414  // fill b-discriminators
415  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
416  // for the btagEff collection
417  double btagEffDisc = (*btagEff)[jetRef];
418  fill("jetBDiscEff_", btagEffDisc);
419  if( (*btagEff)[jetRef]>btagEffWP_ ) ++multBEff;
420  // for the btagPur collection
421 // double btagPurDisc = (*btagPur)[jetRef];
422 // fill("jetBDiscPur_", btagPurDisc);
423 // if( (*btagPur)[jetRef]>btagPurWP_ ) {if(multBPur == 0) bJetCand = *jet; ++multBPur;}
424  // for the btagVtx collection
425  double btagVtxDisc = (*btagVtx)[jetRef];
426  fill("jetBDiscVtx_", btagVtxDisc);
427  if( (*btagVtx)[jetRef]>btagVtxWP_ ) { if(multBVtx == 0) bJetCand= *jet; ++multBVtx;}
428  }
429  }
430 
431  fill("jetMult_" , mult );
432  fill("jetMultBEff_", multBEff);
433 // fill("jetMultBPur_", multBPur);
434  fill("jetMultBVtx_", multBVtx);
435 
436  /*
437  ------------------------------------------------------------
438 
439  MET Monitoring
440 
441  ------------------------------------------------------------
442  */
443 
444  // fill monitoring histograms for met
445  reco::MET mET;
446  for(auto met_=mets_.begin(); met_!=mets_.end(); ++met_){
448  if( !event.getByToken(*met_, met) ) continue;
449  if(met->begin()!=met->end()){
450  mET = *(met->begin());
451  }
452  }
453 
454  /*
455  ------------------------------------------------------------
456 
457  Event Monitoring
458 
459  ------------------------------------------------------------
460  */
461 
462  // fill W boson and top mass estimates
463  CalculateHLT eventKinematics(MAXJETS, WMASS);
464  double wMass = eventKinematics.massWBoson (correctedJets);
465  double topMass = eventKinematics.massTopQuark(correctedJets);
466  if(wMass>=0 && topMass>=0) {fill("massW_" , wMass ); fill("massTop_" , topMass);}
467  // fill plots for trigger monitoring
468  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<wMass && wMass<upperEdge_) ){
469  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "trigger", triggerPaths_);
470  if(logged_<=hists_.find("eventLogger_")->second->getNbinsY()){
471  // log runnumber, lumi block, event number & some
472  // more pysics infomation for interesting events
473  // We're doing a static_cast here to denote the explicity of the cast
474  auto runID = static_cast<double>(event.eventAuxiliary().run());
475  auto luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
476  auto eventID = static_cast<double>(event.eventAuxiliary().event());
477  fill("eventLogger_", 0.5, logged_+0.5, runID);
478  fill("eventLogger_", 1.5, logged_+0.5, luminosityBlockID);
479  fill("eventLogger_", 2.5, logged_+0.5, eventID);
480  ++logged_;
481  }
482  }
483  if(multBVtx != 0 && mMultIso == 1 ){
484  double mtW = eventKinematics.tmassWBoson(&mu,mET,bJetCand); if (mtW == mtW) fill("MTWm_",mtW);
485  double Mlb = eventKinematics.masslb(&mu,mET,bJetCand); if (Mlb == Mlb) fill("mMub_", Mlb);
486  double MTT = eventKinematics.tmassTopQuark(&mu,mET,bJetCand); if (MTT == MTT) fill("mMTT_", MTT);
487  }
488 
489  if(multBVtx != 0 && eMultIso == 1 ){
490  double mtW = eventKinematics.tmassWBoson(&mu,mET,bJetCand); if (mtW == mtW)fill("MTWe_",mtW);
491  double Mlb = eventKinematics.masslb(&mu,mET,bJetCand); if (Mlb == Mlb) fill("mEb_", Mlb);
492  double MTT = eventKinematics.tmassTopQuark(&mu,mET,bJetCand); if (MTT == MTT) fill("eMTT_", MTT);
493  }
494 
495 
496  /*
497  ------------------------------------------------------------
498 
499  HLT Objects Monitoring
500 
501  ------------------------------------------------------------
502  */
503 
504 // edm::Handle<trigger::TriggerEventWithRefs> triggerEventWithRefsHandle;
505 // if(event.getByToken(triggerEventWithRefsTag_,triggerEventWithRefsHandle)) {
506 
508  event.getByToken(triggerSummaryTokenRAW,rawTriggerEvent);
509 
511  event.getByToken(triggerSummaryTokenAOD,aodTriggerEvent);
512 
514  if(!rawTriggerEvent.isValid()){
515  hasRawTriggerSummary=false;
516 // edm::LogWarning( "TopDiLeptonHLTOfflineDQM" )
517 // << "No RAW trigger summary found! Returning... \n";
518 
519  if(!aodTriggerEvent.isValid()){
520 // edm::LogWarning( "TopDiLeptonHLTOfflineDQM" )
521 // << "No AOD trigger summary found! Returning... \n";
522  return;
523  }
524  }
525 
526  const edm::TriggerNames& triggerNames = event.triggerNames(*triggerTable);
527  // loop over trigger paths
528  for(unsigned int i=0; i<triggerNames.triggerNames().size(); ++i){
529  // consider only path from triggerPaths
530  string name = triggerNames.triggerNames()[i];
531  bool isInteresting = false;
532  for (auto const & triggerPath : triggerPaths) {
533  if (TString(name.c_str()).Contains(TString(triggerPath), TString::kIgnoreCase)) isInteresting = true;
534  }
535  if (!isInteresting) continue;
536  // dump infos on the considered trigger path
537  const unsigned int triggerIndex = triggerNames.triggerIndex(name);
538  // get modules for the considered trigger path
539  const vector<string>& moduleLabels(hltConfig.moduleLabels(triggerIndex));
540  const unsigned int moduleIndex(triggerTable->index(triggerIndex));
541  // Results from TriggerEventWithRefs product
542  electronIds_.clear(); electronRefs_.clear();
543  muonIds_.clear(); muonRefs_.clear();
544  pfjetIds_.clear(); pfjetRefs_.clear();
545  // look only for modules actually run in this path
546  unsigned int kElec=0;
547  unsigned int kMuon=0;
548  unsigned int kJet=0;
549  for (unsigned int k=0; k<=moduleIndex; ++k) {
550  const string& moduleLabel(moduleLabels[k]);
551  const string moduleType(hltConfig.moduleType(moduleLabel));
552  // check whether the module is packed up in TriggerEventWithRef product
553 // const unsigned int filterIndex(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
555  const unsigned int filterIndex(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
556  if (filterIndex<rawTriggerEvent->size()) {
557  rawTriggerEvent->getObjects(filterIndex,electronIds_,electronRefs_);
558  const unsigned int nElectrons(electronIds_.size());
559  if (nElectrons>0) kElec = k;
560 
561  rawTriggerEvent->getObjects(filterIndex,muonIds_,muonRefs_);
562  const unsigned int nMuons(muonIds_.size());
563  if (nMuons>0) kMuon = k;
564 
565  rawTriggerEvent->getObjects(filterIndex,pfjetIds_,pfjetRefs_);
566  const unsigned int nPFJets(pfjetIds_.size());
567  if (nPFJets>0) kJet = k;
568  }
569  }
570 
571  else{
572  const unsigned int filterIndex(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
573  if (filterIndex<aodTriggerEvent->size()) {
574  aodTriggerEvent->getObjects(filterIndex,electronIds_,electronRefs_);
575  const unsigned int nElectrons(electronIds_.size());
576  if (nElectrons>0) kElec = k;
577 
578  aodTriggerEvent->getObjects(filterIndex,muonIds_,muonRefs_);
579  const unsigned int nMuons(muonIds_.size());
580  if (nMuons>0) kMuon = k;
581 
582  aodTriggerEvent->getObjects(filterIndex,pfjetIds_,pfjetRefs_);
583  const unsigned int nPFJets(pfjetIds_.size());
584  if (nPFJets>0) kJet = k;
585  }
586  }
587 
588  }
589  bool isMatched = true;
590  bool lMatched = false;
591  bool j1Matched = false;
592  bool j2Matched = false;
593  bool j3Matched = false;
594 
595 // access to hlt elecs
596  double eDeltaRMin = 500.;
597  unsigned int eIndMatched = 500;
598  electronIds_.clear(); electronRefs_.clear();
599  if (kElec > 0) {
600  const string& moduleLabelElec(moduleLabels[kElec]);
601  const string moduleTypeElec(hltConfig.moduleType(moduleLabelElec));
602 // const unsigned int filterIndexElec(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
603 // triggerEventWithRefsHandle->getObjects(filterIndexElec,electronIds_,electronRefs_);
604 
606  const unsigned int filterIndexElec(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
607  rawTriggerEvent->getObjects(filterIndexElec,electronIds_,electronRefs_);
608  }
609  else{
610  const unsigned int filterIndexElec(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
611  aodTriggerEvent->getObjects(filterIndexElec,electronIds_,electronRefs_);
612  }
613 
614  for (unsigned int inde = 0; inde < isoElecs.size(); inde++) {
615  double deltar = deltaR(*electronRefs_[0],*isoElecs[inde]);
616  if (deltar < eDeltaRMin) {
617  eDeltaRMin = deltar;
618  eIndMatched = inde;
619  }
620  }
621  if (eDeltaRMin < DRMIN) lMatched = true;
622  }
623 
624 // access to hlt muons
625  muonIds_.clear(); muonRefs_.clear();
626  double mDeltaRMin = 500.;
627  unsigned int mIndMatched = 500;
628  if (kMuon > 0) {
629  const string& moduleLabelMuon(moduleLabels[kMuon]);
630  const string moduleTypeMuon(hltConfig.moduleType(moduleLabelMuon));
631 // const unsigned int filterIndexMuon(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
632 // triggerEventWithRefsHandle->getObjects(filterIndexMuon,muonIds_,muonRefs_);
633 
635  const unsigned int filterIndexMuon(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
636  rawTriggerEvent->getObjects(filterIndexMuon,muonIds_,muonRefs_);
637  }
638  else{
639  const unsigned int filterIndexMuon(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
640  aodTriggerEvent->getObjects(filterIndexMuon,muonIds_,muonRefs_);
641  }
642 
643  for (unsigned int indm = 0; indm < isoMuons.size(); indm++) {
644  double deltar = deltaR(*muonRefs_[0],*isoMuons[indm]);
645  if (deltar < mDeltaRMin) {
646  mDeltaRMin = deltar;
647  mIndMatched = indm;
648  }
649  }
650  if (mDeltaRMin < DRMIN) lMatched = true;
651  }
652 
653 // access to hlt pf jets
654  const unsigned int nPFJets(pfjetIds_.size());
655  pfjetIds_.clear(); pfjetRefs_.clear();
656  double j1DeltaRMin = 500.;
657  double j2DeltaRMin = 500.;
658  double j3DeltaRMin = 500.;
659  unsigned int j1IndMatched = 500;
660  unsigned int j2IndMatched = 500;
661  unsigned int j3IndMatched = 500;
662  if (kJet > 0) {
663  const string& moduleLabelJet(moduleLabels[kJet]);
664  const string moduleTypeJet(hltConfig.moduleType(moduleLabelJet));
665 // const unsigned int filterIndexJet(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelJet,"",processName_)));
666 // triggerEventWithRefsHandle->getObjects(filterIndexJet,pfjetIds_,pfjetRefs_);
667 
669  const unsigned int filterIndexJet(rawTriggerEvent->filterIndex(edm::InputTag(moduleLabelJet,"",processName_)));
670  rawTriggerEvent->getObjects(filterIndexJet,pfjetIds_,pfjetRefs_);
671  }
672  else{
673  const unsigned int filterIndexJet(aodTriggerEvent->filterIndex(edm::InputTag(moduleLabelJet,"",processName_)));
674  aodTriggerEvent->getObjects(filterIndexJet,pfjetIds_,pfjetRefs_);
675  }
676 
677  for (unsigned int indj = 0; indj < correctedJets.size(); indj++) {
678  double deltar1 = deltaR(*pfjetRefs_[0],correctedJets[indj]);
679  if (deltar1 < j1DeltaRMin) {j1DeltaRMin = deltar1; j1IndMatched = indj;}
680  if (nPFJets > 1) {
681  double deltar2 = deltaR(*pfjetRefs_[1],correctedJets[indj]);
682  if (deltar2 < j2DeltaRMin) {j2DeltaRMin = deltar2; j2IndMatched = indj;}
683  if (nPFJets > 2) {
684  double deltar3 = deltaR(*pfjetRefs_[2],correctedJets[indj]);
685  if (deltar3 < j3DeltaRMin) {j3DeltaRMin = deltar3; j3IndMatched = indj;}
686  }
687  }
688  }
689  if (nPFJets > 0 && j1DeltaRMin < DRMIN) j1Matched = true;
690  if (nPFJets > 1 && j2DeltaRMin < DRMIN) j2Matched = true;
691  if (nPFJets > 2 && j3DeltaRMin < DRMIN) j3Matched = true;
692  }
693 
694  if (eIndMatched < 500) {
695  fill("leptDeltaREta_", isoElecs[eIndMatched]->eta(), eDeltaRMin);
696  if (lMatched) fill("leptResolution_", fabs(isoElecs[eIndMatched]->pt()-electronRefs_[0]->pt())/isoElecs[eIndMatched]->pt() );
697  }
698 
699  if (mIndMatched < 500) {
700  fill("leptDeltaREta_", isoMuons[mIndMatched]->eta(), mDeltaRMin);
701  if (lMatched) fill("leptResolution_", fabs(isoMuons[mIndMatched]->pt()-muonRefs_[0]->pt())/isoMuons[mIndMatched]->pt() );
702  }
703 
704  if (lMatched) fill("matchingMon_", 0.5 );
705  else isMatched = false;
706 
707  if (j1IndMatched < 500) {
708  fill("jetDeltaREta_", correctedJets[j1IndMatched].eta(), j1DeltaRMin);
709  if (j1Matched) {
710  fill("jetResolution_", fabs(correctedJets[j1IndMatched].pt()-pfjetRefs_[0]->pt())/correctedJets[j1IndMatched].pt() );
711  fill("matchingMon_", 1.5 );
712  }
713  else isMatched = false;
714  if (j2IndMatched < 500) {
715  fill("jetDeltaREta_", correctedJets[j2IndMatched].eta(), j2DeltaRMin);
716  if (j2Matched) {
717  fill("jetResolution_", fabs(correctedJets[j2IndMatched].pt()-pfjetRefs_[1]->pt())/correctedJets[j2IndMatched].pt() );
718  fill("matchingMon_", 2.5 );
719  }
720  else isMatched = false;
721  if (j3IndMatched < 500) {
722  fill("jetDeltaREta_", correctedJets[j3IndMatched].eta(), j3DeltaRMin);
723  if (j3Matched) {
724  fill("jetResolution_", fabs(correctedJets[j3IndMatched].pt()-pfjetRefs_[2]->pt())/correctedJets[j3IndMatched].pt() );
725  fill("matchingMon_", 3.5 );
726  }
727  else isMatched = false;
728  }
729  }
730  }
731  if (isMatched) fill("matchingMon_", 4.5 );
732 
733  }
734 
735 // }
736  }
size
Write out results.
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenAOD
std::unique_ptr< StringCutObjectSelector< reco::GsfElectron > > elecSelect_
extra selection on electrons
const std::string moduleType(const std::string &module) const
C++ class name of module.
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void scaleEnergy(double fScale)
scale energy of the jet
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
Base class for all types of Jets.
Definition: Jet.h:20
void fill(const edm::Event &event, const edm::EventSetup &setup, const HLTConfigProvider &hltConfig, const std::vector< std::string > &triggerPaths)
fill monitor histograms with electronId and jetCorrections
std::map< std::string, MonitorElement * > hists_
histogram container
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
input sources for monitoring
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
Jets made from PFObjects.
Definition: PFJet.h:21
std::unique_ptr< StringCutObjectSelector< reco::Muon > > muonIso_
extra isolation criterion on muon
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
Definition: MET.h:42
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
vector< PseudoJet > jets
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
def pv(vc)
Definition: MetAnalyzer.py:6
bool isMatched(TrackingRecHit const &hit)
const int mu
Definition: Constants.h:22
bool isValid() const
Definition: HandleBase.h:74
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerSummaryTokenRAW
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
std::unique_ptr< StringCutObjectSelector< reco::JetID > > jetIDSelect_
extra jetID selection on calo jets
size_type filterIndex(const edm::InputTag &filterTag) const
index from tag
int k[5][pyjets_maxn]
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
met
===> hadronic RAZOR
Definition: deltar.py:1
void getObjects(size_type filter, Vids &ids, VRphoton &photons) const
extract Ref<C>s for a specific filter and of specific physics type
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::View< reco::Jet > > jets_
std::unique_ptr< StringCutObjectSelector< reco::Muon > > muonSelect_
extra selection on muons
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
boost::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:88
std::unique_ptr< StringCutObjectSelector< reco::Vertex > > pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
bool isUninitialized() const
Definition: EDGetToken.h:73
std::unique_ptr< StringCutObjectSelector< reco::GsfElectron > > elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
void MonitorSingleLepton::fill ( const edm::Event event,
const edm::TriggerResults triggerTable,
const std::string &  channel,
const std::vector< std::string > &  labels 
) const
inlineprivate

fill trigger monitoring histograms

Definition at line 178 of file TopSingleLeptonHLTOfflineDQM.h.

References acceptHLT(), fill(), training_settings::idx, and monitorPath().

179  {
180  for(unsigned int idx=0; idx<labels.size(); ++idx){
181  if( acceptHLT(event, triggerTable, monitorPath(labels[idx])) ){
182  fill(channel+"Mon_", idx+0.5 );
183  }
184  }
185  }
std::string monitorPath(const std::string &label) const
void fill(const edm::Event &event, const edm::EventSetup &setup, const HLTConfigProvider &hltConfig, const std::vector< std::string > &triggerPaths)
fill monitor histograms with electronId and jetCorrections
bool acceptHLT(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
void HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::fill ( const std::string &  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 77 of file TopSingleLeptonHLTOfflineDQM.h.

References booked(), and hists_.

77 { if(booked(histName)) hists_.find(histName)->second->Fill(value); };
std::map< std::string, MonitorElement * > hists_
histogram container
Definition: value.py:1
bool booked(const std::string &histName) const
check if histogram was booked
void HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::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 79 of file TopSingleLeptonHLTOfflineDQM.h.

References booked(), and hists_.

79 { if(booked(histName)) hists_.find(histName)->second->Fill(xValue, yValue); };
std::map< std::string, MonitorElement * > hists_
histogram container
bool booked(const std::string &histName) const
check if histogram was booked
void HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::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 81 of file TopSingleLeptonHLTOfflineDQM.h.

81 { if(booked(histName)) hists_.find(histName)->second->Fill(xValue, yValue, zValue); };
std::map< std::string, MonitorElement * > hists_
histogram container
bool booked(const std::string &histName) const
check if histogram was booked
std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::monitorPath ( const std::string &  label) const
inlineprivate

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

Definition at line 64 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

64 { return label.substr(label.find(':')+1); };
std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::selectionPath ( const std::string &  label) const
inlineprivate

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

Definition at line 67 of file TopSingleLeptonHLTOfflineDQM.h.

References fill(), tablePrinter::labels, AlCaHLTBitMon_QueryRunRegistry::string, and triggerBinLabels().

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

set configurable labels for trigger monitoring histograms

Definition at line 170 of file TopSingleLeptonHLTOfflineDQM.h.

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

Referenced by book(), and selectionPath().

171  {
172  for(unsigned int idx=0; idx<labels.size(); ++idx){
173  hists_[channel+"Mon_"]->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
174  }
175  }
std::string monitorPath(const std::string &label) const
std::map< std::string, MonitorElement * > hists_
histogram container

Member Data Documentation

edm::EDGetTokenT< reco::JetTagCollection > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::btagEff_
private

btag discriminator labels

Definition at line 146 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

double HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::btagEffWP_
private

btag working points

Definition at line 150 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< reco::JetTagCollection > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::btagPur_
private

Definition at line 147 of file TopSingleLeptonHLTOfflineDQM.h.

double HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::btagPurWP_
private

Definition at line 150 of file TopSingleLeptonHLTOfflineDQM.h.

edm::EDGetTokenT< reco::JetTagCollection > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::btagVtx_
private

Definition at line 148 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

double HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::btagVtxWP_
private

Definition at line 150 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

int HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::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 119 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::unique_ptr<StringCutObjectSelector<reco::GsfElectron> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::elecIso_
private

extra isolation criterion on electron

Definition at line 121 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< edm::View<reco::GsfElectron> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::elecs_
private

input sources for monitoring

Definition at line 90 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::unique_ptr<StringCutObjectSelector<reco::GsfElectron> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::elecSelect_
private

extra selection on electrons

Definition at line 123 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< edm::ValueMap<float> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::electronId_
private

electronId label

Definition at line 108 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

trigger::Vids HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::electronIds_
private

Definition at line 161 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

trigger::VRelectron HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::electronRefs_
private

Definition at line 162 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::folder_
private

Definition at line 81 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by book(), and MonitorSingleLepton().

bool HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::hasRawTriggerSummary
private

Definition at line 100 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

std::map<std::string,MonitorElement*> HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::hists_
private

histogram container

Definition at line 157 of file TopSingleLeptonHLTOfflineDQM.h.

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

bool HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::includeBTag_
private

include btag information or not to be determined from the cfg

Definition at line 144 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::jetCorrector_
private

jetCorrector

Definition at line 134 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< reco::JetIDValueMap > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::jetIDLabel_
private

jetID as an extra selection type

Definition at line 136 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::unique_ptr<StringCutObjectSelector<reco::JetID> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::jetIDSelect_
private

extra jetID selection on calo jets

Definition at line 138 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< edm::View<reco::Jet> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::jets_
private

Definition at line 92 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::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 141 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::label_
private
int HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::logged_
private

number of logged interesting events

Definition at line 155 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

double HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::lowerEdge_
private

mass window upper and lower edge

Definition at line 152 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::vector< edm::EDGetTokenT< edm::View<reco::MET> > > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::mets_
private

considers a vector of METs

Definition at line 88 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

trigger::Vids HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::muonIds_
private

Definition at line 163 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

std::unique_ptr<StringCutObjectSelector<reco::Muon> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::muonIso_
private

extra isolation criterion on muon

Definition at line 129 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

trigger::VRmuon HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::muonRefs_
private

Definition at line 164 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

edm::EDGetTokenT< edm::View<reco::Muon> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::muons_
private

Definition at line 91 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::unique_ptr<StringCutObjectSelector<reco::Muon> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::muonSelect_
private

extra selection on muons

Definition at line 131 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

trigger::Vids HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::pfjetIds_
private

Definition at line 165 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

trigger::VRpfjet HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::pfjetRefs_
private

Definition at line 166 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill().

std::string HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::processName_
private

hlt objects

Definition at line 160 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< edm::View<reco::Vertex> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::pvs_
private

Definition at line 93 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::unique_ptr<StringCutObjectSelector<reco::Vertex> > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::pvSelect_
private

extra selection on primary vertices; meant to investigate the pile-up effect

Definition at line 126 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

std::vector<std::string> HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::triggerPaths_
private

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

Definition at line 105 of file TopSingleLeptonHLTOfflineDQM.h.

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

edm::EDGetTokenT<trigger::TriggerEventWithRefs> HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::triggerSummaryTokenAOD
private

Definition at line 99 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT<trigger::TriggerEventWithRefs> HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::triggerSummaryTokenRAW
private

Definition at line 98 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

edm::EDGetTokenT< edm::TriggerResults > HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::triggerTable_
private

trigger table

Definition at line 96 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().

double HLTOfflineDQMTopSingleLepton::MonitorSingleLepton::upperEdge_
private

Definition at line 152 of file TopSingleLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorSingleLepton().