13 namespace SingleTopTChannelLepton {
20 static const double WMASS = 80.4;
23 label_(label), pvSelect_(0), jetIDSelect_(0), includeBTag_(
false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
188 hists_[
"triggerEff_" ] =
store_->
book1D(
"TriggerEff" ,
"Eff(trigger)" , nPaths, 0., nPaths);
190 hists_[
"triggerMon_" ] =
store_->
book1D(
"TriggerMon" ,
"Mon(trigger)" , nPaths, 0., nPaths);
217 hists_[
"muonPFRelIso_" ] =
store_->
book1D(
"MuonPFRelIso",
"PFIso_{Rel}(#mu)", 50, 0., 1.);
218 hists_[
"muonRelIso_" ] =
store_->
book1D(
"MuonRelIso" ,
"Iso_{Rel}(#mu)" , 50, 0., 1.);
224 hists_[
"elecPFRelIso_" ] =
store_->
book1D(
"ElecPFRelIso" ,
"PFIso_{Rel}(e)", 50, 0., 1.);
227 hists_[
"jetMultBEff_"] =
store_->
book1D(
"JetMultBEff",
"N_{30}(b/eff)" , 10, 0., 10.);
229 hists_[
"jetBDiscEff_"] =
store_->
book1D(
"JetBDiscEff",
"Disc_{b/eff}(jet)", 100, 0., 10.);
244 hists_[
"TaggedJetEta_" ] =
store_->
book1D(
"TaggedJetEta" ,
"#eta (Tagged jet)" , 50, -5., 5.);
245 hists_[
"TaggedJetPt_" ] =
store_->
book1D(
"TaggedJetPt" ,
"pt_{L2L3}(Tagged jet)" , 60, 0., 300.);
248 hists_[
"UnTaggedJetEta_" ] =
store_->
book1D(
"UnTaggedJetEta" ,
"#eta (UnTagged jet)" , 50, -5., 5.);
249 hists_[
"UnTaggedJetPt_" ] =
store_->
book1D(
"UnTaggedJetPt" ,
"pt_{L2L3}(UnTagged jet)" , 60, 0., 300.);
253 hists_[
"FwdJetPt_" ] =
store_->
book1D(
"FwdJetPt" ,
"pt_{L2L3}(Fwd jet)" , 60, 0., 300.);
257 hists_[
"TaggedJetPtEta_" ] =
store_->
book2D(
"TaggedJetPt_Eta" ,
"(pt vs #eta)_{L2L3}(Tagged jet)" , 60, 0., 300., 50, -5., 5.);
260 hists_[
"UnTaggedJetPtEta_" ] =
store_->
book2D(
"UnTaggedJetPt_Eta" ,
"(pt vs #eta)_{L2L3}(UnTagged jet)" , 60, 0., 300., 50, -5., 5.);
272 hists_[
"muonDelXY_" ] =
store_->
book2D(
"MuonDelXY" ,
"d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
275 hists_[
"muonDelXY_" ]->setAxisTitle(
"x [cm]", 1);
hists_[
"muonDelXY_" ]->setAxisTitle(
"y [cm]", 2);
282 hists_[
"muonChHadIso_" ] =
store_->
book1D(
"MuonChHadIso" ,
"Iso_{ChHad}(#mu)" , 100, 0., 1.);
284 hists_[
"muonNeuHadIso_" ] =
store_->
book1D(
"MuonNeuHadIso" ,
"Iso_{NeuHad}(#mu)" , 100, 0., 1.);
289 hists_[
"elecChHadIso_" ] =
store_->
book1D(
"ElecChHadIso" ,
"Iso_{ChHad}(e)" , 100, 0., 1.);
291 hists_[
"elecNeuHadIso_" ] =
store_->
book1D(
"ElecNeuHadIso" ,
"Iso_{NeuHad}(e)" , 100, 0., 1.);
296 hists_[
"jetMultBPur_"] =
store_->
book1D(
"JetMultBPur",
"N_{30}(b/pur)" , 10, 0., 10.);
298 hists_[
"jetBDiscPur_"] =
store_->
book1D(
"JetBDiscPur",
"Disc_{b/pur}(Jet)", 200, -10., 10.);
300 hists_[
"jet1BDiscPur_"] =
store_->
book1D(
"Jet1BDiscPur",
"Disc_{b/pur}(Jet1)", 200, -10., 10.);
302 hists_[
"jet2BDiscPur_"] =
store_->
book1D(
"Jet2BDiscPur",
"Disc_{b/pur}(Jet2)", 200, -10., 10.);
306 hists_[
"jetMultBVtx_"] =
store_->
book1D(
"JetMultBVtx",
"N_{30}(b/vtx)" , 10, 0., 10.);
308 hists_[
"jetBDiscVtx_"] =
store_->
book1D(
"JetBDiscVtx",
"Disc_{b/vtx}(Jet)", 35, -1., 6.);
312 hists_[
"jetMultBCombVtx_"] =
store_->
book1D(
"JetMultBCombVtx",
"N_{30}(b/CSV)" , 10, 0., 10.);
314 hists_[
"jetBDiscCombVtx_"] =
store_->
book1D(
"JetBDiscCombVtx",
"Disc_{b/CSV}(Jet)", 60, -1., 2.);
316 hists_[
"jet1BDiscCombVtx_"] =
store_->
book1D(
"Jet1BDiscCombVtx",
"Disc_{b/CSV}(Jet1)", 60, -1., 2.);
318 hists_[
"jet2BDiscCombVtx_"] =
store_->
book1D(
"Jet2BDiscCombVtx",
"Disc_{b/CSV}(Jet2)", 60, -1., 2.);
322 hists_[
"jet1PtRaw_" ] =
store_->
book1D(
"Jet1PtRaw" ,
"pt_{Raw}(jet1)" , 60, 0., 300.);
324 hists_[
"jet2PtRaw_" ] =
store_->
book1D(
"Jet2PtRaw" ,
"pt_{Raw}(jet2)" , 60, 0., 300.);
327 hists_[
"eventLogger_"] =
store_->
book2D(
"EventLogger",
"Logged Events" , 9, 0., 9., 10, 0., 10.);
330 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
331 hists_[
"eventLogger_"]->setBinLabel( 1 ,
"Run" , 1);
332 hists_[
"eventLogger_"]->setBinLabel( 2 ,
"Block" , 1);
333 hists_[
"eventLogger_"]->setBinLabel( 3 ,
"Event" , 1);
334 hists_[
"eventLogger_"]->setBinLabel( 4 ,
"pt_{L2L3}(jet1)" , 1);
335 hists_[
"eventLogger_"]->setBinLabel( 5 ,
"pt_{L2L3}(jet2)" , 1);
336 hists_[
"eventLogger_"]->setBinLabel( 6 ,
"pt_{L2L3}(jet3)" , 1);
337 hists_[
"eventLogger_"]->setBinLabel( 7 ,
"pt_{L2L3}(jet4)" , 1);
338 hists_[
"eventLogger_"]->setBinLabel( 8 ,
"M_{W}" , 1);
339 hists_[
"eventLogger_"]->setBinLabel( 9 ,
"M_{Top}" , 1);
340 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts" , 2);
364 unsigned int pvMult = 0;
370 fill(
"pvMult_", pvMult );
382 if( !event.
getByLabel(
"offlineBeamSpot",recoBeamSpotHandle))
return;
383 beamSpot = *recoBeamSpotHandle;
405 unsigned int eMult=0, eMultIso=0;
406 std::vector<const reco::GsfElectron*> isoElecs;
410 unsigned int idx_gsf = 0;
411 for(elec_it=elecs->begin(); elec_it!=elecs->end(); ++elec_it){
413 if(elec_it->gsfElectronRef().isNull())
continue ;
416 if(elec->gsfTrack().
isNull())
continue ;
421 eID = (
int)(*electronId)[elecs_gsf->refAt(idx_gsf)];
425 if(!elecSelect || (*elecSelect)(*elec_it)){
426 double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
428 double isolationChHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumChargedHadronPt);
429 double isolationNeuHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumNeutralHadronEt);
430 double isolationPhoton = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumPhotonEt);
431 double PFisolationRel = (elec->pfIsolationVariables().sumChargedHadronPt+elec->pfIsolationVariables().sumNeutralHadronEt+elec->pfIsolationVariables().sumPhotonEt)/elec->pt();
435 fill(
"elecPt_" , elec->pt() );
436 fill(
"elecEta_", elec->eta());
437 fill(
"elecRelIso_" , isolationRel );
438 fill(
"elecPFRelIso_",PFisolationRel );
439 fill(
"elecChHadIso_" , isolationChHad );
440 fill(
"elecNeuHadIso_" , isolationNeuHad );
441 fill(
"elecPhIso_" , isolationPhoton );
446 ++eMult;
if( !elecIso || (*elecIso)(*elec_it)){
if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso; }
452 fill(
"elecMult_", eMult );
453 fill(
"elecMultIso_", eMultIso);
464 unsigned int mMult=0, mMultIso=0;
486 for(muonit = muons->begin(); muonit != muons->end(); ++muonit){
490 if(muonit->muonRef().isNull())
continue ;
493 if(muon->innerTrack().
isNull())
continue ;
500 if( muon->isGlobalMuon() ){
501 fill(
"muonDelZ_" , muon->globalTrack()->vz());
502 fill(
"muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy());
505 if( !muonSelect || (*muonSelect)(*muonit)) {
509 double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt();
510 double isolationChHad = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumChargedHadronPt);
511 double isolationNeuHad = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumNeutralHadronEt);
512 double isolationPhoton = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumPhotonEt);
513 double PFisolationRel = (muon->pfIsolationR04().sumChargedHadronPt + muon->pfIsolationR04().sumNeutralHadronEt + muon->pfIsolationR04().sumPhotonEt)/muon->pt();
522 fill(
"muonPt_" , muon->pt() );
523 fill(
"muonEta_" , muon->eta());
524 fill(
"muonRelIso_" , isolationRel );
525 fill(
"muonChHadIso_" , isolationChHad );
526 fill(
"muonNeuHadIso_" , isolationNeuHad );
527 fill(
"muonPhIso_" , isolationPhoton );
528 fill(
"muonPFRelIso_" , PFisolationRel );
533 if( !muonIso || (*muonIso)(*muonit)) {
if(mMultIso == 0) mu = *
muon; ++mMultIso;}
538 fill(
"muonMult_", mMult );
539 fill(
"muonMultIso_", mMultIso);
562 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
568 <<
"------------------------------------------------------------------------------------- \n"
569 <<
" No JetCorrectionsRecord available from EventSetup: \n"
570 <<
" - Jets will not be corrected. \n"
571 <<
" - If you want to change this add the following lines to your cfg file: \n"
573 <<
" ## load jet corrections \n"
574 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
575 <<
" process.prefer(\"ak5CaloL2L3\") \n"
577 <<
"------------------------------------------------------------------------------------- \n";
582 std::vector<reco::Jet> correctedJets;
583 unsigned int mult=0, multBEff=0, multBPur=0, multNoBPur=0, multBVtx=0, multBCombVtx=0;
593 vector<double> bJetDiscVal;
594 vector<double> NobJetDiscVal;
600 unsigned int idx =
jet-jets->begin();
601 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
602 if(
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
603 if(!(*
jetIDSelect_)((*jetID)[jets->refAt(idx)]))
continue;
608 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
611 if(!jetSelect(sel)){
continue;}
613 else if(dynamic_cast<const reco::PFJet*>(&*
jet)){
616 if(!jetSelect(sel))
continue;
621 if(!jetSelect(sel))
continue;
634 correctedJets.push_back(monitorJet);
642 if( (*btagVtx)[jetRef]>
btagVtxWP_ ) ++multBVtx;
647 TaggedJetCand = monitorJet;
649 bJetDiscVal.push_back((*btagPur)[jetRef]);
652 else if (multBPur == 1){
653 bJetDiscVal.push_back((*btagPur)[jetRef]);
654 if (bJetDiscVal[1]>bJetDiscVal[0])
655 TaggedJetCand = monitorJet;
662 if (multNoBPur == 0){
663 UnTaggedJetCand = monitorJet;
664 NobJetDiscVal.push_back((*btagPur)[jetRef]);
667 else if (multNoBPur == 1){
668 NobJetDiscVal.push_back((*btagPur)[jetRef]);
669 if (NobJetDiscVal[1]<NobJetDiscVal[0])
670 UnTaggedJetCand = monitorJet;
676 if( (*btagEff)[jetRef]>
btagEffWP_ ) ++multBEff;
680 fill(
"jet1BDiscPur_", (*btagPur)[jetRef]);
681 fill(
"jet1BDiscCombVtx_", (*btagCombVtx)[jetRef]);
685 fill(
"jet2BDiscPur_", (*btagPur)[jetRef]);
686 fill(
"jet2BDiscCombVtx_", (*btagCombVtx)[jetRef]);
689 fill(
"jetBDiscEff_", (*btagEff)[jetRef]);
690 fill(
"jetBDiscPur_", (*btagPur)[jetRef]);
691 fill(
"jetBDiscVtx_", (*btagVtx)[jetRef]);
692 fill(
"jetBDiscCombVtx_", (*btagCombVtx)[jetRef]);
697 fill(
"jet1Pt_" , monitorJet.
pt());
698 fill(
"jet1Eta_", monitorJet.
eta());
699 fill(
"jet1PtRaw_",
jet->pt() );
700 FwdJetCand = monitorJet;
705 fill(
"jet2Pt_" , monitorJet.
pt());
706 fill(
"jet2Eta_", monitorJet.
eta());
707 fill(
"jet2PtRaw_",
jet->pt() );
710 FwdJetCand = monitorJet;
713 fill(
"FwdJetPt_" , FwdJetCand.
pt());
714 fill(
"FwdJetEta_", FwdJetCand.
eta());
722 if (multNoBPur == 1 && multBPur == 1){
724 fill(
"TaggedJetPtEta_" , TaggedJetCand.
pt(), TaggedJetCand.
eta());
725 fill(
"UnTaggedJetPtEta_" , UnTaggedJetCand.
pt(), UnTaggedJetCand.
eta());
728 fill(
"TaggedJetPt_" , TaggedJetCand.
pt());
729 fill(
"TaggedJetEta_", TaggedJetCand.
eta());
730 fill(
"UnTaggedJetPt_" , UnTaggedJetCand.
pt());
731 fill(
"UnTaggedJetEta_", UnTaggedJetCand.
eta());
734 fill(
"jetMult_" , mult );
735 fill(
"jetMultBEff_", multBEff);
736 fill(
"jetMultBPur_", multBPur);
737 fill(
"jetMultBVtx_", multBVtx);
738 fill(
"jetMultBCombVtx_", multBCombVtx);
750 for(std::vector<edm::InputTag>::const_iterator met_=
mets_.begin(); met_!=
mets_.end(); ++met_){
753 if(met->begin()!=met->end()){
754 unsigned int idx=met_-
mets_.begin();
755 if(idx==0) {
fill(
"metCalo_" , met->begin()->et()); }
756 if(idx==1) {
fill(
"metTC_" , met->begin()->et()); }
757 if(idx==2) {
fill(
"metPflow_", met->begin()->et()); mET = *(met->begin()); }
773 double wMass = eventKinematics.
massWBoson (correctedJets);
774 double topMass = eventKinematics.
massTopQuark(correctedJets);
775 if(wMass>=0 && topMass>=0) {
fill(
"massW_" , wMass );
fill(
"massTop_" , topMass);}
779 if(
logged_<=
hists_.find(
"eventLogger_")->second->getNbinsY()){
785 if(correctedJets.size()>0)
fill(
"eventLogger_", 3.5,
logged_+0.5, correctedJets[0].
pt());
786 if(correctedJets.size()>1)
fill(
"eventLogger_", 4.5,
logged_+0.5, correctedJets[1].
pt());
787 if(correctedJets.size()>2)
fill(
"eventLogger_", 5.5,
logged_+0.5, correctedJets[2].
pt());
788 if(correctedJets.size()>3)
fill(
"eventLogger_", 6.5,
logged_+0.5, correctedJets[3].
pt());
795 if(multBPur != 0 && mMultIso == 1 ){
797 double mtW = eventKinematics.
tmassWBoson(&mu,mET,TaggedJetCand);
fill(
"MTWm_",mtW);
798 double MTT = eventKinematics.
tmassTopQuark(&mu,mET,TaggedJetCand);
fill(
"mMTT_", MTT);
802 if(multBPur != 0 && eMultIso == 1 ){
803 double mtW = eventKinematics.
tmassWBoson(&e,mET,TaggedJetCand);
fill(
"MTWe_",mtW);
804 double MTT = eventKinematics.
tmassTopQuark(&e,mET,TaggedJetCand);
fill(
"eMTT_", MTT);
832 std::vector<edm::ParameterSet>
sel=cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
833 for(
unsigned int i=0;
i<sel.size(); ++
i){
865 unsigned int passed=0;
878 if(step.
select(event)){ ++passed;
882 if(
type==
"elecs/pf"){
884 if(step.
select(event,
"electron")){ ++passed;
890 if(step.
select(event)){ ++passed;
894 if(
type==
"muons/pf"){
897 if(step.
select(event,
"muon")){++passed;
904 if(step.
select(event, setup)){ ++passed;
908 if(
type==
"jets/pf" ){
915 if(step.
select(event, setup)){ ++passed;
918 else if (step2.
select(event, setup)){ ++passed;
923 if(
type==
"jets/calo" ){
925 if(step.
select(event, setup)){ ++passed;
931 if(step.
select(event)){ ++passed;
std::vector< std::string > selectionOrder_
std::string objectType(const std::string &label)
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
double btagEffWP_
btag working points
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.
bool select(const edm::Event &event)
apply selection
std::vector< std::string > triggerPaths_
trigger paths
Level verbosity_
verbosity level for booking
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
static const double WMASS
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
std::vector< ParameterSet > VParameterSet
Base class for all types of Jets.
int logged_
number of logged interesting events
edm::InputTag elecs_
input sources for monitoring
edm::InputTag triggerTable_
trigger table
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
virtual void scaleEnergy(double fScale)
scale energy of the jet
edm::InputTag beamspot_
beamspot
std::string muonIso_
extra isolation criterion on muon
std::vector< std::string > triggerPaths_
edm::InputTag jetIDLabel_
jetID as an extra selection type
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
std::string muonSelect_
extra selection on muons
std::map< std::string, std::pair< edm::ParameterSet, SingleTopTChannelLepton::MonitorEnsemble * > > selection_
Jets made from PFObjects.
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
SingleTopTChannelLeptonDQM(const edm::ParameterSet &cfg)
default constructor
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
edm::InputTag btagCombVtx_
StringCutObjectSelector< reco::Vertex > * pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
edm::InputTag vertex_
primary vertex
edm::InputTag btagEff_
btag discriminator labels
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
Helper class for the calculation of a top and a W boson mass estime.
std::string 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
bool isNull() const
Checks for null.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Abs< T >::type abs(const T &t)
double tmassTopQuark(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
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 getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::map< std::string, MonitorElement * > hists_
histogram container
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
EventAuxiliary const & eventAuxiliary() const
std::string selectionStep(const std::string &label)
double tmassWBoson(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
edm::InputTag triggerTable_
trigger table
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 ...
static const unsigned int MAXJETS
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
std::string jetCorrector_
jetCorrector
volatile std::atomic< bool > shutdown_flag false
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
DQMStore * store_
storage manager
edm::InputTag electronId_
electronId label
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
EventNumber_t event() const
void setCurrentFolder(const std::string &fullpath)
void book(std::string directory)
book histograms in subdirectory directory
std::string label_
instance label
std::vector< edm::InputTag > mets_
considers a vector of METs
std::string elecIso_
extra isolation criterion on electron