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
HLTOfflineDQMTopDiLepton::MonitorDiLepton Class Reference

#include <TopDiLeptonHLTOfflineDQM.h>

Public Types

enum  DecayChannel { NONE, DIMUON, DIELEC, ELECMU }
 different decay channels More...
 
typedef
reco::LeafCandidate::LorentzVector 
LorentzVector
 

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...
 
 MonitorDiLepton (const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 default contructor More...
 
 ~MonitorDiLepton ()
 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, 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_
 
std::vector< std::string > diElecPaths_
 trigger paths for di electron channel More...
 
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_
 input sources for monitoring More...
 
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_
 
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_
 
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...
 
trigger::Vids muonIds_
 
StringCutObjectSelector
< reco::Muon > * 
muonIso_
 extra isolation criterion on muon More...
 
trigger::VRmuon muonRefs_
 
edm::EDGetTokenT< edm::View
< reco::Muon > > 
muons_
 
StringCutObjectSelector
< reco::Muon > * 
muonSelect_
 extra selection on muons More...
 
std::string processName_
 hlt objects More...
 
edm::EDGetTokenT
< trigger::TriggerEventWithRefs
triggerEventWithRefsTag_
 
edm::EDGetTokenT
< edm::TriggerResults
triggerTable_
 trigger table More...
 
double upperEdge_
 

Detailed Description

Definition at line 46 of file TopDiLeptonHLTOfflineDQM.h.

Member Typedef Documentation

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

Definition at line 50 of file TopDiLeptonHLTOfflineDQM.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

default contructor

Definition at line 28 of file TopDiLeptonHLTOfflineDQM.cc.

References diElecPaths_, diMuonPaths_, eidPattern_, elecIso_, elecMuPaths_, elecs_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), folder_, edm::ParameterSet::getParameter(), jetCorrector_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, caloMETBenchmarkGeneric_cfi::met, mets_, muonIso_, muons_, muonSelect_, LaserDQM_cfg::process, processName_, AlCaHLTBitMon_QueryRunRegistry::string, triggerEventWithRefsTag_, triggerTable_, and upperEdge_.

