CMS 3D CMS Logo

HLTExoticaSubAnalysis.h
Go to the documentation of this file.
1 #ifndef HLTriggerOffline_Exotica_HLTExoticaSubAnalysis_H
2 #define HLTriggerOffline_Exotica_HLTExoticaSubAnalysis_H
3 
22 
49 
51 
52 #include <cstring>
53 #include <map>
54 #include <set>
55 #include <vector>
56 
58 struct EVTColContainer;
59 
64 public:
67 
68  enum class Level { GEN = 98, RECO = 99 };
69 
71  const std::string &analysisname,
72  edm::ConsumesCollector &&consCollector);
74  void beginJob();
75  void beginRun(const edm::Run &iRun, const edm::EventSetup &iEventSetup);
76  void endRun();
77 
81  void subAnalysisBookHistos(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup);
82 
86  void analyze(const edm::Event &iEvent, const edm::EventSetup &iEventSetup, EVTColContainer *cols);
87 
88 private:
94  const std::vector<unsigned int> getObjectsType(const std::string &hltpath) const;
95 
97  void getNamesOfObjects(const edm::ParameterSet &anpset);
99  void registerConsumes(edm::ConsumesCollector &consCollector);
103  void initSelector(const unsigned int &objtype);
106  void insertCandidates(const unsigned int &objtype,
107  const EVTColContainer *col,
108  std::vector<reco::LeafCandidate> *matches,
109  std::map<int, double> &theSumEt,
110  std::map<int, std::vector<const reco::Track *>> &trkObjs);
111 
113  void bookHist(DQMStore::IBooker &iBooker,
114  const std::string &source,
115  const std::string &objType,
116  const std::string &variable);
117  void fillHist(const std::string &source, const std::string &objType, const std::string &variable, const float &value);
118 
121 
124 
126  unsigned int _minCandidates;
127 
129  std::vector<std::string> _hltPathsToCheck;
131  std::set<std::string> _hltPaths;
133  std::map<std::string, std::string> _shortpath2long;
134 
140  std::map<unsigned int, edm::InputTag> _recLabels;
145  std::map<unsigned int, edm::EDGetToken> _tokens;
146 
148  std::vector<double> _parametersEta;
149  std::vector<double> _parametersPhi;
150  std::vector<double> _parametersTurnOn;
151  std::vector<double> _parametersTurnOnSumEt;
152  std::vector<double> _parametersDxy;
153 
154  // flag to switch off
155  bool _drop_pt2;
156  bool _drop_pt3;
157 
159  std::map<unsigned int, std::string> _genCut;
160  std::map<unsigned int, std::string> _recCut;
162  std::map<unsigned int, std::string> _genCut_leading;
163  std::map<unsigned int, std::string> _recCut_leading;
164 
167  std::map<unsigned int, StringCutObjectSelector<reco::GenParticle> *> _genSelectorMap;
182 
184  std::vector<HLTExoticaPlotter> _plotters;
185 
187  std::map<std::string, int> _triggerCounter;
188 
191 
193  std::map<std::string, MonitorElement *> _elements;
194 };
195 
196 #endif
StringCutObjectSelector< reco::Track > * _recMuonTrkSelector
const std::vector< unsigned int > getObjectsType(const std::string &hltpath) const
closes analyze method
unsigned int _minCandidates
The minimum number of reco/gen candidates needed by the analysis.
void getNamesOfObjects(const edm::ParameterSet &anpset)
Creates the maps that map which collection should come from which label.
std::map< unsigned int, std::string > _genCut
gen/rec objects cuts
std::vector< HLTExoticaPlotter > _plotters
The plotters: managers of each hlt path where the plots are done.
StringCutObjectSelector< reco::CaloJet > * _recCaloJetSelector
StringCutObjectSelector< reco::GenMET > * _genMETSelector
std::vector< double > _parametersPhi
void fillHist(const std::string &source, const std::string &objType, const std::string &variable, const float &value)
container with all the objects needed
void analyze(const edm::Event &iEvent, const edm::EventSetup &iEventSetup, EVTColContainer *cols)
StringCutObjectSelector< reco::MET > * _recMETSelector
edm::EDGetTokenT< edm::TriggerResults > _trigResultsToken
dqm::legacy::MonitorElement MonitorElement
std::map< unsigned int, std::string > _genCut_leading
gen/rec pt-leading objects cuts
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
std::map< std::string, int > _triggerCounter
counting HLT passed events
std::map< unsigned int, edm::InputTag > _recLabels
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector
std::map< unsigned int, std::string > _recCut_leading
int iEvent
Definition: GenABIO.cc:224
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)
StringCutObjectSelector< reco::Muon > * _recMuonSelector
edm::ParameterSet _pset
Internal, working copy of the PSet passed from above.
void subAnalysisBookHistos(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup)
std::vector< double > _parametersEta
Some kinematical parameters.
std::map< unsigned int, std::string > _recCut
std::vector< double > _parametersDxy
StringCutObjectSelector< reco::Track > * _recTrackSelector
HLTConfigProvider _hltConfig
Interface to the HLT information.
~HLTExoticaSubAnalysis()
End Constructor.
Definition: value.py:1
std::vector< std::string > _hltPathsToCheck
The hlt paths to check for.
StringCutObjectSelector< reco::CaloMET > * _recCaloMHTSelector
std::string _hltProcessName
The labels of the object collections to be used in this analysis.
void registerConsumes(edm::ConsumesCollector &consCollector)
Registers consumption of objects.
void getHandlesToObjects(const edm::Event &iEvent, EVTColContainer *col)
Gets the collections themselves.
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
std::string _analysisname
The name of this sub-analysis.
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
void beginRun(const edm::Run &iRun, const edm::EventSetup &iEventSetup)
std::vector< double > _parametersTurnOn
std::map< unsigned int, edm::EDGetToken > _tokens
std::map< std::string, MonitorElement * > _elements
Structure of the MonitorElements.
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
HLTExoticaSubAnalysis(const edm::ParameterSet &pset, const std::string &analysisname, edm::ConsumesCollector &&consCollector)
Constructor.
col
Definition: cuy.py:1009
dqm::legacy::DQMStore DQMStore
edm::EDGetTokenT< reco::GenParticleCollection > _genParticleToken
And also the tokens to get the object collections.
void initSelector(const unsigned int &objtype)
Initializes the selectors of the objects based on which object it is.
std::vector< double > _parametersTurnOnSumEt
std::set< std::string > _hltPaths
The hlt paths found in the hltConfig.
StringCutObjectSelector< reco::PFMET > * _recPFMHTSelector
static std::string const source
Definition: EdmProvDump.cc:49
edm::EDGetTokenT< reco::BeamSpot > _bsToken
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
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.
Definition: Run.h:45
std::map< std::string, std::string > _shortpath2long
Relation between the short and long versions of the path.