Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RPCEMAPSOURCEHANDLER
0002 #define RPCEMAPSOURCEHANDLER
0003 
0004 #include <vector>
0005 #include <string>
0006 #include <iostream>
0007 #include <typeinfo>
0008 
0009 #include "FWCore/Framework/interface/MakerMacros.h"
0010 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0011 //#include "CondCore/PopCon/interface/LogReader.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "DataFormats/Common/interface/Handle.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0017 
0018 #include "CondFormats/RPCObjects/interface/RPCEMap.h"
0019 #include "CondFormats/DataRecord/interface/RPCEMapRcd.h"
0020 #include "CondFormats/RPCObjects/interface/RPCReadOutMapping.h"
0021 #include "CondFormats/RPCObjects/interface/DccSpec.h"
0022 #include "CondFormats/RPCObjects/interface/TriggerBoardSpec.h"
0023 #include "CondFormats/RPCObjects/interface/LinkConnSpec.h"
0024 #include "CondFormats/RPCObjects/interface/LinkBoardSpec.h"
0025 #include "CondFormats/RPCObjects/interface/ChamberLocationSpec.h"
0026 #include "CondFormats/RPCObjects/interface/FebLocationSpec.h"
0027 #include "CondFormats/RPCObjects/interface/FebConnectorSpec.h"
0028 #include "CondFormats/RPCObjects/interface/ChamberStripSpec.h"
0029 #include "CondFormats/RPCObjects/interface/DBSpecToDetUnit.h"
0030 
0031 #include "CondCore/CondDB/interface/Session.h"
0032 #include "RelationalAccess/ITable.h"
0033 #include "RelationalAccess/ISchema.h"
0034 #include "RelationalAccess/IQuery.h"
0035 #include "RelationalAccess/ICursor.h"
0036 #include "CoralBase/AttributeList.h"
0037 #include "CoralBase/Attribute.h"
0038 #include "CoralBase/AttributeSpecification.h"
0039 
0040 namespace popcon {
0041   class RPCEMapSourceHandler : public popcon::PopConSourceHandler<RPCEMap> {
0042   public:
0043     RPCEMapSourceHandler(const edm::ParameterSet& ps);
0044     ~RPCEMapSourceHandler() override;
0045     void getNewObjects() override;
0046     std::string id() const override { return m_name; }
0047     void ConnectOnlineDB(std::string connect, std::string authPath);
0048     void DisconnectOnlineDB();
0049     void readEMap1();
0050     int Compare2EMaps(const Ref& map1, RPCEMap* map2);
0051 
0052   private:
0053     RPCEMap* eMap;
0054     cond::persistency::Session session;
0055     std::string m_name;
0056     int m_dummy;
0057     int m_validate;
0058     std::string m_connect;
0059     std::string m_authpath;
0060 
0061     // utilities
0062     std::string IntToString(int num) {
0063       std::stringstream snum;
0064       snum << num << std::flush;
0065       return (snum.str());
0066     }
0067 
0068     typedef struct {
0069       int febId, chamberId, connectorId, lbInputNum, posInLocalEtaPart, posInCmsEtaPart;
0070       std::string localEtaPart, cmsEtaPart;
0071     } FEBStruct;
0072   };
0073 }  // namespace popcon
0074 #endif