CMS 3D CMS Logo

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

#include <HLTExoticaSubAnalysis.h>

Public Types

enum  Level { Level::GEN = 98, Level::RECO = 99 }
 

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iEventSetup, EVTColContainer *cols)
 
void beginJob ()
 
void beginRun (const edm::Run &iRun, const edm::EventSetup &iEventSetup)
 
void endRun ()
 
 HLTExoticaSubAnalysis (const edm::ParameterSet &pset, const std::string &analysisname, edm::ConsumesCollector &&consCollector)
 Constructor. More...
 
void subAnalysisBookHistos (DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup)
 
 ~HLTExoticaSubAnalysis ()
 End Constructor. More...
 

Private Member Functions

void bookHist (DQMStore::IBooker &iBooker, const std::string &source, const std::string &objType, const std::string &variable)
 The internal functions to book and fill histograms. More...
 
void fillHist (const std::string &source, const std::string &objType, const std::string &variable, const float &value)
 
void getHandlesToObjects (const edm::Event &iEvent, EVTColContainer *col)
 Gets the collections themselves. More...
 
void getNamesOfObjects (const edm::ParameterSet &anpset)
 Creates the maps that map which collection should come from which label. More...
 
const std::vector< unsigned int > getObjectsType (const std::string &hltpath) const
 closes analyze method More...
 
void initSelector (const unsigned int &objtype)
 Initializes the selectors of the objects based on which object it is. More...
 
void insertCandidates (const unsigned int &objtype, const EVTColContainer *col, std::vector< reco::LeafCandidate > *matches, std::map< int, double > &theSumEt, std::map< int, std::vector< const reco::Track * > > &trkObjs)
 
void registerConsumes (edm::ConsumesCollector &consCollector)
 Registers consumption of objects. More...
 

Private Attributes

std::string _analysisname
 The name of this sub-analysis. More...
 
edm::InputTag _beamSpotLabel
 
edm::EDGetTokenT< reco::BeamSpot_bsToken
 
bool _drop_pt2
 
bool _drop_pt3
 
std::map< std::string,
MonitorElement * > 
_elements
 Structure of the MonitorElements. More...
 
std::map< unsigned int,
std::string > 
_genCut
 gen/rec objects cuts More...
 
std::map< unsigned int,
std::string > 
_genCut_leading
 gen/rec pt-leading objects cuts More...
 
StringCutObjectSelector
< reco::GenMET > * 
_genMETSelector
 
edm::InputTag _genParticleLabel
 
edm::EDGetTokenT
< reco::GenParticleCollection
_genParticleToken
 And also the tokens to get the object collections. More...
 
std::map< unsigned int,
StringCutObjectSelector
< reco::GenParticle > * > 
_genSelectorMap
 
HLTConfigProvider _hltConfig
 Interface to the HLT information. More...
 
std::set< std::string > _hltPaths
 The hlt paths found in the hltConfig. More...
 
std::vector< std::string > _hltPathsToCheck
 The hlt paths to check for. More...
 
std::string _hltProcessName
 The labels of the object collections to be used in this analysis. More...
 
StringCutObjectSelector
< l1extra::L1EtMissParticle > * 
_l1METSelector
 
unsigned int _minCandidates
 The minimum number of reco/gen candidates needed by the analysis. More...
 
std::vector< double > _parametersDxy
 
std::vector< double > _parametersEta
 Some kinematical parameters. More...
 
std::vector< double > _parametersPhi
 
std::vector< double > _parametersTurnOn
 
std::vector< double > _parametersTurnOnSumEt
 
std::vector< HLTExoticaPlotter_plotters
 The plotters: managers of each hlt path where the plots are done. More...
 
edm::ParameterSet _pset
 Internal, working copy of the PSet passed from above. More...
 
StringCutObjectSelector
< reco::CaloJet > * 
_recCaloJetSelector
 
StringCutObjectSelector
< reco::CaloMET > * 
_recCaloMETSelector
 
StringCutObjectSelector
< reco::CaloMET > * 
_recCaloMHTSelector
 
std::map< unsigned int,
std::string > 
_recCut
 
std::map< unsigned int,
std::string > 
_recCut_leading
 
StringCutObjectSelector
< reco::GsfElectron > * 
_recElecSelector
 
