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() [1/2]

PixelTTCciConfig::PixelTTCciConfig ( std::string  filename)

Definition at line 58 of file PixelTTCciConfig.cc.

58  : PixelConfigBase(" ", " ", " ") {
59  std::string mthn = "]\t[PixelTKFECConfig::PixelTKFECConfig()]\t\t\t ";
60  std::ifstream in(filename.c_str());
61 
62  if (!in.good()) {
63  std::cout << __LINE__ << mthn << "Could not open: " << filename << std::endl;
64  throw std::runtime_error("Failed to open file " + filename);
65  } else {
66  std::cout << __LINE__ << mthn << "Opened : " << filename << std::endl;
67  }
68 
69  //ttcConfigPath_ = filename;
70  string line;
71  while (!in.eof()) {
72  getline(in, line);
73  ttcConfigStream_ << line << endl;
74  }
75 }

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

◆ PixelTTCciConfig() [2/2]

pos::PixelTTCciConfig::PixelTTCciConfig ( std::vector< std::vector< std::string > > &  )

Member Function Documentation

◆ getTTCConfigStream()

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

Definition at line 24 of file PixelTTCciConfig.h.

24 { return ttcConfigStream_; }

References ttcConfigStream_.

◆ writeASCII()

void PixelTTCciConfig::writeASCII ( std::string  dir) const
overridevirtual

Implements pos::PixelConfigBase.

Definition at line 77 of file PixelTTCciConfig.cc.

77  {
78  if (!dir.empty())
79  dir += "/";
80  std::string filename = dir + "TTCciConfiguration.txt";
81  std::ofstream out(filename.c_str());
82 
83  //std::ifstream in(ttcConfigPath_.c_str());
84  //assert(in.good());
85 
86  string configstr = ttcConfigStream_.str();
87 
88  out << configstr << endl;
89 
90  out.close();
91 }

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

Referenced by writeXMLHeader().

◆ writeXML() [1/2]

void pos::PixelTTCciConfig::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 27 of file PixelTTCciConfig.h.

27 { ; }

◆ writeXML() [2/2]

void PixelTTCciConfig::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 139 of file PixelTTCciConfig.cc.

139  {
140  std::string mthn = "[PixelTTCciConfig::writeXML()]\t\t\t ";
141 
142  *outstream << " " << std::endl;
143  *outstream << " <DATA>" << std::endl;
144  *outstream << " <TTC_OBJ_DATA_FILE>TTCciConfiguration.txt</TTC_OBJ_DATA_FILE>" << std::endl;
145  *outstream << " </DATA>" << std::endl;
146  *outstream << " " << std::endl;
147 }

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ writeXMLHeader()

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 94 of file PixelTTCciConfig.cc.

99  {
100  std::string mthn = "[PixelTTCciConfig::writeXMLHeader()]\t\t\t ";
101  std::stringstream maskFullPath;
102 
103  writeASCII(path);
104 
105  maskFullPath << path << "/Pixel_TtcParameters_" << PixelTimeFormatter::getmSecTime() << ".xml";
106  std::cout << mthn << "Writing to: " << maskFullPath.str() << std::endl;
107 
108  outstream->open(maskFullPath.str().c_str());
109 
110  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
111  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
112  *outstream << "" << std::endl;
113  *outstream << " <HEADER>" << std::endl;
114  *outstream << " <TYPE>" << std::endl;
115  *outstream << " <EXTENSION_TABLE_NAME>PIXEL_TTC_PARAMETERS</EXTENSION_TABLE_NAME>" << std::endl;
116  *outstream << " <NAME>TTC Configuration Parameters</NAME>" << std::endl;
117  *outstream << " </TYPE>" << std::endl;
118  *outstream << " <RUN>" << std::endl;
119  *outstream << " <RUN_TYPE>TTC Configuration Parameters</RUN_TYPE>" << std::endl;
120  *outstream << " <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
121  *outstream << " <RUN_BEGIN_TIMESTAMP>" << PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl;
122  *outstream << " <LOCATION>CERN P5</LOCATION>" << std::endl;
123  *outstream << " </RUN>" << std::endl;
124  *outstream << " </HEADER>" << std::endl;
125  *outstream << "" << std::endl;
126  *outstream << " <DATA_SET>" << std::endl;
127  *outstream << "" << std::endl;
128  *outstream << " <VERSION>" << version << "</VERSION>" << std::endl;
129  *outstream << " <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>" << std::endl;
130  *outstream << " <CREATED_BY_USER>" << getAuthor() << "</CREATED_BY_USER>" << std::endl;
131  *outstream << "" << std::endl;
132  *outstream << " <PART>" << std::endl;
133  *outstream << " <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
134  *outstream << " <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
135  *outstream << " </PART>" << std::endl;
136 }

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

◆ writeXMLTrailer()

void PixelTTCciConfig::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 150 of file PixelTTCciConfig.cc.

152  {
153  std::string mthn = "[PixelTTCciConfig::writeXMLTrailer()]\t\t\t ";
154 
155  *outstream << " " << std::endl;
156  *outstream << " </DATA_SET>" << std::endl;
157  *outstream << "</ROOT>" << std::endl;
158 
159  outstream->close();
160  std::cout << mthn << "Data written " << std::endl;
161 }

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

Member Data Documentation

◆ ttcConfigStream_

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

Definition at line 41 of file PixelTTCciConfig.h.

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

pos::PixelTTCciConfig::ttcConfigStream_
std::stringstream ttcConfigStream_
Definition: PixelTTCciConfig.h:41
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos::PixelTimeFormatter::getTime
static std::string getTime(void)
Definition: PixelTimeFormatter.h:60
pos::PixelConfigBase::getAuthor
std::string getAuthor() const
Definition: PixelConfigBase.h:70
pos::PixelTimeFormatter::getmSecTime
static std::string getmSecTime(void)
Definition: PixelTimeFormatter.h:93
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
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
recoMuon::in
Definition: RecoMuonEnumerators.h:6
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
mps_splice.line
line
Definition: mps_splice.py:76
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
pos::PixelTTCciConfig::writeASCII
void writeASCII(std::string dir) const override
Definition: PixelTTCciConfig.cc:77
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23