28  :
31  {
32  // sources have to be given; this PSet is not optional
33  edm::ParameterSet sources=cfg.getParameter<edm::ParameterSet>("sources");
35  elecs_= iC.consumes< edm::View<reco::GsfElectron> >(sources.getParameter<edm::InputTag>("elecs"));
36  jets_ = iC.consumes< edm::View<reco::Jet> >(sources.getParameter<edm::InputTag>("jets" ));
37 
38  const auto& mets = sources.getParameter<std::vector<edm::InputTag>>("mets");
39  for (const auto& met: mets) {
40  mets_.push_back(iC.consumes<edm::View<reco::MET>>(met));
41  }
42 
43  // elecExtras are optional; they may be omitted or empty
44  if( cfg.existsAs<edm::ParameterSet>("elecExtras") ){
45  edm::ParameterSet elecExtras=cfg.getParameter<edm::ParameterSet>("elecExtras");
46  // select is optional; in case it's not found no
47  // selection will be applied
48  if( elecExtras.existsAs<std::string>("select") ){
50  }
51  // isolation is optional; in case it's not found no
52  // isolation will be applied
53  if( elecExtras.existsAs<std::string>("isolation") ){
55  }
56  // electronId is optional; in case it's not found the
57  // InputTag will remain empty
58  if( elecExtras.existsAs<edm::ParameterSet>("electronId") ){
59  edm::ParameterSet elecId=elecExtras.getParameter<edm::ParameterSet>("electronId");
61  eidPattern_= elecId.getParameter<int>("pattern");
62  }
63  }
64  // muonExtras are optional; they may be omitted or empty
65  if( cfg.existsAs<edm::ParameterSet>("muonExtras") ){
66  edm::ParameterSet muonExtras=cfg.getParameter<edm::ParameterSet>("muonExtras");
67  // select is optional; in case it's not found no
68  // selection will be applied
69  if( muonExtras.existsAs<std::string>("select") ){
71  }
72  // isolation is optional; in case it's not found no
73  // isolation will be applied
74  if( muonExtras.existsAs<std::string>("isolation") ){
76  }
77  }
78  // jetExtras are optional; they may be omitted or empty
79  if( cfg.existsAs<edm::ParameterSet>("jetExtras") ){
80  edm::ParameterSet jetExtras=cfg.getParameter<edm::ParameterSet>("jetExtras");
81  // jetCorrector is optional; in case it's not found
82  // the InputTag will remain empty
83  if( jetExtras.existsAs<std::string>("jetCorrector") ){
84  jetCorrector_= jetExtras.getParameter<std::string>("jetCorrector");
85  }
86  // read jetID information if it exists
87  if(jetExtras.existsAs<edm::ParameterSet>("jetID")){
91  }
92  // select is optional; in case it's not found no
93  // selection will be applied (only implemented for
94  // CaloJets at the moment)
95  if( jetExtras.existsAs<std::string>("select") ){
96  jetSelect_= jetExtras.getParameter<std::string>("select");
97  }
98  }
99  // triggerExtras are optional; they may be omitted or empty
100  processName_ = "HLT";
101  if( cfg.existsAs<edm::ParameterSet>("triggerExtras") ){
102  edm::ParameterSet triggerExtras=cfg.getParameter<edm::ParameterSet>("triggerExtras");
104  processName_ = triggerExtras.getParameter<edm::InputTag>("src").process();
105  elecMuPaths_ = triggerExtras.getParameter<std::vector<std::string> >("pathsELECMU");
106  diMuonPaths_ = triggerExtras.getParameter<std::vector<std::string> >("pathsDIMUON");
107  diElecPaths_ = triggerExtras.getParameter<std::vector<std::string> >("pathsDIELEC");
108  }
109  // massExtras is optional; in case it's not found no mass
110  // window cuts are applied for the same flavor monitor
111  // histograms
112  if( cfg.existsAs<edm::ParameterSet>("massExtras") ){
113  edm::ParameterSet massExtras=cfg.getParameter<edm::ParameterSet>("massExtras");
114  lowerEdge_= massExtras.getParameter<double>("lowerEdge");
115  upperEdge_= massExtras.getParameter<double>("upperEdge");
116  }
117 
118  // and don't forget to do the histogram booking
119  folder_=cfg.getParameter<std::string>("directory");
120 
122 
123  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
double lowerEdge_
mass window upper and lower edge
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
int elecMuLogged_
number of logged interesting events
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
input sources for monitoring
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
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::vector< std::string > diMuonPaths_
trigger paths for di muon channel
std::vector< std::string > diElecPaths_
trigger paths for di electron channel
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerEventWithRefsTag_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
tuple process
Definition: LaserDQM_cfg.py:3
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
HLTOfflineDQMTopDiLepton::MonitorDiLepton::~MonitorDiLepton ( )
inline

default destructor

Definition at line 58 of file TopDiLeptonHLTOfflineDQM.h.

58 {};

Member Function Documentation

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

book histograms in subdirectory directory

Definition at line 126 of file TopDiLeptonHLTOfflineDQM.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), cond::rpcobimon::current, diElecPaths_, diMuonPaths_, elecMuPaths_, folder_, hists_, label_, loggerBinLabels(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and triggerBinLabels().

127  {
128  //set up the current directory path
130  store_.setCurrentFolder(current);
131 
132  // determine number of bins for trigger monitoring
133  unsigned int nElecMu=elecMuPaths_.size();
134  unsigned int nDiMuon=diMuonPaths_.size();
135  unsigned int nDiElec=diElecPaths_.size();
136 
137  // invariant mass of opposite charge lepton pair (only filled for same flavor)
138  hists_["invMass_" ] = store_.book1D("InvMass" , "M(lep1, lep2)" , 80, 0., 320.); //OK
139  // invariant mass of same charge lepton pair (only filled for same flavor)
140  hists_["invMassWC_" ] = store_.book1D("InvMassWC" , "M_{WC}(L1, L2)" , 80, 0., 320.); //OK
141  // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon
142  hists_["decayChannel_"] = store_.book1D("DecayChannel", "Decay Channel" , 3, 0, 3); //OK
143  // // trigger efficiency estimates for the electron muon channel
144  // hists_["elecMuEff_" ] = store_.book1D("ElecMuEff" , "Eff(e/#mu paths)" , nElecMu, 0., nElecMu);
145  // monitored trigger occupancy for the electron muon channel
146  hists_["elecMuMon_" ] = store_.book1D("ElecMuMon" , "Mon(e/#mu paths)" , nElecMu, 0., nElecMu);
147  // // trigger efficiency estimates for the di muon channel
148  // hists_["diMuonEff_" ] = store_.book1D("DiMuonEff" , "Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
149  // monitored trigger occupancy for the di muon channel
150  hists_["diMuonMon_" ] = store_.book1D("DiMuonMon" , "Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
151  // // trigger efficiency estimates for the di electron channel
152  // hists_["diElecEff_" ] = store_.book1D("DiElecEff" , "Eff(e/e paths)" , nDiElec, 0., nDiElec);
153  // monitored trigger occupancy for the di electron channel
154  hists_["diElecMon_" ] = store_.book1D("DiElecMon" , "Mon(e/e paths)" , nDiElec, 0., nDiElec);
155  // multiplicity of jets with pt>30 (corrected to L2+L3)
156  hists_["jetMult_" ] = store_.book1D("JetMult" , "N_{30}(jet)" , 21, -0.5, 20.5); //OK
157 
158  // set bin labels for trigger monitoring
162  // set bin labels for decayChannel_
163  hists_["decayChannel_"]->setBinLabel( 1, "#mu e" , 1);
164  hists_["decayChannel_"]->setBinLabel( 2, "#mu #mu", 1);
165  hists_["decayChannel_"]->setBinLabel( 3, "e e" , 1);
166 
167  // selected dimuon events
168  hists_["diMuonLogger_"] = store_.book2D("DiMuonLogger", "Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.); //OK
169  // selected dielec events
170  hists_["diElecLogger_"] = store_.book2D("DiElecLogger", "Logged DiElec Events" , 8, 0., 8., 10, 0., 10.); //OK
171  // selected elemu events
172  hists_["elecMuLogger_"] = store_.book2D("ElecMuLogger", "Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.); //OK
173 
174  // set bin labels for trigger monitoring
175  loggerBinLabels(std::string("diMuonLogger_"));
176  loggerBinLabels(std::string("diElecLogger_"));
177  loggerBinLabels(std::string("elecMuLogger_"));
178 
179  // deltaR min between hlt iso lepton and reco iso lepton wrt eta
180  hists_["leptDeltaREta_"] = store_.book2D("DeltaRMinEtaLepton", "#Delta R_{min}(leptons) wrt #eta", 30, -3, 3, 10, 0., 0.1);
181  // resolution in pT for matched isolated leptons
182  hists_["leptResolution_"] = store_.book1D("ResIsoLeptons", "#Delta p_{T}/p_{T}(matched leptons)", 20, 0., 0.1);
183  // matching monitoring
184  hists_["matchingMon_"] = store_.book1D("MatchingMon", "Mon(matching)", 3, 0., 3.);
185  // set axes titles for matching monitoring
186  hists_["matchingMon_"]->setBinLabel( 1 , "1st lepton" );
187  hists_["matchingMon_"]->setBinLabel( 2 , "2nd lepton" );
188  hists_["matchingMon_"]->setBinLabel( 3 , "both " );
189 
190  return;
191  }
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
void loggerBinLabels(std::string hist)
set labels for event logging histograms
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< std::string > diElecPaths_
trigger paths for di electron channel
std::map< std::string, MonitorElement * > hists_
histogram container
void triggerBinLabels(std::string channel, const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
bool HLTOfflineDQMTopDiLepton::MonitorDiLepton::booked ( const std::string  histName) const
inlineprivate

check if histogram was booked

Definition at line 81 of file TopDiLeptonHLTOfflineDQM.h.

References hists_.

Referenced by fill().

81 { return hists_.find(histName.c_str())!=hists_.end(); };
std::map< std::string, MonitorElement * > hists_
histogram container
void MonitorDiLepton::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 194 of file TopDiLeptonHLTOfflineDQM.cc.

References JetCorrector::correction(), mvaPFMET_cff::corrector, deltaR(), reco::deltaR(), diElecLogged_, diElecPaths_, diMuonLogged_, diMuonPaths_, HLTOfflineDQMTopDiLepton::DRMIN, alignCSCRings::e, eidPattern_, elecIso_, elecMuLogged_, elecMuPaths_, elecs_, elecSelect_, electronId_, electronIds_, electronRefs_, reco::LeafCandidate::et(), eta(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByToken(), JetCorrector::getJetCorrector(), hists_, i, customizeTrackingMonitorSeedNumber::idx, edm::EDGetTokenT< T >::isUninitialized(), j, metsig::jet, jetCorrector_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, roll_playback::k, WDecay::kElec, WDecay::kMuon, prof2calltree::l, lowerEdge_, caloMETBenchmarkGeneric_cfi::met, mets_, HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), VarParsing::mult, trackingTruthProducerFastSim_cfi::muon, muonIds_, muonIso_, muonRefs_, patZpeak::muons, muons_, muonSelect_, mergeVDriftHistosByStation::name, muon::overlap(), processName_, EnergyCorrector::pt, edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, findQualityFiles::size, triggerEventWithRefsTag_, edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerNames(), triggerTable_, and upperEdge_.

Referenced by fill().

195  {
196  // fetch trigger event if configured such
199  if( !event.getByToken(triggerTable_, triggerTable) ) return;
200  }
201 
202  edm::Handle<trigger::TriggerEventWithRefs> triggerEventWithRefsHandle;
203  if(!event.getByToken(triggerEventWithRefsTag_,triggerEventWithRefsHandle)) return;
204 
205  /*
206  ------------------------------------------------------------
207 
208  Run information
209 
210  ------------------------------------------------------------
211  */
212 
213  if (!event.eventAuxiliary().run()) return;
214 
215  /*
216  ------------------------------------------------------------
217 
218  Muon Selection
219 
220  ------------------------------------------------------------
221  */
222 
223  // buffer isolated muons
224  std::vector<const reco::Muon*> isoMuons;
225 
227  if( !event.getByToken(muons_, muons) ) {
228  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
229  << "Muon collection not found \n";
230  return;
231  }
232 
233  for(edm::View<reco::Muon>::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){
234  // restrict to globalMuons
235  if( muon->isGlobalMuon() ){
236  // apply preselection
237  if(!muonSelect_ || (*muonSelect_)(*muon)){
238  if(!muonIso_ || (*muonIso_)(*muon)) isoMuons.push_back(&(*muon));
239  }
240  }
241  }
242 
243  /*
244  ------------------------------------------------------------
245 
246  Electron Selection
247 
248  ------------------------------------------------------------
249  */
250 
251  // buffer isolated electronss
252  std::vector<const reco::GsfElectron*> isoElecs;
253  edm::Handle<edm::ValueMap<float> > electronId;
255  if( !event.getByToken(electronId_, electronId) ) return;
256  }
257 
259  if( !event.getByToken(elecs_, elecs) ) {
260  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
261  << "Electron collection not found \n";
262  return;
263  }
264 
265  for(edm::View<reco::GsfElectron>::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){
266  // restrict to electrons with good electronId
267  int idx = elec-elecs->begin();
268  if( electronId_.isUninitialized() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){
269  // apply preselection
270  if(!elecSelect_ || (*elecSelect_)(*elec)){
271  if(!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec));
272  }
273  }
274  }
275 
276  /*
277  ------------------------------------------------------------
278 
279  Jet Selection
280 
281  ------------------------------------------------------------
282  */
283 
284  const JetCorrector* corrector=0;
285  if(!jetCorrector_.empty()){
286  // check whether a jet correcto is in the event setup or not
287  if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
288  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
289  }
290  else{
291  edm::LogVerbatim( "TopDiLeptonHLTOfflineDQM" )
292  << "\n"
293  << "------------------------------------------------------------------------------------- \n"
294  << " No JetCorrectionsRecord available from EventSetup: \n"
295  << " - Jets will not be corrected. \n"
296  << " - If you want to change this add the following lines to your cfg file: \n"
297  << " \n"
298  << " ## load jet corrections \n"
299  << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
300  << " process.prefer(\"ak5CaloL2L3\") \n"
301  << " \n"
302  << "------------------------------------------------------------------------------------- \n";
303  }
304  }
305 
306  unsigned int mult=0;
307  // buffer leadingJets
308  std::vector<reco::Jet> leadingJets;
310  if( !event.getByToken(jets_, jets) ) {
311  edm::LogWarning( "TopSingleLeptonHLTOfflineDQM" )
312  << "Jet collection not found \n";
313  return;
314  }
315 
317  if(jetIDSelect_){
318  if( !event.getByToken(jetIDLabel_, jetID) ) return;
319  }
320 
321  for(edm::View<reco::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){
322  unsigned int idx=jet-jets->begin();
323  if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
324  if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
325  }
326  // chekc additional jet selection for calo, pf and bare reco jets
327  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
328  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
329  StringCutObjectSelector<reco::CaloJet> jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;}
330  }
331  else if(dynamic_cast<const reco::PFJet*>(&*jet)){
332  reco::PFJet sel= dynamic_cast<const reco::PFJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
333  StringCutObjectSelector<reco::PFJet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
334  }
335  else{
336  reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
337  StringCutObjectSelector<reco::Jet> jetSelect(jetSelect_); if(!jetSelect(sel)) continue;
338  }
339  // check for overlaps
340  bool overlap=false;
341  for(std::vector<const reco::GsfElectron*>::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
342  if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;}
343  } if(overlap){continue;}
344  // prepare jet to fill monitor histograms
345  reco::Jet monitorJet=*jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
346  ++mult; // determine jet multiplicity
347  if(idx==0) {
348  leadingJets.push_back(monitorJet);
349  }
350  if(idx==1) {
351  leadingJets.push_back(monitorJet);
352  }
353  }
354  fill("jetMult_", mult);
355 
356  /*
357  ------------------------------------------------------------
358 
359  MET Selection
360 
361  ------------------------------------------------------------
362  */
363 
364  // buffer for event logging
365  reco::MET caloMET;
366  for(std::vector< edm::EDGetTokenT< edm::View<reco::MET> > >::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){
367 
369  if( !event.getByToken(*met_, met) ) continue;
370 
371  if(met->begin()!=met->end()){
372  unsigned int idx=met_-mets_.begin();
373  if(idx==0){
374  caloMET=*met->begin();
375  }
376  }
377  }
378 
379 
380  /*
381  ------------------------------------------------------------
382 
383  Event Monitoring
384 
385  ------------------------------------------------------------
386  */
387  const edm::TriggerNames& triggerNames = event.triggerNames(*triggerTable);
388  // loop over trigger paths
389  for(unsigned int i=0; i<triggerNames.triggerNames().size(); ++i){
390  bool elecmu = false;
391  bool dielec = false;
392  bool dimuon = false;
393  // consider only path from triggerPaths
394  string name = triggerNames.triggerNames()[i];
395  for (unsigned int j=0; j<triggerPaths.size(); j++) {
396  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("ele"), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("mu"), TString::kIgnoreCase)) elecmu = true;
397  else {
398  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("ele"), TString::kIgnoreCase)) dielec = true;
399  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase) && TString(name.c_str()).Contains(TString("mu"), TString::kIgnoreCase)) dimuon = true;
400  }
401  }
402 
403  // ELECMU channel
404  if( elecmu ){
405  fill("decayChannel_", 0.5);
406  if( isoElecs.size()>0 && isoMuons.size()>0 ) {
407  double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass();
408  if( (lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
409  // fill plots for trigger monitoring
410  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "elecMu", elecMuPaths_);
411  if(elecMuLogged_<=hists_.find("elecMuLogger_")->second->getNbinsY()){
412  // log runnumber, lumi block, event number & some
413  // more pysics infomation for interesting events
414  // We're doing a static_cast here to denote the explicity of the cast
415  double runID = static_cast<double>(event.eventAuxiliary().run());
416  double luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
417  double eventID = static_cast<double>(event.eventAuxiliary().event());
418  fill("elecMuLogger_", 0.5, elecMuLogged_+0.5, runID);
419  fill("elecMuLogger_", 1.5, elecMuLogged_+0.5, luminosityBlockID);
420  fill("elecMuLogger_", 2.5, elecMuLogged_+0.5, eventID);
421  fill("elecMuLogger_", 3.5, elecMuLogged_+0.5, isoMuons[0]->pt());
422  fill("elecMuLogger_", 4.5, elecMuLogged_+0.5, isoElecs[0]->pt());
423  if(leadingJets.size()>0) fill("elecMuLogger_", 5.5, elecMuLogged_+0.5, leadingJets[0].pt());
424  if(leadingJets.size()>1) fill("elecMuLogger_", 6.5, elecMuLogged_+0.5, leadingJets[1].pt());
425  fill("elecMuLogger_", 7.5, elecMuLogged_+0.5, caloMET.et());
426  ++elecMuLogged_;
427  }
428  }
429  }
430  }
431 
432  // DIMUON channel
433  if( dimuon ){
434  fill("decayChannel_", 1.5);
435  if (isoMuons.size()>1) {
436  int charge = isoMuons[0]->charge()*isoMuons[1]->charge();
437  double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass();
438  fill(charge<0 ? "invMass_" : "invMassWC_" , mass );
439  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
440  // fill plots for trigger monitoring
441  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "diMuon", diMuonPaths_);
442  if(diMuonLogged_<=hists_.find("diMuonLogger_")->second->getNbinsY()){
443  // log runnumber, lumi block, event number & some
444  // more pysics infomation for interesting events
445  // We're doing a static_cast here to denote the explicity of the cast
446  double runID = static_cast<double>(event.eventAuxiliary().run());
447  double luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
448  double eventID = static_cast<double>(event.eventAuxiliary().event());
449  fill("diMuonLogger_", 0.5, diMuonLogged_+0.5, runID);
450  fill("diMuonLogger_", 1.5, diMuonLogged_+0.5, luminosityBlockID);
451  fill("diMuonLogger_", 2.5, diMuonLogged_+0.5, eventID);
452  fill("diMuonLogger_", 3.5, diMuonLogged_+0.5, isoMuons[0]->pt());
453  fill("diMuonLogger_", 4.5, diMuonLogged_+0.5, isoMuons[1]->pt());
454  if(leadingJets.size()>0) fill("diMuonLogger_", 5.5, diMuonLogged_+0.5, leadingJets[0].pt());
455  if(leadingJets.size()>1) fill("diMuonLogger_", 6.5, diMuonLogged_+0.5, leadingJets[1].pt());
456  fill("diMuonLogger_", 7.5, diMuonLogged_+0.5, caloMET.et());
457  ++diMuonLogged_;
458  }
459  }
460  }
461  }
462 
463  // DIELEC channel
464  if( dielec ){
465  fill("decayChannel_", 2.5);
466  if( dielec && isoElecs.size()>1 ){
467  int charge = isoElecs[0]->charge()*isoElecs[1]->charge();
468  double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass();
469  fill(charge<0 ? "invMass_" : "invMassWC_" , mass );
470  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<mass && mass<upperEdge_) ){
471  // fill plots for trigger monitoring
472  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "diElec", diElecPaths_);
473  if(diElecLogged_<=hists_.find("diElecLogger_")->second->getNbinsY()){
474  // log runnumber, lumi block, event number & some
475  // more pysics infomation for interesting events
476  // We're doing a static_cast here to denote the explicity of the cast
477  double runID = static_cast<double>(event.eventAuxiliary().run());
478  double luminosityBlockID = static_cast<double>(event.eventAuxiliary().luminosityBlock());
479  double eventID = static_cast<double>(event.eventAuxiliary().event());
480  fill("diElecLogger_", 0.5, diElecLogged_+0.5, runID);
481  fill("diElecLogger_", 1.5, diElecLogged_+0.5, luminosityBlockID);
482  fill("diElecLogger_", 2.5, diElecLogged_+0.5, eventID);
483  fill("diElecLogger_", 3.5, diElecLogged_+0.5, isoElecs[0]->pt());
484  fill("diElecLogger_", 4.5, diElecLogged_+0.5, isoElecs[1]->pt());
485  if(leadingJets.size()>0) fill("diElecLogger_", 5.5, diElecLogged_+0.5, leadingJets[0].pt());
486  if(leadingJets.size()>1) fill("diElecLogger_", 6.5, diElecLogged_+0.5, leadingJets[1].pt());
487  fill("diElecLogger_", 7.5, diElecLogged_+0.5, caloMET.et());
488  ++diElecLogged_;
489  }
490  }
491  }
492  }
493  }
494 
495  /*
496  ------------------------------------------------------------
497 
498  HLT Objects Monitoring
499 
500  ------------------------------------------------------------
501  */
502 
503  // loop over trigger paths
504  for(unsigned int i=0; i<triggerNames.triggerNames().size(); ++i){
505  // consider only path from triggerPaths
506  string name = triggerNames.triggerNames()[i].c_str();
507  bool isInteresting = false;
508  for (unsigned int j=0; j<triggerPaths.size(); j++) {
509  if (TString(name.c_str()).Contains(TString(triggerPaths[j]), TString::kIgnoreCase)) isInteresting = true;
510  }
511  if (!isInteresting) continue;
512  // dump infos on the considered trigger path
513  const unsigned int triggerIndex = triggerNames.triggerIndex(name);
514  // get modules for the considered trigger path
515  const vector<string>& moduleLabels(hltConfig.moduleLabels(triggerIndex));
516  const unsigned int moduleIndex(triggerTable->index(triggerIndex));
517  // Results from TriggerEventWithRefs product
518  electronIds_.clear(); electronRefs_.clear();
519  muonIds_.clear(); muonRefs_.clear();
520  // look only for modules actually run in this path
521  unsigned int kElec=0;
522  unsigned int kMuon=0;
523  for (unsigned int k=0; k<=moduleIndex; ++k) {
524  const string& moduleLabel(moduleLabels[k]);
525  const string moduleType(hltConfig.moduleType(moduleLabel));
526  // check whether the module is packed up in TriggerEventWithRef product
527  const unsigned int filterIndex(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabel,"",processName_)));
528  if (filterIndex<triggerEventWithRefsHandle->size()) {
529  triggerEventWithRefsHandle->getObjects(filterIndex,electronIds_,electronRefs_);
530  const unsigned int nElectrons(electronIds_.size());
531  if (nElectrons>0) kElec = k;
532 
533  triggerEventWithRefsHandle->getObjects(filterIndex,muonIds_,muonRefs_);
534  const unsigned int nMuons(muonIds_.size());
535  if (nMuons>0) kMuon = k;
536 
537  }
538  }
539  bool l1Matched = false;
540  bool l2Matched = false;
541  double l1DeltaRMin = 500.;
542  double l2DeltaRMin = 500.;
543  unsigned int l1IndMatched = 500;
544  unsigned int l2IndMatched = 500;
545  // access to hlt dielecs
546  electronIds_.clear(); electronRefs_.clear();
547  if (kElec > 0 && kMuon < 1 && isoElecs.size()>0) {
548  const string& moduleLabelElec(moduleLabels[kElec]);
549  const string moduleTypeElec(hltConfig.moduleType(moduleLabelElec));
550  const unsigned int filterIndexElec(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
551  triggerEventWithRefsHandle->getObjects(filterIndexElec,electronIds_,electronRefs_);
552  const unsigned int nElectrons(electronIds_.size());
553  double deltar1 = 600.;
554  double deltar2 = 600.;
555  for (unsigned int inde = 0; inde < isoElecs.size(); inde++) {
556  if (nElectrons > 0) deltar1 = deltaR(*electronRefs_[0],*isoElecs[inde]);
557  if (nElectrons > 1) deltar2 = deltaR(*electronRefs_[1],*isoElecs[inde]);
558  if (deltar1 < deltar2 && deltar1 < l1DeltaRMin) {
559  l1DeltaRMin = deltar1;
560  l1IndMatched = inde;
561  }
562  if (deltar2 < deltar1 && deltar2 < l2DeltaRMin) {
563  l2DeltaRMin = deltar2;
564  l2IndMatched = inde;
565  }
566  }
567  if (nElectrons > 0 && l1IndMatched < 500) fill("leptDeltaREta_", isoElecs[l1IndMatched]->eta(), l1DeltaRMin);
568  if (nElectrons > 1 && l2IndMatched < 500) fill("leptDeltaREta_", isoElecs[l2IndMatched]->eta(), l2DeltaRMin);
569  if (l1DeltaRMin < DRMIN) {
570  l1Matched = true;
571  fill("matchingMon_", 0.5 );
572  fill("leptResolution_", fabs(isoElecs[l1IndMatched]->pt()-electronRefs_[0]->pt())/isoElecs[l1IndMatched]->pt() );
573  }
574  if (l2DeltaRMin < DRMIN) {
575  l2Matched = true;
576  fill("matchingMon_", 1.5 );
577  fill("leptResolution_", fabs(isoElecs[l2IndMatched]->pt()-electronRefs_[1]->pt())/isoElecs[l2IndMatched]->pt() );
578  }
579  }
580  // access to hlt dimuons
581  muonIds_.clear(); muonRefs_.clear();
582  l1DeltaRMin = 500.; l2DeltaRMin = 500.; double l3DeltaRMin = 500.;
583  l1IndMatched = 500; l2IndMatched = 500; double l3IndMatched = 500;
584  if (kMuon > 0 && kElec < 1 && isoMuons.size()>0) {
585  const string& moduleLabelMuon(moduleLabels[kMuon]);
586  const string moduleTypeMuon(hltConfig.moduleType(moduleLabelMuon));
587  const unsigned int filterIndexMuon(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
588  triggerEventWithRefsHandle->getObjects(filterIndexMuon,muonIds_,muonRefs_);
589  trigger::VRmuon myMuonRefs;
590  const unsigned int nMuons(muonIds_.size());
591  for (unsigned int l=0; l<nMuons; l++) {
592  bool isNew = true;
593  for (unsigned int ll=0; ll<myMuonRefs.size(); ll++) {
594  if (fabs((myMuonRefs[ll]->pt()-muonRefs_[l]->pt())/muonRefs_[l]->pt()) < 1e-5) isNew = false;
595  }
596  if (isNew) myMuonRefs.push_back(muonRefs_[l]);
597  }
598  const unsigned int nMyMuons(myMuonRefs.size());
599  double deltar1 = 600.;
600  double deltar2 = 600.;
601  double deltar3 = 600.;
602  for (unsigned int indm = 0; indm < isoMuons.size(); indm++) {
603  if (nMyMuons > 0) deltar1 = deltaR(*myMuonRefs[0],*isoMuons[indm]);
604  if (nMyMuons > 1) deltar2 = deltaR(*myMuonRefs[1],*isoMuons[indm]);
605  if (nMyMuons > 2) deltar3 = deltaR(*myMuonRefs[2],*isoMuons[indm]);
606  if (nMyMuons > 0 && (nMyMuons<1 || deltar1 < deltar2) && (nMyMuons<2 || deltar1<deltar3) && deltar1 < l1DeltaRMin) {
607  l1DeltaRMin = deltar1;
608  l1IndMatched = indm;
609  }
610  if (nMyMuons > 1 && deltar2 < deltar1 && (nMyMuons<3 || deltar2<deltar3) && deltar2 < l2DeltaRMin) {
611  l2DeltaRMin = deltar2;
612  l2IndMatched = indm;
613  }
614  if (nMyMuons > 2 && deltar3 < deltar1 && deltar3 < deltar2 && deltar3 < l3DeltaRMin) {
615  l3DeltaRMin = deltar3;
616  l3IndMatched = indm;
617  }
618  }
619  if (nMyMuons > 0 && l1IndMatched < 500) fill("leptDeltaREta_", isoMuons[l1IndMatched]->eta(), l1DeltaRMin);
620  if (nMyMuons > 1 && l2IndMatched < 500) fill("leptDeltaREta_", isoMuons[l2IndMatched]->eta(), l2DeltaRMin);
621  if (nMyMuons > 2 && l3IndMatched < 500) fill("leptDeltaREta_", isoMuons[l3IndMatched]->eta(), l3DeltaRMin);
622  if (l1DeltaRMin < DRMIN) {
623  l1Matched = true;
624  fill("matchingMon_", 0.5 );
625  fill("leptResolution_", fabs(isoMuons[l1IndMatched]->pt()-myMuonRefs[0]->pt())/isoMuons[l1IndMatched]->pt() );
626  if (l2DeltaRMin < DRMIN) {
627  l2Matched = true;
628  fill("matchingMon_", 1.5 );
629  fill("leptResolution_", fabs(isoMuons[l2IndMatched]->pt()-myMuonRefs[1]->pt())/isoMuons[l2IndMatched]->pt() );
630  } else if (l3DeltaRMin < DRMIN) {
631  l2Matched = true;
632  fill("matchingMon_", 1.5 );
633  fill("leptResolution_", fabs(isoMuons[l3IndMatched]->pt()-myMuonRefs[2]->pt())/isoMuons[l3IndMatched]->pt() );
634  }
635  } else {
636  if (l2DeltaRMin < DRMIN) {
637  l1Matched = true;
638  fill("matchingMon_", 0.5 );
639  fill("leptResolution_", fabs(isoMuons[l2IndMatched]->pt()-myMuonRefs[1]->pt())/isoMuons[l2IndMatched]->pt() );
640  if (l3DeltaRMin < DRMIN) {
641  l2Matched = true;
642  fill("matchingMon_", 1.5 );
643  fill("leptResolution_", fabs(isoMuons[l3IndMatched]->pt()-myMuonRefs[2]->pt())/isoMuons[l3IndMatched]->pt() );
644  }
645  }
646  if (l3DeltaRMin < DRMIN) {
647  l1Matched = true;
648  fill("matchingMon_", 0.5 );
649  fill("leptResolution_", fabs(isoMuons[l3IndMatched]->pt()-myMuonRefs[2]->pt())/isoMuons[l3IndMatched]->pt() );
650  }
651  }
652  }
653  // access to hlt elec-muon
654  electronIds_.clear(); electronRefs_.clear();
655  muonIds_.clear(); muonRefs_.clear();
656  l1DeltaRMin = 500.; l2DeltaRMin = 500.;
657  l1IndMatched = 500; l2IndMatched = 500;
658  if (kElec > 0 && kMuon > 0 && isoElecs.size()>0) {
659  const string& moduleLabelElec(moduleLabels[kElec]);
660  const string moduleTypeElec(hltConfig.moduleType(moduleLabelElec));
661  const unsigned int filterIndexElec(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelElec,"",processName_)));
662  triggerEventWithRefsHandle->getObjects(filterIndexElec,electronIds_,electronRefs_);
663  const unsigned int nElectrons(electronIds_.size());
664  double deltar = 600.;
665  for (unsigned int inde = 0; inde < isoElecs.size(); inde++) {
666  if (nElectrons > 0) deltar = deltaR(*electronRefs_[0],*isoElecs[inde]);
667  if (deltar < l1DeltaRMin) {
668  l1DeltaRMin = deltar;
669  l1IndMatched = inde;
670  }
671  }
672  if (nElectrons > 0 && l1IndMatched < 500) fill("leptDeltaREta_", isoElecs[l1IndMatched]->eta(), l1DeltaRMin);
673  if (l1DeltaRMin < DRMIN) {
674  l1Matched = true;
675  fill("matchingMon_", 0.5 );
676  fill("leptResolution_", fabs(isoElecs[l1IndMatched]->pt()-electronRefs_[0]->pt())/isoElecs[l1IndMatched]->pt() );
677  }
678  }
679  if (kElec > 0 && kMuon > 0 && isoMuons.size()>0) {
680  const string& moduleLabelMuon(moduleLabels[kMuon]);
681  const string moduleTypeMuon(hltConfig.moduleType(moduleLabelMuon));
682  const unsigned int filterIndexMuon(triggerEventWithRefsHandle->filterIndex(edm::InputTag(moduleLabelMuon,"",processName_)));
683  triggerEventWithRefsHandle->getObjects(filterIndexMuon,muonIds_,muonRefs_);
684  const unsigned int nMuons(muonIds_.size());
685  if (isoMuons.size()<1) continue;
686  double deltar = 600.;
687  for (unsigned int indm = 0; indm < isoMuons.size(); indm++) {
688  if (nMuons > 0) deltar = deltaR(*muonRefs_[0],*isoMuons[indm]);
689  if (deltar < l2DeltaRMin) {
690  l2DeltaRMin = deltar;
691  l2IndMatched = indm;
692  }
693  }
694  if (nMuons > 0 && l2IndMatched < 500) fill("leptDeltaREta_", isoMuons[l2IndMatched]->eta(), l2DeltaRMin);
695  if (l2DeltaRMin < DRMIN) {
696  l2Matched = true;
697  fill("matchingMon_", 1.5 );
698  fill("leptResolution_", fabs(isoMuons[l2IndMatched]->pt()-muonRefs_[0]->pt())/isoMuons[l2IndMatched]->pt() );
699  }
700  }
701  if (l1Matched && l2Matched) fill("matchingMon_", 2.5 );
702  }
703 
704  }
int i
Definition: DBlmapReader.cc:9
const std::string moduleType(const std::string &module) const
C++ class name of module.
double lowerEdge_
mass window upper and lower edge
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual void scaleEnergy(double fScale)
scale energy of the jet
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
virtual double et() const
transverse energy
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
Definition: Jet.h:20
RunNumber_t run() const
int elecMuLogged_
number of logged interesting events
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
T eta() const
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
input sources for monitoring
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
Jets made from PFObjects.
Definition: PFJet.h:21
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
tuple corrector
Definition: mvaPFMET_cff.py:50
Definition: MET.h:42
vector< PseudoJet > jets
std::vector< std::string > diElecPaths_
trigger paths for di electron channel
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerEventWithRefsTag_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::map< std::string, MonitorElement * > hists_
histogram container
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
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
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:69
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
std::vector< reco::RecoChargedCandidateRef > VRmuon
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
tuple muons
Definition: patZpeak.py:38
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
bool isUninitialized() const
Definition: EDGetToken.h:71
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
static std::string const triggerPaths
Definition: EdmProvDump.cc:42
tuple size
Write out results.
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
void MonitorDiLepton::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 TopDiLeptonHLTOfflineDQM.h.

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