std::map< unsigned int,
edm::InputTag
_recLabels
 
StringCutObjectSelector
< reco::MET > * 
_recMETSelector
 
StringCutObjectSelector
< reco::Muon > * 
_recMuonSelector
 
StringCutObjectSelector
< reco::Track > * 
_recMuonTrkSelector
 
StringCutObjectSelector
< reco::PFJet > * 
_recPFJetSelector
 
StringCutObjectSelector
< reco::PFMET > * 
_recPFMETSelector
 
StringCutObjectSelector
< reco::PFMET > * 
_recPFMHTSelector
 
StringCutObjectSelector
< reco::PFTau > * 
_recPFTauSelector
 
StringCutObjectSelector
< reco::Photon > * 
_recPhotonSelector
 
StringCutObjectSelector
< reco::Track > * 
_recTrackSelector
 
std::map< std::string,
std::string > 
_shortpath2long
 Relation between the short and long versions of the path. More...
 
std::map< unsigned int,
edm::EDGetToken
_tokens
 
std::map< std::string, int > _triggerCounter
 counting HLT passed events More...
 
edm::InputTag _trigResultsLabel
 
edm::EDGetTokenT
< edm::TriggerResults
_trigResultsToken
 

Detailed Description

This class is the main workhorse of the package. It makes the histograms for one given analysis, taking care of all HLT paths related to that analysis.

Generate histograms for trigger efficiencies Exotica related Documentation available on the CMS TWiki: https://twiki.cern.ch/twiki/bin/view/CMS/EXOTICATriggerValidation

Author
Thiago R. Fernandez Perez Tomei Based and adapted from: J. Duarte Campderros code from HLTriggerOffline/Higgs J. Klukas, M. Vander Donckt and J. Alcaraz code from the HLTriggerOffline/Muon package.

Definition at line 66 of file HLTExoticaSubAnalysis.h.

Member Enumeration Documentation

Enumerator
GEN 
RECO 

Definition at line 68 of file HLTExoticaSubAnalysis.h.

Constructor & Destructor Documentation

HLTExoticaSubAnalysis::HLTExoticaSubAnalysis ( const edm::ParameterSet pset,
const std::string &  analysisname,
edm::ConsumesCollector &&  consCollector 
)

Constructor.

Get the vector of paths to check, for this particular analysis.

Get the minimum candidates, for this particular analysis.

Definition at line 28 of file HLTExoticaSubAnalysis.cc.

HLTExoticaSubAnalysis::~HLTExoticaSubAnalysis ( )

End Constructor.

Definition at line 152 of file HLTExoticaSubAnalysis.cc.

Member Function Documentation

void HLTExoticaSubAnalysis::analyze ( const edm::Event iEvent,
const edm::EventSetup iEventSetup,
EVTColContainer cols 
)

Method to fill all relevant histograms. Notice that we update the EVTColContaner to point to the collections we want.

We are going to make a fake reco::LeafCandidate, with our particleType as the pdgId. This is an alternative to the older implementation with MatchStruct.

Filling the histograms if pass the minimum amount of candidates needed by the analysis:

GEN CASE ///

Close GEN case

RECO CASE ///

Debugging.

Close RECO case

Definition at line 385 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::beginJob ( void  )

Definition at line 192 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::beginRun ( const edm::Run iRun,
const edm::EventSetup iEventSetup 
)

Construct the plotters right here. For that we need to create the _hltPaths vector.

Definition at line 278 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::bookHist ( DQMStore::IBooker iBooker,
const std::string &  source,
const std::string &  objType,
const std::string &  variable 
)
private

The internal functions to book and fill histograms.

Definition at line 1072 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::endRun ( void  )

Definition at line 1343 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::fillHist ( const std::string &  source,
const std::string &  objType,
const std::string &  variable,
const float &  value 
)
private

Definition at line 1133 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::getHandlesToObjects ( const edm::Event iEvent,
EVTColContainer col 
)
private

Gets the collections themselves.

Definition at line 956 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::getNamesOfObjects ( const edm::ParameterSet anpset)
private

Creates the maps that map which collection should come from which label.

Definition at line 775 of file HLTExoticaSubAnalysis.cc.

