CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pos::PixelTTCciConfig Class Reference

#include <PixelTTCciConfig.h>

Inheritance diagram for pos::PixelTTCciConfig:
pos::PixelConfigBase

Public Member Functions

std::stringstream & getTTCConfigStream ()
 
 PixelTTCciConfig (std::string filename)
 
 PixelTTCciConfig (std::vector< std::vector< std::string > > &)
 
void writeASCII (std::string dir) const override
 
void writeXML (pos::PixelConfigKey key, int version, std::string path) const override
 
void writeXML (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLTrailer (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
- Public Member Functions inherited from pos::PixelConfigBase
std::string creator ()
 
std::string date ()
 
std::string description ()
 
std::string getAuthor () const
 
std::string getComment () const
 
 PixelConfigBase (std::string description, std::string creator, std::string date)
 
void setAuthor (std::string author)
 
void setComment (std::string comment)
 
virtual void writeXML (std::ofstream *out) const
 
virtual void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
 
virtual void writeXMLTrailer (std::ofstream *out) const
 
virtual ~PixelConfigBase ()
 

Private Attributes

std::stringstream ttcConfigStream_
 

Detailed Description

Definition at line 19 of file PixelTTCciConfig.h.

Constructor & Destructor Documentation

PixelTTCciConfig::PixelTTCciConfig ( std::string  filename)

Definition at line 63 of file PixelTTCciConfig.cc.

References gather_cfg::cout, recoMuon::in, mps_splice::line, AlCaHLTBitMon_QueryRunRegistry::string, and ttcConfigStream_.

63  :
64  PixelConfigBase(" "," "," "){
65 
66  std::string mthn ="]\t[PixelTKFECConfig::PixelTKFECConfig()]\t\t\t " ;
67  std::ifstream in(filename.c_str());
68 
69  if (!in.good()){
70  std::cout << __LINE__ << mthn << "Could not open: " << filename << std::endl;
71  throw std::runtime_error("Failed to open file "+filename);
72  }
73  else {
74  std::cout << __LINE__ << mthn << "Opened : " << filename << std::endl;
75  }
76 
77  //ttcConfigPath_ = filename;
78  string line;
79  while (!in.eof()) {
80  getline (in,line);
81  ttcConfigStream_ << line << endl;
82  }
83 
84 }
std::stringstream ttcConfigStream_
PixelConfigBase(std::string description, std::string creator, std::string date)
pos::PixelTTCciConfig::PixelTTCciConfig ( std::vector< std::vector< std::string > > &  )

Member Function Documentation

std::stringstream& pos::PixelTTCciConfig::getTTCConfigStream ( )
inline

Definition at line 26 of file PixelTTCciConfig.h.

References dir, AlCaHLTBitMon_QueryRunRegistry::string, ttcConfigStream_, and writeASCII().

26 {return ttcConfigStream_;}
std::stringstream ttcConfigStream_
void PixelTTCciConfig::writeASCII ( std::string  dir) const
overridevirtual

Implements pos::PixelConfigBase.

Definition at line 86 of file PixelTTCciConfig.cc.

References corrVsCorr::filename, MillePedeFileConverter_cfg::out, AlCaHLTBitMon_QueryRunRegistry::string, and ttcConfigStream_.

Referenced by getTTCConfigStream(), and writeXMLHeader().

86  {
87 
88 
89  if (dir!="") dir+="/";
90  std::string filename=dir+"TTCciConfiguration.txt";
91  std::ofstream out(filename.c_str());
92 
93  //std::ifstream in(ttcConfigPath_.c_str());
94  //assert(in.good());
95 
96  string configstr = ttcConfigStream_.str();
97 
98  out << configstr << endl;
99 
100  out.close();
101 
102 }
std::stringstream ttcConfigStream_
dbl *** dir
Definition: mlp_gen.cc:35
void pos::PixelTTCciConfig::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual
void PixelTTCciConfig::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 152 of file PixelTTCciConfig.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

155 {
156  std::string mthn = "[PixelTTCciConfig::writeXML()]\t\t\t " ;
157 
158  *outstream << " " << std::endl ;
159  *outstream << " <DATA>" << std::endl ;
160  *outstream << " <TTC_OBJ_DATA_FILE>TTCciConfiguration.txt</TTC_OBJ_DATA_FILE>" << std::endl ;
161  *outstream << " </DATA>" << std::endl ;
162  *outstream << " " << std::endl ;
163 }
void PixelTTCciConfig::writeXMLHeader ( pos::PixelConfigKey  key,
int  version,
std::string  path,
std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 105 of file PixelTTCciConfig.cc.

References gather_cfg::cout, pos::PixelConfigBase::getAuthor(), pos::PixelConfigBase::getComment(), pos::PixelTimeFormatter::getmSecTime(), pos::PixelTimeFormatter::getTime(), AlCaHLTBitMon_QueryRunRegistry::string, and writeASCII().

Referenced by writeXML().

111 {
112  std::string mthn = "[PixelTTCciConfig::writeXMLHeader()]\t\t\t " ;
113  std::stringstream maskFullPath ;
114 
115  writeASCII(path) ;
116 
117  maskFullPath << path << "/Pixel_TtcParameters_" << PixelTimeFormatter::getmSecTime() << ".xml";
118  std::cout << mthn << "Writing to: " << maskFullPath.str() << std::endl ;
119 
120  outstream->open(maskFullPath.str().c_str()) ;
121 
122  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
123  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
124  *outstream << "" << std::endl ;
125  *outstream << " <HEADER>" << std::endl ;
126  *outstream << " <TYPE>" << std::endl ;
127  *outstream << " <EXTENSION_TABLE_NAME>PIXEL_TTC_PARAMETERS</EXTENSION_TABLE_NAME>" << std::endl ;
128  *outstream << " <NAME>TTC Configuration Parameters</NAME>" << std::endl ;
129  *outstream << " </TYPE>" << std::endl ;
130  *outstream << " <RUN>" << std::endl ;
131  *outstream << " <RUN_TYPE>TTC Configuration Parameters</RUN_TYPE>" << std::endl ;
132  *outstream << " <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
133  *outstream << " <RUN_BEGIN_TIMESTAMP>" << PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl ;
134  *outstream << " <LOCATION>CERN P5</LOCATION>" << std::endl ;
135  *outstream << " </RUN>" << std::endl ;
136  *outstream << " </HEADER>" << std::endl ;
137  *outstream << "" << std::endl ;
138  *outstream << " <DATA_SET>" << std::endl ;
139  *outstream << "" << std::endl ;
140  *outstream << " <VERSION>" << version << "</VERSION>" << std::endl ;
141  *outstream << " <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>" << std::endl ;
142  *outstream << " <CREATED_BY_USER>" << getAuthor() << "</CREATED_BY_USER>" << std::endl ;
143  *outstream << "" << std::endl ;
144  *outstream << " <PART>" << std::endl ;
145  *outstream << " <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
146  *outstream << " <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
147  *outstream << " </PART>" << std::endl ;
148 
149 }
static std::string getmSecTime(void)
static std::string getTime(void)
std::string getComment() const
std::string getAuthor() const
void writeASCII(std::string dir) const override
void PixelTTCciConfig::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 166 of file PixelTTCciConfig.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writeXML().

169 {
170  std::string mthn = "[PixelTTCciConfig::writeXMLTrailer()]\t\t\t " ;
171 
172  *outstream << " " << std::endl ;
173  *outstream << " </DATA_SET>" << std::endl ;
174  *outstream << "</ROOT>" << std::endl ;
175 
176  outstream->close() ;
177  std::cout << mthn << "Data written " << std::endl ;
178 
179 }

Member Data Documentation

std::stringstream pos::PixelTTCciConfig::ttcConfigStream_
private

Definition at line 48 of file PixelTTCciConfig.h.

Referenced by getTTCConfigStream(), PixelTTCciConfig(), and writeASCII().