test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 namespace pos{
34 
35  public:
36 
37  //A few things that you should provide
38  //description : purpose of this object
39  //creator : who created this configuration object
40  //date : time/date of creation (should probably not be
41  // a string, but I have no idea what CMS uses.
45 
46  virtual ~PixelConfigBase(){}
47 
50  std::string date();
51 
52  //Interface to write out data to ascii file
53  virtual void writeASCII(std::string dir="") const = 0;
54  //Interface to write out data to XML file for DB population
56  int version,
58  std::ofstream *out,
59  std::ofstream *out1,
60  std::ofstream *out2) const {;}
61  virtual void writeXML( std::ofstream *out,
62  std::ofstream *out1,
63  std::ofstream *out2 ) const {;}
64  virtual void writeXMLTrailer( std::ofstream *out,
65  std::ofstream *ou1,
66  std::ofstream *out2) const {;}
67  virtual void writeXML( pos::PixelConfigKey key, int version, std::string path) const {;}
68  virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const {;}
69  virtual void writeXML( std::ofstream *out) const {std::cout << __LINE__ << " " << __PRETTY_FUNCTION__ << "\tUnimplemented method" << std::endl ;;}
70  virtual void writeXMLTrailer( std::ofstream *out) const {;}
71 
72  void setAuthor (std::string author) {creator_ = author ;}
74  std::string getAuthor()const {return creator_ ;}
75  std::string getComment()const {return base64_encode((unsigned char *)comment_.c_str(), comment_.length()) ;}
76 
77  private:
78 
83 
84  };
85 
86 /* @} */
87 }
88 
89 #endif
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *ou1, std::ofstream *out2) const
This file contains the base class for &quot;pixel configuration data&quot; management.
void setAuthor(std::string author)
std::string description()
std::string base64_encode(unsigned char const *, unsigned int len)
Definition: PixelBase64.cc:41
virtual void writeXML(std::ofstream *out, std::ofstream *out1, std::ofstream *out2) const
virtual void writeXML(pos::PixelConfigKey key, int version, std::string path) const
std::string getComment() const
void setComment(std::string comment)
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
std::string getAuthor() const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
This class implements..
virtual void writeXMLTrailer(std::ofstream *out) const
std::string date()
virtual void writeXML(std::ofstream *out) const
This class implements the configuration key which actually just is an integer.
std::string creator()
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1, std::ofstream *out2) const
virtual void writeASCII(std::string dir="") const =0
tuple cout
Definition: gather_cfg.py:145
dbl *** dir
Definition: mlp_gen.cc:35
PixelConfigBase(std::string description, std::string creator, std::string date)
std::string description_
#define comment(par)
Definition: vmac.h:161