FACT++  1.0
string DataProcessorImp::FormFileName ( const std::string &  path,
uint64_t  night,
uint32_t  runid,
const std::string &  extension 
)
static

This creates an appropriate file name for a particular run number and type

Parameters
runNumberqthe run number for which a filename is to be created
runTypean int describing the kind of run. 0=Data, 1=Pedestal, 2=Calibration, 3=Calibrated data
extensiona string containing the extension to be appened to the file name

Definition at line 19 of file DataProcessorImp.cc.

References Tools::Form().

Referenced by EventBuilderWrapper::InitRunNumber(), and DataWriteFits2::Open().

20 {
21  ostringstream name;
22 
23  if (!path.empty())
24  {
25  name << path;
26  if (path[path.length()-1] != '/')
27  name << '/';
28  }
29 
30  name << Tools::Form("%04d/%02d/%02d/", night/10000, (night/100)%100, night%100);
31 
32  try
33  {
34  boost::filesystem::create_directories(name.str());
35  }
36  catch (const runtime_error &)
37  {
38  // File creation will fail anyway
39  //Error(e.what());
40  }
41 
42  name << night << '_' << setfill('0') << setw(3) << runid << '.' << extension;
43  return name.str();
44 }
std::string Form(const char *fmt,...)
Definition: tools.cc:45

+ Here is the call graph for this function:

+ Here is the caller graph for this function: