![]() |
![]() |
#include <CalibFormats/SiPixelObjects/interface/PixelLTCConfig.h>
Public Member Functions | |
std::stringstream & | getLTCConfigStream () |
PixelLTCConfig (std::string filename) | |
virtual void | writeASCII (std::string dir) const |
virtual void | writeXML (std::ofstream *out) const |
void | writeXML (pos::PixelConfigKey key, int version, std::string path) const |
virtual void | writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const |
virtual void | writeXMLTrailer (std::ofstream *out) const |
Private Attributes | |
std::stringstream | ltcConfigStream_ |
" "
This class reads the LTC configuration file
Definition at line 29 of file PixelLTCConfig.h.
PixelLTCConfig::PixelLTCConfig | ( | std::string | filename | ) |
Definition at line 13 of file PixelLTCConfig.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), in, parsecf::pyparsing::line(), and ltcConfigStream_.
00013 : 00014 PixelConfigBase(" "," "," "){ 00015 00016 std::ifstream in(filename.c_str()); 00017 00018 if (!in.good()){ 00019 std::cout << "Could not open:"<<filename<<std::endl; 00020 assert(0); 00021 } 00022 else { 00023 std::cout << "Opened:"<<filename<<std::endl; 00024 } 00025 00026 //ltcConfigPath_ = filename; 00027 string line; 00028 while (!in.eof()) { 00029 getline (in,line); 00030 ltcConfigStream_ << line << endl; 00031 } 00032 00033 }
std::stringstream& pos::PixelLTCConfig::getLTCConfigStream | ( | ) | [inline] |
Definition at line 35 of file PixelLTCConfig.h.
References ltcConfigStream_.
00035 {return ltcConfigStream_;}
void PixelLTCConfig::writeASCII | ( | std::string | dir | ) | const [virtual] |
Implements pos::PixelConfigBase.
Definition at line 35 of file PixelLTCConfig.cc.
References lat::endl(), EgammaValidation_cff::filename, ltcConfigStream_, and out.
00035 { 00036 00037 if (dir!="") dir+="/"; 00038 std::string filename=dir+"LTCConfiguration.txt"; 00039 std::ofstream out(filename.c_str()); 00040 00041 //std::ifstream in(ltcConfigPath_.c_str()); 00042 //assert(in.good()); 00043 00044 string configstr = ltcConfigStream_.str(); 00045 00046 out << configstr << endl; 00047 00048 out.close(); 00049 00050 }
virtual void pos::PixelLTCConfig::writeXML | ( | std::ofstream * | out | ) | const [inline, virtual] |
void pos::PixelLTCConfig::writeXML | ( | pos::PixelConfigKey | key, | |
int | version, | |||
std::string | path | |||
) | const [inline, virtual] |
virtual void pos::PixelLTCConfig::writeXMLHeader | ( | pos::PixelConfigKey | key, | |
int | version, | |||
std::string | path, | |||
std::ofstream * | out | |||
) | const [inline, virtual] |
virtual void pos::PixelLTCConfig::writeXMLTrailer | ( | std::ofstream * | out | ) | const [inline, virtual] |
std::stringstream pos::PixelLTCConfig::ltcConfigStream_ [private] |
Definition at line 46 of file PixelLTCConfig.h.
Referenced by getLTCConfigStream(), PixelLTCConfig(), and writeASCII().