30 for (
unsigned int iChain = 0; iChain < _chains.size(); iChain++) {
31 delete _chains[iChain];
38 static const std::string nullFile(
"");
47 void GGSTFilesHandler::_AddFile(
const std::string &fileName,
bool force) {
48 static const std::string routineName(
"GGSTFilesHandler::_AddFile");
50 _files.push_back(fileName);
53 TFile *file = TFile::Open(fileName.data());
54 if (file->IsZombie()) {
55 COUT(WARNING) <<
"File " << fileName <<
" cannot be opened. File discarded." <<
ENDL;
65 if (simInfo == NULL) {
66 COUT(WARNING) <<
"GGS simulation info not present in file " << fileName <<
". File discarded." <<
ENDL;
73 if (_files.size() == 1) {
78 _geoParams = *geoParams;
83 COUT(WARNING) <<
"Simulation info in file " << fileName <<
" are inconsistent with those in file " << _files[0]
84 <<
". File discarded." <<
ENDL;
88 COUT(WARNING) <<
"geometry parameters in file " << fileName <<
" are inconsistent with those in file " << _files[0]
89 <<
". File discarded." <<
ENDL;
100 void GGSTFilesHandler::_SortFiles() {
101 static const std::string routineName(
"GGSTFilesHandler::_SortFiles");
103 if (_chains.size() > 0) {
104 COUT(WARNING) <<
"Can't sort files after chain creation." <<
ENDL;
108 sort(_files.begin(), _files.end());
110 TFile *file0 = TFile::Open(_files[0].data());
111 _simInfo = *((
GGSTSimInfo*) (file0->Get(
"GGSSimInfo")));
~GGSTFilesHandler()
Destructor.
bool IsSameSimAs(const GGSTSimInfo &simInfo)
Equality operator.
GGSTFilesHandler()
Constructor.
#define COUT(level)
Smart log macro. It writes on stdout only if the specified verbosity level is lesser than the maximum...
bool AreSameParamsAs(const GGSTGeoParams ¶ms) const
Compares two geometry parameter objects.
Class for storing the geometry parameters on Root output file.
unsigned int GetNFiles()
The number of files handled by this object.
A class to store simulation informations.
const std::string & GetFileName(unsigned int iFile)
Fetch the name of a handled file.