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  const PCaloGeometry peg(tvec, dvec, ivec, dins);
21 
23  if (!mydbservice.isAvailable()) {
24  edm::LogError("PCaloDBGeometryBuilder") << "PoolDBOutputService unavailable";
25  } else {
26  if (mydbservice->isNewTagRequest(tag)) {
27  mydbservice->createOneIOV<PCaloGeometry>(peg, mydbservice->beginOfTime(), tag);
28  } else {
29  mydbservice->appendOneIOV<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  const PCaloGeometry peg(tvec, dvec, ivec, dins);
37 
39  if (!mydbservice.isAvailable()) {
40  edm::LogError("PCaloDBGeometryBuilder") << "PoolDBOutputService unavailable";
41  } else {
42  if (mydbservice->isNewTagRequest(tag)) {
43  mydbservice->createOneIOV<PCaloGeometry>(peg, mydbservice->beginOfTime(), tag);
44  } else {
45  mydbservice->appendOneIOV<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 constexpr bool writeFlag()
Log< level::Error, false > LogError
static void write(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const std::string &tag)
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
CaloSubdetectorGeometry::TrVec TrVec
bool isNewTagRequest(const std::string &recordName)
CaloSubdetectorGeometry::DimVec DimVec
CaloSubdetectorGeometry::IVec IVec
bool isAvailable() const
Definition: Service.h:40