ATLAS Offline Software
Loading...
Searching...
No Matches
VP1FileUtilities.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// Header file for class VP1FileUtilities //
8// //
9// Author: Vakho Tsulaia <tsulaia@mail.cern.ch> //
10// //
11// Initial version: October 2007 //
12// //
13// Updates: //
14// Riccardo Maria BIANCHI <rbianchi@cern.ch> //
15// //
17
18#ifndef VP1FILEUTILITIES_H
19#define VP1FILEUTILITIES_H
20
21//NB: There should never be any Qt (or Athena of course) includes in this file!!!
22#include <string>
23
25{
26public:
27 //
28 // Parameters for the constructor
29 //
30 // 1. inputDirectory. The directory where vp1 event files are created
31 // by Writer algorithm.
32 //
33 // 2. fileLimit.
34 // * Writing: maximum number of files to keep in 'inputDirectory'
35 // * Reading: maximum number of files to keep in 'copyDirectory' (see below)
36 VP1FileUtilities(const std::string& inputDirectory,
37 unsigned int fileLimit, const std::string& outputDir = "", bool forceMakeOutputDir = false, bool removeInputFile = true);
38 virtual ~VP1FileUtilities();
39
40 //
41 // **** Write method ****
42 //
43 // This method takes the 'sourceFile' (pool.root file with single event) from run directory
44 // and copies it over to the 'inputDirectory' with the name:
45 //
46 // vp1_runNumber_eventNumber_timeStamp.pool.root
47 //
48 // After that, if the total number of files in the 'inputDirectory' is > fileLimit then the oldest
49 // vp1 event file is deleted.
50 void produceNewFile(const std::string& sourceFile,
51 unsigned int runNumber,
52 unsigned long long eventNumber,
53 unsigned int timeStamp,
54 const std::string& textLabel = "");
55
56 // **** Check if file exists ****
57 static bool fileExistsAndReadable(const std::string&);
58
59private:
60 // Delete the oldest vp1 events file in either inputDirectory (inputDir = True) or copyDirectory
61 void cleanUp();
62
63 std::string m_inputDirectory;
65 std::string m_outputDirectory;
68};
69
70#endif
void produceNewFile(const std::string &sourceFile, unsigned int runNumber, unsigned long long eventNumber, unsigned int timeStamp, const std::string &textLabel="")
VP1FileUtilities(const std::string &inputDirectory, unsigned int fileLimit, const std::string &outputDir="", bool forceMakeOutputDir=false, bool removeInputFile=true)
std::string m_inputDirectory
static bool fileExistsAndReadable(const std::string &)
std::string m_outputDirectory