CMS 3D CMS Logo

EDMtoMEConverter Class Reference

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

#include <DQMServices/Components/plugins/EDMtoMEConverter.h>

Inheritance diagram for EDMtoMEConverter:

edm::EDAnalyzer

List of all members.

Public Types

typedef std::vector< uint32_t > TagList

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (const edm::EventSetup &)
virtual void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
virtual void convert (const edm::Run &, const bool endrun)
 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 &)
virtual void respondToOpenInputFile (const edm::FileBlock &)
virtual ~EDMtoMEConverter ()

Private Attributes

std::vector< std::string > classtypes
bool convertOnEndLumi
bool convertOnEndRun
std::map< int, intcount
unsigned int countf
DQMStoredbe
int frequency
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
int prescaleFactor
bool releaseTag
int verbosity


Detailed Description

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

Date
2008/09/22 17:26:01
Revision
1.12
Author:
M. Strang SUNY-Buffalo

Definition at line 53 of file EDMtoMEConverter.h.


Member Typedef Documentation

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

Definition at line 71 of file EDMtoMEConverter.h.


Constructor & Destructor Documentation

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

Definition at line 12 of file EDMtoMEConverter.cc.

References classtypes, convertOnEndLumi, convertOnEndRun, count, countf, dbe, frequency, edm::ParameterSet::getUntrackedParameter(), name, prescaleFactor, releaseTag, DQMStore::setVerbose(), and verbosity.

00012                                                                 :
00013   verbosity(0), frequency(0)
00014 {
00015   std::string MsgLoggerCat = "EDMtoMEConverter_EDMtoMEConverter";
00016 
00017   // get information from parameter set
00018   name = iPSet.getUntrackedParameter<std::string>("Name");
00019   verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
00020   frequency = iPSet.getUntrackedParameter<int>("Frequency");
00021 
00022   convertOnEndLumi = iPSet.getUntrackedParameter<bool>("convertOnEndLumi",false);
00023   convertOnEndRun = iPSet.getUntrackedParameter<bool>("convertOnEndRun",false);
00024 
00025   prescaleFactor = iPSet.getUntrackedParameter<int>("prescaleFactor", 1);
00026 
00027   // reset the release tag
00028   releaseTag = false;
00029 
00030   // use value of first digit to determine default output level (inclusive)
00031   // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
00032   verbosity %= 10;
00033 
00034   // get dqm info
00035   dbe = 0;
00036   dbe = edm::Service<DQMStore>().operator->();
00037   if (dbe) {
00038     if (verbosity) {
00039       dbe->setVerbose(1);
00040     } else {
00041       dbe->setVerbose(0);
00042     }
00043   }
00044 
00045   // print out Parameter Set information being used
00046   if (verbosity >= 0) {
00047     edm::LogInfo(MsgLoggerCat)
00048       << "\n===============================\n"
00049       << "Initialized as EDAnalyzer with parameter values:\n"
00050       << "    Name          = " << name << "\n"
00051       << "    Verbosity     = " << verbosity << "\n"
00052       << "    Frequency     = " << frequency << "\n"
00053       << "===============================\n";
00054   }
00055 
00056   classtypes.clear();
00057   classtypes.push_back("TH1F");
00058   classtypes.push_back("TH1S");
00059   classtypes.push_back("TH2F");
00060   classtypes.push_back("TH2S");
00061   classtypes.push_back("TH3F");
00062   classtypes.push_back("TProfile");
00063   classtypes.push_back("TProfile2D");
00064   classtypes.push_back("Float");
00065   classtypes.push_back("Int");
00066   classtypes.push_back("String");
00067 
00068   count.clear();
00069   countf = 0;
00070 
00071 } // end constructor

EDMtoMEConverter::~EDMtoMEConverter (  )  [virtual]

Definition at line 73 of file EDMtoMEConverter.cc.

00073 {}


Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 147 of file EDMtoMEConverter.cc.

00149 {
00150   return;
00151 }

void EDMtoMEConverter::beginJob ( const edm::EventSetup iSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file EDMtoMEConverter.cc.

00076 {
00077   return;
00078 }

void EDMtoMEConverter::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 128 of file EDMtoMEConverter.cc.

00130 {
00131   return;
00132 }

void EDMtoMEConverter::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file EDMtoMEConverter.cc.

References count, frequency, edm::Run::run(), and verbosity.

00099 {
00100   std::string MsgLoggerCat = "EDMtoMEConverter_beginRun";
00101 
00102   int nrun = iRun.run();
00103 
00104   // keep track of number of unique runs processed
00105   ++count[nrun];
00106 
00107   if (verbosity) {
00108     edm::LogInfo(MsgLoggerCat)
00109       << "Processing run " << nrun << " (" << count.size() << " runs total)";
00110   } else if (verbosity == 0) {
00111     if (nrun%frequency == 0 || count.size() == 1) {
00112       edm::LogInfo(MsgLoggerCat)
00113         << "Processing run " << nrun << " (" << count.size() << " runs total)";
00114     }
00115   }
00116 
00117 }

void EDMtoMEConverter::convert ( const edm::Run iRun,
const bool  endrun 
) [virtual]

Definition at line 153 of file EDMtoMEConverter.cc.

References DQMStore::book1D(), DQMStore::book1S(), DQMStore::book2D(), DQMStore::book2S(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), DQMStore::cd(), classtypes, GenMuonPlsPt100GeV_cfg::cout, dbe, dir, lat::endl(), DQMStore::get(), DQMStore::getAllTags(), edm::DataViewImpl::getByType(), i, edm::Handle< T >::isValid(), j, me, me1, me2, me3, me4, me5, me6, me7, me8, name, release(), releaseTag, DQMStore::setCurrentFolder(), split, DQMStore::tag(), and verbosity.

Referenced by endLuminosityBlock(), and endRun().

00154 {
00155   std::string MsgLoggerCat = "EDMtoMEConverter_convert";
00156 
00157   if (verbosity >= 0)
00158     edm::LogInfo (MsgLoggerCat) << "\nRestoring MonitorElements.";
00159 
00160   for (unsigned int ii = 0; ii < classtypes.size(); ++ii) {
00161 
00162     if (classtypes[ii] == "TH1F") {
00163       edm::Handle<MEtoEDM<TH1F> > metoedm;
00164       iRun.getByType(metoedm);
00165 
00166       if (!metoedm.isValid()) {
00167         //edm::LogWarning(MsgLoggerCat)
00168         //  << "MEtoEDM<TH1F> doesn't exist in run";
00169         continue;
00170       }
00171 
00172       std::vector<MEtoEDM<TH1F>::MEtoEDMObject> metoedmobject =
00173         metoedm->getMEtoEdmObject();
00174 
00175       me1.resize(metoedmobject.size());
00176 
00177       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00178 
00179         me1[i] = 0;
00180 
00181         // get full path of monitor element
00182         std::string pathname = metoedmobject[i].name;
00183         if (verbosity) std::cout << pathname << std::endl;
00184 
00185         // set the release tag if it has not be yet done
00186         if (!releaseTag)
00187         {
00188           dbe->cd();
00189           dbe->bookString(
00190             "ReleaseTag",
00191             metoedmobject[i].
00192             release.substr(1,metoedmobject[i].release.size()-2)
00193           );
00194           releaseTag = true;
00195         }
00196 
00197         std::string dir;
00198 
00199         // deconstruct path from fullpath
00200         StringList fulldir = StringOps::split(pathname,"/");
00201 
00202         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00203           dir += fulldir[j];
00204           if (j != fulldir.size() - 2) dir += "/";
00205         }
00206 
00207         // define new monitor element
00208         if (dbe) {
00209           dbe->setCurrentFolder(dir);
00210           me1[i] = dbe->book1D(metoedmobject[i].object.GetName(),
00211                                &metoedmobject[i].object);
00212         } // end define new monitor elements
00213 
00214         // attach taglist
00215         TagList tags = metoedmobject[i].tags;
00216 
00217         for (unsigned int j = 0; j < tags.size(); ++j) {
00218           dbe->tag(me1[i]->getFullname(),tags[j]);
00219         }
00220       } // end loop thorugh metoedmobject
00221     } // end TH1F creation
00222 
00223     if (classtypes[ii] == "TH1S") {
00224       edm::Handle<MEtoEDM<TH1S> > metoedm;
00225       iRun.getByType(metoedm);
00226 
00227       if (!metoedm.isValid()) {
00228         //edm::LogWarning(MsgLoggerCat)
00229         //  << "MEtoEDM<TH1S> doesn't exist in run";
00230         continue;
00231       }
00232 
00233       std::vector<MEtoEDM<TH1S>::MEtoEDMObject> metoedmobject =
00234         metoedm->getMEtoEdmObject();
00235 
00236       me1.resize(metoedmobject.size());
00237 
00238       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00239 
00240         me1[i] = 0;
00241 
00242         // get full path of monitor element
00243         std::string pathname = metoedmobject[i].name;
00244         if (verbosity) std::cout << pathname << std::endl;
00245 
00246         // set the release tag if it has not be yet done
00247         if (!releaseTag)
00248         {
00249           dbe->cd();
00250           dbe->bookString(
00251             "ReleaseTag",
00252             metoedmobject[i].
00253             release.substr(1,metoedmobject[i].release.size()-2)
00254           );
00255           releaseTag = true;
00256         }
00257 
00258         std::string dir;
00259 
00260         // deconstruct path from fullpath
00261         StringList fulldir = StringOps::split(pathname,"/");
00262 
00263         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00264           dir += fulldir[j];
00265           if (j != fulldir.size() - 2) dir += "/";
00266         }
00267 
00268         // define new monitor element
00269         if (dbe) {
00270           dbe->setCurrentFolder(dir);
00271           me1[i] = dbe->book1S(metoedmobject[i].object.GetName(),
00272                                &metoedmobject[i].object);
00273         } // end define new monitor elements
00274 
00275         // attach taglist
00276         TagList tags = metoedmobject[i].tags;
00277 
00278         for (unsigned int j = 0; j < tags.size(); ++j) {
00279           dbe->tag(me1[i]->getFullname(),tags[j]);
00280         }
00281       } // end loop thorugh metoedmobject
00282     } // end TH1S creation
00283 
00284     if (classtypes[ii] == "TH2F") {
00285       edm::Handle<MEtoEDM<TH2F> > metoedm;
00286       iRun.getByType(metoedm);
00287 
00288       if (!metoedm.isValid()) {
00289         //edm::LogWarning(MsgLoggerCat)
00290         //  << "MEtoEDM<TH2F> doesn't exist in run";
00291         continue;
00292       }
00293 
00294       std::vector<MEtoEDM<TH2F>::MEtoEDMObject> metoedmobject =
00295         metoedm->getMEtoEdmObject();
00296 
00297       me2.resize(metoedmobject.size());
00298 
00299       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00300 
00301         me2[i] = 0;
00302 
00303         // get full path of monitor element
00304         std::string pathname = metoedmobject[i].name;
00305         if (verbosity) std::cout << pathname << std::endl;
00306 
00307         // set the release tag if it has not be yet done
00308         if (!releaseTag)
00309         {
00310           dbe->cd();
00311           dbe->bookString(
00312             "ReleaseTag",
00313             metoedmobject[i].
00314             release.substr(1,metoedmobject[i].release.size()-2)
00315           );
00316           releaseTag = true;
00317         }
00318 
00319         std::string dir;
00320 
00321         // deconstruct path from fullpath
00322         StringList fulldir = StringOps::split(pathname,"/");
00323 
00324         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00325           dir += fulldir[j];
00326           if (j != fulldir.size() - 2) dir += "/";
00327         }
00328 
00329         // define new monitor element
00330         if (dbe) {
00331           dbe->setCurrentFolder(dir);
00332           me2[i] = dbe->book2D(metoedmobject[i].object.GetName(),
00333                                &metoedmobject[i].object);
00334         } // end define new monitor elements
00335 
00336         // attach taglist
00337         TagList tags = metoedmobject[i].tags;
00338 
00339         for (unsigned int j = 0; j < tags.size(); ++j) {
00340           dbe->tag(me2[i]->getFullname(),tags[j]);
00341         }
00342       } // end loop thorugh metoedmobject
00343     } // end TH2F creation
00344 
00345     if (classtypes[ii] == "TH2S") {
00346       edm::Handle<MEtoEDM<TH2S> > metoedm;
00347       iRun.getByType(metoedm);
00348 
00349       if (!metoedm.isValid()) {
00350         //edm::LogWarning(MsgLoggerCat)
00351         //  << "MEtoEDM<TH2S> doesn't exist in run";
00352         continue;
00353       }
00354 
00355       std::vector<MEtoEDM<TH2S>::MEtoEDMObject> metoedmobject =
00356         metoedm->getMEtoEdmObject();
00357 
00358       me2.resize(metoedmobject.size());
00359 
00360       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00361 
00362         me2[i] = 0;
00363 
00364         // get full path of monitor element
00365         std::string pathname = metoedmobject[i].name;
00366         if (verbosity) std::cout << pathname << std::endl;
00367 
00368         // set the release tag if it has not be yet done
00369         if (!releaseTag)
00370         {
00371           dbe->cd();
00372           dbe->bookString(
00373             "ReleaseTag",
00374             metoedmobject[i].
00375             release.substr(1,metoedmobject[i].release.size()-2)
00376           );
00377           releaseTag = true;
00378         }
00379 
00380         std::string dir;
00381 
00382         // deconstruct path from fullpath
00383         StringList fulldir = StringOps::split(pathname,"/");
00384 
00385         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00386           dir += fulldir[j];
00387           if (j != fulldir.size() - 2) dir += "/";
00388         }
00389 
00390         // define new monitor element
00391         if (dbe) {
00392           dbe->setCurrentFolder(dir);
00393           me2[i] = dbe->book2S(metoedmobject[i].object.GetName(),
00394                                &metoedmobject[i].object);
00395         } // end define new monitor elements
00396 
00397         // attach taglist
00398         TagList tags = metoedmobject[i].tags;
00399 
00400         for (unsigned int j = 0; j < tags.size(); ++j) {
00401           dbe->tag(me2[i]->getFullname(),tags[j]);
00402         }
00403       } // end loop thorugh metoedmobject
00404     } // end TH2S creation
00405 
00406     if (classtypes[ii] == "TH3F") {
00407       edm::Handle<MEtoEDM<TH3F> > metoedm;
00408       iRun.getByType(metoedm);
00409 
00410       if (!metoedm.isValid()) {
00411         //edm::LogWarning(MsgLoggerCat)
00412         //  << "MEtoEDM<TH3F> doesn't exist in run";
00413         continue;
00414       }
00415 
00416       std::vector<MEtoEDM<TH3F>::MEtoEDMObject> metoedmobject =
00417         metoedm->getMEtoEdmObject();
00418 
00419       me3.resize(metoedmobject.size());
00420 
00421       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00422 
00423         me3[i] = 0;
00424 
00425         // get full path of monitor element
00426         std::string pathname = metoedmobject[i].name;
00427         if (verbosity) std::cout << pathname << std::endl;
00428 
00429         // set the release tag if it has not be yet done
00430         if (!releaseTag)
00431         {
00432           dbe->cd();
00433           dbe->bookString(
00434             "ReleaseTag",
00435             metoedmobject[i].
00436             release.substr(1,metoedmobject[i].release.size()-2)
00437           );
00438           releaseTag = true;
00439         }
00440 
00441         std::string dir;
00442 
00443         // deconstruct path from fullpath
00444         StringList fulldir = StringOps::split(pathname,"/");
00445 
00446         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00447           dir += fulldir[j];
00448           if (j != fulldir.size() - 2) dir += "/";
00449         }
00450 
00451         // define new monitor element
00452         if (dbe) {
00453           dbe->setCurrentFolder(dir);
00454           me3[i] = dbe->book3D(metoedmobject[i].object.GetName(),
00455                                &metoedmobject[i].object);
00456         } // end define new monitor elements
00457 
00458         // attach taglist
00459         TagList tags = metoedmobject[i].tags;
00460 
00461         for (unsigned int j = 0; j < tags.size(); ++j) {
00462           dbe->tag(me3[i]->getFullname(),tags[j]);
00463         }
00464       } // end loop thorugh metoedmobject
00465     } // end TH3F creation
00466 
00467     if (classtypes[ii] == "TProfile") {
00468       edm::Handle<MEtoEDM<TProfile> > metoedm;
00469       iRun.getByType(metoedm);
00470 
00471       if (!metoedm.isValid()) {
00472         //edm::LogWarning(MsgLoggerCat)
00473         //  << "MEtoEDM<TProfile> doesn't exist in run";
00474         continue;
00475       }
00476 
00477       std::vector<MEtoEDM<TProfile>::MEtoEDMObject> metoedmobject =
00478         metoedm->getMEtoEdmObject();
00479 
00480       me4.resize(metoedmobject.size());
00481 
00482       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00483 
00484         me4[i] = 0;
00485 
00486         // get full path of monitor element
00487         std::string pathname = metoedmobject[i].name;
00488         if (verbosity) std::cout << pathname << std::endl;
00489 
00490         // set the release tag if it has not be yet done
00491         if (!releaseTag)
00492         {
00493           dbe->cd();
00494           dbe->bookString(
00495             "ReleaseTag",
00496             metoedmobject[i].
00497             release.substr(1,metoedmobject[i].release.size()-2)
00498           );
00499           releaseTag = true;
00500         }
00501 
00502         std::string dir;
00503 
00504         // deconstruct path from fullpath
00505         StringList fulldir = StringOps::split(pathname,"/");
00506 
00507         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00508           dir += fulldir[j];
00509           if (j != fulldir.size() - 2) dir += "/";
00510         }
00511 
00512         // define new monitor element
00513         if (dbe) {
00514           dbe->setCurrentFolder(dir);
00515           me4[i] = dbe->bookProfile(metoedmobject[i].object.GetName(),
00516                                     &metoedmobject[i].object);
00517         } // end define new monitor elements
00518 
00519         // attach taglist
00520         TagList tags = metoedmobject[i].tags;
00521 
00522         for (unsigned int j = 0; j < tags.size(); ++j) {
00523           dbe->tag(me4[i]->getFullname(),tags[j]);
00524         }
00525       } // end loop thorugh metoedmobject
00526     } // end TProfile creation
00527 
00528     if (classtypes[ii] == "TProfile2D") {
00529       edm::Handle<MEtoEDM<TProfile2D> > metoedm;
00530       iRun.getByType(metoedm);
00531 
00532       if (!metoedm.isValid()) {
00533         //edm::LogWarning(MsgLoggerCat)
00534         //  << "MEtoEDM<TProfile2D> doesn't exist in run";
00535         continue;
00536       }
00537 
00538       std::vector<MEtoEDM<TProfile2D>::MEtoEDMObject> metoedmobject =
00539         metoedm->getMEtoEdmObject();
00540 
00541       me5.resize(metoedmobject.size());
00542 
00543       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00544 
00545         me5[i] = 0;
00546 
00547         // get full path of monitor element
00548         std::string pathname = metoedmobject[i].name;
00549         if (verbosity) std::cout << pathname << std::endl;
00550 
00551         // set the release tag if it has not be yet done
00552         if (!releaseTag)
00553         {
00554           dbe->cd();
00555           dbe->bookString(
00556             "ReleaseTag",
00557             metoedmobject[i].
00558             release.substr(1,metoedmobject[i].release.size()-2)
00559           );
00560           releaseTag = true;
00561         }
00562 
00563         std::string dir;
00564 
00565         // deconstruct path from fullpath
00566         StringList fulldir = StringOps::split(pathname,"/");
00567 
00568         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00569           dir += fulldir[j];
00570           if (j != fulldir.size() - 2) dir += "/";
00571         }
00572 
00573         // define new monitor element
00574         if (dbe) {
00575           dbe->setCurrentFolder(dir);
00576           me5[i] = dbe->bookProfile2D(metoedmobject[i].object.GetName(),
00577                                       &metoedmobject[i].object);
00578         } // end define new monitor elements
00579 
00580         // attach taglist
00581         TagList tags = metoedmobject[i].tags;
00582 
00583         for (unsigned int j = 0; j < tags.size(); ++j) {
00584           dbe->tag(me5[i]->getFullname(),tags[j]);
00585         }
00586       } // end loop thorugh metoedmobject
00587     } // end TProfile2D creation
00588 
00589     if (classtypes[ii] == "Float") {
00590       edm::Handle<MEtoEDM<double> > metoedm;
00591       iRun.getByType(metoedm);
00592 
00593       if (!metoedm.isValid()) {
00594         //edm::LogWarning(MsgLoggerCat)
00595         //  << "MEtoEDM<double> doesn't exist in run";
00596         continue;
00597       }
00598 
00599       std::vector<MEtoEDM<double>::MEtoEDMObject> metoedmobject =
00600         metoedm->getMEtoEdmObject();
00601 
00602       me6.resize(metoedmobject.size());
00603 
00604       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00605 
00606         me6[i] = 0;
00607 
00608         // get full path of monitor element
00609         std::string pathname = metoedmobject[i].name;
00610         if (verbosity) std::cout << pathname << std::endl;
00611 
00612         // set the release tag if it has not be yet done
00613         if (!releaseTag)
00614         {
00615           dbe->cd();
00616           dbe->bookString(
00617             "ReleaseTag",
00618             metoedmobject[i].
00619             release.substr(1,metoedmobject[i].release.size()-2)
00620           );
00621           releaseTag = true;
00622         }
00623 
00624         std::string dir;
00625         std::string name;
00626 
00627         // deconstruct path from fullpath
00628 
00629         StringList fulldir = StringOps::split(pathname,"/");
00630         name = *(fulldir.end() - 1);
00631 
00632         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00633           dir += fulldir[j];
00634           if (j != fulldir.size() - 2) dir += "/";
00635         }
00636 
00637         // define new monitor element
00638         if (dbe) {
00639           dbe->setCurrentFolder(dir);
00640           me6[i] = dbe->bookFloat(name);
00641           me6[i]->Fill(metoedmobject[i].object);
00642         } // end define new monitor elements
00643 
00644         // attach taglist
00645         TagList tags = metoedmobject[i].tags;
00646 
00647         for (unsigned int j = 0; j < tags.size(); ++j) {
00648           dbe->tag(me6[i]->getFullname(),tags[j]);
00649         }
00650       } // end loop thorugh metoedmobject
00651     } // end Float creation
00652 
00653     if (classtypes[ii] == "Int") {
00654       edm::Handle<MEtoEDM<int> > metoedm;
00655       iRun.getByType(metoedm);
00656 
00657       if (!metoedm.isValid()) {
00658         //edm::LogWarning(MsgLoggerCat)
00659         //  << "MEtoEDM<int> doesn't exist in run";
00660         continue;
00661       }
00662 
00663       std::vector<MEtoEDM<int>::MEtoEDMObject> metoedmobject =
00664         metoedm->getMEtoEdmObject();
00665 
00666       me7.resize(metoedmobject.size());
00667 
00668       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00669 
00670         me7[i] = 0;
00671 
00672         // get full path of monitor element
00673         std::string pathname = metoedmobject[i].name;
00674         if (verbosity) std::cout << pathname << std::endl;
00675 
00676         // set the release tag if it has not be yet done
00677         if (!releaseTag)
00678         {
00679           dbe->cd();
00680           dbe->bookString(
00681             "ReleaseTag",
00682             metoedmobject[i].
00683             release.substr(1,metoedmobject[i].release.size()-2)
00684           );
00685           releaseTag = true;
00686         }
00687 
00688         std::string dir;
00689         std::string name;
00690 
00691         // deconstruct path from fullpath
00692         StringList fulldir = StringOps::split(pathname,"/");
00693         name = *(fulldir.end() - 1);
00694 
00695         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00696           dir += fulldir[j];
00697           if (j != fulldir.size() - 2) dir += "/";
00698         }
00699 
00700         // define new monitor element
00701         if (dbe) {
00702           dbe->setCurrentFolder(dir);
00703           int ival = 0;
00704           if ( endrun ) {
00705             if (name.find("processedEvents") != std::string::npos) {
00706               if (MonitorElement* me = dbe->get(dir+"/"+name)) {
00707                 ival = me->getIntValue();
00708               }
00709             }
00710           }
00711           me7[i] = dbe->bookInt(name);
00712           me7[i]->Fill(metoedmobject[i].object+ival);
00713         } // end define new monitor elements
00714 
00715         // attach taglist
00716         TagList tags = metoedmobject[i].tags;
00717 
00718         for (unsigned int j = 0; j < tags.size(); ++j) {
00719           dbe->tag(me7[i]->getFullname(),tags[j]);
00720         }
00721       } // end loop thorugh metoedmobject
00722     } // end Int creation
00723 
00724     if (classtypes[ii] == "String") {
00725       edm::Handle<MEtoEDM<TString> > metoedm;
00726       iRun.getByType(metoedm);
00727 
00728       if (!metoedm.isValid()) {
00729         //edm::LogWarning(MsgLoggerCat)
00730         //  << "MEtoEDM<TString> doesn't exist in run";
00731         continue;
00732       }
00733 
00734       std::vector<MEtoEDM<TString>::MEtoEDMObject> metoedmobject =
00735         metoedm->getMEtoEdmObject();
00736 
00737       me8.resize(metoedmobject.size());
00738 
00739       for (unsigned int i = 0; i < metoedmobject.size(); ++i) {
00740 
00741         me8[i] = 0;
00742 
00743         // get full path of monitor element
00744         std::string pathname = metoedmobject[i].name;
00745         if (verbosity) std::cout << pathname << std::endl;
00746 
00747         // set the release tag if it has not be yet done
00748         if (!releaseTag)
00749         {
00750           dbe->cd();
00751           dbe->bookString(
00752             "ReleaseTag",
00753             metoedmobject[i].
00754             release.substr(1,metoedmobject[i].release.size()-2)
00755           );
00756           releaseTag = true;
00757         }
00758 
00759         std::string dir;
00760         std::string name;
00761 
00762         // deconstruct path from fullpath
00763         StringList fulldir = StringOps::split(pathname,"/");
00764         name = *(fulldir.end() - 1);
00765 
00766         for (unsigned j = 0; j < fulldir.size() - 1; ++j) {
00767           dir += fulldir[j];
00768           if (j != fulldir.size() - 2) dir += "/";
00769         }
00770 
00771         // define new monitor element
00772         if (dbe) {
00773           dbe->setCurrentFolder(dir);
00774           std::string scont = metoedmobject[i].object.Data();
00775           me8[i] = dbe->bookString(name,scont);
00776         } // end define new monitor elements
00777 
00778         // attach taglist
00779         TagList tags = metoedmobject[i].tags;
00780 
00781         for (unsigned int j = 0; j < tags.size(); ++j) {
00782           dbe->tag(me8[i]->getFullname(),tags[j]);
00783         }
00784       } // end loop thorugh metoedmobject
00785     } // end String creation
00786   }
00787 
00788   // verify tags stored properly
00789   if (verbosity) {
00790     std::vector<std::string> stags;
00791     dbe->getAllTags(stags);
00792     for (unsigned int i = 0; i < stags.size(); ++i) {
00793       std::cout << "Tags: " << stags[i] << std::endl;
00794     }
00795   }
00796 
00797   return;
00798 }

void EDMtoMEConverter::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file EDMtoMEConverter.cc.

References count, countf, and verbosity.

00081 {
00082   std::string MsgLoggerCat = "EDMtoMEConverter_endJob";
00083   if (verbosity >= 0)
00084     edm::LogInfo(MsgLoggerCat)
00085       << "Terminating having processed " << count.size() << " runs across "
00086       << countf << " files.";
00087   return;
00088 }

void EDMtoMEConverter::endLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file EDMtoMEConverter.cc.

References convert(), convertOnEndLumi, edm::LuminosityBlock::getRun(), edm::LuminosityBlock::id(), and prescaleFactor.

00136 {
00137   if (convertOnEndLumi) {
00138     if (prescaleFactor > 0 &&
00139         iLumi.id().luminosityBlock() % prescaleFactor == 0) {
00140       const edm::Run& iRun = iLumi.getRun();
00141       convert(iRun, false);
00142     }
00143   }
00144   return;
00145 }

void EDMtoMEConverter::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file EDMtoMEConverter.cc.

References convert(), and convertOnEndRun.

00121 {
00122   if (convertOnEndRun) {
00123     convert(iRun, true);
00124   }
00125   return;
00126 }

void EDMtoMEConverter::respondToOpenInputFile ( const edm::FileBlock iFb  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file EDMtoMEConverter.cc.

References countf.

00091 {
00092   ++countf;
00093 
00094   return;
00095 }


Member Data Documentation

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

Definition at line 94 of file EDMtoMEConverter.h.

Referenced by convert(), and EDMtoMEConverter().

bool EDMtoMEConverter::convertOnEndLumi [private]

Definition at line 79 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and endLuminosityBlock().

bool EDMtoMEConverter::convertOnEndRun [private]

Definition at line 80 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and endRun().

std::map<int,int> EDMtoMEConverter::count [private]

Definition at line 92 of file EDMtoMEConverter.h.

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

unsigned int EDMtoMEConverter::countf [private]

Definition at line 91 of file EDMtoMEConverter.h.

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

DQMStore* EDMtoMEConverter::dbe [private]

Definition at line 84 of file EDMtoMEConverter.h.

Referenced by convert(), and EDMtoMEConverter().

int EDMtoMEConverter::frequency [private]

Definition at line 77 of file EDMtoMEConverter.h.

Referenced by beginRun(), and EDMtoMEConverter().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

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

Definition at line 85 of file EDMtoMEConverter.h.

Referenced by convert().

std::string EDMtoMEConverter::name [private]

Definition at line 75 of file EDMtoMEConverter.h.

Referenced by convert(), and EDMtoMEConverter().

int EDMtoMEConverter::prescaleFactor [private]

Definition at line 82 of file EDMtoMEConverter.h.

Referenced by EDMtoMEConverter(), and endLuminosityBlock().

bool EDMtoMEConverter::releaseTag [private]

Definition at line 88 of file EDMtoMEConverter.h.

Referenced by convert(), and EDMtoMEConverter().

int EDMtoMEConverter::verbosity [private]

Definition at line 76 of file EDMtoMEConverter.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:04 2009 for CMSSW by  doxygen 1.5.4