Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PIXELPOPCONSOURCEHANDLER_H
0002 #define PIXELPOPCONSOURCEHANDLER_H
0003 
0004 // Package: CondTools/SiPixel
0005 // Class: PixelPopConSourceHandler
0006 /** \class PixelPopConSourceHandler PixelPopConSourceHandler.cc CondTools/SiPixel/src/PixelPopConSourceHandler.cc
0007 
0008  Description: PopCon source handler base class for all pixel popcon applications
0009 
0010  Implementation: 
0011    <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Michael Eads
0015 //         Created:  19 Apr 2008
0016 //
0017 //
0018 
0019 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0020 #include <string>
0021 #include <iostream>
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 
0024 template <class T>
0025 class PixelPopConSourceHandler : public popcon::PopConSourceHandler<T> {
0026 public:
0027   //PixelPopConSourceHandler(edm::ParameterSet const &) {;}
0028 
0029   void getNewObjects() override {
0030     // look at _connectString to see which method to call
0031     if (_connectString.find("oracle") == 0)
0032       getNewObjects_coral();
0033     else if (_connectString.find("file") == 0)
0034       getNewObjects_file();
0035     else {
0036       std::cout << "  PixelPopConSourceHandler::getNewObjects() - unknown connect string:" << _connectString
0037                 << std::endl;
0038       std::cout << "    connect string must begin with \"oracle\" or \"file\"" << std::endl;
0039     }
0040 
0041   }  // virtual void getNewObjects()
0042 
0043   virtual void getNewObjects_coral() { ; }
0044   virtual void getNewObjects_file() { ; }
0045   std::string id() const override { return std::string("PixelPopConSourceHandler"); }
0046 
0047 protected:
0048   std::string _connectString;
0049   std::string _schemaName;
0050   std::string _viewName;
0051   std::string _configKeyName;
0052   int _runNumber;
0053   unsigned int _sinceIOV;
0054 };
0055 
0056 #endif