const std::vector< unsigned int > HLTExoticaSubAnalysis::getObjectsType ( const std::string &  hltpath) const
private

closes analyze method

Return the objects (muons,electrons,photons,...) needed by a HLT path. Will in general return: 0 for muon, 1 for electron, 2 for photon, 3 for PFMET, 4 for PFTau, 5 for Jet. Notice that this function is really based on a parsing of the name of the path; any incongruences there may lead to problems.

Definition at line 735 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::initSelector ( const unsigned int &  objtype)
private

Initializes the selectors of the objects based on which object it is.

Definition at line 1148 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::insertCandidates ( const unsigned int &  objtype,
const EVTColContainer col,
std::vector< reco::LeafCandidate > *  matches,
std::map< int, double > &  theSumEt,
std::map< int, std::vector< const reco::Track * > > &  trkObjs 
)
private

This function applies the selectors initialized previously to the objects, and matches the passing objects to HLT objects.

This is a special case. Passing a PFMET* to the constructor of MatchStruct will trigger the usage of the special constructor which also sets the sumEt member.

Definition at line 1191 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::registerConsumes ( edm::ConsumesCollector consCollector)
private

Registers consumption of objects.

Definition at line 854 of file HLTExoticaSubAnalysis.cc.

void HLTExoticaSubAnalysis::subAnalysisBookHistos ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup 
)

Method to book all relevant histograms in the DQMStore. Uses the IBooker interface for thread safety. Intended to be called from master object.

Definition at line 203 of file HLTExoticaSubAnalysis.cc.

Member Data Documentation

std::string HLTExoticaSubAnalysis::_analysisname
private

The name of this sub-analysis.

Definition at line 123 of file HLTExoticaSubAnalysis.h.

edm::InputTag HLTExoticaSubAnalysis::_beamSpotLabel
private

Definition at line 139 of file HLTExoticaSubAnalysis.h.

edm::EDGetTokenT<reco::BeamSpot> HLTExoticaSubAnalysis::_bsToken
private

Definition at line 144 of file HLTExoticaSubAnalysis.h.

bool HLTExoticaSubAnalysis::_drop_pt2
private

Definition at line 155 of file HLTExoticaSubAnalysis.h.

bool HLTExoticaSubAnalysis::_drop_pt3
private

Definition at line 156 of file HLTExoticaSubAnalysis.h.

std::map<std::string, MonitorElement *> HLTExoticaSubAnalysis::_elements
private

Structure of the MonitorElements.

Definition at line 194 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, std::string> HLTExoticaSubAnalysis::_genCut
private

gen/rec objects cuts

Definition at line 159 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, std::string> HLTExoticaSubAnalysis::_genCut_leading
private

gen/rec pt-leading objects cuts

Definition at line 162 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::GenMET>* HLTExoticaSubAnalysis::_genMETSelector
private

Definition at line 175 of file HLTExoticaSubAnalysis.h.

edm::InputTag HLTExoticaSubAnalysis::_genParticleLabel
private

Definition at line 137 of file HLTExoticaSubAnalysis.h.

edm::EDGetTokenT<reco::GenParticleCollection> HLTExoticaSubAnalysis::_genParticleToken
private

And also the tokens to get the object collections.

Definition at line 142 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, StringCutObjectSelector<reco::GenParticle> *> HLTExoticaSubAnalysis::_genSelectorMap
private

The concrete String selectors (use the string cuts introduced via the config python)

Definition at line 167 of file HLTExoticaSubAnalysis.h.

HLTConfigProvider HLTExoticaSubAnalysis::_hltConfig
private

Interface to the HLT information.

Definition at line 191 of file HLTExoticaSubAnalysis.h.

std::set<std::string> HLTExoticaSubAnalysis::_hltPaths
private

The hlt paths found in the hltConfig.

Definition at line 131 of file HLTExoticaSubAnalysis.h.

std::vector<std::string> HLTExoticaSubAnalysis::_hltPathsToCheck
private

The hlt paths to check for.

Definition at line 129 of file HLTExoticaSubAnalysis.h.

std::string HLTExoticaSubAnalysis::_hltProcessName
private

The labels of the object collections to be used in this analysis.

Definition at line 136 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<l1extra::L1EtMissParticle>* HLTExoticaSubAnalysis::_l1METSelector
private

