CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TopSingleLeptonDQM Class Reference

define MonitorEnsembple to be used More...

#include "DQM/Physics/plugins/TopSingleLeptonDQM.h"

Inheritance diagram for TopSingleLeptonDQM:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &setup)
 do this during the event loop More...
 
 TopSingleLeptonDQM (const edm::ParameterSet &cfg)
 default constructor More...
 
 ~TopSingleLeptonDQM ()
 default destructor More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

std::string objectType (const std::string &label)
 
std::string selectionStep (const std::string &label)
 

Private Attributes

edm::InputTag beamspot_
 beamspot More...
 
StringCutObjectSelector
< reco::BeamSpot > * 
beamspotSelect_
 string cut selector More...
 
std::map< std::string,
std::pair< edm::ParameterSet,
TopSingleLepton::MonitorEnsemble * > > 
selection_
 
std::vector< std::string > selectionOrder_
 
std::vector< std::string > triggerPaths_
 trigger paths More...
 
edm::InputTag triggerTable_
 trigger table More...
 
edm::InputTag vertex_
 primary vertex More...
 
StringCutObjectSelector
< reco::Vertex > * 
vertexSelect_
 string cut selector More...
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

define MonitorEnsembple to be used

Module to apply a monitored selection of top like events in the semi-leptonic channel.

Plugin to apply a monitored selection of top like events with some minimal flexibility in the number and definition of the selection steps. To achieve this flexibility it employes the SelectionStep class. The MonitorEnsemble class is used to provide a well defined set of histograms to be monitored after each selection step. The SelectionStep class provides a flexible and intuitive selection via the StringCutParser. SelectionStep and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection step (which is not monitored in the context of this module) with an instance of the MonitorEnsemble class. The following objects are supported for selection:

These types have to be present as prefix of the selection step paramter label separated from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects selection labels of this type. They will be disentangled by the private helper functions objectType and seletionStep as declared below.

Definition at line 209 of file TopSingleLeptonDQM.h.

Constructor & Destructor Documentation

TopSingleLeptonDQM::TopSingleLeptonDQM ( const edm::ParameterSet cfg)

default constructor

Definition at line 502 of file TopSingleLeptonDQM.cc.

References beamspot_, beamspotSelect_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), i, runTheMatrix::sel, selection_, selectionOrder_, selectionStep(), triggerPaths_, triggerTable_, vertex_, and vertexSelect_.

502  : triggerTable_(""), beamspot_("")
503 {
504  // configure preselection
505  edm::ParameterSet presel=cfg.getParameter<edm::ParameterSet>("preselection");
506  if( presel.existsAs<edm::ParameterSet>("trigger") ){
507  edm::ParameterSet trigger=presel.getParameter<edm::ParameterSet>("trigger");
508  triggerTable_=trigger.getParameter<edm::InputTag>("src");
509  triggerPaths_=trigger.getParameter<std::vector<std::string> >("select");
510  }
511  if( presel.existsAs<edm::ParameterSet>("vertex" ) ){
512  edm::ParameterSet vertex=presel.getParameter<edm::ParameterSet>("vertex");
513  vertex_= vertex.getParameter<edm::InputTag>("src");
514  vertexSelect_= new StringCutObjectSelector<reco::Vertex>(vertex.getParameter<std::string>("select"));
515  }
516  if( presel.existsAs<edm::ParameterSet>("beamspot" ) ){
517  edm::ParameterSet beamspot=presel.getParameter<edm::ParameterSet>("beamspot");
518  beamspot_= beamspot.getParameter<edm::InputTag>("src");
519  beamspotSelect_= new StringCutObjectSelector<reco::BeamSpot>(beamspot.getParameter<std::string>("select"));
520  }
521 
522  // conifgure the selection
523  std::vector<edm::ParameterSet> sel=cfg.getParameter<std::vector<edm::ParameterSet> >("selection");
524  for(unsigned int i=0; i<sel.size(); ++i){
525  selectionOrder_.push_back(sel.at(i).getParameter<std::string>("label"));
526  selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopSingleLepton::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter<edm::ParameterSet>("setup")));
527  }
528 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:181
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
std::vector< std::string > triggerPaths_
trigger paths
std::vector< std::string > selectionOrder_
std::string selectionStep(const std::string &label)
edm::InputTag vertex_
primary vertex
std::map< std::string, std::pair< edm::ParameterSet, TopSingleLepton::MonitorEnsemble * > > selection_
edm::InputTag beamspot_
beamspot
edm::InputTag triggerTable_
trigger table
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
TopSingleLeptonDQM::~TopSingleLeptonDQM ( )
inline

default destructor

Definition at line 214 of file TopSingleLeptonDQM.h.

214 {};

Member Function Documentation

void TopSingleLeptonDQM::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
virtual

do this during the event loop

Implements edm::EDAnalyzer.

Definition at line 531 of file TopSingleLeptonDQM.cc.

References accept(), beamspot_, beamspotSelect_, first, edm::Event::getByLabel(), combine::key, edm::InputTag::label(), objectType(), SelectionStep< Object >::select(), selection_, selectionOrder_, selectionStep(), launcher::step, triggerPaths_, and triggerTable_.

532 {
533  if(!triggerTable_.label().empty()){
535  if( !event.getByLabel(triggerTable_, triggerTable) ) return;
536  if(!accept(event, *triggerTable, triggerPaths_)) return;
537  }
538  if(!beamspot_.label().empty()){
540  if( !event.getByLabel(beamspot_, beamspot) ) return;
541  if(!(*beamspotSelect_)(*beamspot)) return;
542  }
543  // apply selection steps
544  unsigned int passed=0;
545  for(std::vector<std::string>::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){
546  std::string key = selectionStep(*selIt), type = objectType(*selIt);
547  if(selection_.find(key)!=selection_.end()){
548  if(type=="empty"){
549  selection_[key].second->fill(event, setup);
550  }
551  if(type=="muons"){
553  if(step.select(event)){ ++passed;
554  selection_[key].second->fill(event, setup);
555  } else break;
556  }
557  if(type=="elecs"){
559  if(step.select(event)){ ++passed;
560  selection_[key].second->fill(event, setup);
561  } else break;
562  }
563  if(type=="jets" ){
565  if(step.select(event, setup)){ ++passed;
566  selection_[key].second->fill(event, setup);
567  } else break;
568  }
569  if(type=="jets/pf" ){
571  if(step.select(event, setup)){ ++passed;
572  selection_[key].second->fill(event, setup);
573  } else break;
574  }
575  if(type=="jets/calo" ){
577  if(step.select(event, setup)){ ++passed;
578  selection_[key].second->fill(event, setup);
579  } else break;
580  }
581  if(type=="met" ){
583  if(step.select(event)){ ++passed;
584  selection_[key].second->fill(event, setup);
585  } else break;
586  }
587  }
588  }
589 }
type
Definition: HCALResponse.h:22
list step
Definition: launcher.py:15
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
std::vector< std::string > triggerPaths_
trigger paths
std::vector< std::string > selectionOrder_
std::string selectionStep(const std::string &label)
std::map< std::string, std::pair< edm::ParameterSet, TopSingleLepton::MonitorEnsemble * > > selection_
edm::InputTag beamspot_
beamspot
edm::InputTag triggerTable_
trigger table
bool first
Definition: L1TdeRCT.cc:79
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
Templated helper class to allow a selection on a certain object collection.
std::string const & label() const
Definition: InputTag.h:25
std::string objectType(const std::string &label)
list key
Definition: combine.py:13
std::string TopSingleLeptonDQM::objectType ( const std::string &  label)
inlineprivate

deduce object type from ParameterSet label, the label is expected to be of type 'objectType:selectionStep'

Definition at line 222 of file TopSingleLeptonDQM.h.

Referenced by analyze().

222 { return label.substr(0, label.find(':')); };
const std::string & label
Definition: MVAComputer.cc:186
std::string TopSingleLeptonDQM::selectionStep ( const std::string &  label)
inlineprivate

deduce selection step from ParameterSet label, the label is expected to be of type 'objectType:selectionStep'

Definition at line 225 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

225 { return label.substr(label.find(':')+1); };
const std::string & label
Definition: MVAComputer.cc:186

Member Data Documentation

edm::InputTag TopSingleLeptonDQM::beamspot_
private

beamspot

Definition at line 237 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

StringCutObjectSelector<reco::BeamSpot>* TopSingleLeptonDQM::beamspotSelect_
private

string cut selector

Definition at line 239 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

std::map<std::string, std::pair<edm::ParameterSet, TopSingleLepton::MonitorEnsemble*> > TopSingleLeptonDQM::selection_
private

this is the heart component of the plugin; std::string keeps a label the selection step for later identification, edm::ParameterSet keeps the configuration of the selection for the SelectionStep class, MonitoringEnsemble keeps an instance of the MonitorEnsemble class to be filled after each selection step

Definition at line 249 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

std::vector<std::string> TopSingleLeptonDQM::selectionOrder_
private

needed to guarantee the selection order as defined by the order of ParameterSets in the selection vector as defined in the config

Definition at line 243 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

std::vector<std::string> TopSingleLeptonDQM::triggerPaths_
private

trigger paths

Definition at line 231 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

edm::InputTag TopSingleLeptonDQM::triggerTable_
private

trigger table

Definition at line 225 of file TopSingleLeptonDQM.h.

Referenced by analyze(), and TopSingleLeptonDQM().

edm::InputTag TopSingleLeptonDQM::vertex_
private

primary vertex

Definition at line 233 of file TopSingleLeptonDQM.h.

Referenced by TopSingleLeptonDQM().

StringCutObjectSelector<reco::Vertex>* TopSingleLeptonDQM::vertexSelect_
private

string cut selector

Definition at line 235 of file TopSingleLeptonDQM.h.

Referenced by TopSingleLeptonDQM().