196  {
197  for(unsigned int idx=0; idx<labels.size(); ++idx){
198  if( acceptHLT(event, triggerTable, monitorPath(labels[idx])) ){
199  fill((channel+"Mon_").c_str(), idx+0.5 );
200  }
201  }
202  }
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)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void HLTOfflineDQMTopDiLepton::MonitorDiLepton::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 83 of file TopDiLeptonHLTOfflineDQM.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 HLTOfflineDQMTopDiLepton::MonitorDiLepton::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 TopDiLeptonHLTOfflineDQM.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 HLTOfflineDQMTopDiLepton::MonitorDiLepton::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 TopDiLeptonHLTOfflineDQM.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 MonitorDiLepton::loggerBinLabels ( std::string  hist)
inlineprivate

set labels for event logging histograms

Definition at line 160 of file TopDiLeptonHLTOfflineDQM.h.

References hists_.

Referenced by book().

161  {
162  // set axes titles for selected events
163  hists_[hist.c_str()]->getTH1()->SetOption("TEXT");
164  hists_[hist.c_str()]->setBinLabel( 1 , "Run" , 1);
165  hists_[hist.c_str()]->setBinLabel( 2 , "Block" , 1);
166  hists_[hist.c_str()]->setBinLabel( 3 , "Event" , 1);
167  hists_[hist.c_str()]->setBinLabel( 6 , "pt_{L2L3}(jet1)" , 1);
168  hists_[hist.c_str()]->setBinLabel( 7 , "pt_{L2L3}(jet2)" , 1);
169  hists_[hist.c_str()]->setBinLabel( 8 , "MET_{Calo}" , 1);
170  hists_[hist.c_str()]->setAxisTitle("logged evts" , 2);
171 
172  if(hist=="diMuonLogger_"){
173  hists_[hist.c_str()]->setBinLabel( 4 , "pt(muon)" , 1);
174  hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1);
175  }
176  if(hist=="diElecLogger_"){
177  hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1);
178  hists_[hist.c_str()]->setBinLabel( 5 , "pt(elec)" , 1);
179  }
180  if(hist=="elecMuLogger_"){
181  hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1);
182  hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1);
183  }
184  }
std::map< std::string, MonitorElement * > hists_
histogram container
std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::monitorPath ( const std::string &  label) const
inlineprivate

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

