CMS 3D CMS Logo

PayloadInspector.cc
Go to the documentation of this file.
5 
6 #include <sstream>
7 #include <iostream>
8 
9 namespace cond {
10 
11  namespace payloadInspector {
12 
14 
16  std::string ret("");
17  auto im = m.find( key );
18  if( im != m.end() ) ret = im->second;
19  return ret;
20  }
21 
22  constexpr const char* const ModuleVersion::label;
23 
25  m_plotAnnotations(),m_data(""){
26  }
27 
30  }
31 
34  }
35 
38  }
39 
40  bool PlotBase::isSingleIov() const {
42  }
43 
44  bool PlotBase::isTwoTags() const {
46  }
47 
49  return m_data;
50  }
51 
52  bool PlotBase::process( const std::string& connectionString, const std::string& tag, const std::string&, cond::Time_t begin, cond::Time_t end ){
53  init();
54 
55  std::vector<edm::ParameterSet> psets;
56  edm::ParameterSet pSet;
57  pSet.addParameter("@service_type",std::string("SiteLocalConfigService"));
58  psets.push_back(pSet);
59  static const edm::ServiceToken services(edm::ServiceRegistry::createSet(psets));
60  static const edm::ServiceRegistry::Operate operate(services);
61 
62  m_tag0 = tag;
63  //m_tagTimeType = cond::time::timeTypeFromName(timeType);
65  m_dbSession = connection.createSession( connectionString );
67  std::vector<std::tuple<cond::Time_t,cond::Hash> > iovs;
68  m_dbSession.getIovRange( tag, begin, end, iovs );
69  m_data = processData( iovs );
71  // fixme...
72  return true;
73  }
74 
99  bool PlotBase::processTwoTags( const std::string& connectionString, const std::string& tag0, const std::string& tag1, cond::Time_t time0, cond::Time_t time1 ){
100  init();
101 
102  std::vector<edm::ParameterSet> psets;
103  edm::ParameterSet pSet;
104  pSet.addParameter("@service_type",std::string("SiteLocalConfigService"));
105  psets.push_back(pSet);
106  static const edm::ServiceToken services(edm::ServiceRegistry::createSet(psets));
107  static const edm::ServiceRegistry::Operate operate(services);
108 
109  m_tag0 = tag0;
110  m_tag1 = tag1;
112  m_dbSession = connection.createSession( connectionString );
114  std::vector<std::tuple<cond::Time_t,cond::Hash> > iovs;
115  m_dbSession.getIovRange( tag0, time0, time0, iovs );
116  m_dbSession.getIovRange( tag1, time1, time1, iovs );
117  m_data = processData( iovs );
119  // fixme...
120  return true;
121  }
122 
123 
125  }
126 
127  std::string PlotBase::processData( const std::vector<std::tuple<cond::Time_t,cond::Hash> >& ){
128  return "";
129  }
130 
133  }
134 
137  if(flag) m_plotAnnotations.singleIov = flag;
138  }
139 
140  //cond::TimeType PlotBase::tagTimeType() const {
141  // return m_tagTimeType;
142  //}
143 
146  m_dbSession.getTagInfo( tag, info );
147  return info;
148  }
149 
151  return m_dbSession;
152  }
153 
154  }
155 
156 }
cond::Tag_t getTagInfo(const std::string &tag)
static const TGPicture * info(bool iBackgroundIsBlack)
const boost::posix_time::ptime time0
bool getTagInfo(const std::string &tag, cond::Tag_t &info)
Definition: Session.cc:102
void start(bool readOnly=true)
Definition: Session.cc:22
std::map< std::string, std::string > m
Transaction & transaction()
Definition: Session.cc:66
cond::persistency::Session dbSession()
bool process(const std::string &connectionString, const std::string &tag, const std::string &timeType, cond::Time_t begin, cond::Time_t end)
unsigned long long Time_t
Definition: Time.h:16
std::string get(const std::string &key) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:125
Session createSession(const std::string &connectionString, bool writeCapable=false)
#define end
Definition: vmac.h:39
static ServiceToken createSet(std::vector< ParameterSet > &)
static const char *const PAYLOAD_TYPE_K
virtual std::string processData(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)
Definition: plugin.cc:24
#define begin
Definition: vmac.h:32
cond::persistency::Session m_dbSession
bool getIovRange(const std::string &tag, cond::Time_t begin, cond::Time_t end, std::vector< std::tuple< cond::Time_t, cond::Hash > > &range)
Definition: Session.cc:116
bool processTwoTags(const std::string &connectionString, const std::string &tag0, const std::string &tag1, cond::Time_t time0, cond::Time_t time1)
#define constexpr
def operate(timelog, memlog, json_f, num)