12 namespace TopSingleLepton {
19 static const double WMASS = 80.4;
22 label_(label), elecIso_(0), elecSelect_(0), pvSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(
false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
183 hists_[
"triggerEff_" ] =
store_->
book1D(
"TriggerEff" ,
"Eff(trigger)" , nPaths, 0., nPaths);
185 hists_[
"triggerMon_" ] =
store_->
book1D(
"TriggerMon" ,
"Mon(trigger)" , nPaths, 0., nPaths);
203 hists_[
"muonRelIso_" ] =
store_->
book1D(
"MuonRelIso" ,
"Iso_{Rel}(#mu)" , 50, 0., 1.);
211 hists_[
"jetBDiscEff_"] =
store_->
book1D(
"JetBDiscEff",
"Disc_{TCHE}(jet)", 100, 0., 10.);
235 hists_[
"muonDelXY_" ] =
store_->
book2D(
"MuonDelXY" ,
"d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
238 hists_[
"muonDelXY_" ]->setAxisTitle(
"x [cm]", 1);
hists_[
"muonDelXY_" ]->setAxisTitle(
"y [cm]", 2);
244 hists_[
"muonTrkIso_" ] =
store_->
book1D(
"MuonTrkIso" ,
"Iso_{Trk}(#mu)" , 50, 0., 1.);
246 hists_[
"muonCalIso_" ] =
store_->
book1D(
"MuonCalIso" ,
"Iso_{Ecal}(#mu)" , 50, 0., 1.);
254 hists_[
"jetBDiscPur_"] =
store_->
book1D(
"JetBDiscPur",
"Disc_{TCHP}(Jet)", 100, 0., 10.);
256 hists_[
"jetMultBVtx_"] =
store_->
book1D(
"JetMultBVtx",
"N_{30}(SSVHE)" , 10, 0., 10.);
258 hists_[
"jetBDiscVtx_"] =
store_->
book1D(
"JetBDiscVtx",
"Disc_{SSVHE}(Jet)", 35, -1., 6.);
262 hists_[
"jetBCVtx_"] =
store_->
book1D(
"JetDiscCSV" ,
"Disc_{CSV}(JET)" , 100, -1., 2.);
264 hists_[
"jet1PtRaw_" ] =
store_->
book1D(
"Jet1PtRaw" ,
"pt_{Raw}(jet1)" , 60, 0., 300.);
266 hists_[
"jet2PtRaw_" ] =
store_->
book1D(
"Jet2PtRaw" ,
"pt_{Raw}(jet2)" , 60, 0., 300.);
268 hists_[
"jet3PtRaw_" ] =
store_->
book1D(
"Jet3PtRaw" ,
"pt_{Raw}(jet3)" , 60, 0., 300.);
270 hists_[
"jet4PtRaw_" ] =
store_->
book1D(
"Jet4PtRaw" ,
"pt_{Raw}(jet4)" , 60, 0., 300.);
272 hists_[
"eventLogger_"] =
store_->
book2D(
"EventLogger",
"Logged Events" , 9, 0., 9., 10, 0., 10.);
275 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
276 hists_[
"eventLogger_"]->setBinLabel( 1 ,
"Run" , 1);
277 hists_[
"eventLogger_"]->setBinLabel( 2 ,
"Block" , 1);
278 hists_[
"eventLogger_"]->setBinLabel( 3 ,
"Event" , 1);
279 hists_[
"eventLogger_"]->setBinLabel( 4 ,
"pt_{L2L3}(jet1)" , 1);
280 hists_[
"eventLogger_"]->setBinLabel( 5 ,
"pt_{L2L3}(jet2)" , 1);
281 hists_[
"eventLogger_"]->setBinLabel( 6 ,
"pt_{L2L3}(jet3)" , 1);
282 hists_[
"eventLogger_"]->setBinLabel( 7 ,
"pt_{L2L3}(jet4)" , 1);
283 hists_[
"eventLogger_"]->setBinLabel( 8 ,
"M_{W}" , 1);
284 hists_[
"eventLogger_"]->setBinLabel( 9 ,
"M_{Top}" , 1);
285 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts" , 2);
309 unsigned int pvMult = 0;
314 fill(
"pvMult_", pvMult );
327 double dummy=5.;
fill(
"InstLumi_", dummy);
349 unsigned int eMult=0, eMultIso=0;
350 std::vector<const reco::GsfElectron*> isoElecs;
352 unsigned int idx = elec-elecs->begin();
356 double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt());
357 double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt());
358 double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
361 fill(
"elecPt_" , elec->pt() );
362 fill(
"elecEta_", elec->eta());
363 fill(
"elecRelIso_" , isolationRel );
364 fill(
"elecTrkIso_" , isolationTrk );
365 fill(
"elecCalIso_" , isolationCal );
369 ++eMult;
if(!
elecIso_ || (*
elecIso_)(*elec)){ isoElecs.push_back(&(*elec)); ++eMultIso;}
373 fill(
"elecMult_", eMult );
374 fill(
"elecMultIso_", eMultIso);
385 unsigned int mMult=0, mMultIso=0;
392 if(
muon->isGlobalMuon() ){
393 fill(
"muonDelZ_" ,
muon->globalTrack()->vz());
394 fill(
"muonDelXY_",
muon->globalTrack()->vx(),
muon->globalTrack()->vy());
397 double isolationTrk =
muon->pt()/(
muon->pt()+
muon->isolationR03().sumPt);
398 double isolationCal =
muon->pt()/(
muon->pt()+
muon->isolationR03().emEt+
muon->isolationR03().hadEt);
399 double isolationRel = (
muon->isolationR03().sumPt+
muon->isolationR03().emEt+
muon->isolationR03().hadEt)/
muon->pt();
404 fill(
"muonRelIso_" , isolationRel );
405 fill(
"muonTrkIso_" , isolationTrk );
406 fill(
"muonCalIso_" , isolationCal );
412 fill(
"muonMult_", mMult );
413 fill(
"muonMultIso_", mMultIso);
435 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
441 <<
"------------------------------------------------------------------------------------- \n"
442 <<
" No JetCorrectionsRecord available from EventSetup: \n"
443 <<
" - Jets will not be corrected. \n"
444 <<
" - If you want to change this add the following lines to your cfg file: \n"
446 <<
" ## load jet corrections \n"
447 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
448 <<
" process.prefer(\"ak4CaloL2L3\") \n"
450 <<
"------------------------------------------------------------------------------------- \n";
455 std::vector<reco::Jet> correctedJets;
456 std::vector<double> JetTagValues;
457 unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0, multCSV=0;
472 unsigned int idx =
jet-jets->begin();
473 if(
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
474 if(!(*
jetIDSelect_)((*jetID)[jets->refAt(idx)]))
continue;
477 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
481 else if(dynamic_cast<const reco::PFJet*>(&*
jet)){
497 correctedJets.push_back(monitorJet);
502 fill(
"jetBDiscEff_", (*btagEff)[jetRef]);
if( (*btagEff)[jetRef]>
btagEffWP_ ) ++multBEff;
503 fill(
"jetBDiscPur_", (*btagPur)[jetRef]);
if( (*btagPur)[jetRef]>
btagPurWP_ ) ++multBPur;
504 fill(
"jetBDiscVtx_", (*btagVtx)[jetRef]);
if( (*btagVtx)[jetRef]>
btagVtxWP_ ) ++multBVtx;
505 fill(
"jetBCVtx_" , (*btagCSV)[jetRef]);
if( (*btagCSV)[jetRef]>
btagCSVWP_ ) ++multCSV;
508 JetTagValues.push_back( (*btagCSV)[jetRef]);
511 if(idx==0) {
fill(
"jet1Pt_" , monitorJet.
pt());
fill(
"jet1PtRaw_",
jet->pt() );
512 fill(
"jet1Eta_", monitorJet.
eta());
514 if(idx==1) {
fill(
"jet2Pt_" , monitorJet.
pt());
fill(
"jet2PtRaw_",
jet->pt() );
515 fill(
"jet2Eta_", monitorJet.
eta());
517 if(idx==2) {
fill(
"jet3Pt_" , monitorJet.
pt());
fill(
"jet3PtRaw_",
jet->pt() );
518 fill(
"jet3Eta_", monitorJet.
eta());
520 if(idx==3) {
fill(
"jet4Pt_" , monitorJet.
pt());
fill(
"jet4PtRaw_",
jet->pt() );
521 fill(
"jet4Eta_", monitorJet.
eta());
524 fill(
"jetMult_" , mult );
525 fill(
"jetMultBEff_" , multBEff);
526 fill(
"jetMultBPur_" , multBPur);
527 fill(
"jetMultBVtx_" , multBVtx);
528 fill(
"jetMultCSVtx_", multCSV );
542 if(met->begin()!=met->end()){
543 unsigned int idx=met_-
mets_.begin();
544 if(idx==0)
fill(
"metCalo_" , met->begin()->et());
545 if(idx==1)
fill(
"metTC_" , met->begin()->et());
546 if(idx==2)
fill(
"metPflow_", met->begin()->et());
561 double wMass = eventKinematics.
massWBoson (correctedJets);
562 double topMass = eventKinematics.
massTopQuark (correctedJets);
563 if(wMass>=0 && topMass>=0 ) {
fill(
"massW_" , wMass );
fill(
"massTop_" , topMass);}
568 if (correctedJets.size() != JetTagValues.size())
return;
570 if (btopMass>=0)
fill(
"massBTop_", btopMass);
575 if(
logged_<=
hists_.find(
"eventLogger_")->second->getNbinsY()){
581 if(correctedJets.size()>0)
fill(
"eventLogger_", 3.5,
logged_+0.5, correctedJets[0].
pt());
582 if(correctedJets.size()>1)
fill(
"eventLogger_", 4.5,
logged_+0.5, correctedJets[1].
pt());
583 if(correctedJets.size()>2)
fill(
"eventLogger_", 5.5,
logged_+0.5, correctedJets[2].
pt());
584 if(correctedJets.size()>3)
fill(
"eventLogger_", 6.5,
logged_+0.5, correctedJets[3].
pt());
596 MuonStep(0), ElectronStep(0), PvStep(0), METStep(0)
621 std::vector<edm::ParameterSet>
sel=cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
622 for(
unsigned int i=0;
i<sel.size(); ++
i){
641 if(
type==
"jets/pf" ){
644 if(
type==
"jets/calo" ){
668 unsigned int passed=0;
669 unsigned int nJetSteps = -1;
670 unsigned int nPFJetSteps = -1;
671 unsigned int nCaloJetSteps = -1;
706 if(
type==
"jets/pf" ){
714 if(
type==
"jets/calo" ){
std::map< std::string, MonitorElement * > hists_
histogram container
T getParameter(std::string const &) const
int logged_
number of logged interesting events
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
double btagEffWP_
btag working points
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
tuple met
____________________________________________________________________________||
double massBTopQuark(const std::vector< reco::Jet > &jets, std::vector< double > VbtagWP, double btagWP_)
calculate b-tagged t-quark mass estimate
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
virtual float pt() const
transverse momentum
SelectionStep< reco::MET > * METStep
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
static const double WMASS
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::string > triggerPaths_
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
bool selectVertex(const edm::Event &event)
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
TopSingleLeptonDQM(const edm::ParameterSet &cfg)
default constructor
edm::EDGetTokenT< reco::BeamSpot > beamspot__
virtual void scaleEnergy(double fScale)
scale energy of the jet
edm::EDGetTokenT< reco::JetTagCollection > btagCSV_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_
Jets made from PFObjects.
std::vector< std::string > triggerPaths_
trigger paths
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
std::vector< std::string > selectionOrder_
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
std::string selectionStep(const std::string &label)
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Level verbosity_
verbosity level for booking
StringCutObjectSelector< reco::Vertex > * pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
static const double WMASS
double lowerEdge_
mass window upper and lower edge
std::vector< SelectionStep< reco::Jet > * > JetSteps
SelectionStep< reco::Muon > * MuonStep
Helper class for the calculation of a top and a W boson mass estime.
std::map< std::string, std::pair< edm::ParameterSet, TopSingleLepton::MonitorEnsemble * > > selection_
virtual float eta() const
momentum pseudorapidity
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::InputTag beamspot_
beamspot
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
void book(std::string directory)
book histograms in subdirectory directory
SelectionStep< reco::GsfElectron > * ElectronStep
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
StringCutObjectSelector< reco::GsfElectron > * elecIso_
extra isolation criterion on electron
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
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
std::vector< SelectionStep< reco::PFJet > * > PFJetSteps
EventAuxiliary const & eventAuxiliary() const
SelectionStep< reco::Vertex > * PvStep
std::string label_
instance label
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
edm::EDGetTokenT< edm::View< reco::Muon > > muons_
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
std::vector< SelectionStep< reco::CaloJet > * > CaloJetSteps
std::string objectType(const std::string &label)
StringCutObjectSelector< reco::Muon > * muonIso_
extra isolation criterion on muon
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
bool isUninitialized() const
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
volatile std::atomic< bool > shutdown_flag false
std::string jetCorrector_
jetCorrector
static const unsigned int MAXJETS
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
EventNumber_t event() const
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
void setCurrentFolder(const std::string &fullpath)
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
DQMStore * store_
storage manager