Definition at line 68 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and triggerBinLabels().

68 { return label.substr(label.find(':')+1); };
std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::selectionPath ( const std::string &  label) const
inlineprivate

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

Definition at line 71 of file TopDiLeptonHLTOfflineDQM.h.

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

set configurable labels for trigger monitoring histograms

Definition at line 187 of file TopDiLeptonHLTOfflineDQM.h.

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

Referenced by book().

188  {
189  for(unsigned int idx=0; idx<labels.size(); ++idx){
190  hists_[(channel+"Mon_").c_str()]->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
191  }
192  }
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 HLTOfflineDQMTopDiLepton::MonitorDiLepton::diElecLogged_
private

Definition at line 147 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

std::vector<std::string> HLTOfflineDQMTopDiLepton::MonitorDiLepton::diElecPaths_
private

trigger paths for di electron channel

Definition at line 109 of file TopDiLeptonHLTOfflineDQM.h.

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

int HLTOfflineDQMTopDiLepton::MonitorDiLepton::diMuonLogged_
private

Definition at line 147 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

std::vector<std::string> HLTOfflineDQMTopDiLepton::MonitorDiLepton::diMuonPaths_
private

trigger paths for di muon channel

Definition at line 107 of file TopDiLeptonHLTOfflineDQM.h.

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

