CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTMuonOfflineAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTMuonOfflineAnalyzer
4 // Class: HLTMuonOfflineAnalyzer
5 //
6 
7 //
8 // Jason Slaunwhite and Jeff Klukas
9 //
10 //
11 
12 // system include files
13 #include <memory>
14 #include <iostream>
15 
16 // user include files
18 
20 
27 
28 
31 
32 
33 #include "TFile.h"
34 #include "TDirectory.h"
35 #include "TPRegexp.h"
36 
37 
40 
41 
42 
44 
45 public:
46 
48 
49 private:
50 
51  // Analyzer Methods
52  virtual void beginJob();
53  virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override;
54  virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
55  virtual void analyze(const edm::Event &, const edm::EventSetup &) override;
56  virtual void endRun(const edm::Run &, const edm::EventSetup &) override;
57  virtual void endJob();
58 
59  // Extra Methods
60  std::vector<std::string> moduleLabels(std::string);
61 
62  // Input from Configuration File
65  std::vector<std::string> hltPathsToCheck_;
66 
67  // Member Variables
70 
71 };
72 
73 
74 
77 
78 using namespace std;
79 using namespace edm;
80 using namespace reco;
81 using namespace trigger;
82 
83 typedef vector<string> vstring;
84 
85 
86 
89 
91  pset_(pset),
92  hltProcessName_(pset.getParameter<string>("hltProcessName")),
93  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck")),
94  plotterContainer_(consumesCollector(),pset)
95 {
96 
97 }
98 
99 
100 
101 vector<string>
103 {
104 
105  vector<string> modules = hltConfig_.moduleLabels(path);
106  vector<string>::iterator iter = modules.begin();
107 
108  while (iter != modules.end())
109  if (iter->find("Filtered") == string::npos)
110  iter = modules.erase(iter);
111  else
112  ++iter;
113 
114  return modules;
115 
116 }
117 
118 
119 
120 void
122  const edm::EventSetup & iSetup)
123 {
124 
125  // Initialize hltConfig
126  bool changedConfig;
127  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
128  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
129  return;
130  }
131 
132  // Get the set of trigger paths we want to make plots for
133  set<string> hltPaths;
134  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
135  TPRegexp pattern(hltPathsToCheck_[i]);
136  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
137  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
138  hltPaths.insert(hltConfig_.triggerNames()[j]);
139  }
140 
141  // Initialize the plotters
142  set<string>::iterator iPath;
143  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
144  string path = * iPath;
145  vector<string> labels = moduleLabels(path);
146  if (labels.size() > 0) {
148  }
149  }
150 
151 }
152 
153 
154 
155 void
157  edm::Run const & iRun, edm::EventSetup const & iSetup)
158 {
159 
160  plotterContainer_.beginRun(iBooker, iRun, iSetup);
161 
162 }
163 
164 
165 
166 void
168  const EventSetup& iSetup)
169 {
170 
171  plotterContainer_.analyze(iEvent, iSetup);
172 
173 }
174 
175 
176 
177 void
179 {
180 
181 }
182 
183 
184 
185 void
187  const edm::EventSetup& iSetup)
188 {
189 
190  // plotterContainer_.endRun(iRun, iSetup);
191 
192 }
193 
194 
195 
196 void
198 {
199 
200 }
201 
202 
203 
204 //define this as a plug-in
int i
Definition: DBlmapReader.cc:9
HLTMuonMatchAndPlotContainer plotterContainer_
vector< string > vstring
Definition: ExoticaDQM.cc:75
virtual void endRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< std::string > moduleLabels(std::string)
const std::vector< std::string > & triggerNames() const
names of trigger paths
virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:230
tuple path
else: Piece not in the list, fine.
int j
Definition: DBlmapReader.cc:9
void analyze(const edm::Event &, const edm::EventSetup &)
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
void addPlotter(const edm::ParameterSet &, std::string, const std::vector< std::string > &)
Add a HLTMuonMatchAndPlot for a given path.
HLTMuonOfflineAnalyzer(const edm::ParameterSet &)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void beginRun(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Container Class Definition (this is what is used by the DQM module) ///////.
Definition: Run.h:41
std::vector< std::string > hltPathsToCheck_