11 namespace TopHLTSingleLepton {
18 static const double WMASS = 80.4;
21 label_(label), elecIso_(0), elecSelect_(0), pvSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(
false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
175 hists_[
"triggerEff_" ] =
store_->
book1D(
"TriggerEff" ,
"Eff(trigger)" , nPaths, 0., nPaths);
177 hists_[
"triggerMon_" ] =
store_->
book1D(
"TriggerMon" ,
"Mon(trigger)" , nPaths, 0., nPaths);
210 hists_[
"muonRelIso_" ] =
store_->
book1D(
"MuonRelIso" ,
"Iso_{Rel}(#mu)" , 50, 0., 1.);
216 hists_[
"jetMultBEff_"] =
store_->
book1D(
"JetMultBEff",
"N_{30}(b/eff)" , 10, 0., 10.);
218 hists_[
"jetBDiscEff_"] =
store_->
book1D(
"JetBDiscEff",
"Disc_{b/eff}(jet)", 100, 0., 10.);
242 hists_[
"muonDelXY_" ] =
store_->
book2D(
"MuonDelXY" ,
"d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
245 hists_[
"muonDelXY_" ]->setAxisTitle(
"x [cm]", 1);
hists_[
"muonDelXY_" ]->setAxisTitle(
"y [cm]", 2);
251 hists_[
"muonTrkIso_" ] =
store_->
book1D(
"MuonTrkIso" ,
"Iso_{Trk}(#mu)" , 50, 0., 1.);
253 hists_[
"muonCalIso_" ] =
store_->
book1D(
"MuonCalIso" ,
"Iso_{Ecal}(#mu)" , 50, 0., 1.);
259 hists_[
"jetMultBPur_"] =
store_->
book1D(
"JetMultBPur",
"N_{30}(b/pur)" , 10, 0., 10.);
261 hists_[
"jetBDiscPur_"] =
store_->
book1D(
"JetBDiscPur",
"Disc_{b/pur}(Jet)", 100, 0., 10.);
263 hists_[
"jetMultBVtx_"] =
store_->
book1D(
"JetMultBVtx",
"N_{30}(b/vtx)" , 10, 0., 10.);
265 hists_[
"jetBDiscVtx_"] =
store_->
book1D(
"JetBDiscVtx",
"Disc_{b/vtx}(Jet)", 35, -1., 6.);
267 hists_[
"jet1PtRaw_" ] =
store_->
book1D(
"Jet1PtRaw" ,
"pt_{Raw}(jet1)" , 60, 0., 300.);
269 hists_[
"jet2PtRaw_" ] =
store_->
book1D(
"Jet2PtRaw" ,
"pt_{Raw}(jet2)" , 60, 0., 300.);
271 hists_[
"jet3PtRaw_" ] =
store_->
book1D(
"Jet3PtRaw" ,
"pt_{Raw}(jet3)" , 60, 0., 300.);
273 hists_[
"jet4PtRaw_" ] =
store_->
book1D(
"Jet4PtRaw" ,
"pt_{Raw}(jet4)" , 60, 0., 300.);
275 hists_[
"eventLogger_"] =
store_->
book2D(
"EventLogger",
"Logged Events" , 9, 0., 9., 10, 0., 10.);
278 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
279 hists_[
"eventLogger_"]->setBinLabel( 1 ,
"Run" , 1);
280 hists_[
"eventLogger_"]->setBinLabel( 2 ,
"Block" , 1);
281 hists_[
"eventLogger_"]->setBinLabel( 3 ,
"Event" , 1);
282 hists_[
"eventLogger_"]->setBinLabel( 4 ,
"pt_{L2L3}(jet1)" , 1);
283 hists_[
"eventLogger_"]->setBinLabel( 5 ,
"pt_{L2L3}(jet2)" , 1);
284 hists_[
"eventLogger_"]->setBinLabel( 6 ,
"pt_{L2L3}(jet3)" , 1);
285 hists_[
"eventLogger_"]->setBinLabel( 7 ,
"pt_{L2L3}(jet4)" , 1);
286 hists_[
"eventLogger_"]->setBinLabel( 8 ,
"M_{W}" , 1);
287 hists_[
"eventLogger_"]->setBinLabel( 9 ,
"M_{Top}" , 1);
288 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts" , 2);
303 if( !triggerTable.
isValid() )
return;
314 if( !pvs.isValid() )
return;
315 unsigned int pvMult = 0;
320 fill(
"pvMult_", pvMult );
332 if( !electronId.isValid() )
return;
335 if( !elecs.isValid() )
return;
338 unsigned int eMult=0, eMultIso=0;
339 std::vector<const reco::GsfElectron*> isoElecs;
342 unsigned int idx = elec-elecs->begin();
346 double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt());
347 double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt());
348 double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
351 fill(
"elecPt_" , elec->pt() );
352 fill(
"elecEta_", elec->eta());
353 fill(
"elecRelIso_" , isolationRel );
354 fill(
"elecTrkIso_" , isolationTrk );
355 fill(
"elecCalIso_" , isolationCal );
359 ++eMult;
if(!
elecIso_ || (*
elecIso_)(*elec)){
if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso;}
363 fill(
"elecMult_", eMult );
364 fill(
"elecMultIso_", eMultIso);
375 unsigned int mMult=0, mMultIso=0;
377 if( !
muons.isValid() )
return;
382 if(
muon->isGlobalMuon() ){
383 fill(
"muonDelZ_" ,
muon->globalTrack()->vz());
384 fill(
"muonDelXY_",
muon->globalTrack()->vx(),
muon->globalTrack()->vy());
387 double isolationTrk =
muon->pt()/(
muon->pt()+
muon->isolationR03().sumPt);
388 double isolationCal =
muon->pt()/(
muon->pt()+
muon->isolationR03().emEt+
muon->isolationR03().hadEt);
389 double isolationRel = (
muon->isolationR03().sumPt+
muon->isolationR03().emEt+
muon->isolationR03().hadEt)/
muon->pt();
394 fill(
"muonRelIso_" , isolationRel );
395 fill(
"muonTrkIso_" , isolationTrk );
396 fill(
"muonCalIso_" , isolationCal );
402 fill(
"muonMult_", mMult );
403 fill(
"muonMultIso_", mMultIso);
415 if( !btagEff.
isValid() )
return;
416 if( !btagPur.
isValid() )
return;
417 if( !btagVtx.
isValid() )
return;
423 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
429 <<
"------------------------------------------------------------------------------------- \n"
430 <<
" No JetCorrectionsRecord available from EventSetup: \n"
431 <<
" - Jets will not be corrected. \n"
432 <<
" - If you want to change this add the following lines to your cfg file: \n"
434 <<
" ## load jet corrections \n"
435 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
436 <<
" process.prefer(\"ak5CaloL2L3\") \n"
438 <<
"------------------------------------------------------------------------------------- \n";
443 std::vector<reco::Jet> correctedJets;
444 unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0;
446 if( !
jets.isValid() )
return;
456 if(
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(
jets->refAt(idx).get())){
460 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
464 else if(dynamic_cast<const reco::PFJet*>(&*
jet)){
480 correctedJets.push_back(monitorJet);
485 fill(
"jetBDiscEff_", (*btagEff)[jetRef]);
if( (*btagEff)[jetRef]>
btagEffWP_ ) ++multBEff;
486 fill(
"jetBDiscPur_", (*btagPur)[jetRef]);
if( (*btagPur)[jetRef]>
btagPurWP_ ) {
if(multBPur == 0) bJetCand = *
jet; ++multBPur;}
487 fill(
"jetBDiscVtx_", (*btagVtx)[jetRef]);
if( (*btagVtx)[jetRef]>
btagVtxWP_ ) ++multBVtx;
490 if(idx==0) {
fill(
"jet1Pt_" , monitorJet.
pt());
fill(
"jet1PtRaw_",
jet->pt() );
fill(
"jet1Eta_" , monitorJet.
eta());}
491 if(idx==1) {
fill(
"jet2Pt_" , monitorJet.
pt());
fill(
"jet2PtRaw_",
jet->pt() );
fill(
"jet2Eta_" , monitorJet.
eta());}
492 if(idx==2) {
fill(
"jet3Pt_" , monitorJet.
pt());
fill(
"jet3PtRaw_",
jet->pt() );
fill(
"jet3Eta_" , monitorJet.
eta());}
493 if(idx==3) {
fill(
"jet4Pt_" , monitorJet.
pt());
fill(
"jet4PtRaw_",
jet->pt() );
fill(
"jet4Eta_" , monitorJet.
eta());}
495 fill(
"jetMult_" , mult );
496 fill(
"jetMultBEff_", multBEff);
497 fill(
"jetMultBPur_", multBPur);
498 fill(
"jetMultBVtx_", multBVtx);
510 for(
int i=0;
i<int(mets.size());
i++ ){
513 if(met->begin()!=met->end()){
515 if(idx==0)
fill(
"metCalo_" , met->begin()->et());
516 if(idx==1)
fill(
"metTC_" , met->begin()->et());
517 if(idx==2)
fill(
"metPflow_", met->begin()->et());
518 mET = *(met->begin());
532 double wMass = eventKinematics.
massWBoson (correctedJets);
533 double topMass = eventKinematics.
massTopQuark(correctedJets);
534 if(wMass>=0 && topMass>=0) {
fill(
"massW_" , wMass );
fill(
"massTop_" , topMass);}
538 if(
logged_<=
hists_.find(
"eventLogger_")->second->getNbinsY()){
544 if(correctedJets.size()>0)
fill(
"eventLogger_", 3.5,
logged_+0.5, correctedJets[0].
pt());
545 if(correctedJets.size()>1)
fill(
"eventLogger_", 4.5,
logged_+0.5, correctedJets[1].
pt());
546 if(correctedJets.size()>2)
fill(
"eventLogger_", 5.5,
logged_+0.5, correctedJets[2].
pt());
547 if(correctedJets.size()>3)
fill(
"eventLogger_", 6.5,
logged_+0.5, correctedJets[3].
pt());
553 if(multBPur != 0 && mMultIso == 1 ){
554 cout<<bJetCand.
pt()<<
"\t"<<mu.
pt()<<
"\t"<<mET.
pt()<<endl;
555 double mtW = eventKinematics.
tmassWBoson(&mu,mET,bJetCand);
fill(
"MTWm_",mtW);
556 double Mlb = eventKinematics.
masslb(&mu,mET,bJetCand);
fill(
"mMub_", Mlb);
557 double MTT = eventKinematics.
tmassTopQuark(&mu,mET,bJetCand);
fill(
"mMTT_", MTT);
560 if(multBPur != 0 && eMultIso == 1 ){
561 double mtW = eventKinematics.
tmassWBoson(&mu,mET,bJetCand);
fill(
"MTWe_",mtW);
562 double Mlb = eventKinematics.
masslb(&mu,mET,bJetCand);
fill(
"mEb_", Mlb);
563 double MTT = eventKinematics.
tmassTopQuark(&mu,mET,bJetCand);
fill(
"eMTT_", MTT);
625 std::vector<edm::ParameterSet>
sel=cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
626 for(
unsigned int i=0; i<sel.size(); ++
i){
664 std::vector< edm::Handle<edm::View<reco::MET> > > mets;
674 if(vertex->empty() || !(*vertexSelect_)(vertex->front()))
return;
683 unsigned int passed=0;
688 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
692 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
697 if(step.
select(event)){ ++passed;
698 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
703 if(step.
select(event)){ ++passed;
704 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
709 if(step.
select(event, setup)){ ++passed;
710 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
713 if(
type==
"jets/pf" ){
715 if(step.
select(event, setup)){ ++passed;
716 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
719 if(
type==
"jets/calo" ){
722 if(step.
select(event, setup)){ ++passed;
723 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
728 if(step.
select(event)){ ++passed;
729 selection_[
key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets);
std::map< std::string, std::pair< edm::ParameterSet, TopHLTSingleLepton::MonitorEnsemble * > > selection_
T getParameter(std::string const &) const
edm::InputTag electronId_
electronId label
void book(std::string directory)
book histograms in subdirectory directory
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
tuple met
____________________________________________________________________________||
Level verbosity_
verbosity level for booking
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Jets made from CaloTowers.
bool acceptHLT(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
double masslb(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate mlb estimate
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate top quark mass estimate
edm::InputTag elecs_
input sources for monitoring
static const double WMASS
std::vector< edm::InputTag > mets_
considers a vector of METs
edm::EDGetTokenT< reco::JetIDValueMap > jetIDToken_
int logged_
number of logged interesting events
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecsToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void fill(const edm::Event &event, const edm::EventSetup &setup, edm::Handle< edm::TriggerResults > triggerTable, edm::Handle< edm::View< reco::Vertex > > pvs, edm::Handle< edm::View< reco::Muon > > muons, edm::Handle< edm::ValueMap< float > > electronId, edm::Handle< edm::View< reco::GsfElectron > > elecs, edm::Handle< edm::View< reco::Jet > > jets, edm::Handle< reco::JetIDValueMap > jetID, edm::Handle< reco::JetTagCollection > btagEff, edm::Handle< reco::JetTagCollection > btagPur, edm::Handle< reco::JetTagCollection > btagVtx, std::vector< edm::Handle< edm::View< reco::MET > > > mets)
fill monitor histograms with electronId and jetCorrections
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
double tmassTopQuark(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
edm::EDGetTokenT< edm::View< reco::Vertex > > pvsToken_
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken_
edm::EDGetTokenT< reco::JetTagCollection > btagPurToken_
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
virtual void scaleEnergy(double fScale)
scale energy of the jet
edm::InputTag vertex_
primary vertex
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
double lowerEdge_
mass window upper and lower edge
void triggerBinLabels(std::string channel, const std::vector< std::string > &labels)
set configurable labels for trigger monitoring histograms
edm::EDGetTokenT< reco::JetTagCollection > btagEffToken_
Jets made from PFObjects.
edm::InputTag btagEff_
btag discriminator labels
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::map< std::string, MonitorElement * > hists_
histogram container
DQMStore * store_
storage manager
edm::InputTag triggerTable_
trigger table
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
std::vector< std::string > triggerPaths_
trigger paths
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
edm::InputTag beamspot_
beamspot
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
edm::EDGetTokenT< edm::TriggerResults > triggerTableToken_
edm::EDGetTokenT< edm::View< reco::Muon > > muonsToken_
static const unsigned int MAXJETS
edm::InputTag jetIDLabel_
jetID as an extra selection type
std::vector< std::string > triggerPaths_
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
StringCutObjectSelector< reco::Vertex > * pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
bool select(const edm::Event &event)
apply selection
double tmassWBoson(reco::RecoCandidate *mu, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
std::vector< std::string > selectionOrder_
edm::EDGetTokenT< reco::JetTagCollection > btagVtxToken_
EventAuxiliary const & eventAuxiliary() const
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > metsTokens_
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
std::string jetCorrector_
jetCorrector
TopHLTSingleLeptonDQM(const edm::ParameterSet &cfg)
default constructor
std::string selectionStep(const std::string &label)
edm::InputTag triggerTable_
trigger table
static const double WMASS
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
edm::EDGetTokenT< edm::ValueMap< float > > electronIdToken_
volatile std::atomic< bool > shutdown_flag false
double btagEffWP_
btag working points
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::string label_
instance label
virtual float pt() const GCC11_FINAL
transverse momentum
std::string objectType(const std::string &label)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
EventNumber_t event() const
void setCurrentFolder(const std::string &fullpath)
std::vector< edm::InputTag > metsTemp_