8 namespace TopSingleLepton {
15 static const double WMASS = 80.4;
18 label_(label), elecIso_(0), elecSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(
false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
33 if( elecExtras.
existsAs<std::string>(
"select") ){
38 if( elecExtras.
existsAs<std::string>(
"isolation") ){
55 if( muonExtras.
existsAs<std::string>(
"select") ){
60 if( muonExtras.
existsAs<std::string>(
"isolation") ){
71 if( jetExtras.
existsAs<std::string>(
"jetCorrector") ){
83 if( jetExtras.
existsAs<std::string>(
"select") ){
124 if(monitoring.
getParameter<std::string>(
"verbosity") ==
"DEBUG" )
126 if(monitoring.
getParameter<std::string>(
"verbosity") ==
"VERBOSE" )
128 if(monitoring.
getParameter<std::string>(
"verbosity") ==
"STANDARD")
162 hists_[
"triggerEff_" ] =
store_->
book1D(
"TriggerEff" ,
"Eff(trigger)" , nPaths, 0., nPaths);
164 hists_[
"triggerMon_" ] =
store_->
book1D(
"TriggerMon" ,
"Mon(trigger)" , nPaths, 0., nPaths);
181 hists_[
"muonRelIso_" ] =
store_->
book1D(
"MuonRelIso" ,
"Iso_{Rel}(#mu)" , 50, 0., 1.);
187 hists_[
"jetMultBEff_"] =
store_->
book1D(
"JetMultBEff",
"N_{30}(b/eff)" , 10, 0., 10.);
189 hists_[
"jetBDiscEff_"] =
store_->
book1D(
"JetBDiscEff",
"Disc_{b/eff}(jet)", 100, 0., 10.);
205 hists_[
"muonDelXY_" ] =
store_->
book2D(
"MuonDelXY" ,
"d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
208 hists_[
"muonDelXY_" ]->setAxisTitle(
"x [cm]", 1);
hists_[
"muonDelXY_" ]->setAxisTitle(
"y [cm]", 2);
214 hists_[
"muonTrkIso_" ] =
store_->
book1D(
"MuonTrkIso" ,
"Iso_{Trk}(#mu)" , 50, 0., 1.);
216 hists_[
"muonCalIso_" ] =
store_->
book1D(
"MuonCalIso" ,
"Iso_{Ecal}(#mu)" , 50, 0., 1.);
222 hists_[
"jetMultBPur_"] =
store_->
book1D(
"JetMultBPur",
"N_{30}(b/pur)" , 10, 0., 10.);
224 hists_[
"jetBDiscPur_"] =
store_->
book1D(
"JetBDiscPur",
"Disc_{b/pur}(Jet)", 100, 0., 10.);
226 hists_[
"jetMultBVtx_"] =
store_->
book1D(
"JetMultBVtx",
"N_{30}(b/vtx)" , 10, 0., 10.);
228 hists_[
"jetBDiscVtx_"] =
store_->
book1D(
"JetBDiscVtx",
"Disc_{b/vtx}(Jet)", 35, -1., 6.);
230 hists_[
"jet1PtRaw_" ] =
store_->
book1D(
"Jet1PtRaw" ,
"pt_{Raw}(jet1)" , 60, 0., 300.);
232 hists_[
"jet2PtRaw_" ] =
store_->
book1D(
"Jet2PtRaw" ,
"pt_{Raw}(jet2)" , 60, 0., 300.);
234 hists_[
"jet3PtRaw_" ] =
store_->
book1D(
"Jet3PtRaw" ,
"pt_{Raw}(jet3)" , 60, 0., 300.);
236 hists_[
"jet4PtRaw_" ] =
store_->
book1D(
"Jet4PtRaw" ,
"pt_{Raw}(jet4)" , 60, 0., 300.);
238 hists_[
"eventLogger_"] =
store_->
book2D(
"EventLogger",
"Logged Events" , 9, 0., 9., 10, 0., 10.);
241 hists_[
"eventLogger_"]->getTH1()->SetOption(
"TEXT");
242 hists_[
"eventLogger_"]->setBinLabel( 1 ,
"Run" , 1);
243 hists_[
"eventLogger_"]->setBinLabel( 2 ,
"Block" , 1);
244 hists_[
"eventLogger_"]->setBinLabel( 3 ,
"Event" , 1);
245 hists_[
"eventLogger_"]->setBinLabel( 4 ,
"pt_{L2L3}(jet1)" , 1);
246 hists_[
"eventLogger_"]->setBinLabel( 5 ,
"pt_{L2L3}(jet2)" , 1);
247 hists_[
"eventLogger_"]->setBinLabel( 6 ,
"pt_{L2L3}(jet3)" , 1);
248 hists_[
"eventLogger_"]->setBinLabel( 7 ,
"pt_{L2L3}(jet4)" , 1);
249 hists_[
"eventLogger_"]->setBinLabel( 8 ,
"M_{W}" , 1);
250 hists_[
"eventLogger_"]->setBinLabel( 9 ,
"M_{Top}" , 1);
251 hists_[
"eventLogger_"]->setAxisTitle(
"logged evts" , 2);
283 unsigned int eMult=0, eMultIso=0;
284 std::vector<const reco::GsfElectron*> isoElecs;
286 unsigned int idx = elec-elecs->begin();
290 double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt());
291 double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt());
292 double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
295 fill(
"elecPt_" , elec->pt() );
296 fill(
"elecEta_", elec->eta());
297 fill(
"elecRelIso_" , isolationRel );
298 fill(
"elecTrkIso_" , isolationTrk );
299 fill(
"elecCalIso_" , isolationCal );
303 ++eMult;
if(!
elecIso_ || (*
elecIso_)(*elec)){ isoElecs.push_back(&(*elec)); ++eMultIso;}
307 fill(
"elecMult_", eMult );
308 fill(
"elecMultIso_", eMultIso);
319 unsigned int mMult=0, mMultIso=0;
326 if(
muon->isGlobalMuon() ){
327 fill(
"muonDelZ_" ,
muon->globalTrack()->vz());
328 fill(
"muonDelXY_",
muon->globalTrack()->vx(),
muon->globalTrack()->vy());
331 double isolationTrk =
muon->pt()/(
muon->pt()+
muon->isolationR03().sumPt);
332 double isolationCal =
muon->pt()/(
muon->pt()+
muon->isolationR03().emEt+
muon->isolationR03().hadEt);
333 double isolationRel = (
muon->isolationR03().sumPt+
muon->isolationR03().emEt+
muon->isolationR03().hadEt)/
muon->pt();
338 fill(
"muonRelIso_" , isolationRel );
339 fill(
"muonTrkIso_" , isolationTrk );
340 fill(
"muonCalIso_" , isolationCal );
346 fill(
"muonMult_", mMult );
347 fill(
"muonMultIso_", mMultIso);
368 if(setup.
find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
374 <<
"------------------------------------------------------------------------------------- \n"
375 <<
" No JetCorrectionsRecord available from EventSetup: \n"
376 <<
" - Jets will not be corrected. \n"
377 <<
" - If you want to change this add the following lines to your cfg file: \n"
379 <<
" ## load jet corrections \n"
380 <<
" process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
381 <<
" process.prefer(\"ak5CaloL2L3\") \n"
383 <<
"------------------------------------------------------------------------------------- \n";
388 std::vector<reco::Jet> correctedJets;
389 unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0;
401 unsigned int idx =
jet-jets->begin();
402 if(
jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
403 if(!(*
jetIDSelect_)((*jetID)[jets->refAt(idx)]))
continue;
406 if(dynamic_cast<const reco::CaloJet*>(&*
jet)){
410 else if(dynamic_cast<const reco::PFJet*>(&*
jet)){
426 correctedJets.push_back(monitorJet);
431 fill(
"jetBDiscEff_", (*btagEff)[jetRef]);
if( (*btagEff)[jetRef]>
btagEffWP_ ) ++multBEff;
432 fill(
"jetBDiscPur_", (*btagPur)[jetRef]);
if( (*btagPur)[jetRef]>
btagPurWP_ ) ++multBPur;
433 fill(
"jetBDiscVtx_", (*btagVtx)[jetRef]);
if( (*btagVtx)[jetRef]>
btagVtxWP_ ) ++multBVtx;
436 if(idx==0) {
fill(
"jet1Pt_" , monitorJet.
pt());
fill(
"jet1PtRaw_",
jet->pt() );}
437 if(idx==1) {
fill(
"jet2Pt_" , monitorJet.
pt());
fill(
"jet2PtRaw_",
jet->pt() );}
438 if(idx==2) {
fill(
"jet3Pt_" , monitorJet.
pt());
fill(
"jet3PtRaw_",
jet->pt() );}
439 if(idx==3) {
fill(
"jet4Pt_" , monitorJet.
pt());
fill(
"jet4PtRaw_",
jet->pt() );}
441 fill(
"jetMult_" , mult );
442 fill(
"jetMultBEff_", multBEff);
443 fill(
"jetMultBPur_", multBPur);
444 fill(
"jetMultBVtx_", multBVtx);
455 for(std::vector<edm::InputTag>::const_iterator met_=
mets_.begin(); met_!=
mets_.end(); ++met_){
458 if(met->begin()!=met->end()){
459 unsigned int idx=met_-
mets_.begin();
460 if(idx==0)
fill(
"metCalo_" , met->begin()->et());
461 if(idx==1)
fill(
"metTC_" , met->begin()->et());
462 if(idx==2)
fill(
"metPflow_", met->begin()->et());
476 double wMass = eventKinematics.
massWBoson (correctedJets);
477 double topMass = eventKinematics.
massTopQuark(correctedJets);
478 if(wMass>=0 && topMass>=0) {
fill(
"massW_" , wMass );
fill(
"massTop_" , topMass);}
482 if(
logged_<=
hists_.find(
"eventLogger_")->second->getNbinsY()){
488 if(correctedJets.size()>0)
fill(
"eventLogger_", 3.5,
logged_+0.5, correctedJets[0].pt());
489 if(correctedJets.size()>1)
fill(
"eventLogger_", 4.5,
logged_+0.5, correctedJets[1].pt());
490 if(correctedJets.size()>2)
fill(
"eventLogger_", 5.5,
logged_+0.5, correctedJets[2].pt());
491 if(correctedJets.size()>3)
fill(
"eventLogger_", 6.5,
logged_+0.5, correctedJets[3].pt());
523 std::vector<edm::ParameterSet>
sel=cfg.
getParameter<std::vector<edm::ParameterSet> >(
"selection");
524 for(
unsigned int i=0;
i<sel.size(); ++
i){
544 unsigned int passed=0;
553 if(step.
select(event)){ ++passed;
559 if(step.
select(event)){ ++passed;
565 if(step.
select(event, setup)){ ++passed;
569 if(
type==
"jets/pf" ){
571 if(step.
select(event, setup)){ ++passed;
575 if(
type==
"jets/calo" ){
577 if(step.
select(event, setup)){ ++passed;
583 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.
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
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
virtual double pt() const
transverse momentum
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.
MonitorEnsemble(const char *label, const edm::ParameterSet &cfg)
default contructor
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