CMS 3D CMS Logo

PixelConfigBase.h
Go to the documentation of this file.
1 #ifndef PixelConfigBase_h
2 #define PixelConfigBase_h
3 
9 //
10 // Base class for pixel configuration data
11 // provide a place to implement common interfaces
12 // for these objects. Any configuration data
13 // object that is to be accessed from the database
14 // should derive from this class.
15 //
16 
17 #include <string>
20 
21 namespace pos {
33  public:
34  //A few things that you should provide
35  //description : purpose of this object
36  //creator : who created this configuration object
37  //date : time/date of creation (should probably not be
38  // a string, but I have no idea what CMS uses.
40 
41  virtual ~PixelConfigBase() {}
42 
45  std::string date();
46 
47  //Interface to write out data to ascii file
48  virtual void writeASCII(std::string dir = "") const = 0;
49  //Interface to write out data to XML file for DB population
51  int version,
53  std::ofstream *out,
54  std::ofstream *out1,
55  std::ofstream *out2) const {
56  ;
57  }
58  virtual void writeXML(std::ofstream *out, std::ofstream *out1, std::ofstream *out2) const { ; }
59  virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *ou1, std::ofstream *out2) const { ; }
60  virtual void writeXML(pos::PixelConfigKey key, int version, std::string path) const { ; }
61  virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const { ; }
62  virtual void writeXML(std::ofstream *out) const {
63  std::cout << __LINE__ << " " << __PRETTY_FUNCTION__ << "\tUnimplemented method" << std::endl;
64  ;
65  }
66  virtual void writeXMLTrailer(std::ofstream *out) const { ; }
67 
68  void setAuthor(std::string author) { creator_ = author; }
69  void setComment(std::string comment) { comment_ = comment; }
70  std::string getAuthor() const { return creator_; }
71  std::string getComment() const { return base64_encode((unsigned char *)comment_.c_str(), comment_.length()); }
72 
73  private:
78  };
79 
80  /* @} */
81 } // namespace pos
82 
83 #endif
pos::PixelConfigBase::date
std::string date()
pos::PixelConfigBase::writeXMLTrailer
virtual void writeXMLTrailer(std::ofstream *out) const
Definition: PixelConfigBase.h:66
pos::PixelConfigBase::writeXMLTrailer
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *ou1, std::ofstream *out2) const
Definition: PixelConfigBase.h:59
PixelBase64.h
pos::PixelConfigBase::writeXML
virtual void writeXML(std::ofstream *out, std::ofstream *out1, std::ofstream *out2) const
Definition: PixelConfigBase.h:58
pos::PixelConfigBase::writeXML
virtual void writeXML(std::ofstream *out) const
Definition: PixelConfigBase.h:62
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PixelConfigKey.h
This class implements the configuration key which actually just is an integer.
pos
Definition: PixelAliasList.h:18
pos::PixelConfigBase
This file contains the base class for "pixel configuration data" management.
Definition: PixelConfigBase.h:32
pos::PixelConfigBase::writeXMLHeader
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1, std::ofstream *out2) const
Definition: PixelConfigBase.h:50
pos::PixelConfigBase::getAuthor
std::string getAuthor() const
Definition: PixelConfigBase.h:70
pos::PixelConfigBase::creator
std::string creator()
pos::PixelConfigBase::setAuthor
void setAuthor(std::string author)
Definition: PixelConfigBase.h:68
pos::PixelConfigBase::comment_
std::string comment_
Definition: PixelConfigBase.h:77
pos::PixelConfigBase::writeASCII
virtual void writeASCII(std::string dir="") const =0
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pos::PixelConfigBase::PixelConfigBase
PixelConfigBase(std::string description, std::string creator, std::string date)
Definition: PixelConfigBase.cc:15
pos::PixelConfigBase::getComment
std::string getComment() const
Definition: PixelConfigBase.h:71
pos::PixelConfigBase::description_
std::string description_
Definition: PixelConfigBase.h:74
pos::PixelConfigBase::writeXML
virtual void writeXML(pos::PixelConfigKey key, int version, std::string path) const
Definition: PixelConfigBase.h:60
pos::PixelConfigKey
This class implements..
Definition: PixelConfigKey.h:20
testProducerWithPsetDescEmpty_cfi.ou1
ou1
Definition: testProducerWithPsetDescEmpty_cfi.py:56
pos::PixelConfigBase::writeXMLHeader
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
Definition: PixelConfigBase.h:61
pos::PixelConfigBase::~PixelConfigBase
virtual ~PixelConfigBase()
Definition: PixelConfigBase.h:41
pos::PixelConfigBase::date_
std::string date_
Definition: PixelConfigBase.h:76
pos::PixelConfigBase::description
std::string description()
PointingDoubleMultiSkim_cfg.out2
out2
Definition: PointingDoubleMultiSkim_cfg.py:85
PointingDoubleMultiSkim_cfg.out1
out1
Definition: PointingDoubleMultiSkim_cfg.py:57
base64_encode
std::string base64_encode(unsigned char const *, unsigned int len)
Definition: PixelBase64.cc:38
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
crabWrapper.key
key
Definition: crabWrapper.py:19
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
pos::PixelConfigBase::setComment
void setComment(std::string comment)
Definition: PixelConfigBase.h:69
pos::PixelConfigBase::creator_
std::string creator_
Definition: PixelConfigBase.h:75
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23