int HLTOfflineDQMTopDiLepton::MonitorDiLepton::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 123 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

StringCutObjectSelector<reco::GsfElectron>* HLTOfflineDQMTopDiLepton::MonitorDiLepton::elecIso_
private

extra isolation criterion on electron

Definition at line 125 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

int HLTOfflineDQMTopDiLepton::MonitorDiLepton::elecMuLogged_
private

number of logged interesting events

Definition at line 147 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

std::vector<std::string> HLTOfflineDQMTopDiLepton::MonitorDiLepton::elecMuPaths_
private

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

Definition at line 105 of file TopDiLeptonHLTOfflineDQM.h.

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

edm::EDGetTokenT< edm::View<reco::GsfElectron> > HLTOfflineDQMTopDiLepton::MonitorDiLepton::elecs_
private

input sources for monitoring

Definition at line 94 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

StringCutObjectSelector<reco::GsfElectron>* HLTOfflineDQMTopDiLepton::MonitorDiLepton::elecSelect_
private

extra selection on electrons

Definition at line 127 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

edm::EDGetTokenT< edm::ValueMap<float> > HLTOfflineDQMTopDiLepton::MonitorDiLepton::electronId_
private

electronId label

Definition at line 112 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

trigger::Vids HLTOfflineDQMTopDiLepton::MonitorDiLepton::electronIds_
private

