CMS 3D CMS Logo

CaloGeometryDBWriter.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOEVENTSETUP_CALOGEOMETRYDBWRITER_H
2 #define GEOMETRY_CALOEVENTSETUP_CALOGEOMETRYDBWRITER_H 1
3 
9 
11 public:
15 
16  static constexpr bool writeFlag() { return true; }
17 
18  static void write(const TrVec& tvec, const DimVec& dvec, const IVec& ivec, const std::string& tag) {
19  const IVec dins;
20  PCaloGeometry* peg = new PCaloGeometry(tvec, dvec, ivec, dins);
21 
23  if (!mydbservice.isAvailable()) {
24  edm::LogError("PCaloDBGeometryBuilder") << "PoolDBOutputService unavailable";
25  } else {
26  if (mydbservice->isNewTagRequest(tag)) {
27  mydbservice->createNewIOV<PCaloGeometry>(peg, mydbservice->beginOfTime(), mydbservice->endOfTime(), tag);
28  } else {
29  mydbservice->appendSinceTime<PCaloGeometry>(peg, mydbservice->currentTime(), tag);
30  }
31  }
32  }
33 
34  static void writeIndexed(
35  const TrVec& tvec, const DimVec& dvec, const IVec& ivec, const IVec& dins, const std::string& tag) {
36  PCaloGeometry* peg = new PCaloGeometry(tvec, dvec, ivec, dins);
37 
39  if (!mydbservice.isAvailable()) {
40  edm::LogError("PCaloDBGeometryBuilder") << "PoolDBOutputService unavailable";
41  } else {
42  if (mydbservice->isNewTagRequest(tag)) {
43  mydbservice->createNewIOV<PCaloGeometry>(peg, mydbservice->beginOfTime(), mydbservice->endOfTime(), tag);
44  } else {
45  mydbservice->appendSinceTime<PCaloGeometry>(peg, mydbservice->currentTime(), tag);
46  }
47  }
48  }
49 
51  virtual ~CaloGeometryDBWriter() {}
52 };
53 
54 #endif
std::vector< CCGFloat > DimVec
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, const std::string &tag)
std::vector< unsigned int > IVec
std::vector< CCGFloat > TrVec
static void write(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const std::string &tag)
CaloSubdetectorGeometry::TrVec TrVec
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:40
CaloSubdetectorGeometry::DimVec DimVec
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
CaloSubdetectorGeometry::IVec IVec
#define constexpr