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
MessageLogger.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
CaloSubdetectorGeometry::DimVec
std::vector< CCGFloat > DimVec
Definition: CaloSubdetectorGeometry.h:35
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:141
CaloSubdetectorGeometry::TrVec
std::vector< CCGFloat > TrVec
Definition: CaloSubdetectorGeometry.h:33
CaloSubdetectorGeometry::IVec
std::vector< unsigned int > IVec
Definition: CaloSubdetectorGeometry.h:34
CaloGeometryDBWriter
Definition: CaloGeometryDBWriter.h:10
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
PCaloGeometry
Definition: PCaloGeometry.h:9
CaloGeometryDBWriter::writeFlag
static constexpr bool writeFlag()
Definition: CaloGeometryDBWriter.h:16
CaloGeometryDBWriter::CaloGeometryDBWriter
CaloGeometryDBWriter()
Definition: CaloGeometryDBWriter.h:50
PoolDBOutputService.h
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:116
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
CaloGeometryDBWriter::TrVec
CaloSubdetectorGeometry::TrVec TrVec
Definition: CaloGeometryDBWriter.h:12
CaloGeometryDBWriter::write
static void write(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const std::string &tag)
Definition: CaloGeometryDBWriter.h:18
Service.h
PCaloGeometry.h
CaloGeometryDBWriter::writeIndexed
static void writeIndexed(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, const IVec &dins, const std::string &tag)
Definition: CaloGeometryDBWriter.h:34
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CaloSubdetectorGeometry.h
edm::Service< cond::service::PoolDBOutputService >
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
CaloGeometryDBWriter::DimVec
CaloSubdetectorGeometry::DimVec DimVec
Definition: CaloGeometryDBWriter.h:13
CaloGeometryDBWriter::~CaloGeometryDBWriter
virtual ~CaloGeometryDBWriter()
Definition: CaloGeometryDBWriter.h:51
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
CaloGeometryDBWriter::IVec
CaloSubdetectorGeometry::IVec IVec
Definition: CaloGeometryDBWriter.h:14
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:217