11 namespace TopDiLeptonOffline {
14 label_(label), eidPattern_(0), elecIso_(0), elecSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0),
15 lowerEdge_(-1.), upperEdge_(-1.), elecMuLogged_(0), diMuonLogged_(0), diElecLogged_(0)
132 hists_[
"invMassLog_" ] =
store_->
book1D(
"InvMassLog" ,
"log_{10}(M(lep1, lep2))" , 80, .1, 2.5);
134 hists_[
"invMassWC_" ] =
store_->
book1D(
"InvMassWC" ,
"M_{WC}(L1, L2)" , 80, 0., 320.);
136 hists_[
"invMassWCLog_"] =
store_->
book1D(
"InvMassLogWC",
"log_{10}(M_{WC})" , 80, .1, 2.5);
140 hists_[
"elecMuEff_" ] =
store_->
book1D(
"ElecMuEff" ,
"Eff(e/#mu paths)" , nElecMu, 0., nElecMu);
142 hists_[
"elecMuMon_" ] =
store_->
book1D(
"ElecMuMon" ,
"Mon(e/#mu paths)" , nElecMu, 0., nElecMu);
144 hists_[
"diMuonEff_" ] =
store_->
book1D(
"DiMuonEff" ,
"Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
146 hists_[
"diMuonMon_" ] =
store_->
book1D(
"DiMuonMon" ,
"Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon);
160 hists_[
"decayChannel_"]->setBinLabel( 1,
"#mu e" , 1);
161 hists_[
"decayChannel_"]->setBinLabel( 2,
"#mu #mu", 1);
162 hists_[
"decayChannel_"]->setBinLabel( 3,
"e e" , 1);
168 hists_[
"sumEtaL1L2_" ] =
store_->
book1D(
"SumEtaL1L2" ,
"<#eta>(lep1, lep2)" , 100, -5., 5.);
170 hists_[
"dEtaL1L2_" ] =
store_->
book1D(
"DEtaL1L2" ,
"#Delta#eta(lep1,lep2)" , 80, -4., 4.);
172 hists_[
"dPhiL1L2_" ] =
store_->
book1D(
"DPhiL1L2" ,
"#Delta#phi(lep1,lep2)" , 64, -3.2, 3.2);
180 hists_[
"muonRelIso_" ] =
store_->
book1D(
"MuonRelIso" ,
"Iso_{Rel}(#mu)" , 50, 0., 1.);
192 hists_[
"muonDelXY_" ] =
store_->
book2D(
"MuonDelXY" ,
"d_{xy}(#mu)" , 50, -1., 1., 50, -1., 1.);
194 hists_[
"lepMultIso_" ] =
store_->
book2D(
"LepMultIso" ,
"N_{Iso}(e) vs N_{Iso}(#mu)" , 5, 0., 5., 5, 0., 5.);
197 hists_[
"muonDelXY_" ]->setAxisTitle(
"x [cm]", 1);
hists_[
"muonDelXY_" ]->setAxisTitle(
"y [cm]", 2);
199 hists_[
"lepMultIso_" ]->setAxisTitle(
"N_{Iso}(#mu)", 1);
hists_[
"lepMultIso_" ]->setAxisTitle(
"N_{Iso}(elec)", 2);
205 hists_[
"elecMultIso_" ] =
store_->
book1D(
"ElecMultIso" ,
"N_{Iso}(e)" , 11, -0.5, 10.5);
207 hists_[
"muonMultIso_" ] =
store_->
book1D(
"MuonMultIso" ,
"N_{Iso}(#mu)" , 11, -0.5, 10.5);
209 hists_[
"muonCalIso_" ] =
store_->
book1D(
"MuonCalIso" ,
"Iso_{Cal}(#mu)" , 50, 0., 1.);
211 hists_[
"muonTrkIso_" ] =
store_->
book1D(
"MuonTrkIso" ,
"Iso_{Trk}(#mu)" , 50, 0., 1.);
221 hists_[
"jet1PtRaw_" ] =
store_->
book1D(
"Jet1PtRaw" ,
"pt_{Raw}(jet1)" , 60, 0., 300.);
223 hists_[
"jet2PtRaw_" ] =
store_->
book1D(
"Jet2PtRaw" ,
"pt_{Raw}(jet2)" , 60, 0., 300.);
225 hists_[
"dEtaJet1Jet2_"] =
store_->
book1D(
"DEtaJet1Jet2",
"#Delta#eta(jet1,jet2)" , 80, -4., 4.);
227 hists_[
"dEtaJet1Lep1_"] =
store_->
book1D(
"DEtaJet1Lep1",
"#Delta#eta(jet1,lep1)" , 80, -4., 4.);
229 hists_[
"dEtaLep1MET_" ] =
store_->
book1D(
"DEtaLep1MET" ,
"#Delta#eta(lep1,MET)" , 80, -4., 4.);
231 hists_[
"dEtaJet1MET_" ] =
store_->
book1D(
"DEtaJet1MET" ,
"#Delta#eta(jet1,MET)" , 80, -4., 4.);
233 hists_[
"dPhiJet1Jet2_"] =
store_->
book1D(
"DPhiJet1Jet2",
"#Delta#phi(jet1,jet2)" , 64, -3.2, 3.2);
235 hists_[
"dPhiJet1Lep1_"] =
store_->
book1D(
"DPhiJet1Lep1",
"#Delta#phi(jet1,lep1)" , 64, -3.2, 3.2);
237 hists_[
"dPhiLep1MET_" ] =
store_->
book1D(
"DPhiLep1MET" ,
"#Delta#phi(lep1,MET)" , 64, -3.2, 3.2);
239 hists_[
"dPhiJet1MET_" ] =
store_->
book1D(
"DPhiJet1MET" ,
"#Delta#phi(jet1,MET)" , 64, -3.2, 3.2);
241 hists_[
"diMuonLogger_"] =
store_->
book2D(
"DiMuonLogger",
"Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.);
243 hists_[
"diElecLogger_"] =
store_->
book2D(
"DiElecLogger",
"Logged DiElec Events" , 8, 0., 8., 10, 0., 10.);
245 hists_[
"elecMuLogger_"] =
store_->
book2D(
"ElecMuLogger",
"Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.);
263 if( !triggerTable.
isValid() )
return;
277 double dummy=5.;
fill(
"InstLumi_", dummy);
289 std::vector<const reco::Muon*> isoMuons;
291 if( !
muons.isValid() )
return;
295 if(
muon->isGlobalMuon() ){
296 fill(
"muonDelZ_" ,
muon->globalTrack()->vz());
297 fill(
"muonDelXY_",
muon->globalTrack()->vx(),
muon->globalTrack()->vy());
300 double isolationTrk =
muon->pt()/(
muon->pt()+
muon->isolationR03().sumPt);
301 double isolationCal =
muon->pt()/(
muon->pt()+
muon->isolationR03().emEt+
muon->isolationR03().hadEt);
302 double isolationRel = (
muon->isolationR03().sumPt+
muon->isolationR03().emEt+
muon->isolationR03().hadEt)/
muon->pt();
303 fill(
"muonTrkIso_" , isolationTrk);
fill(
"muonCalIso_" , isolationCal);
fill(
"muonRelIso_" , isolationRel);
308 fill(
"muonMultIso_", isoMuons.size());
319 std::vector<const reco::GsfElectron*> isoElecs;
321 if( !electronId.isValid() )
return;
324 if( !elecs.isValid() )
return;
328 int idx = elec-elecs->begin();
332 double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt());
333 double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt());
334 double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
335 fill(
"elecTrkIso_" , isolationTrk);
fill(
"elecCalIso_" , isolationCal);
fill(
"elecRelIso_" , isolationRel);
340 fill(
"elecMultIso_", isoElecs.size());
353 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
359 <<
"------------------------------------------------------------------------------------- \n"
360 <<
" No JetCorrectionsRecord available from EventSetup: \n"
361 <<
" - Jets will not be corrected. \n"
362 <<
" - If you want to change this add the following lines to your cfg file: \n"
364 <<
" ## load jet corrections \n"
365 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
366 <<
" process.prefer(\"ak5CaloL2L3\") \n"
368 <<
"------------------------------------------------------------------------------------- \n";
374 std::vector<reco::Jet> leadingJets;
375 if( !
jets.isValid() )
return;
383 if(
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(
jets->refAt(idx).get())){
387 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
391 else if(dynamic_cast<const reco::PFJet*>(&*
jet)){
401 for(std::vector<const reco::GsfElectron*>::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
402 if(
reco::deltaR((*elec)->eta(), (*elec)->phi(),
jet->eta(),
jet->phi())<0.4){overlap=
true;
break;}
403 }
if(overlap){
continue;}
408 leadingJets.push_back(monitorJet);
409 fill(
"jet1Pt_" , monitorJet.
pt());
410 fill(
"jet1PtRaw_" ,
jet->pt() );
414 leadingJets.push_back(monitorJet);
415 fill(
"jet2Pt_" , monitorJet.
pt());
416 fill(
"jet2PtRaw_" ,
jet->pt() );
420 if(leadingJets.size()>1){
421 fill(
"dEtaJet1Jet2_" , leadingJets[0].
eta()-leadingJets[1].
eta());
423 if( !isoMuons.empty() ){
424 if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){
425 fill(
"dEtaJet1Lep1_" , isoMuons[0]->
eta()-leadingJets[0].
eta());
429 if( !isoElecs.empty() ){
430 if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){
431 fill(
"dEtaJet1Lep1_" , isoElecs[0]->
eta()-leadingJets[0].
eta());
436 fill(
"jetMult_", mult);
450 for(
int i=0;
i<int(mets.size());
i++ ){
454 if(met->begin()!=met->end()){
457 caloMET=*met->begin();
458 fill(
"metCalo_", met->begin()->et());
459 if(!leadingJets.empty()){
460 fill(
"dEtaJet1MET_" , leadingJets[0].
eta()-met->begin()->eta());
463 if( !isoMuons.empty() ){
464 if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){
465 fill(
"dEtaLep1MET_" , isoMuons[0]->
eta()-met->begin()->eta());
469 if( !isoElecs.empty() ){
470 if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){
471 fill(
"dEtaLep1MET_" , isoElecs[0]->
eta()-met->begin()->eta());
476 if(idx==1){
fill(
"metTC_" , met->begin()->et());}
477 if(idx==2){
fill(
"metPflow_", met->begin()->et());}
491 fill(
"lepMultIso_", isoMuons.size(), isoElecs.size());
494 fill(
"decayChannel_", 0.5);
495 double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass();
498 fill(
"dEtaL1L2_" , isoElecs[0]->
eta()-isoMuons[0]->
eta());
499 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta()+isoMuons[0]->
eta())/2);
501 fill(
"elecPt_", isoElecs[0]->
pt());
fill(
"muonPt_", isoMuons[0]->
pt());
502 fill(
"lep1Pt_", isoElecs[0]->
pt()>isoMuons[0]->
pt() ? isoElecs[0]->
pt() : isoMuons[0]->
pt());
503 fill(
"lep2Pt_", isoElecs[0]->
pt()>isoMuons[0]->
pt() ? isoMuons[0]->
pt() : isoElecs[0]->
pt());
514 if(leadingJets.size()>0)
fill(
"elecMuLogger_", 5.5,
elecMuLogged_+0.5, leadingJets[0].
pt());
515 if(leadingJets.size()>1)
fill(
"elecMuLogger_", 6.5,
elecMuLogged_+0.5, leadingJets[1].
pt());
524 fill(
"decayChannel_", 1.5);
525 int charge = isoMuons[0]->charge()*isoMuons[1]->charge();
526 double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass();
528 fill(charge<0 ?
"invMass_" :
"invMassWC_" , mass );
529 fill(charge<0 ?
"invMassLog_" :
"invMassWCLog_" , log10(mass));
531 fill(
"dEtaL1L2_" , isoMuons[0]->
eta()-isoMuons[1]->
eta() );
532 fill(
"sumEtaL1L2_", (isoMuons[0]->
eta()+isoMuons[1]->
eta())/2);
534 fill(
"muonPt_", isoMuons[0]->
pt());
fill(
"muonPt_", isoMuons[1]->
pt());
535 fill(
"lep1Pt_", isoMuons[0]->
pt());
fill(
"lep2Pt_", isoMuons[1]->
pt());
546 if(leadingJets.size()>0)
fill(
"diMuonLogger_", 5.5,
diMuonLogged_+0.5, leadingJets[0].
pt());
547 if(leadingJets.size()>1)
fill(
"diMuonLogger_", 6.5,
diMuonLogged_+0.5, leadingJets[1].
pt());
556 fill(
"decayChannel_", 2.5);
557 int charge = isoElecs[0]->charge()*isoElecs[1]->charge();
558 double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass();
559 fill(charge<0 ?
"invMass_" :
"invMassWC_" , mass );
560 fill(charge<0 ?
"invMassLog_" :
"invMassWCLog_" , log10(mass));
562 fill(
"dEtaL1L2_" , isoElecs[0]->
eta()-isoElecs[1]->
eta() );
563 fill(
"sumEtaL1L2_", (isoElecs[0]->
eta()+isoElecs[1]->
eta())/2);
565 fill(
"elecPt_", isoElecs[0]->
pt());
fill(
"elecPt_", isoElecs[1]->
pt());
566 fill(
"lep1Pt_", isoElecs[0]->
pt());
fill(
"lep2Pt_", isoElecs[1]->
pt());
575 if(leadingJets.size()>0)
fill(
"diElecLogger_", 5.5,
diElecLogged_+0.5, leadingJets[0].
pt());
576 if(leadingJets.size()>1)
fill(
"diElecLogger_", 6.5,
diElecLogged_+0.5, leadingJets[1].
pt());
641 std::vector<edm::ParameterSet>
sel=cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
642 for(
unsigned int i=0; i<sel.size(); ++
i){
670 std::vector< edm::Handle<edm::View<reco::MET> > > mets;
680 if(vertex->empty() || !(*vertexSelect_)(vertex->front()))
return;
692 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
696 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
701 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
707 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
712 if(step.
select(event, setup)){
713 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
716 if(
type==
"jets/pf" ){
718 if(step.
select(event, setup)){
719 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
722 if(
type==
"jets/calo" ){
724 if(step.
select(event, setup)){
725 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
731 selection_[
key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets);
T getParameter(std::string const &) const
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
virtual double et() const GCC11_FINAL
transverse energy
edm::EDGetTokenT< edm::View< reco::Muon > > muonsToken_
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
tuple met
____________________________________________________________________________||
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Jets made from CaloTowers.
edm::EDGetTokenT< reco::JetIDValueMap > jetIDToken_
bool acceptHLT(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
Base class for all types of Jets.
MonitorEnsemble(const char *label, const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
default contructor
std::vector< edm::InputTag > metsTemp_
DecayChannel decayChannel(const std::vector< const reco::Muon * > &muons, const std::vector< const reco::GsfElectron * > &elecs) const
determine dileptonic decay channel
void loggerBinLabels(std::string hist)
set labels for event logging histograms
int elecMuLogged_
number of logged interesting events
virtual void scaleEnergy(double fScale)
scale energy of the jet
std::string selectionStep(const std::string &label)
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
Jets made from PFObjects.
std::vector< std::string > selectionOrder_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
edm::InputTag triggerTable_
trigger table
std::vector< std::string > triggerPaths_
trigger paths
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken_
std::map< std::string, std::pair< edm::ParameterSet, TopDiLeptonOffline::MonitorEnsemble * > > selection_
std::string jetCorrector_
jetCorrector
std::string label_
instance label
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool select(const edm::Event &event)
apply selection
TopHLTDiLeptonOfflineDQM(const edm::ParameterSet &cfg)
default constructor
void book(std::string directory)
book histograms in subdirectory directory
double deltaPhi(double phi1, double phi2)
EventAuxiliary const & eventAuxiliary() const
std::vector< std::string > diMuonPaths_
trigger paths for di muon channel
edm::InputTag beamspot_
beamspot
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "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 ...
double lowerEdge_
mass window upper and lower edge
Level verbosity_
verbosity level for booking
edm::EDGetTokenT< edm::TriggerResults > triggerTableToken_
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::string objectType(const std::string &label)
std::map< std::string, MonitorElement * > hists_
histogram container
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
edm::InputTag vertex_
primary vertex
DQMStore * store_
storage manager
std::vector< std::string > elecMuPaths_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecsToken_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > metsTokens_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
virtual float pt() const GCC11_FINAL
transverse momentum
edm::EDGetTokenT< edm::ValueMap< float > > electronIdToken_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventNumber_t event() const
void setCurrentFolder(const std::string &fullpath)
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms