Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:25

0001 #include "FWCore/PluginManager/interface/PluginManager.h"
0002 #include "FWCore/PluginManager/interface/standard.h"
0003 #include "RecoLuminosity/LumiProducer/interface/DataPipe.h"
0004 #include "RecoLuminosity/LumiProducer/interface/DataPipeFactory.h"
0005 #include <sstream>
0006 #include <iostream>
0007 int main(int argc, char** argv) {
0008   unsigned int runnumber;
0009   std::string lumifile;
0010   if (argc > 2) {
0011     std::istringstream iss(argv[1]);
0012     iss >> runnumber;
0013     lumifile = std::string(argv[2]);
0014   } else {
0015     std::cout << "must specify a run and lumi file path" << std::endl;
0016     return 0;
0017   }
0018 
0019   edmplugin::PluginManager::Config config;
0020   edmplugin::PluginManager::configure(edmplugin::standard::config());
0021   //const std::string con("sqlite_file:pippo.db");
0022   //const std::string con("oracle://cms_orcoff_prep/cms_lumi_dev_offline");
0023   //const std::string con("oracle://devdb10/cms_xiezhen_dev");
0024   const std::string con("sqlite_file:trg.db");
0025   const std::string authpath("/afs/cern.ch/user/x/xiezhen");
0026   //fill lhx data
0027   /**
0028   std::cout<<"filling hlx/dip data"<<std::endl;
0029   try{
0030     std::unique_ptr<lumi::DataPipe> ptr(lumi::DataPipeFactory::get()->create("Lumi2DB",con));
0031     ptr->setAuthPath(authpath);
0032     //ptr->setSource("rfio:/castor/cern.ch/cms/store/lumi/200912/CMS_LUMI_RAW_20091212_000124025_0001_1.root");
0033     ptr->setSource(lumifile);
0034     ptr->retrieveData(runnumber);
0035   }catch(...){
0036     std::cout<<"problem in loading run "<<runnumber<<" skip "<<std::endl;
0037     throw;
0038   }
0039   
0040   //
0041   //fill runsummary data
0042   //
0043   try{
0044     std::cout<<"fill out runsummary data"<<std::endl;
0045     std::unique_ptr<lumi::DataPipe> runptr(lumi::DataPipeFactory::get()->create("CMSRunSummary2DB",con));
0046     runptr->setSource("oracle://cms_omds_lb/CMS_RUNINFO");
0047     runptr->setAuthPath(authpath);
0048     runptr->retrieveData(runnumber);
0049   }catch(...){
0050     std::cout<<"problem in loading run "<<runnumber<<" skip "<<std::endl;
0051     throw;
0052   }
0053   //
0054   //fill hlt conf data
0055   //
0056   try{
0057     std::cout<<"fill out conf data"<<std::endl;
0058     std::unique_ptr<lumi::DataPipe> confptr(lumi::DataPipeFactory::get()->create("HLTConf2DB",con));
0059     //confptr->setSource("oracle://cms_omds_lb/CMS_HLT_V0");
0060     confptr->setSource("oracle://cms_omds_lb/CMS_HLT");
0061     confptr->setAuthPath(authpath);
0062     confptr->retrieveData(runnumber);
0063   }catch(...){
0064     std::cout<<"problem in loading run "<<runnumber<<" skip "<<std::endl;
0065     throw;
0066   }
0067   **/
0068   //fill trg data
0069   try {
0070     std::cout << "fill out trg data" << std::endl;
0071     std::unique_ptr<lumi::DataPipe> trgptr(lumi::DataPipeFactory::get()->create("TRG2DB", con));
0072     trgptr->setAuthPath(authpath);
0073     //trgptr->setSource("oracle://cms_omds_lb/CMS_GT_MON");
0074     trgptr->setSource("oracle://cms_orcoff_prod/CMS_GT_MON");
0075     trgptr->retrieveData(runnumber);
0076   } catch (...) {
0077     std::cout << "problem in loading run " << runnumber << " skip " << std::endl;
0078     throw;
0079   }
0080   //fill hlt scaler data
0081   /**
0082   try{
0083     std::cout<<"fill out hlt data"<<std::endl;
0084     std::unique_ptr<lumi::DataPipe> hltptr(lumi::DataPipeFactory::get()->create("HLT2DB",con));
0085     hltptr->setSource("oracle://cms_omds_lb/CMS_RUNINFO");
0086     hltptr->setAuthPath(authpath);
0087     hltptr->retrieveData(runnumber);
0088   }catch(...){
0089     std::cout<<"problem in loading run "<<runnumber<<" skip "<<std::endl;
0090     throw;
0091   }
0092   **/
0093   return 0;
0094 }