CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloGeometryDBWriter.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOEVENTSETUP_CALOGEOMETRYDBWRITER_H
2 #define GEOMETRY_CALOEVENTSETUP_CALOGEOMETRYDBWRITER_H 1
3 
7 
9 
11 {
12  public:
13 
17 
18  static bool writeFlag() { return true ; }
19 
20  static void write( const TrVec& tvec,
21  const DimVec& dvec,
22  const IVec& ivec,
23  std::string tag )
24  {
25  PCaloGeometry* peg = new PCaloGeometry( tvec , dvec, ivec );
26 
28  if( !mydbservice.isAvailable() )
29  {
30  edm::LogError("PCaloDBGeometryBuilder")<<"PoolDBOutputService unavailable";
31  }
32  else
33  {
34  if ( mydbservice->isNewTagRequest( tag ) )
35  {
36  mydbservice->createNewIOV<PCaloGeometry>(
37  peg,
38  mydbservice->beginOfTime(),
39  mydbservice->endOfTime(),
40  tag ) ;
41  }
42  else
43  {
44  mydbservice->appendSinceTime<PCaloGeometry>(
45  peg,
46  mydbservice->currentTime(),
47  tag ) ;
48  }
49  }
50  }
51 
53  virtual ~CaloGeometryDBWriter() {}
54 };
55 
56 #endif
std::vector< CCGFloat > DimVec
std::vector< unsigned int > IVec
std::vector< CCGFloat > TrVec
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:47
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
static void write(const TrVec &tvec, const DimVec &dvec, const IVec &ivec, std::string tag)