Definition at line 153 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

trigger::VRelectron HLTOfflineDQMTopDiLepton::MonitorDiLepton::electronRefs_
private

Definition at line 154 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::folder_
private

Definition at line 87 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by book(), and MonitorDiLepton().

std::map<std::string,MonitorElement*> HLTOfflineDQMTopDiLepton::MonitorDiLepton::hists_
private

histogram container

Definition at line 149 of file TopDiLeptonHLTOfflineDQM.h.

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

std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::jetCorrector_
private

jetCorrector

Definition at line 135 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

edm::EDGetTokenT< reco::JetIDValueMap > HLTOfflineDQMTopDiLepton::MonitorDiLepton::jetIDLabel_
private

jetID as an extra selection type

Definition at line 137 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

StringCutObjectSelector<reco::JetID>* HLTOfflineDQMTopDiLepton::MonitorDiLepton::jetIDSelect_
private

extra jetID selection on calo jets

Definition at line 139 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

edm::EDGetTokenT< edm::View<reco::Jet> > HLTOfflineDQMTopDiLepton::MonitorDiLepton::jets_
private

Definition at line 96 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::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 142 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::label_
private
double HLTOfflineDQMTopDiLepton::MonitorDiLepton::lowerEdge_
private

mass window upper and lower edge

Definition at line 144 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

