28 for (
unsigned int iChain = 0; iChain < _chains.size(); iChain++) {
29 delete _chains[iChain];
36 static const std::string nullFile(
"");
45 void GGSTFilesHandler::_AddFile(
const std::string &fileName,
bool force) {
46 static const std::string routineName(
"GGSTFilesHandler::_AddFile");
48 _files.push_back(fileName);
51 TFile *file = TFile::Open(fileName.data());
52 if (file->IsZombie()) {
53 COUT(WARNING) <<
"File " << fileName <<
" cannot be opened. File discarded." <<
ENDL;
63 if (simInfo == NULL) {
64 COUT(WARNING) <<
"GGS simulation info not present in file " << fileName <<
". File discarded." <<
ENDL;
72 TGeoManager *geoManager = (TGeoManager *)(file->Get(
"GGSGeometry"));
73 if (_files.size() == 1) {
78 _geoParams = *geoParams;
81 _genParams = *genParams;
84 _geoManager = geoManager;
88 COUT(WARNING) <<
"Simulation info in file " << fileName <<
" are inconsistent with those in file " << _files[0]
89 <<
". File discarded." <<
ENDL;
92 COUT(WARNING) <<
"Geometry parameters in file " << fileName <<
" are inconsistent with those in file "
93 << _files[0] <<
". File discarded." <<
ENDL;
96 COUT(WARNING) <<
"Generator parameters in file " << fileName <<
" are inconsistent with those in file "
97 << _files[0] <<
". File discarded." <<
ENDL;
107 void GGSTFilesHandler::_SortFiles() {
108 static const std::string routineName(
"GGSTFilesHandler::_SortFiles");
110 if (_chains.size() > 0) {
111 COUT(WARNING) <<
"Can't sort files after chain creation." <<
ENDL;
115 sort(_files.begin(), _files.end());
117 TFile *file0 = TFile::Open(_files[0].data());
118 _simInfo = *((
GGSTSimInfo *)(file0->Get(
"GGSSimInfo")));
bool AreSameParamsAs(const GGSParameters ¶ms) const
Compares two parameter objects.
~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.
Class for writing parameters into the output Root file.