CMS 3D CMS Logo

CondDBFetch.cc
Go to the documentation of this file.
1 //
2 
3 #define FETCH_PAYLOAD_CASE(TYPENAME) \
4  if (payloadTypeName == #TYPENAME) { \
5  payloadPtr = deserialize<TYPENAME>(payloadTypeName, data, streamerInfo); \
6  match = true; \
7  }
8 
10 
13 #include "CondFormats.h"
14 
15 //
16 #include <memory>
17 #include <sstream>
18 
19 namespace cond {
20 
21  namespace persistency {
22 
23  std::pair<std::string, std::shared_ptr<void> > fetchOne(const std::string &payloadTypeName,
24  const cond::Binary &data,
25  const cond::Binary &streamerInfo,
26  std::shared_ptr<void> payloadPtr) {
27  bool match = false;
29  FETCH_PAYLOAD_CASE(std::vector<unsigned long long>)
262  //FETCH_PAYLOAD_CASE( PerformancePayload )
334 
335  //
336  if (payloadTypeName == "PhysicsTools::Calibration::Histogram3D<double,double,double,double>") {
337  payloadPtr = deserialize<PhysicsTools::Calibration::Histogram3D<double, double, double, double> >(
338  payloadTypeName, data, streamerInfo);
339  match = true;
340  }
341  if (payloadTypeName == "PhysicsTools::Calibration::Histogram2D<double,double,double>") {
342  payloadPtr = deserialize<PhysicsTools::Calibration::Histogram2D<double, double, double> >(
343  payloadTypeName, data, streamerInfo);
344  match = true;
345  }
346  if (payloadTypeName == "std::vector<unsignedlonglong,std::allocator<unsignedlonglong>>") {
347  payloadPtr = deserialize<std::vector<unsigned long long> >(payloadTypeName, data, streamerInfo);
348  match = true;
349  }
350 
351  if (!match)
352  throwException("Payload type \"" + payloadTypeName + "\" is unknown.", "fetch");
353  return std::make_pair(payloadTypeName, payloadPtr);
354  }
355 
356  std::pair<std::string, std::shared_ptr<void> > fetch(const cond::Hash &payloadId, Session &session) {
357  std::shared_ptr<void> payloadPtr;
359  cond::Binary streamerInfo;
360  std::string payloadTypeName;
361  bool found = session.fetchPayloadData(payloadId, payloadTypeName, data, streamerInfo);
362  if (!found)
363  throwException("Payload with id " + payloadId + " has not been found in the database.", "fetch");
364  return fetchOne(payloadTypeName, data, streamerInfo, payloadPtr);
365  }
366 
367  } // namespace persistency
368 } // namespace cond
std::pair< std::string, std::shared_ptr< void > > fetchOne(const std::string &payloadTypeName, const cond::Binary &data, const cond::Binary &streamerInfo, std::shared_ptr< void > payloadPtr)
Definition: CondDBFetch.cc:23
Channel-mask mapping.
Definition: ESGain.h:7
#define FETCH_PAYLOAD_CASE(TYPENAME)
Definition: CondDBFetch.cc:3
Definition: DTT0.h:48
QGLikelihoodObject containing valid range and entries with category and histogram (mean is not used a...
The mapping between FramePosition and VFATInfo.
Channel-mask mapping.
std::string Hash
Definition: Types.h:43
bool fetchPayloadData(const cond::Hash &payloadHash, std::string &payloadType, cond::Binary &payloadData, cond::Binary &streamerInfoData)
Definition: Session.cc:185
Category structure: ranges associated with QGLikelihood histograms.
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
Collection of optical functions for two crossing angle values and various scoring planes...
std::pair< std::string, std::shared_ptr< void > > fetch(const cond::Hash &payloadId, Session &session)
Definition: CondDBFetch.cc:356
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12
The mapping between FramePosition and ROCInfo.