9 namespace TopSingleLepton {
16 static const double WMASS = 80.4;
19 label_(label), elecIso_(0), elecSelect_(0), pvSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(
false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
173 hists_[
"triggerEff_" ] =
store_->
book1D(
"TriggerEff" ,
"Eff(trigger)" , nPaths, 0., nPaths);
175 hists_[
"triggerMon_" ] =
store_->
book1D(
"TriggerMon" ,
"Mon(trigger)" , nPaths, 0., nPaths);
192 hists_[
"muonRelIso_" ] =
store_->
book1D(
"MuonRelIso" ,
"Iso_{Rel}(#mu)" , 50, 0., 1.);
198 hists_[
"jetMultBEff_"] =
store_->
book1D(
"JetMultBEff",
"N_{30}(b/eff)" , 10, 0., 10.);
200 hists_[
"jetBDiscEff_"] =
store_->
book1D(
"JetBDiscEff",
"Disc_{b/eff}(jet)", 100, 0., 10.);
216 hists_[
"muonDelXY_" ] =
store_->
book2D(
"MuonDelXY" ,
"d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
219 hists_[
"muonDelXY_" ]->setAxisTitle(
"x [cm]", 1);
hists_[
"muonDelXY_" ]->setAxisTitle(
"y [cm]", 2);
225 hists_[
"muonTrkIso_" ] =
store_->
book1D(
"MuonTrkIso" ,
"Iso_{Trk}(#mu)" , 50, 0., 1.);
227 hists_[
"muonCalIso_" ] =
store_->
book1D(
"MuonCalIso" ,
"Iso_{Ecal}(#mu)" , 50, 0., 1.);
233 hists_[
"jetMultBPur_"] =
store_->
book1D(
"JetMultBPur",
"N_{30}(b/pur)" , 10, 0., 10.);
235 hists_[
"jetBDiscPur_"] =
store_->
book1D(
"JetBDiscPur",
"Disc_{b/pur}(Jet)", 100, 0., 10.);
237 hists_[
"jetMultBVtx_"] =
store_->
book1D(
"JetMultBVtx",
"N_{30}(b/vtx)" , 10, 0., 10.);
239 hists_[
"jetBDiscVtx_"] =
store_->
book1D(
"JetBDiscVtx",
"Disc_{b/vtx}(Jet)", 35, -1., 6.);
241 hists_[
"jet1PtRaw_" ] =
store_->
book1D(
"Jet1PtRaw" ,
"pt_{Raw}(jet1)" , 60, 0., 300.);
243 hists_[
"jet2PtRaw_" ] =
store_->
book1D(
"Jet2PtRaw" ,
"pt_{Raw}(jet2)" , 60, 0., 300.);
245 hists_[
"jet3PtRaw_" ] =
store_->
book1D(
"Jet3PtRaw" ,
"pt_{Raw}(jet3)" , 60, 0., 300.);
247 hists_[
"jet4PtRaw_" ] =
store_->
book1D(
"Jet4PtRaw" ,
"pt_{Raw}(jet4)" , 60, 0., 300.);
249 hists_[
"eventLogger_"] =
store_->
book2D(
"EventLogger",
"Logged Events" , 9, 0., 9., 10, 0., 10.);
252 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
253 hists_[
"eventLogger_"]->setBinLabel( 1 ,
"Run" , 1);
254 hists_[
"eventLogger_"]->setBinLabel( 2 ,
"Block" , 1);
255 hists_[
"eventLogger_"]->setBinLabel( 3 ,
"Event" , 1);
256 hists_[
"eventLogger_"]->setBinLabel( 4 ,
"pt_{L2L3}(jet1)" , 1);
257 hists_[
"eventLogger_"]->setBinLabel( 5 ,
"pt_{L2L3}(jet2)" , 1);
258 hists_[
"eventLogger_"]->setBinLabel( 6 ,
"pt_{L2L3}(jet3)" , 1);
259 hists_[
"eventLogger_"]->setBinLabel( 7 ,
"pt_{L2L3}(jet4)" , 1);
260 hists_[
"eventLogger_"]->setBinLabel( 8 ,
"M_{W}" , 1);
261 hists_[
"eventLogger_"]->setBinLabel( 9 ,
"M_{Top}" , 1);
262 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts" , 2);
285 unsigned int pvMult = 0;
290 fill(
"pvMult_", pvMult );
311 unsigned int eMult=0, eMultIso=0;
312 std::vector<const reco::GsfElectron*> isoElecs;
314 unsigned int idx = elec-elecs->begin();
318 double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt());
319 double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt());
320 double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
323 fill(
"elecPt_" , elec->pt() );
324 fill(
"elecEta_", elec->eta());
325 fill(
"elecRelIso_" , isolationRel );
326 fill(
"elecTrkIso_" , isolationTrk );
327 fill(
"elecCalIso_" , isolationCal );
331 ++eMult;
if(!
elecIso_ || (*
elecIso_)(*elec)){ isoElecs.push_back(&(*elec)); ++eMultIso;}
335 fill(
"elecMult_", eMult );
336 fill(
"elecMultIso_", eMultIso);
347 unsigned int mMult=0, mMultIso=0;
354 if(
muon->isGlobalMuon() ){
355 fill(
"muonDelZ_" ,
muon->globalTrack()->vz());
356 fill(
"muonDelXY_",
muon->globalTrack()->vx(),
muon->globalTrack()->vy());
359 double isolationTrk =
muon->pt()/(
muon->pt()+
muon->isolationR03().sumPt);
360 double isolationCal =
muon->pt()/(
muon->pt()+
muon->isolationR03().emEt+
muon->isolationR03().hadEt);
361 double isolationRel = (
muon->isolationR03().sumPt+
muon->isolationR03().emEt+
muon->isolationR03().hadEt)/
muon->pt();
366 fill(
"muonRelIso_" , isolationRel );
367 fill(
"muonTrkIso_" , isolationTrk );
368 fill(
"muonCalIso_" , isolationCal );
374 fill(
"muonMult_", mMult );
375 fill(
"muonMultIso_", mMultIso);
396 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
402 <<
"------------------------------------------------------------------------------------- \n"
403 <<
" No JetCorrectionsRecord available from EventSetup: \n"
404 <<
" - Jets will not be corrected. \n"
405 <<
" - If you want to change this add the following lines to your cfg file: \n"
407 <<
" ## load jet corrections \n"
408 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
409 <<
" process.prefer(\"ak5CaloL2L3\") \n"
411 <<
"------------------------------------------------------------------------------------- \n";
416 std::vector<reco::Jet> correctedJets;
417 unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0;
429 unsigned int idx =
jet-jets->begin();
430 if(
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
431 if(!(*
jetIDSelect_)((*jetID)[jets->refAt(idx)]))
continue;
434 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
438 else if(dynamic_cast<const reco::PFJet*>(&*
jet)){
454 correctedJets.push_back(monitorJet);
459 fill(
"jetBDiscEff_", (*btagEff)[jetRef]);
if( (*btagEff)[jetRef]>
btagEffWP_ ) ++multBEff;
460 fill(
"jetBDiscPur_", (*btagPur)[jetRef]);
if( (*btagPur)[jetRef]>
btagPurWP_ ) ++multBPur;
461 fill(
"jetBDiscVtx_", (*btagVtx)[jetRef]);
if( (*btagVtx)[jetRef]>
btagVtxWP_ ) ++multBVtx;
464 if(idx==0) {
fill(
"jet1Pt_" , monitorJet.
pt());
fill(
"jet1PtRaw_",
jet->pt() );}
465 if(idx==1) {
fill(
"jet2Pt_" , monitorJet.
pt());
fill(
"jet2PtRaw_",
jet->pt() );}
466 if(idx==2) {
fill(
"jet3Pt_" , monitorJet.
pt());
fill(
"jet3PtRaw_",
jet->pt() );}
467 if(idx==3) {
fill(
"jet4Pt_" , monitorJet.
pt());
fill(
"jet4PtRaw_",
jet->pt() );}
469 fill(
"jetMult_" , mult );
470 fill(
"jetMultBEff_", multBEff);
471 fill(
"jetMultBPur_", multBPur);
472 fill(
"jetMultBVtx_", multBVtx);
483 for(std::vector<edm::InputTag>::const_iterator met_=
mets_.begin(); met_!=
mets_.end(); ++met_){
486 if(met->begin()!=met->end()){
487 unsigned int idx=met_-
mets_.begin();
488 if(idx==0)
fill(
"metCalo_" , met->begin()->et());
489 if(idx==1)
fill(
"metTC_" , met->begin()->et());
490 if(idx==2)
fill(
"metPflow_", met->begin()->et());
504 double wMass = eventKinematics.
massWBoson (correctedJets);
505 double topMass = eventKinematics.
massTopQuark(correctedJets);
506 if(wMass>=0 && topMass>=0) {
fill(
"massW_" , wMass );
fill(
"massTop_" , topMass);}
510 if(
logged_<=
hists_.find(
"eventLogger_")->second->getNbinsY()){
516 if(correctedJets.size()>0)
fill(
"eventLogger_", 3.5,
logged_+0.5, correctedJets[0].pt());
517 if(correctedJets.size()>1)
fill(
"eventLogger_", 4.5,
logged_+0.5, correctedJets[1].pt());
518 if(correctedJets.size()>2)
fill(
"eventLogger_", 5.5,
logged_+0.5, correctedJets[2].pt());
519 if(correctedJets.size()>3)
fill(
"eventLogger_", 6.5,
logged_+0.5, correctedJets[3].pt());
551 std::vector<edm::ParameterSet>
sel=cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
552 for(
unsigned int i=0;
i<sel.size(); ++
i){
573 unsigned int passed=0;
582 if(step.
select(event)){ ++passed;
588 if(step.
select(event)){ ++passed;
600 if(step.
select(event, setup)){ ++passed;
604 if(
type==
"jets/pf" ){
606 if(step.
select(event, setup)){ ++passed;
610 if(
type==
"jets/calo" ){
612 if(step.
select(event, setup)){ ++passed;
618 if(step.
select(event)){ ++passed;
std::map< std::string, MonitorElement * > hists_
histogram container
T getParameter(std::string const &) const
int logged_
number of logged interesting events
double btagEffWP_
btag working points
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
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
edm::InputTag elecs_
input sources for monitoring
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::InputTag triggerTable_
trigger table
std::vector< edm::InputTag > mets_
considers a vector of METs
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)
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
TopSingleLeptonDQM(const edm::ParameterSet &cfg)
default constructor
virtual void scaleEnergy(double fScale)
scale energy of the jet
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
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::string selectionStep(const std::string &label)
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
edm::InputTag vertex_
primary vertex
static const double WMASS
double lowerEdge_
mass window upper and lower edge
edm::InputTag btagEff_
btag discriminator labels
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_
edm::InputTag beamspot_
beamspot
StringCutObjectSelector< reco::Muon > * muonSelect_
extra selection on muons
void book(std::string directory)
book histograms in subdirectory directory
edm::InputTag triggerTable_
trigger table
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
EventAuxiliary const & eventAuxiliary() const
edm::InputTag jetIDLabel_
jetID as an extra selection type
std::string label_
instance label
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 ...
StringCutObjectSelector< reco::GsfElectron > * elecSelect_
extra selection on electrons
Templated helper class to allow a selection on a certain object collection.
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
edm::InputTag electronId_
electronId label
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
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.
virtual float pt() const GCC11_FINAL
transverse momentum
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
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
DQMStore * store_
storage manager