std::vector< edm::EDGetTokenT< edm::View<reco::MET> > > HLTOfflineDQMTopDiLepton::MonitorDiLepton::mets_
private

considers a vector of METs

Definition at line 98 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

trigger::Vids HLTOfflineDQMTopDiLepton::MonitorDiLepton::muonIds_
private

Definition at line 155 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

StringCutObjectSelector<reco::Muon>* HLTOfflineDQMTopDiLepton::MonitorDiLepton::muonIso_
private

extra isolation criterion on muon

Definition at line 130 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

trigger::VRmuon HLTOfflineDQMTopDiLepton::MonitorDiLepton::muonRefs_
private

Definition at line 156 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill().

edm::EDGetTokenT< edm::View<reco::Muon> > HLTOfflineDQMTopDiLepton::MonitorDiLepton::muons_
private

Definition at line 95 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

StringCutObjectSelector<reco::Muon>* HLTOfflineDQMTopDiLepton::MonitorDiLepton::muonSelect_
private

extra selection on muons

Definition at line 132 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

std::string HLTOfflineDQMTopDiLepton::MonitorDiLepton::processName_
private

hlt objects

Definition at line 152 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

edm::EDGetTokenT< trigger::TriggerEventWithRefs > HLTOfflineDQMTopDiLepton::MonitorDiLepton::triggerEventWithRefsTag_
private

Definition at line 102 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

edm::EDGetTokenT< edm::TriggerResults > HLTOfflineDQMTopDiLepton::MonitorDiLepton::triggerTable_
private

trigger table

Definition at line 101 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().

double HLTOfflineDQMTopDiLepton::MonitorDiLepton::upperEdge_
private

Definition at line 144 of file TopDiLeptonHLTOfflineDQM.h.

Referenced by fill(), and MonitorDiLepton().