CMS 3D CMS Logo

FFFNamingSchema.h
Go to the documentation of this file.
1 #ifndef FFFNAMINGSCHEMA_H_
2 #define FFFNAMINGSCHEMA_H_
3 
4 #include <iomanip>
5 #include <sstream>
6 #include <unistd.h>
7 
8 namespace fffnaming {
9 
10  inline std::string runLumiPrefix(const unsigned int run, const unsigned int ls) {
11  std::stringstream ss;
12  ss << "run" << std::setfill('0') << std::setw(6) << run << "_ls" << std::setfill('0') << std::setw(4) << ls;
13  return ss.str();
14  }
15 
16  inline void runLumiPrefixFill(std::stringstream& ss, const unsigned int run, const unsigned int ls) {
17  ss << "run" << std::setfill('0') << std::setw(6) << run << "_ls" << std::setfill('0') << std::setw(4) << ls;
18  }
19 
20  inline std::string eolsFileName(const unsigned int run, const unsigned int ls) {
21  std::stringstream ss;
23  ss << "_EoLS.jsn";
24  return ss.str();
25  }
26 
27  inline std::string bolsFileName(const unsigned int run, const unsigned int ls) {
28  std::stringstream ss;
30  ss << "_BoLS.jsn";
31  return ss.str();
32  }
33 
34  inline std::string eorFileName(const unsigned int run) {
35  std::stringstream ss;
36  ss << "run" << std::setfill('0') << std::setw(6) << run << "_ls0000"
37  << "_EoR.jsn";
38  return ss.str();
39  }
40 
41  inline std::string inputJsonFileName(const unsigned int run, const unsigned int ls, const unsigned int index) {
42  std::stringstream ss;
44  ss << "_index" << std::setfill('0') << std::setw(6) << index << ".jsn";
45  return ss.str();
46  }
47 
48  inline std::string inputRawFileName(const unsigned int run, const unsigned int ls, const unsigned int index) {
49  std::stringstream ss;
51  ss << "_index" << std::setfill('0') << std::setw(6) << index << ".raw";
52  return ss.str();
53  }
54 
55  inline std::string initFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const& stream) {
56  std::stringstream ss;
58  ss << "_" << stream << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".ini";
59  return ss.str();
60  }
61 
62  inline std::string initTempFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const& stream) {
63  std::stringstream ss;
65  ss << "_" << stream << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".initemp";
66  return ss.str();
67  }
68 
69  inline std::string initFileNameWithInstance(const unsigned int run,
70  const unsigned int ls,
71  std::string const& stream,
72  std::string const& instance) {
73  std::stringstream ss;
75  ss << "_" << stream << "_" << instance << ".ini";
76  return ss.str();
77  }
78 
79  inline std::string streamerDataFileNameWithPid(const unsigned int run,
80  const unsigned int ls,
81  std::string const& stream) {
82  std::stringstream ss;
84  ss << "_" << stream << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".dat";
85  return ss.str();
86  }
87 
89  const unsigned int ls,
90  std::string const& stream,
91  std::string const& instance) {
92  std::stringstream ss;
94  ss << "_" << stream << "_" << instance << ".dat";
95  return ss.str();
96  }
97 
99  const unsigned int ls,
100  std::string const& stream,
101  std::string const& instance) {
102  std::stringstream ss;
104  ss << "_" << stream << "_" << instance << ".checksum";
105  return ss.str();
106  }
107 
108  inline std::string streamerJsonFileNameWithPid(const unsigned int run,
109  const unsigned int ls,
110  std::string const& stream) {
111  std::stringstream ss;
113  ss << "_" << stream << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsn";
114  return ss.str();
115  }
116 
118  const unsigned int ls,
119  std::string const& stream,
120  std::string const& instance) {
121  std::stringstream ss;
123  ss << "_stream" << stream << "_" << instance << ".jsn";
124  return ss.str();
125  }
126 
128  const unsigned int ls,
129  std::string const& stream) {
130  std::stringstream ss;
132  ss << "_" << stream << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".pb";
133  return ss.str();
134  }
135 
137  const unsigned int ls,
138  std::string const& stream,
139  std::string const& instance) {
140  std::stringstream ss;
142  ss << "_" << stream << "_" << instance << ".pb";
143  return ss.str();
144  }
145 
146  inline std::string rootHistogramFileNameWithPid(const unsigned int run,
147  const unsigned int ls,
148  std::string const& stream) {
149  std::stringstream ss;
151  ss << "_" << stream << "_pid" << std::setfill('0') << std::setw(5) << getpid() << ".root";
152  return ss.str();
153  }
154 
156  const unsigned int ls,
157  std::string const& stream,
158  std::string const& instance) {
159  std::stringstream ss;
161  ss << "_" << stream << "_" << instance << ".root";
162  return ss.str();
163  }
164 
165  inline std::string genericFileName(const unsigned int run,
166  const unsigned int ls,
167  std::string const& typePrefix,
168  std::string const& typeSuffix,
169  unsigned int typeWidth,
170  std::string const& instancePrefix,
171  std::string const& instanceSuffix,
172  unsigned int instanceWidth,
173  std::string const& fileExtension) {
174  std::stringstream ss;
176  ss << "_";
177  if (!typePrefix.empty())
178  ss << typePrefix;
179  if (typeWidth)
180  ss << std::setfill('0') << std::setw(typeWidth);
181  ss << typeSuffix;
182  if (!instanceSuffix.empty()) {
183  ss << "_";
184  if (!instancePrefix.empty())
185  ss << instancePrefix;
186  if (instanceWidth)
187  ss << std::setfill('0') << std::setw(instanceWidth);
188  ss << instanceSuffix;
189  }
190  if (!fileExtension.empty())
191  ss << "." << fileExtension;
192  return ss.str();
193  }
194 
195 }; // namespace fffnaming
196 #endif
std::string protocolBufferHistogramFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
std::string bolsFileName(const unsigned int run, const unsigned int ls)
std::string streamerDataChecksumFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
static PFTauRenderPlugin instance
void runLumiPrefixFill(std::stringstream &ss, const unsigned int run, const unsigned int ls)
std::string inputRawFileName(const unsigned int run, const unsigned int ls, const unsigned int index)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::string runLumiPrefix(const unsigned int run, const unsigned int ls)
std::string streamerDataFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
std::string genericFileName(const unsigned int run, const unsigned int ls, std::string const &typePrefix, std::string const &typeSuffix, unsigned int typeWidth, std::string const &instancePrefix, std::string const &instanceSuffix, unsigned int instanceWidth, std::string const &fileExtension)
std::string streamerJsonFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
std::string inputJsonFileName(const unsigned int run, const unsigned int ls, const unsigned int index)
std::string streamerJsonFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string eorFileName(const unsigned int run)
std::string initFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
def ls(path, rec=False)
Definition: eostools.py:349
std::string rootHistogramFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string initFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string rootHistogramFileNameWithInstance(const unsigned int run, const unsigned int ls, std::string const &stream, std::string const &instance)
std::string initTempFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string protocolBufferHistogramFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)
std::string eolsFileName(const unsigned int run, const unsigned int ls)
std::string streamerDataFileNameWithPid(const unsigned int run, const unsigned int ls, std::string const &stream)