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 Attributes
EDMtoMEConverter Class Reference

#include <EDMtoMEConverter.h>

Inheritance diagram for EDMtoMEConverter:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef std::vector< uint32_t > TagList
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
 EDMtoMEConverter (const edm::ParameterSet &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
template<class T >
void getData (T &iGetFrom, bool iEndRun)
 
virtual void respondToOpenInputFile (const edm::FileBlock &)
 
virtual ~EDMtoMEConverter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::vector< std::string > classtypes
 
bool convertOnEndLumi
 
bool convertOnEndRun
 
DQMStoredbe
 
int frequency
 
std::map< int, int > iCount
 
unsigned int iCountf
 
edm::InputTag lumiInputTag_
 
std::vector< MonitorElement * > me1
 
std::vector< MonitorElement * > me2
 
std::vector< MonitorElement * > me3
 
std::vector< MonitorElement * > me4
 
std::vector< MonitorElement * > me5
 
std::vector< MonitorElement * > me6
 
std::vector< MonitorElement * > me7
 
std::vector< MonitorElement * > me8
 
std::string name
 
edm::InputTag runInputTag_
 
int verbosity
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Class to take dqm monitor elements and convert into a ROOT dataformat stored in Run tree of edm file

Author
M. Strang SUNY-Buffalo

Definition at line 49 of file EDMtoMEConverter.h.

Member Typedef Documentation

typedef std::vector<uint32_t> EDMtoMEConverter::TagList

Definition at line 68 of file EDMtoMEConverter.h.

Constructor & Destructor Documentation

EDMtoMEConverter::EDMtoMEConverter ( const edm::ParameterSet iPSet)
explicit

Definition at line 14 of file EDMtoMEConverter.cc.

References classtypes, convertOnEndLumi, convertOnEndRun, dbe, frequency, edm::ParameterSet::getUntrackedParameter(), iCount, iCountf, name, cppFunctionSkipper::operator, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

14  :
15  verbosity(0), frequency(0),
16  runInputTag_(iPSet.getParameter<edm::InputTag>("runInputTag")),
17  lumiInputTag_(iPSet.getParameter<edm::InputTag>("lumiInputTag"))
18 {
19  std::string MsgLoggerCat = "EDMtoMEConverter_EDMtoMEConverter";
20 
21  // get information from parameter set
22  name = iPSet.getUntrackedParameter<std::string>("Name");
23  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
24  frequency = iPSet.getUntrackedParameter<int>("Frequency");
25 
26  convertOnEndLumi = iPSet.getUntrackedParameter<bool>("convertOnEndLumi",true);
27  convertOnEndRun = iPSet.getUntrackedParameter<bool>("convertOnEndRun",true);
28 
29  // use value of first digit to determine default output level (inclusive)
30  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
31  verbosity %= 10;
32 
33  // get dqm info
34  dbe = 0;
36 
37  // print out Parameter Set information being used
38  if (verbosity >= 0) {
39  edm::LogInfo(MsgLoggerCat)
40  << "\n===============================\n"
41  << "Initialized as EDAnalyzer with parameter values:\n"
42  << " Name = " << name << "\n"
43  << " Verbosity = " << verbosity << "\n"
44  << " Frequency = " << frequency << "\n"
45  << "===============================\n";
46  }
47 
48  classtypes.clear();
49  classtypes.push_back("TH1F");
50  classtypes.push_back("TH1S");
51  classtypes.push_back("TH1D");
52  classtypes.push_back("TH2F");
53  classtypes.push_back("TH2S");
54  classtypes.push_back("TH2D");
55  classtypes.push_back("TH3F");
56  classtypes.push_back("TProfile");
57  classtypes.push_back("TProfile2D");
58  classtypes.push_back("Double");
59  classtypes.push_back("Int");
60  classtypes.push_back("Int64");
61  classtypes.push_back("String");
62 
63  iCountf = 0;
64  iCount.clear();
65 
66  assert(sizeof(int64_t) == sizeof(long long));
67 
68 } // end constructor
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > classtypes
edm::InputTag lumiInputTag_
edm::InputTag runInputTag_
unsigned int iCountf
std::map< int, int > iCount
EDMtoMEConverter::~EDMtoMEConverter ( )
virtual

Definition at line 70 of file EDMtoMEConverter.cc.

70 {}

Member Function Documentation

void EDMtoMEConverter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 131 of file EDMtoMEConverter.cc.

132 {
133 }
void EDMtoMEConverter::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file EDMtoMEConverter.cc.

73 {
74 }
void EDMtoMEConverter::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 120 of file EDMtoMEConverter.cc.

121 {
122 }
void EDMtoMEConverter::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 92 of file EDMtoMEConverter.cc.

References frequency, iCount, edm::RunBase::run(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

93 {
94  std::string MsgLoggerCat = "EDMtoMEConverter_beginRun";
95 
96  int nrun = iRun.run();
97 
98  // keep track of number of unique runs processed
99  ++iCount[nrun];
100 
101  if (verbosity > 0) {
102  edm::LogInfo(MsgLoggerCat)
103  << "Processing run " << nrun << " (" << iCount.size() << " runs total)";
104  } else if (verbosity == 0) {
105  if (nrun%frequency == 0 || iCount.size() == 1) {
106  edm::LogInfo(MsgLoggerCat)
107  << "Processing run " << nrun << " (" << iCount.size() << " runs total)";
108  }
109  }
110 
111 }
RunNumber_t run() const
Definition: RunBase.h:42
std::map< int, int > iCount
void EDMtoMEConverter::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file EDMtoMEConverter.cc.

References iCount, iCountf, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

77 {
78  std::string MsgLoggerCat = "EDMtoMEConverter_endJob";
79  if (verbosity >= 0)
80  edm::LogInfo(MsgLoggerCat)
81  << "Terminating having processed " << iCount.size() << " runs across "
82  << iCountf << " files.";
83  return;
84 }
unsigned int iCountf
std::map< int, int > iCount
void EDMtoMEConverter::endLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 124 of file EDMtoMEConverter.cc.

References convertOnEndLumi, and getData().

125 {
126  if (convertOnEndLumi) {
127  getData(iLumi, false);
128  }
129 }
void getData(T &iGetFrom, bool iEndRun)
void EDMtoMEConverter::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 113 of file EDMtoMEConverter.cc.

References convertOnEndRun, and getData().

114 {
115  if (convertOnEndRun) {
116  getData(iRun, true);
117  }
118 }
void getData(T &iGetFrom, bool iEndRun)
template<class T >
void EDMtoMEConverter::getData ( T iGetFrom,
bool  iEndRun 
)

Definition at line 137 of file EDMtoMEConverter.cc.

References DQMStore::book1D(), DQMStore::book1DD(), DQMStore::book1S(), DQMStore::book2D(), DQMStore::book2DD(), DQMStore::book2S(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), classtypes, gather_cfg::cout, dbe, dir, DQMStore::get(), DQMStore::getAllTags(), getTH1F(), getTH2F(), getTH3F(), getTProfile(), getTProfile2D(), i, cuy::ii, edm::HandleBase::isValid(), j, list(), lumiInputTag_, me1, me2, me3, me4, me5, me6, me7, me8, name, timingPdfMaker::pathname, runInputTag_, DQMStore::setCurrentFolder(), split, AlCaHLTBitMon_QueryRunRegistry::string, DQMStore::tag(), o2o::tags, and verbosity.

Referenced by endLuminosityBlock(), and endRun().

138 {
139  edm::InputTag* inputTag = 0;
140  if (iEndRun) {
141  inputTag = &runInputTag_;
142  } else {
143  inputTag = &lumiInputTag_;
144  }
145 
146  std::string MsgLoggerCat = "EDMtoMEConverter_getData";
147 
148  if (verbosity >= 0)
149  edm::LogInfo (MsgLoggerCat) << "\nRestoring MonitorElements.";
150 
151  for (unsigned int ii = 0; ii < classtypes.size(); ++ii) {
152 
153  if (classtypes[ii] == "TH1F") {
154  edm::Handle<MEtoEDM<TH1F> > metoedm;
155  iGetFrom.getByLabel(*inputTag, metoedm);
156 
157  if (!metoedm.isValid()) {
158  //edm::LogWarning(MsgLoggerCat)
159  // << "MEtoEDM<TH1F> doesn't exist in run";
160  continue;
161  }
162 
163  std::vector<MEtoEDM<TH1F>::MEtoEDMObject> metoedmobject =
164  metoedm->getMEtoEdmObject();
165 
166  me1.resize(metoedmobject.size());
167 
168  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
169 
170  me1[i] = 0;
171 
172  // get full path of monitor element
173  std::string pathname = metoedmobject[i].name;
174  if (verbosity > 0) std::cout << pathname << std::endl;
175 
177 
178  // deconstruct path from fullpath
179  StringList fulldir = StringOps::split(pathname,"/");
180 
181  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
182  dir += fulldir[j];
183  if (j != fulldir.size() - 2) dir += "/";
184  }
185 
186  // define new monitor element
187  if (dbe) {
188  me1[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
189  if (me1[i] && me1[i]->getTH1F() && me1[i]->getTH1F()->TestBit(TH1::kCanRebin) == true) {
190  TList list;
191  list.Add(&metoedmobject[i].object);
192  if (me1[i]->getTH1F()->Merge(&list) == -1)
193  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
194  << metoedmobject[i].object.GetName() << "'" << std::endl;
195  } else {
196  dbe->setCurrentFolder(dir);
197  me1[i] = dbe->book1D(metoedmobject[i].object.GetName(),
198  &metoedmobject[i].object);
199  }
200  if (!iEndRun) me1[i]->setLumiFlag();
201  } // end define new monitor elements
202 
203  // attach taglist
204  TagList tags = metoedmobject[i].tags;
205 
206  for (unsigned int j = 0; j < tags.size(); ++j) {
207  dbe->tag(me1[i]->getFullname(),tags[j]);
208  }
209  } // end loop thorugh metoedmobject
210  } // end TH1F creation
211 
212  if (classtypes[ii] == "TH1S") {
213  edm::Handle<MEtoEDM<TH1S> > metoedm;
214  iGetFrom.getByLabel(*inputTag, metoedm);
215 
216  if (!metoedm.isValid()) {
217  //edm::LogWarning(MsgLoggerCat)
218  // << "MEtoEDM<TH1S> doesn't exist in run";
219  continue;
220  }
221 
222  std::vector<MEtoEDM<TH1S>::MEtoEDMObject> metoedmobject =
223  metoedm->getMEtoEdmObject();
224 
225  me1.resize(metoedmobject.size());
226 
227  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
228 
229  me1[i] = 0;
230 
231  // get full path of monitor element
232  std::string pathname = metoedmobject[i].name;
233  if (verbosity > 0) std::cout << pathname << std::endl;
234 
236 
237  // deconstruct path from fullpath
238  StringList fulldir = StringOps::split(pathname,"/");
239 
240  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
241  dir += fulldir[j];
242  if (j != fulldir.size() - 2) dir += "/";
243  }
244 
245  // define new monitor element
246  if (dbe) {
247  me1[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
248  if (me1[i] && me1[i]->getTH1S() && me1[i]->getTH1S()->TestBit(TH1::kCanRebin) == true) {
249  TList list;
250  list.Add(&metoedmobject[i].object);
251  if (me1[i]->getTH1S()->Merge(&list) == -1)
252  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
253  << metoedmobject[i].object.GetName() << "'" << std::endl;
254  } else {
255  dbe->setCurrentFolder(dir);
256  me1[i] = dbe->book1S(metoedmobject[i].object.GetName(),
257  &metoedmobject[i].object);
258  }
259  if (!iEndRun) me1[i]->setLumiFlag();
260  } // end define new monitor elements
261 
262  // attach taglist
263  TagList tags = metoedmobject[i].tags;
264 
265  for (unsigned int j = 0; j < tags.size(); ++j) {
266  dbe->tag(me1[i]->getFullname(),tags[j]);
267  }
268  } // end loop thorugh metoedmobject
269  } // end TH1S creation
270 
271  if (classtypes[ii] == "TH1D") {
272  edm::Handle<MEtoEDM<TH1D> > metoedm;
273  iGetFrom.getByLabel(*inputTag, metoedm);
274 
275  if (!metoedm.isValid()) {
276  //edm::LogWarning(MsgLoggerCat)
277  // << "MEtoEDM<TH1D> doesn't exist in run";
278  continue;
279  }
280 
281  std::vector<MEtoEDM<TH1D>::MEtoEDMObject> metoedmobject =
282  metoedm->getMEtoEdmObject();
283 
284  me1.resize(metoedmobject.size());
285 
286  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
287 
288  me1[i] = 0;
289 
290  // get full path of monitor element
291  std::string pathname = metoedmobject[i].name;
292  if (verbosity > 0) std::cout << pathname << std::endl;
293 
295 
296  // deconstruct path from fullpath
297  StringList fulldir = StringOps::split(pathname,"/");
298 
299  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
300  dir += fulldir[j];
301  if (j != fulldir.size() - 2) dir += "/";
302  }
303 
304  // define new monitor element
305  if (dbe) {
306  me1[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
307  if (me1[i] && me1[i]->getTH1D() && me1[i]->getTH1D()->TestBit(TH1::kCanRebin) == true) {
308  TList list;
309  list.Add(&metoedmobject[i].object);
310  if (me1[i]->getTH1D()->Merge(&list) == -1)
311  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
312  << metoedmobject[i].object.GetName() << "'" << std::endl;
313  } else {
314  dbe->setCurrentFolder(dir);
315  me1[i] = dbe->book1DD(metoedmobject[i].object.GetName(),
316  &metoedmobject[i].object);
317  }
318  if (!iEndRun) me1[i]->setLumiFlag();
319  } // end define new monitor elements
320 
321  // attach taglist
322  TagList tags = metoedmobject[i].tags;
323 
324  for (unsigned int j = 0; j < tags.size(); ++j) {
325  dbe->tag(me1[i]->getFullname(),tags[j]);
326  }
327  } // end loop thorugh metoedmobject
328  } // end TH1D creation
329 
330  if (classtypes[ii] == "TH2F") {
331  edm::Handle<MEtoEDM<TH2F> > metoedm;
332  iGetFrom.getByLabel(*inputTag, metoedm);
333 
334  if (!metoedm.isValid()) {
335  //edm::LogWarning(MsgLoggerCat)
336  // << "MEtoEDM<TH2F> doesn't exist in run";
337  continue;
338  }
339 
340  std::vector<MEtoEDM<TH2F>::MEtoEDMObject> metoedmobject =
341  metoedm->getMEtoEdmObject();
342 
343  me2.resize(metoedmobject.size());
344 
345  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
346 
347  me2[i] = 0;
348 
349  // get full path of monitor element
350  std::string pathname = metoedmobject[i].name;
351  if (verbosity > 0) std::cout << pathname << std::endl;
352 
354 
355  // deconstruct path from fullpath
356  StringList fulldir = StringOps::split(pathname,"/");
357 
358  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
359  dir += fulldir[j];
360  if (j != fulldir.size() - 2) dir += "/";
361  }
362 
363  // define new monitor element
364  if (dbe) {
365  me2[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
366  if (me2[i] && me2[i]->getTH2F() && me2[i]->getTH2F()->TestBit(TH1::kCanRebin) == true) {
367  TList list;
368  list.Add(&metoedmobject[i].object);
369  if (me2[i]->getTH2F()->Merge(&list) == -1)
370  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
371  << metoedmobject[i].object.GetName() << "'" << std::endl;
372  } else {
373  dbe->setCurrentFolder(dir);
374  me2[i] = dbe->book2D(metoedmobject[i].object.GetName(),
375  &metoedmobject[i].object);
376  }
377  if (!iEndRun) me2[i]->setLumiFlag();
378  } // end define new monitor elements
379 
380  // attach taglist
381  TagList tags = metoedmobject[i].tags;
382 
383  for (unsigned int j = 0; j < tags.size(); ++j) {
384  dbe->tag(me2[i]->getFullname(),tags[j]);
385  }
386  } // end loop thorugh metoedmobject
387  } // end TH2F creation
388 
389  if (classtypes[ii] == "TH2S") {
390  edm::Handle<MEtoEDM<TH2S> > metoedm;
391  iGetFrom.getByLabel(*inputTag, metoedm);
392 
393  if (!metoedm.isValid()) {
394  //edm::LogWarning(MsgLoggerCat)
395  // << "MEtoEDM<TH2S> doesn't exist in run";
396  continue;
397  }
398 
399  std::vector<MEtoEDM<TH2S>::MEtoEDMObject> metoedmobject =
400  metoedm->getMEtoEdmObject();
401 
402  me2.resize(metoedmobject.size());
403 
404  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
405 
406  me2[i] = 0;
407 
408  // get full path of monitor element
409  std::string pathname = metoedmobject[i].name;
410  if (verbosity > 0) std::cout << pathname << std::endl;
411 
413 
414  // deconstruct path from fullpath
415  StringList fulldir = StringOps::split(pathname,"/");
416 
417  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
418  dir += fulldir[j];
419  if (j != fulldir.size() - 2) dir += "/";
420  }
421 
422  // define new monitor element
423  if (dbe) {
424  me2[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
425  if (me2[i] && me2[i]->getTH2S() && me2[i]->getTH2S()->TestBit(TH1::kCanRebin) == true) {
426  TList list;
427  list.Add(&metoedmobject[i].object);
428  if (me2[i]->getTH2S()->Merge(&list) == -1)
429  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
430  << metoedmobject[i].object.GetName() << "'" << std::endl;
431  } else {
432  dbe->setCurrentFolder(dir);
433  me2[i] = dbe->book2S(metoedmobject[i].object.GetName(),
434  &metoedmobject[i].object);
435  }
436  if (!iEndRun) me2[i]->setLumiFlag();
437  } // end define new monitor elements
438 
439  // attach taglist
440  TagList tags = metoedmobject[i].tags;
441 
442  for (unsigned int j = 0; j < tags.size(); ++j) {
443  dbe->tag(me2[i]->getFullname(),tags[j]);
444  }
445  } // end loop thorugh metoedmobject
446  } // end TH2S creation
447 
448  if (classtypes[ii] == "TH2D") {
449  edm::Handle<MEtoEDM<TH2D> > metoedm;
450  iGetFrom.getByLabel(*inputTag, metoedm);
451 
452  if (!metoedm.isValid()) {
453  //edm::LogWarning(MsgLoggerCat)
454  // << "MEtoEDM<TH2D> doesn't exist in run";
455  continue;
456  }
457 
458  std::vector<MEtoEDM<TH2D>::MEtoEDMObject> metoedmobject =
459  metoedm->getMEtoEdmObject();
460 
461  me2.resize(metoedmobject.size());
462 
463  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
464 
465  me2[i] = 0;
466 
467  // get full path of monitor element
468  std::string pathname = metoedmobject[i].name;
469  if (verbosity > 0) std::cout << pathname << std::endl;
470 
472 
473  // deconstruct path from fullpath
474  StringList fulldir = StringOps::split(pathname,"/");
475 
476  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
477  dir += fulldir[j];
478  if (j != fulldir.size() - 2) dir += "/";
479  }
480 
481  // define new monitor element
482  if (dbe) {
483  me2[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
484  if (me2[i] && me2[i]->getTH2D() && me2[i]->getTH2D()->TestBit(TH1::kCanRebin) == true) {
485  TList list;
486  list.Add(&metoedmobject[i].object);
487  if (me2[i]->getTH2D()->Merge(&list) == -1)
488  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
489  << metoedmobject[i].object.GetName() << "'" << std::endl;
490  } else {
491  dbe->setCurrentFolder(dir);
492  me2[i] = dbe->book2DD(metoedmobject[i].object.GetName(),
493  &metoedmobject[i].object);
494  }
495  if (!iEndRun) me2[i]->setLumiFlag();
496  } // end define new monitor elements
497 
498  // attach taglist
499  TagList tags = metoedmobject[i].tags;
500 
501  for (unsigned int j = 0; j < tags.size(); ++j) {
502  dbe->tag(me2[i]->getFullname(),tags[j]);
503  }
504  } // end loop thorugh metoedmobject
505  } // end TH2D creation
506 
507  if (classtypes[ii] == "TH3F") {
508  edm::Handle<MEtoEDM<TH3F> > metoedm;
509  iGetFrom.getByLabel(*inputTag, metoedm);
510 
511  if (!metoedm.isValid()) {
512  //edm::LogWarning(MsgLoggerCat)
513  // << "MEtoEDM<TH3F> doesn't exist in run";
514  continue;
515  }
516 
517  std::vector<MEtoEDM<TH3F>::MEtoEDMObject> metoedmobject =
518  metoedm->getMEtoEdmObject();
519 
520  me3.resize(metoedmobject.size());
521 
522  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
523 
524  me3[i] = 0;
525 
526  // get full path of monitor element
527  std::string pathname = metoedmobject[i].name;
528  if (verbosity > 0) std::cout << pathname << std::endl;
529 
531 
532  // deconstruct path from fullpath
533  StringList fulldir = StringOps::split(pathname,"/");
534 
535  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
536  dir += fulldir[j];
537  if (j != fulldir.size() - 2) dir += "/";
538  }
539 
540  // define new monitor element
541  if (dbe) {
542  me3[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
543  if (me3[i] && me3[i]->getTH3F() && me3[i]->getTH3F()->TestBit(TH1::kCanRebin) == true) {
544  TList list;
545  list.Add(&metoedmobject[i].object);
546  if (me3[i]->getTH3F()->Merge(&list) == -1)
547  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
548  << metoedmobject[i].object.GetName() << "'" << std::endl;
549  } else {
550  dbe->setCurrentFolder(dir);
551  me3[i] = dbe->book3D(metoedmobject[i].object.GetName(),
552  &metoedmobject[i].object);
553  }
554  if (!iEndRun) me3[i]->setLumiFlag();
555  } // end define new monitor elements
556 
557  // attach taglist
558  TagList tags = metoedmobject[i].tags;
559 
560  for (unsigned int j = 0; j < tags.size(); ++j) {
561  dbe->tag(me3[i]->getFullname(),tags[j]);
562  }
563  } // end loop thorugh metoedmobject
564  } // end TH3F creation
565 
566  if (classtypes[ii] == "TProfile") {
568  iGetFrom.getByLabel(*inputTag, metoedm);
569 
570  if (!metoedm.isValid()) {
571  //edm::LogWarning(MsgLoggerCat)
572  // << "MEtoEDM<TProfile> doesn't exist in run";
573  continue;
574  }
575 
576  std::vector<MEtoEDM<TProfile>::MEtoEDMObject> metoedmobject =
577  metoedm->getMEtoEdmObject();
578 
579  me4.resize(metoedmobject.size());
580 
581  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
582 
583  me4[i] = 0;
584 
585  // get full path of monitor element
586  std::string pathname = metoedmobject[i].name;
587  if (verbosity > 0) std::cout << pathname << std::endl;
588 
590 
591  // deconstruct path from fullpath
592  StringList fulldir = StringOps::split(pathname,"/");
593 
594  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
595  dir += fulldir[j];
596  if (j != fulldir.size() - 2) dir += "/";
597  }
598 
599  std::string name = metoedmobject[i].object.GetName();
600  // define new monitor element
601  if (dbe) {
602  me4[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
603  if (me4[i] && me4[i]->getTProfile() && me4[i]->getTProfile()->TestBit(TH1::kCanRebin) == true) {
604  TList list;
605  list.Add(&metoedmobject[i].object);
606  if (me4[i]->getTProfile()->Merge(&list) == -1)
607  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
608  << metoedmobject[i].object.GetName() << "'" << std::endl;
609  } else {
610  dbe->setCurrentFolder(dir);
611  me4[i] = dbe->bookProfile(metoedmobject[i].object.GetName(),
612  &metoedmobject[i].object);
613  }
614  if (!iEndRun) me4[i]->setLumiFlag();
615  } // end define new monitor elements
616 
617  // attach taglist
618  TagList tags = metoedmobject[i].tags;
619 
620  for (unsigned int j = 0; j < tags.size(); ++j) {
621  dbe->tag(me4[i]->getFullname(),tags[j]);
622  }
623  } // end loop thorugh metoedmobject
624  } // end TProfile creation
625 
626  if (classtypes[ii] == "TProfile2D") {
628  iGetFrom.getByLabel(*inputTag, metoedm);
629 
630  if (!metoedm.isValid()) {
631  //edm::LogWarning(MsgLoggerCat)
632  // << "MEtoEDM<TProfile2D> doesn't exist in run";
633  continue;
634  }
635 
636  std::vector<MEtoEDM<TProfile2D>::MEtoEDMObject> metoedmobject =
637  metoedm->getMEtoEdmObject();
638 
639  me5.resize(metoedmobject.size());
640 
641  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
642 
643  me5[i] = 0;
644 
645  // get full path of monitor element
646  std::string pathname = metoedmobject[i].name;
647  if (verbosity > 0) std::cout << pathname << std::endl;
648 
650 
651  // deconstruct path from fullpath
652  StringList fulldir = StringOps::split(pathname,"/");
653 
654  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
655  dir += fulldir[j];
656  if (j != fulldir.size() - 2) dir += "/";
657  }
658 
659  // define new monitor element
660  if (dbe) {
661  me5[i] = dbe->get(dir+"/"+metoedmobject[i].object.GetName());
662  if (me5[i] && me5[i]->getTProfile2D() && me5[i]->getTProfile2D()->TestBit(TH1::kCanRebin) == true) {
663  TList list;
664  list.Add(&metoedmobject[i].object);
665  if (me5[i]->getTProfile2D()->Merge(&list) == -1)
666  std::cout << "ERROR EDMtoMEConverter::getData(): merge failed for '"
667  << metoedmobject[i].object.GetName() << "'" << std::endl;
668  } else {
669  dbe->setCurrentFolder(dir);
670  me5[i] = dbe->bookProfile2D(metoedmobject[i].object.GetName(),
671  &metoedmobject[i].object);
672  }
673  if (!iEndRun) me5[i]->setLumiFlag();
674  } // end define new monitor elements
675 
676  // attach taglist
677  TagList tags = metoedmobject[i].tags;
678 
679  for (unsigned int j = 0; j < tags.size(); ++j) {
680  dbe->tag(me5[i]->getFullname(),tags[j]);
681  }
682  } // end loop thorugh metoedmobject
683  } // end TProfile2D creation
684 
685  if (classtypes[ii] == "Double") {
686  edm::Handle<MEtoEDM<double> > metoedm;
687  iGetFrom.getByLabel(*inputTag, metoedm);
688 
689  if (!metoedm.isValid()) {
690  //edm::LogWarning(MsgLoggerCat)
691  // << "MEtoEDM<double> doesn't exist in run";
692  continue;
693  }
694 
695  std::vector<MEtoEDM<double>::MEtoEDMObject> metoedmobject =
696  metoedm->getMEtoEdmObject();
697 
698  me6.resize(metoedmobject.size());
699 
700  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
701 
702  me6[i] = 0;
703 
704  // get full path of monitor element
705  std::string pathname = metoedmobject[i].name;
706  if (verbosity > 0) std::cout << pathname << std::endl;
707 
710 
711  // deconstruct path from fullpath
712 
713  StringList fulldir = StringOps::split(pathname,"/");
714  name = *(fulldir.end() - 1);
715 
716  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
717  dir += fulldir[j];
718  if (j != fulldir.size() - 2) dir += "/";
719  }
720 
721  // define new monitor element
722  if (dbe) {
723  dbe->setCurrentFolder(dir);
724  me6[i] = dbe->bookFloat(name);
725  me6[i]->Fill(metoedmobject[i].object);
726  if (!iEndRun) me6[i]->setLumiFlag();
727  } // end define new monitor elements
728 
729  // attach taglist
730  TagList tags = metoedmobject[i].tags;
731 
732  for (unsigned int j = 0; j < tags.size(); ++j) {
733  dbe->tag(me6[i]->getFullname(),tags[j]);
734  }
735  } // end loop thorugh metoedmobject
736  } // end Float creation
737 
738  if (classtypes[ii] == "Int64") {
740  iGetFrom.getByLabel(*inputTag, metoedm);
741 
742  if (!metoedm.isValid()) {
743  //edm::LogWarning(MsgLoggerCat)
744  // << "MEtoEDM<long long> doesn't exist in run";
745  continue;
746  }
747 
748  std::vector<MEtoEDM<long long>::MEtoEDMObject> metoedmobject =
749  metoedm->getMEtoEdmObject();
750 
751  me7.resize(metoedmobject.size());
752 
753  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
754 
755  me7[i] = 0;
756 
757  // get full path of monitor element
758  std::string pathname = metoedmobject[i].name;
759  if (verbosity > 0) std::cout << pathname << std::endl;
760 
763 
764  // deconstruct path from fullpath
765  StringList fulldir = StringOps::split(pathname,"/");
766  name = *(fulldir.end() - 1);
767 
768  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
769  dir += fulldir[j];
770  if (j != fulldir.size() - 2) dir += "/";
771  }
772 
773  // define new monitor element
774  if (dbe) {
775  dbe->setCurrentFolder(dir);
776  long long ival = 0;
777  if ( iEndRun ) {
778  if (name.find("processedEvents") != std::string::npos) {
779  if (MonitorElement* me = dbe->get(dir+"/"+name)) {
780  ival = me->getIntValue();
781  }
782  }
783  }
784  me7[i] = dbe->bookInt(name);
785  me7[i]->Fill(metoedmobject[i].object+ival);
786  if (!iEndRun) me7[i]->setLumiFlag();
787  } // end define new monitor elements
788 
789  // attach taglist
790  TagList tags = metoedmobject[i].tags;
791 
792  for (unsigned int j = 0; j < tags.size(); ++j) {
793  dbe->tag(me7[i]->getFullname(),tags[j]);
794  }
795  } // end loop thorugh metoedmobject
796  } // end Int creation
797 
798  if (classtypes[ii] == "Int") {
799  edm::Handle<MEtoEDM<int> > metoedm;
800  iGetFrom.getByLabel(*inputTag, metoedm);
801 
802  if (!metoedm.isValid()) {
803  //edm::LogWarning(MsgLoggerCat)
804  // << "MEtoEDM<int> doesn't exist in run";
805  continue;
806  }
807 
808  std::vector<MEtoEDM<int>::MEtoEDMObject> metoedmobject =
809  metoedm->getMEtoEdmObject();
810 
811  me7.resize(metoedmobject.size());
812 
813  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
814 
815  me7[i] = 0;
816 
817  // get full path of monitor element
818  std::string pathname = metoedmobject[i].name;
819  if (verbosity > 0) std::cout << pathname << std::endl;
820 
823 
824  // deconstruct path from fullpath
825  StringList fulldir = StringOps::split(pathname,"/");
826  name = *(fulldir.end() - 1);
827 
828  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
829  dir += fulldir[j];
830  if (j != fulldir.size() - 2) dir += "/";
831  }
832 
833  // define new monitor element
834  if (dbe) {
835  dbe->setCurrentFolder(dir);
836  int ival = 0;
837  if ( iEndRun ) {
838  if (name.find("processedEvents") != std::string::npos) {
839  if (MonitorElement* me = dbe->get(dir+"/"+name)) {
840  ival = me->getIntValue();
841  }
842  }
843  }
844  me7[i] = dbe->bookInt(name);
845  me7[i]->Fill(metoedmobject[i].object+ival);
846  if (!iEndRun) me7[i]->setLumiFlag();
847  } // end define new monitor elements
848 
849  // attach taglist
850  TagList tags = metoedmobject[i].tags;
851 
852  for (unsigned int j = 0; j < tags.size(); ++j) {
853  dbe->tag(me7[i]->getFullname(),tags[j]);
854  }
855  } // end loop thorugh metoedmobject
856  } // end Int creation
857 
858  if (classtypes[ii] == "String") {
860  iGetFrom.getByLabel(*inputTag, metoedm);
861 
862  if (!metoedm.isValid()) {
863  //edm::LogWarning(MsgLoggerCat)
864  // << "MEtoEDM<TString> doesn't exist in run";
865  continue;
866  }
867 
868  std::vector<MEtoEDM<TString>::MEtoEDMObject> metoedmobject =
869  metoedm->getMEtoEdmObject();
870 
871  me8.resize(metoedmobject.size());
872 
873  for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
874 
875  me8[i] = 0;
876 
877  // get full path of monitor element
878  std::string pathname = metoedmobject[i].name;
879  if (verbosity > 0) std::cout << pathname << std::endl;
880 
883 
884  // deconstruct path from fullpath
885  StringList fulldir = StringOps::split(pathname,"/");
886  name = *(fulldir.end() - 1);
887 
888  for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
889  dir += fulldir[j];
890  if (j != fulldir.size() - 2) dir += "/";
891  }
892 
893  // define new monitor element
894  if (dbe) {
895  dbe->setCurrentFolder(dir);
896  std::string scont = metoedmobject[i].object.Data();
897  me8[i] = dbe->bookString(name,scont);
898  if (!iEndRun) me8[i]->setLumiFlag();
899  } // end define new monitor elements
900 
901  // attach taglist
902  TagList tags = metoedmobject[i].tags;
903 
904  for (unsigned int j = 0; j < tags.size(); ++j) {
905  dbe->tag(me8[i]->getFullname(),tags[j]);
906  }
907  } // end loop thorugh metoedmobject
908  } // end String creation
909  }
910 
911  // verify tags stored properly
912  if (verbosity > 0) {
913  std::vector<std::string> stags;
914  dbe->getAllTags(stags);
915  for (unsigned int i = 0; i < stags.size(); ++i) {
916  std::cout << "Tags: " << stags[i] << std::endl;
917  }
918  }
919 
920 }
std::vector< uint32_t > TagList
int i
Definition: DBlmapReader.cc:9
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
Definition: DQMStore.cc:1022
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:1134
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
Definition: DQMStore.cc:1044
std::vector< MonitorElement * > me6
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:904
int ii
Definition: cuy.py:588
std::vector< std::string > classtypes
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
edm::InputTag lumiInputTag_
std::vector< MonitorElement * > me8
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:838
TH3F * getTH3F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
std::vector< MonitorElement * > me7
std::vector< MonitorElement * > me1
edm::InputTag runInputTag_
std::vector< MonitorElement * > me4
std::vector< MonitorElement * > me5
int j
Definition: DBlmapReader.cc:9
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
TProfile2D * getTProfile2D(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
bool isValid() const
Definition: HandleBase.h:76
tuple tags
Definition: o2o.py:248
void getAllTags(std::vector< std::string > &into) const
Definition: DQMStore.cc:1783
std::vector< MonitorElement * > me2
TH2F * getTH2F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:779
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
std::vector< MonitorElement * > me3
double split
Definition: MVATrainer.cc:139
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:888
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
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 list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1330
void EDMtoMEConverter::respondToOpenInputFile ( const edm::FileBlock iFb)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file EDMtoMEConverter.cc.

References iCountf.

87 {
88  ++iCountf;
89  return;
90 }
unsigned int iCountf

Member Data Documentation

std::vector<std::string> EDMtoMEConverter::classtypes
private

Definition at line 86 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and getData().

bool EDMtoMEConverter::convertOnEndLumi
private

Definition at line 76 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and endLuminosityBlock().

bool EDMtoMEConverter::convertOnEndRun
private

Definition at line 77 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and endRun().

DQMStore* EDMtoMEConverter::dbe
private

Definition at line 79 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and getData().

int EDMtoMEConverter::frequency
private

Definition at line 74 of file EDMtoMEConverter.h.

Referenced by beginRun(), and EDMtoMEConverter().

std::map<int,int> EDMtoMEConverter::iCount
private

Definition at line 84 of file EDMtoMEConverter.h.

Referenced by beginRun(), EDMtoMEConverter(), and endJob().

unsigned int EDMtoMEConverter::iCountf
private

Definition at line 83 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), endJob(), and respondToOpenInputFile().

edm::InputTag EDMtoMEConverter::lumiInputTag_
private

Definition at line 89 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me1
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me2
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me3
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me4
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me5
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me6
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me7
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::vector<MonitorElement*> EDMtoMEConverter::me8
private

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by getData().

std::string EDMtoMEConverter::name
private
edm::InputTag EDMtoMEConverter::runInputTag_
private

Definition at line 88 of file EDMtoMEConverter.h.

Referenced by getData().

int EDMtoMEConverter::verbosity
private

Definition at line 73 of file EDMtoMEConverter.h.

Referenced by beginRun(), EDMtoMEConverter(), endJob(), and getData().