Project
Loading...
Searching...
No Matches
GeneratorFileOrCmd.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14#ifndef ALICEO2_EVENTGEN_GENERATORFILEORCMD_H_
15#define ALICEO2_EVENTGEN_GENERATORFILEORCMD_H_
17#include <list>
18#include <string>
19
20namespace o2
21{
22namespace conf
23{
24class SimConfig;
25}
26namespace eventgen
27{
28
37 const conf::SimConfig& config);
38 // Configure with local parameters
39 void setup(const FileOrCmdGenConfig& param,
40 const conf::SimConfig& config);
48 void setCmd(const std::string& cmd) { mCmd = cmd; }
54 void setCmdPid(const pid_t cmdPid) { mCmdPid = cmdPid; }
62 void setNEvents(unsigned int nev) { mNEvents = nev; }
70 void setSeed(unsigned long seed) { mSeed = seed; }
78 void setBmax(float bmax) { mBmax = bmax; }
84 void setFileNames(const std::string& filenames);
90 void setOutputSwitch(const std::string& opt) { mOutputSwitch = opt; }
97 void setSeedSwitch(const std::string& opt) { mSeedSwitch = opt; }
104 void setNEventsSwitch(const std::string& opt) { mNEventsSwitch = opt; }
112 void setBmaxSwitch(const std::string& opt) { mBmaxSwitch = opt; }
119 void setBackgroundSwitch(const std::string& opt) { mBackgroundSwitch = opt; }
121 void setWait(int miliseconds = 500) { mWait = miliseconds; }
122
123 protected:
130 virtual std::string makeCmdLine() const;
141 virtual bool executeCmdLine(const std::string& cmd);
148 virtual bool terminateCmd();
157 virtual bool makeTemp(const bool&);
163 virtual bool removeTemp() const;
171 virtual bool makeFifo() const;
182 virtual bool ensureFiles();
187 virtual void waitForData(const std::string& filename) const;
194 std::string mCmd = "";
199 std::list<std::string> mFileNames;
203 std::string mTemporary;
209 unsigned int mNEvents = 0;
215 unsigned long mSeed = 0;
221 float mBmax = -1.f;
227 std::string mOutputSwitch = ">";
232 std::string mSeedSwitch = "-s";
237 std::string mNEventsSwitch = "-n";
242 std::string mBmaxSwitch = "-b";
247 std::string mBackgroundSwitch = "&";
251 int mWait = 500;
255 int mCmdPid = -1;
256};
257
258} // namespace eventgen
259} // namespace o2
260#endif
261// Local Variables:
262// mode: C++
263// End:
GLenum GLfloat param
Definition glcorearb.h:271
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()
void setCmdPid(const pid_t cmdPid)
void setBackgroundSwitch(const std::string &opt)
void setSeedSwitch(const std::string &opt)
void setWait(int miliseconds=500)
void setFileNames(const std::string &filenames)
void setup(const GeneratorFileOrCmdParam &param, const conf::SimConfig &config)
std::list< std::string > mFileNames
void setSeed(unsigned long seed)
void setNEventsSwitch(const std::string &opt)
void setOutputSwitch(const std::string &opt)
void setCmd(const std::string &cmd)
virtual std::string makeCmdLine() const
virtual void waitForData(const std::string &filename) const
virtual bool executeCmdLine(const std::string &cmd)
virtual bool makeTemp(const bool &)
void setBmaxSwitch(const std::string &opt)