Definition at line 178 of file HLTExoticaSubAnalysis.h.

unsigned int HLTExoticaSubAnalysis::_minCandidates
private

The minimum number of reco/gen candidates needed by the analysis.

Definition at line 126 of file HLTExoticaSubAnalysis.h.

std::vector<double> HLTExoticaSubAnalysis::_parametersDxy
private

Definition at line 152 of file HLTExoticaSubAnalysis.h.

std::vector<double> HLTExoticaSubAnalysis::_parametersEta
private

Some kinematical parameters.

Definition at line 148 of file HLTExoticaSubAnalysis.h.

std::vector<double> HLTExoticaSubAnalysis::_parametersPhi
private

Definition at line 149 of file HLTExoticaSubAnalysis.h.

std::vector<double> HLTExoticaSubAnalysis::_parametersTurnOn
private

Definition at line 150 of file HLTExoticaSubAnalysis.h.

std::vector<double> HLTExoticaSubAnalysis::_parametersTurnOnSumEt
private

Definition at line 151 of file HLTExoticaSubAnalysis.h.

std::vector<HLTExoticaPlotter> HLTExoticaSubAnalysis::_plotters
private

The plotters: managers of each hlt path where the plots are done.

Definition at line 185 of file HLTExoticaSubAnalysis.h.

edm::ParameterSet HLTExoticaSubAnalysis::_pset
private

Internal, working copy of the PSet passed from above.

Definition at line 120 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::CaloJet>* HLTExoticaSubAnalysis::_recCaloJetSelector
private

Definition at line 182 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::CaloMET>* HLTExoticaSubAnalysis::_recCaloMETSelector
private

Definition at line 176 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::CaloMET>* HLTExoticaSubAnalysis::_recCaloMHTSelector
private

Definition at line 177 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, std::string> HLTExoticaSubAnalysis::_recCut
private

Definition at line 160 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, std::string> HLTExoticaSubAnalysis::_recCut_leading
private

Definition at line 163 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::GsfElectron>* HLTExoticaSubAnalysis::_recElecSelector
private

Definition at line 171 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, edm::InputTag> HLTExoticaSubAnalysis::_recLabels
private

Definition at line 140 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::MET>* HLTExoticaSubAnalysis::_recMETSelector
private

Definition at line 172 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::Muon>* HLTExoticaSubAnalysis::_recMuonSelector
private

Definition at line 168 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::Track>* HLTExoticaSubAnalysis::_recMuonTrkSelector
private

Definition at line 169 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::PFJet>* HLTExoticaSubAnalysis::_recPFJetSelector
private

Definition at line 181 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::PFMET>* HLTExoticaSubAnalysis::_recPFMETSelector
private

Definition at line 173 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::PFMET>* HLTExoticaSubAnalysis::_recPFMHTSelector
private

Definition at line 174 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::PFTau>* HLTExoticaSubAnalysis::_recPFTauSelector
private

Definition at line 179 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::Photon>* HLTExoticaSubAnalysis::_recPhotonSelector
private

Definition at line 180 of file HLTExoticaSubAnalysis.h.

StringCutObjectSelector<reco::Track>* HLTExoticaSubAnalysis::_recTrackSelector
private

Definition at line 170 of file HLTExoticaSubAnalysis.h.

std::map<std::string, std::string> HLTExoticaSubAnalysis::_shortpath2long
private

Relation between the short and long versions of the path.

Definition at line 133 of file HLTExoticaSubAnalysis.h.

std::map<unsigned int, edm::EDGetToken> HLTExoticaSubAnalysis::_tokens
private

Definition at line 145 of file HLTExoticaSubAnalysis.h.

std::map<std::string,int> HLTExoticaSubAnalysis::_triggerCounter
private

counting HLT passed events

Definition at line 188 of file HLTExoticaSubAnalysis.h.

edm::InputTag HLTExoticaSubAnalysis::_trigResultsLabel
private

Definition at line 138 of file HLTExoticaSubAnalysis.h.

edm::EDGetTokenT<edm::TriggerResults> HLTExoticaSubAnalysis::_trigResultsToken
private

Definition at line 143 of file HLTExoticaSubAnalysis.h.