// We expect the file with valid paths for this run to be generated in the current directory
// and to be named as the CVMFS OCDB tag, without .gz, with '_runnumber' appended
// Fill fValidFileIds from file
- ifstream *file = new ifstream(runValidFile.Data());
- if (!*file) {
+ std::ifstream file (runValidFile.Data());
+ if (!file.is_open()) {
AliFatal(Form("Error opening file \"%s\"!", runValidFile.Data()));
}
TString filepath;
- while (filepath.ReadLine(*file)) {
+ while (filepath.ReadLine(file)) {
// skip line in case it is not a root file path
if(! filepath.EndsWith(".root")) {
continue;
fValidFileIds.AddLast(validId);
}
- file->close();
- delete file;
+ file.close();
return;
}
}
// now read the file with the uri and first and last run
- ifstream *file = new ifstream(inoutFile.Data());
- if (!*file) {
+ std::ifstream file(inoutFile.Data());
+ if (!file.is_open()) {
AliFatal(Form("Error opening file \"%s\"!", inoutFile.Data()));
}
TString lhcPeriod;
TObjArray* oStringsArray = 0;
- while (lhcPeriod.ReadLine(*file)){
+ while (lhcPeriod.ReadLine(file)){
oStringsArray = lhcPeriod.Tokenize(' ');
}
TObjString *oStrUri = dynamic_cast<TObjString*> (oStringsArray->At(0));
fStartRunLHCPeriod = firstRun.Atoi();
fEndRunLHCPeriod = lastRun.Atoi();
- file->close();
- delete file;
+ file.close();
} else { // if not cvmfs case, "plain" AliEn case
// retrieve XML file from alien