#include "AliDetector.h"
#include "AliGenerator.h"
#include "AliLoader.h"
+#include "AliLog.h"
enum
{
// Default constructor, mainly to keep coding conventions
//
fgInstance=0;//never mind, its going to exit in next step
- Fatal("ctor","Constructor should not be called for a singleton\n");
+ AliFatal("Constructor should not be called for a singleton");
}
//____________________________________________________________________________
//
fgInstance=0;
- Fatal("copy ctor",
- "Copy constructor should not be called for a singleton\n");
+ AliFatal("Copy constructor should not be called for a singleton");
}
//____________________________________________________________________________
//
fgInstance=0;
- Fatal("Assignment operator",
- "Assignment operator should not be called for a singleton\n");
+ AliFatal("Assignment operator should not be called for a singleton");
return *this;
}
//____________________________________________________________________________
//Main AliRoot Folder
if (fTopFolder == 0x0)
{
- Fatal("AliConfig(const char*, const char*)","Can not create Top Alice Folder.");
+ AliFatal("Can not create Top Alice Folder.");
return;//never reached
}
fTopFolder->SetOwner();
//Create new task named 'name' and titled 'title'
//as a subtask of the task named 'taskname'
- if (AliLoader::GetDebug()) Info("AddSubTask","Try to get folder named %s",taskname);
+ AliDebug(1, Form("Try to get folder named %s",taskname));
TObject* obj = fTopFolder->FindObject(taskname);
TTask * task = (obj)?dynamic_cast<TTask*>(obj):0x0;
if (task)
{
- if (AliLoader::GetDebug()) Info("AddSubTask"," Got");
+ AliDebug(1, " Got");
TTask * subtask = static_cast<TTask*>(task->GetListOfTasks()->FindObject(name));
if (!subtask)
{
}
else
{
- Warning("AddSubTask","Task named \"%s\" already exists in Task %s\n",name,taskname);
+ AliWarning(Form("Task named \"%s\" already exists in Task %s",name,taskname));
}
}
else
{
- Error("AddSubTask","Can not find task %s to put a new task in.",taskname);
+ AliError(Form("Can not find task %s to put a new task in.",taskname));
return 1;
}
return 0;
// Adds module to the event folder
TString path(eventfolder);
path = path + "/" + fgkModuleFolderName;
- if (AliLoader::GetDebug())
- Info("Add(AliModule*)","module name = %s, Ev. Fold. Name is %s.",
- obj->GetName(),eventfolder);
+ AliDebug(1, Form("module name = %s, Ev. Fold. Name is %s.",
+ obj->GetName(),eventfolder));
AddInFolder(path, obj);
}
//____________________________________________________________________________
retval = CreateDetectorFolders(evntfolder,name,title);
if (retval)
{
- Error("AddDetector","CreateDetectorFolders returned error for detector %s",name);
+ AliError(Form("CreateDetectorFolders returned error for detector %s",name));
return retval;
}
return 0;
retval = CreateDetectorFolders(evntfoldername,name,title);
if (retval)
{
- Error("AddDetector","CreateDetectorFolders returned error for detector %s",name);
+ AliError(Form("CreateDetectorFolders returned error for detector %s",name));
return retval;
}
// retval = CreateDetectorTasks(name,title);
void AliConfig::Add(AliDetector * obj,const char* eventfolder)
{
// Adds new AliDetector objest to the correspondent event folder
- if (AliLoader::GetDebug())
- Info("Add(AliDetector*)","detector name = %s, Ev. Fold. Name is %s.",
- obj->GetName(),eventfolder);
+ AliDebug(1, Form("detector name = %s, Ev. Fold. Name is %s.",
+ obj->GetName(),eventfolder));
TObject* foundobj = GetTopFolder()->FindObject(eventfolder);
TFolder* evfolder = (foundobj)?dynamic_cast<TFolder*>(foundobj):0x0;
if (evfolder == 0x0)
{
- Fatal("Add(AliDetector * obj,const char* eventfolder)",
- "Can not find folder %s while adding detector %s",eventfolder,obj->GetName());
+ AliFatal(Form("Can not find folder %s while adding detector %s",eventfolder,obj->GetName()));
return;
}
CreateDetectorFolders(evfolder, obj->GetName(), obj->GetTitle());
TFolder* evfolder = dynamic_cast<TFolder*>(GetTopFolder()->FindObject(evntfoldername));
if (evfolder == 0x0)
{
- Error("CreateDetectorFolders",
- "Can not find folder %s while adding detector %s",evntfoldername,name);
+ AliError(Form("Can not find folder %s while adding detector %s",evntfoldername,name));
return 1;
}
return CreateDetectorFolders(evfolder,name,title);
tmp = AddSubFolder(evntfolder,fDetectorFolder[i],name,title);
if (tmp)
{
- Error("AddDetector(TFolder*","Failed to create subfolder of %s for detector %s",fDetectorFolder[i].Data(),name);
+ AliError(Form("Failed to create subfolder of %s for detector %s",fDetectorFolder[i].Data(),name));
return 1;
}
i++;
name+fDetectorTask[i],(fDetectorTask[i]+" for ")+title);
if (tmp)
{
- Error("CreateDetectorTasks","Error occured while creating task for %s in %s.",
- name,fDetectorTask[i-1].Data());
+ AliError(Form("Error occured while creating task for %s in %s.",
+ name,fDetectorTask[i-1].Data()));
return 1;
}
i++;
while (token != NULL)
{
- Info("Add(char *list)","Configuring token=%s",token);
+ AliInfo(Form("Configuring token=%s",token));
TObject *obj;
TIter next (dirlist);
if (strlen(found.Data()))
{
- Info("Add(char *list)","found=%s => OK",found.Data());
+ AliInfo(Form("found=%s => OK",found.Data()));
}
else
{
- Error("Add(char *list)"," => FAILED.");
+ AliError(" => FAILED.");
exit(1);
}
if (topfolder == 0x0)//check if exists top folder
{
- Error("AddSubFodler(TFolder*, ....","Parameter TFolder* points to NULL.");
+ AliError("Parameter TFolder* points to NULL.");
return 1;
}
folder = dynamic_cast<TFolder*>(topfolder->FindObject(infoler));
if (folder == 0x0) //check if we got inolder
{
- Error("AddSubFodler(TFolder*, ....","Can not find folder %s in folder %s.",infoler,topfolder->GetName());
+ AliError(Form("Can not find folder %s in folder %s.",infoler,topfolder->GetName()));
return 1;
}
obj = folder->FindObject(newfoldname); //see if such a subfolder already exists
TFolder *newfolder = folder->AddFolder(newfoldname,newfoldtitle);//add the desired subfolder
if (newfolder == 0x0) //check if we managed
{
- Error("AddSubFodler(TFolder*, ....","Can not create folder %s in folder %s",newfoldname,infoler);
+ AliError(Form("Can not create folder %s in folder %s",newfoldname,infoler));
return 2;
}
else return 0;//success
TFolder* fol = dynamic_cast<TFolder*>(obj);
if (fol == 0x0)
{
- Error("AddSubFodler(TFolder*, ....",
- "Object named %s already exists in folder %s AND IT IS NOT A FOLDER",newfoldname,infoler);
+ AliError(Form("Object named %s already exists in folder %s AND IT IS NOT A FOLDER",newfoldname,infoler));
return 3;
}
- Warning("AddSubFodler(TFolder*, ....",
- "Folder named %s already exists in folder %s",newfoldname,infoler);
+ AliWarning(Form("Folder named %s already exists in folder %s",newfoldname,infoler));
return 0;
}
#include <TString.h>
#include <TBits.h>
+#include "AliLog.h"
#include "AliRunLoader.h"
ClassImp(AliDataLoader)
// creates a 0 loader, depending on option, default "T" is specialized loader for trees
// else standard object loader
// trees needs special care, becouse we need to set dir before writing
- if (GetDebug())
- Info("AliDataLoader","File name is %s",fFileName.Data());
+ AliDebug(1, Form("File name is %s",fFileName.Data()));
TString option(opt);
AliBaseLoader* bl;
/*****************************************************************************/
AliDataLoader::AliDataLoader(const AliDataLoader& source):TNamed(source) {
// copy constructor
- Fatal("AliDataLoader","Copy constructor not implemented");
+ AliFatal("Copy constructor not implemented");
}
/*****************************************************************************/
AliDataLoader& AliDataLoader::operator=(const AliDataLoader& /*source*/) {
// Assignment operator
- Fatal("AliDataLoader","Assignment operator not implemented");
+ AliFatal("Assignment operator not implemented");
return *this;
}
/*****************************************************************************/
AliRunLoader* rl = GetRunLoader();
if (rl == 0x0)
{
- Error("SetEvent","Can not get RunGettr");
+ AliError("Can not get RunGettr");
return 1;
}
{
delete fFile;
fFile = 0x0;
- if (GetDebug()) Info("SetEvent","Reloading new file. File opt is %s",fFileOption.Data());
+ AliDebug(1, Form("Reloading new file. File opt is %s",fFileOption.Data()));
OpenFile(fFileOption);
}
fDirectory = AliLoader::ChangeDir(fFile,evno);
if (fDirectory == 0x0)
{
- Error("SetEvent","Can not chage directory in file %s",fFile->GetName());
+ AliError(Form("Can not chage directory in file %s",fFile->GetName()));
return 1;
}
}
{
if(fFile->IsOpen() == kTRUE)
{
- Warning("OpenFile"," File %s already opened. First close it.",fFile->GetName());
+ AliWarning(Form(" File %s already opened. First close it.",fFile->GetName()));
return 0;
}
else
{
- Warning("OpenFile","Pointer to file %s is not null, but file is not opened",
- fFile->GetName());
+ AliWarning(Form("Pointer to file %s is not null, but file is not opened",
+ fFile->GetName()));
delete fFile;
fFile = 0x0;
}
{
if(fFile->IsOpen() == kTRUE)
{
- Warning("OpenFile","File %s already opened by sombody else. First close it.",
- fFile->GetName());
+ AliWarning(Form("File %s already opened by sombody else. First close it.",
+ fFile->GetName()));
return 0;
}
}
fFile = TFile::Open(fname,fFileOption);//open the file
if (fFile == 0x0)
{//file is null
- Error("OpenFile","Can not open file %s",fname.Data());
+ AliError(Form("Can not open file %s",fname.Data()));
return 1;
}
if (fFile->IsOpen() == kFALSE)
{//file is null
- Error("OpenFile","Can not open file %s",fname.Data());
+ AliError(Form("Can not open file %s",fname.Data()));
return 1;
}
AliRunLoader* rg = GetRunLoader();
if (rg == 0x0)
{
- Error("OpenFile","Can not find Run-Loader in folder.");
+ AliError("Can not find Run-Loader in folder.");
return 2;
}
Int_t evno = rg->GetEventNumber();
fDirectory = AliLoader::ChangeDir(fFile,evno);
if (fDirectory == 0x0)
{
- Error("OpenFile","Can not chage fDirectory in file %s.",fFile->GetName());
+ AliError(Form("Can not chage fDirectory in file %s.",fFile->GetName()));
return 3;
}
return 0;
retval = bl->Load(fFileOption);
if (retval)
{
- Error("Reload","Error occur while loading %s",bl->GetName());
+ AliError(Form("Error occur while loading %s",bl->GetName()));
return retval;
}
}
Int_t AliDataLoader::WriteData(Option_t* opt)
{
//Writes primary data == first BaseLoader
- if (GetDebug())
- Info("WriteData","Writing %s container for %s data. Option is %s.",
- GetBaseLoader(0)->GetName(),GetName(),opt);
+ AliDebug(1, Form("Writing %s container for %s data. Option is %s.",
+ GetBaseLoader(0)->GetName(),GetName(),opt));
return GetBaseLoader(0)->WriteData(opt);
}
/*****************************************************************************/
//sets the event folder
if (eventfolder == 0x0)
{
- Error("SetEventFolder","Stupid joke. Argument is NULL");
+ AliError("Stupid joke. Argument is NULL");
return 1;
}
- if (GetDebug())
- Info("SetFolder","name = %s Setting Event Folder named %s.",
- GetName(),eventfolder->GetName());
+ AliDebug(1, Form("name = %s Setting Event Folder named %s.",
+ GetName(),eventfolder->GetName()));
fEventFolder = eventfolder;
return 0;
// Sets the folder and the data loaders
if (folder == 0x0)
{
- Error("SetFolder","Stupid joke. Argument is NULL");
+ AliError("Stupid joke. Argument is NULL");
return 1;
}
- if (GetDebug()) Info("SetFolder","name = %s Setting folder named %s.",GetName(),folder->GetName());
+ AliDebug(1, Form("name = %s Setting folder named %s.",GetName(),folder->GetName()));
fFolder = folder;
TIter next(fBaseLoaders);
TFolder* AliDataLoader::GetEventFolder()
{
//get EVENT folder (data that are changing from event to event, even in single run)
- if (GetDebug()) Info("GetEventFolder","EF = %#x");
+ AliDebug(1, "EF = %#x");
return fEventFolder;
}
/*****************************************************************************/
TFolder* ef = GetEventFolder();
if (ef == 0x0)
{
- Error("GetRunLoader","Can not get event folder.");
+ AliError("Can not get event folder.");
return 0;
}
rg = dynamic_cast<AliRunLoader*>(ef->FindObject(AliRunLoader::GetRunLoaderName()));
if (bl->IsLoaded()) return;
}
- if (GetDebug())
- Info("CloseFile","Closing and deleting (object) file.");
+ AliDebug(1, "Closing and deleting (object) file.");
delete fFile;
fFile = 0x0;
//adds the suffix before ".root",
//e.g. TPC.Digits.root -> TPC.DigitsMerged.root
//made on Jiri Chudoba demand
- if (GetDebug())
- {
- Info("SetFileNameSuffix","suffix=%s",suffix.Data());
- Info("SetFileNameSuffix"," Digits File Name before: %s",fFileName.Data());
- }
+ AliDebug(1, Form("suffix=%s",suffix.Data()));
+ AliDebug(1, Form(" Digits File Name before: %s",fFileName.Data()));
static TString dotroot(".root");
const TString& suffixdotroot = suffix + dotroot;
fFileName = fFileName.ReplaceAll(dotroot,suffixdotroot);
- if (GetDebug())
- Info("SetDigitsFileNameSuffix"," after : %s",fFileName.Data());
+ AliDebug(1, Form(" after : %s",fFileName.Data()));
}
/*****************************************************************************/
const TString& offfsetdotroot = offset + dotroot;
TString out = fname;
out = out.ReplaceAll(dotroot,offfsetdotroot);
- if (GetDebug()) Info("SetFileOffset","in=%s out=%s.",fname.Data(),out.Data());
+ AliDebug(1, Form("in=%s out=%s.",fname.Data(),out.Data()));
return out;
}
}
/*****************************************************************************/
-Int_t AliDataLoader::GetDebug() const
-{
- //it is not inline bacause AliLoader.h includes AliDataLoaer.h
- //and there is circular depenedence
- return AliLoader::GetDebug();
-}
-/*****************************************************************************/
-
void AliDataLoader::MakeTree()
{
// Makes tree for the current data loader
AliTreeLoader* tl = dynamic_cast<AliTreeLoader*>(fBaseLoaders->At(0));
if (tl == 0x0)
{
- Error("MakeTree","Can not make a tree because main base loader is not a tree loader");
+ AliError("Can not make a tree because main base loader is not a tree loader");
return;
}
tl->MakeTree();
if (bl == 0x0)
{
- Warning("AddBaseLoader","Pointer is null.");
+ AliWarning("Pointer is null.");
return;
}
TObject* obj = fBaseLoaders->FindObject(bl->GetName());
if (obj)
{
- Error("AddBaseLoader","Can not add this base loader.");
- Error("AddBaseLoader","There exists already base loader which manages data named %s for this detector.");
+ AliError("Can not add this base loader.");
+ AliError(Form("There exists already base loader which manages data named %s for this detector.",obj->GetName()));
return;
}
void AliDataLoader::SetDirName(TString& dirname)
{
// Sets the directory name where the files will be stored
- if (GetDebug()>9) Info("SetDirName","FileName before %s",fFileName.Data());
+ AliDebug(10, Form("FileName before %s",fFileName.Data()));
Int_t n = fFileName.Last('/');
- if (GetDebug()>9) Info("SetDirName","Slash found on pos %d",n);
+ AliDebug(10, Form("Slash found on pos %d",n));
if (n > 0) fFileName = fFileName.Remove(0,n+1);
- if (GetDebug()>9) Info("SetDirName","Core FileName %s",fFileName.Data());
+ AliDebug(10, Form("Core FileName %s",fFileName.Data()));
fFileName = dirname + "/" + fFileName;
- if (GetDebug()>9) Info("SetDirName","FileName after %s",fFileName.Data());
+ AliDebug(10, Form("FileName after %s",fFileName.Data()));
}
/*****************************************************************************/
AliObjectLoader* AliDataLoader::GetBaseDataLoader()
//sets data base loader
if (bl == 0x0)
{
- Error("SetBaseDataLoader","Parameter is null");
+ AliError("Parameter is null");
return;
}
if (GetBaseDataLoader()) delete GetBaseDataLoader();
//sets Task base loader
if (bl == 0x0)
{
- Error("SetBaseTaskLoader","Parameter is null");
+ AliError("Parameter is null");
return;
}
if (GetBaseTaskLoader()) delete GetBaseTaskLoader();
//sets QA base loader
if (bl == 0x0)
{
- Error("SetBaseQALoader","Parameter is null");
+ AliError("Parameter is null");
return;
}
if (GetBaseQALoader()) delete GetBaseQALoader();
//sets QA Task base loader
if (bl == 0x0)
{
- Error("SetBaseQATaskLoader","Parameter is null");
+ AliError("Parameter is null");
return;
}
if (GetBaseQATaskLoader()) delete GetBaseQATaskLoader();
/*****************************************************************************/
AliBaseLoader::AliBaseLoader(const AliBaseLoader& source):TNamed(source) {
// copy constructor
- Fatal("AliBaseLoader","Copy constructor not implemented");
+ AliFatal("Copy constructor not implemented");
}
/*****************************************************************************/
AliBaseLoader& AliBaseLoader::operator=(const AliBaseLoader& /*source*/) {
// Assignment operator
- Fatal("AliBaseLoader","Assignment operator not implemented");
+ AliFatal("Assignment operator not implemented");
return *this;
}
/*****************************************************************************/
Int_t AliBaseLoader::Load(Option_t* opt)
{
// Loads and posts the data
- if (GetDebug())
- Info("Load","data type = %s, option = %s",GetName(),opt);
+ AliDebug(1, Form("data type = %s, option = %s",GetName(),opt));
if (Get())
{
- if (GetDebug())
- Warning("Load","Data <<%s>> are already loaded. Use ReloadData to force reload. Nothing done",GetName());
+ AliWarning(Form("Data <<%s>> are already loaded. Use ReloadData to force reload. Nothing done",GetName()));
return 0;
}
{
if (GetDataLoader()->IsOptionContrary(opt) == kTRUE)
{
- Error("Load","Data Type %s, Container Name %s", GetDataLoader()->GetName(),GetName());
- Error("Load","File was already opened in READ-ONLY mode, while now WRITEABLE access is requested.");
- Error("Load","Use AliDataLoader::SetOption to enforce change of access mode OR");
- Error("Load","Load previosly loaded data with coherent option.");
+ AliError(Form("Data Type %s, Container Name %s", GetDataLoader()->GetName(),GetName()));
+ AliError("File was already opened in READ-ONLY mode, while now WRITEABLE access is requested.");
+ AliError("Use AliDataLoader::SetOption to enforce change of access mode OR");
+ AliError("Load previosly loaded data with coherent option.");
return 10;
}
}
retval = GetDataLoader()->OpenFile(opt);
if (retval)
{
- Error("Load","Error occured while opening <<%s>> file",GetName());
+ AliError(Form("Error occured while opening <<%s>> file",GetName()));
return retval;
}
}
retval = Post();
if (retval)
{
- Error("Load","Error occured while posting %s from file to folder.",GetName());
+ AliError(Form("Error occured while posting %s from file to folder.",GetName()));
return retval;
}
if ( GetDirectory() == 0x0)
{
- Error("Post","%s directory is NULL. Load before.",GetDataLoader()->GetName());
+ AliError(Form("%s directory is NULL. Load before.",GetDataLoader()->GetName()));
return 2;
}
Int_t fileupdate = GetDataLoader()->GetFileOption().CompareTo("update",TString::kIgnoreCase);
if ( fileupdate == 0)
{ //if it is, it is normal that there is no data yet
- if (GetDebug())
- {
- Info("Post","Can not find %s in file %s (file is opened in UPDATE mode).",
- GetName(),GetDataLoader()->GetFile()->GetName());
- }
+ AliDebug(1, Form("Can not find %s in file %s (file is opened in UPDATE mode).",
+ GetName(),GetDataLoader()->GetFile()->GetName()));
}
else
{
- Error("Post","Can not find %s in file %s", GetName(),GetDataLoader()->GetFile()->GetName());
+ AliError(Form("Can not find %s in file %s", GetName(),GetDataLoader()->GetFile()->GetName()));
return 5;
}
}
//Posts data container to proper folders
if (data == 0x0)
{
- Error("Post","Pointer to object is NULL");
+ AliError("Pointer to object is NULL");
return 1;
}
if ( fName.CompareTo(data->GetName()) != 0)
{
- Fatal("Post(TObject*)","Object name is <<%s>> while <<%s>> expected",data->GetName(),GetName());
+ AliFatal(Form("Object name is <<%s>> while <<%s>> expected",data->GetName(),GetName()));
return -1;//pro forma
}
TObject* obj = Get();
if (data == obj)
{
- if (GetDebug()) Warning("Post","This object was already posted.");
+ AliWarning("This object was already posted.");
return 0;
}
if (obj)
{
- Warning("PostData","Object named %s already exitsts in data folder. Removing it",GetName());
+ AliWarning(Form("Object named %s already exitsts in data folder. Removing it",GetName()));
Clean();
}
return AddToBoard(data);
{
//Writes data defined by di object
//opt might be "OVERWRITE" in case of forcing overwriting
- if (GetDebug())
- Info("WriteData","Writing %s container for %s data. Option is %s.",
- GetName(),GetDataLoader()->GetName(),opt);
+ AliDebug(1, Form("Writing %s container for %s data. Option is %s.",
+ GetName(),GetDataLoader()->GetName(),opt));
TObject *data = Get();
if(data == 0x0)
{//did not get, nothing to write
- Warning("WriteData","Tree named %s not found in folder. Nothing to write.",GetName());
+ AliWarning(Form("Tree named %s not found in folder. Nothing to write.",GetName()));
return 0;
}
if (GetDataLoader()->OpenFile("UPDATE"))
{
//oops, can not open the file, give an error message and return error code
- Error("WriteData","Can not open hits file. %s ARE NOT WRITTEN",GetName());
+ AliError(Form("Can not open hits file. %s ARE NOT WRITTEN",GetName()));
return 1;
}
}
if (GetDataLoader()->IsFileWritable() == kFALSE)
{
- Error("WriteData","File %s is not writable",GetDataLoader()->GetFileName().Data());
+ AliError(Form("File %s is not writable",GetDataLoader()->GetFileName().Data()));
return 2;
}
const char *oOverWrite = strstr(opt,"OVERWRITE");
if(!oOverWrite)
{//if it is not used - give an error message and return an error code
- Error("WriteData","Tree already exisists. Use option \"OVERWRITE\" to overwrite previous data");
+ AliError("Tree already exisists. Use option \"OVERWRITE\" to overwrite previous data");
return 3;
}
}
- if (GetDebug()) Info("WriteData","DataName = %s, opt = %s, data object name = %s",
- GetName(),opt,data->GetName());
- if (GetDebug()) Info("WriteData","File Name = %s, Directory Name = %s Directory's File Name = %s",
+ AliDebug(1, Form("DataName = %s, opt = %s, data object name = %s",
+ GetName(),opt,data->GetName()));
+ AliDebug(1, Form("File Name = %s, Directory Name = %s Directory's File Name = %s",
GetDataLoader()->GetFile()->GetName(),GetDirectory()->GetName(),
- GetDirectory()->GetFile()->GetName());
+ GetDirectory()->GetFile()->GetName()));
- if (GetDebug()) Info("WriteData","Writing data");
+ AliDebug(1, "Writing data");
data->Write(0,TObject::kOverwrite);
fIsLoaded = kTRUE; // Just to ensure flag is on. Object can be posted manually to folder structure, not using loader.
void AliBaseLoader::Clean()
{
//removes objects from folder/task
- if (GetDebug()) Info("Clean","%s %s",GetName(),GetDataLoader()->GetName());
+ AliDebug(1, Form("%s %s",GetName(),GetDataLoader()->GetName()));
TObject* obj = Get();
if(obj)
{
- if (GetDebug())
- Info("Clean","cleaning %s.",GetName());
+ AliDebug(1, Form("cleaning %s.",GetName()));
RemoveFromBoard(obj);
delete obj;
}
// Returns pointer to the data loader
if (fDataLoader == 0x0)
{
- Fatal("GetDataLoader","Pointer to Data Loader is NULL");
+ AliFatal("Pointer to Data Loader is NULL");
}
return fDataLoader;
}
/*****************************************************************************/
-Int_t AliBaseLoader::GetDebug() const
-{
- // Returns debug level
- return (Int_t)AliLoader::GetDebug();
-}
-
TDirectory* AliBaseLoader::GetDirectory() const
{
// returnd TDirectory where data are to be saved
TFolder* df = GetDataLoader()->GetFolder();
if (df == 0x0)
{
- Fatal("GetFolder","Data Folder is NULL");
+ AliFatal("Data Folder is NULL");
}
return df;
}
AliObjectLoader::AliObjectLoader(const AliObjectLoader& source):
AliBaseLoader(source) {
// copy constructor
- Fatal("AliObjectLoader","Copy constructor not implemented");
+ AliFatal("Copy constructor not implemented");
}
/*****************************************************************************/
AliObjectLoader& AliObjectLoader::operator=(const AliObjectLoader& /*source*/) {
// Assignment operator
- Fatal("AliObjectLoader","Assignment operator not implemented");
+ AliFatal("Assignment operator not implemented");
return *this;
}
/*****************************************************************************/
AliTreeLoader::AliTreeLoader(const AliTreeLoader& source):
AliObjectLoader(source) {
// copy constructor
- Fatal("AliTreeLoader","Copy constructor not implemented");
+ AliFatal("Copy constructor not implemented");
}
/*****************************************************************************/
AliTreeLoader& AliTreeLoader::operator=(const AliTreeLoader& /*source*/) {
// Assignment operator
- Fatal("AliTreeLoader","Assignment operator not implemented");
+ AliFatal("Assignment operator not implemented");
return *this;
}
//Writes data defined by di object
//opt might be "OVERWRITE" in case of forcing overwriting
- if (GetDebug())
- Info("WriteData","Writing %s container for %s data. Option is %s.",
- GetName(),GetDataLoader()->GetName(),opt);
+ AliDebug(1, Form("Writing %s container for %s data. Option is %s.",
+ GetName(),GetDataLoader()->GetName(),opt));
TObject *data = Get();
if(data == 0x0)
{//did not get, nothing to write
- Warning("WriteData","Tree named %s not found in folder. Nothing to write.",GetName());
+ AliWarning(Form("Tree named %s not found in folder. Nothing to write.",GetName()));
return 0;
}
if (GetDataLoader()->OpenFile("UPDATE"))
{
//oops, can not open the file, give an error message and return error code
- Error("WriteData","Can not open hits file. %s ARE NOT WRITTEN",GetName());
+ AliError(Form("Can not open hits file. %s ARE NOT WRITTEN",GetName()));
return 1;
}
}
if (GetDataLoader()->IsFileWritable() == kFALSE)
{
- Error("WriteData","File %s is not writable",GetDataLoader()->GetFileName().Data());
+ AliError(Form("File %s is not writable",GetDataLoader()->GetFileName().Data()));
return 2;
}
const char *oOverWrite = strstr(opt,"OVERWRITE");
if(!oOverWrite)
{//if it is not used - give an error message and return an error code
- Error("WriteData","Tree already exisists. Use option \"OVERWRITE\" to overwrite previous data");
+ AliError("Tree already exisists. Use option \"OVERWRITE\" to overwrite previous data");
return 3;
}
}
- if (GetDebug()) Info("WriteData","DataName = %s, opt = %s, data object name = %s",
- GetName(),opt,data->GetName());
- if (GetDebug()) Info("WriteData","File Name = %s, Directory Name = %s Directory's File Name = %s",
+ AliDebug(1, Form("DataName = %s, opt = %s, data object name = %s",
+ GetName(),opt,data->GetName()));
+ AliDebug(1, Form("File Name = %s, Directory Name = %s Directory's File Name = %s",
GetDataLoader()->GetFile()->GetName(),GetDirectory()->GetName(),
- GetDirectory()->GetFile()->GetName());
+ GetDirectory()->GetFile()->GetName()));
//if a data object is a tree set the directory
TTree* tree = dynamic_cast<TTree*>(data);
if (tree) tree->SetDirectory(GetDirectory()); //forces setting the directory to this directory (we changed dir few lines above)
- if (GetDebug()) Info("WriteData","Writing tree");
+ AliDebug(1, "Writing tree");
data->Write(0,TObject::kOverwrite);
fIsLoaded = kTRUE; // Just to ensure flag is on. Object can be posted manually to folder structure, not using loader.
//this virtual method creates the tree in the file
if (Tree())
{
- if (GetDebug())
- Info("MakeTree","name = %s, Data Name = %s Tree already exists.",
- GetName(),GetDataLoader()->GetName());
+ AliDebug(1, Form("name = %s, Data Name = %s Tree already exists.",
+ GetName(),GetDataLoader()->GetName()));
return;//tree already made
}
- if (GetDebug())
- Info("MakeTree","Making Tree named %s.",GetName());
+ AliDebug(1, Form("Making Tree named %s.",GetName()));
TString dtypename(GetDataLoader()->GetName());
TTree* tree = new TTree(GetName(), dtypename + " Container"); //make a tree
if (tree == 0x0)
{
- Error("MakeTree","Can not create %s tree.",GetName());
+ AliError(Form("Can not create %s tree.",GetName()));
return;
}
tree->SetAutoSave(1000000000); //no autosave
AliTaskLoader::AliTaskLoader(const AliTaskLoader& source):
AliBaseLoader(source) {
// copy constructor
- Fatal("AliTaskLoader","Copy constructor not implemented");
+ AliFatal("Copy constructor not implemented");
}
/*****************************************************************************/
AliTaskLoader& AliTaskLoader::operator=(const AliTaskLoader& /*source*/) {
// Assignment operator
- Fatal("AliTaskLoader","Assignment operator not implemented");
+ AliFatal("Assignment operator not implemented");
return *this;
}
/*****************************************************************************/
//removes tasl from parental task
// DO NOT DELETE OBJECT contrary to BaseLoader
//
- if (GetDebug()) Info("Clean","%s %s",GetName(),GetDataLoader()->GetName());
+ AliDebug(1, Form("Clean","%s %s",GetName(),GetDataLoader()->GetName()));
TObject* obj = Get();
if(obj)
{
- if (GetDebug())
- Info("Clean","cleaning %s.",GetName());
+ AliDebug(1, Form("cleaning %s.",GetName()));
RemoveFromBoard(obj);
}
}
TTask* task = dynamic_cast<TTask*>(obj);
if (task == 0x0)
{
- Error("AddToBoard","To TTask board can be added only tasks.");
+ AliError("To TTask board can be added only tasks.");
return 1;
}
GetParentalTask()->Add(task);
void Synchronize();
protected:
- Int_t GetDebug() const;
AliRunLoader* GetRunLoader();//gets the run-loader from event folder
private:
virtual void RemoveFromBoard(TObject* obj) = 0;
AliDataLoader* GetDataLoader() const;
- Int_t GetDebug() const;
Bool_t fIsLoaded; //! flag indicating if data are loaded
Bool_t fStoreInTopOfFile;// if true, data are stored in top of file ->Indicates fDoNotReload == kTRUE
#include <TSystem.h>
+#include "AliLog.h"
#include "AliFieldMap.h"
ClassImp(AliFieldMap)
Int_t ix, iy, iz, ipx, ipy, ipz;
Float_t bx, by, bz;
char *fname = 0;
- printf("%s: Reading Magnetic Field Map %s from file %s\n",
- ClassName(),fName.Data(),fTitle.Data());
+ AliInfo(Form("Reading Magnetic Field Map %s from file %s",
+ fName.Data(),fTitle.Data()));
fname = gSystem->ExpandPathName(fTitle.Data());
magfile = fopen(fname,"r");
//
// Copy *this onto magf -- Not implemented
//
- Fatal("Copy","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________
#include "TString.h"
#include "TVirtualMC.h"
+#include "AliLog.h"
#include "AliDebugVolume.h"
#include "AliLego.h"
#include "AliLegoGenerator.h"
//
fVolumesFwd = new TClonesArray("AliDebugVolume",1000);
fVolumesBwd = new TClonesArray("AliDebugVolume",1000);
- fDebug = gAlice->GetDebug();
+ fDebug = AliDebugLevel();
}
//_______________________________________________________________________
fVolumesFwd = new TClonesArray("AliDebugVolume",1000);
fVolumesBwd = new TClonesArray("AliDebugVolume",1000);
- fDebug = gAlice->GetDebug();
+ fDebug = AliDebugLevel();
}
//_______________________________________________________________________
fTotGcm2 = 0;
if (fDebug) {
- if (fErrorCondition) DumpVolumes();
+ if (fErrorCondition) ToAliDebug(1, DumpVolumes());
fVolumesFwd->Delete();
fVolumesBwd->Delete();
fStepsForward = 0;
fHistAbso->Delete(); fHistAbso=0;
fHistGcm2->Delete(); fHistGcm2=0;
//
- if (fErrorCondition) DumpVolumes();
+ if (fErrorCondition) ToAliError(DumpVolumes());
}
//_______________________________________________________________________
//
// Copy *this onto lego -- not implemented
//
- Fatal("Copy","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________
AliDebugVolume* tmp = dynamic_cast<AliDebugVolume*>((*fVolumesFwd)[fStepsBackward]);
if (! (tmp->IsVEqual(vol, copy)) && (!fErrorCondition))
{
- printf("\n Problem at (x,y,z): %d %f %f %f, volumes: %s %s step: %f\n",
- fStepsBackward, pos[0], pos[1], pos[2], tmp->GetName(), vol, step);
+ AliWarning(Form("Problem at (x,y,z): %d %f %f %f, volumes: %s %s step: %f\n",
+ fStepsBackward, pos[0], pos[1], pos[2], tmp->GetName(), vol, step));
fErrorCondition = 1;
}
} // Debug
#include "AliLegoGenerator.h"
#include "AliRun.h"
#include "AliMC.h"
+#include "AliLog.h"
ClassImp(AliLegoGenerator)
// Prepare for next step
if(fCoor1Bin>=fNCoor1-1)
if(fCoor2Bin>=fNCoor2-1) {
- Warning("Generate","End of Lego Generation");
+ AliWarning("End of Lego Generation");
return;
} else {
fCoor2Bin++;
- printf("Generating rays in phi bin:%d\n",fCoor2Bin);
+ AliDebug(1, Form("Generating rays in phi bin:%d",fCoor2Bin));
fCoor1Bin=0;
} else fCoor1Bin++;
#include "AliLegoGeneratorEta.h"
#include "AliRun.h"
#include "AliMC.h"
+#include "AliLog.h"
ClassImp(AliLegoGeneratorEta)
// Prepare for next step
if(fCoor1Bin>=fNCoor1-1)
if(fCoor2Bin>=fNCoor2-1) {
- Warning("Generate","End of Lego Generation");
+ AliWarning("End of Lego Generation");
return;
} else {
fCoor2Bin++;
- printf("Generating rays in eta bin:%d\n",fCoor2Bin);
+ AliDebug(1, Form("Generating rays in eta bin:%d",fCoor2Bin));
fCoor1Bin=0;
} else fCoor1Bin++;
#include "AliLegoGeneratorPhiZ.h"
#include "AliRun.h"
#include "AliMC.h"
+#include "AliLog.h"
ClassImp(AliLegoGeneratorPhiZ)
// Prepare for next step
if(fCoor1Bin>=fNCoor1-1)
if(fCoor2Bin>=fNCoor2-1) {
- Warning("Generate","End of Lego Generation");
+ AliWarning("End of Lego Generation");
return;
} else {
fCoor2Bin++;
- printf("Generating rays in Phi-bin:%d\n",fCoor2Bin);
+ AliDebug(1, Form("Generating rays in Phi-bin:%d",fCoor2Bin));
fCoor1Bin=0;
} else fCoor1Bin++;
fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
#include "AliLegoGeneratorXYZ.h"
#include "AliRun.h"
#include "AliMC.h"
+#include "AliLog.h"
ClassImp(AliLegoGeneratorXYZ)
// Prepare for next step
if(fCoor1Bin>=fNCoor1-1)
if(fCoor2Bin>=fNCoor2-1) {
- Warning("Generate","End of Lego Generation");
+ AliWarning("End of Lego Generation");
return;
} else {
fCoor2Bin++;
- printf("Generating rays in Coordinate 2 bin:%d\n",fCoor2Bin);
+ AliDebug(1, Form("Generating rays in Coordinate 2 bin:%d",fCoor2Bin));
fCoor1Bin=0;
} else fCoor1Bin++;
#include <TError.h>
//AliRoot includes
+#include <AliLog.h>
#include <AliRun.h>
#include <AliRunLoader.h>
#include <AliRunDigitizer.h>
#include <AliDetector.h>
#include "AliConfig.h"
-Int_t AliLoader::fgDebug = 0;
-
const TString AliLoader::fgkDefaultHitsContainerName("TreeH");
const TString AliLoader::fgkDefaultDigitsContainerName = "TreeD";
const TString AliLoader::fgkDefaultSDigitsContainerName = "TreeS";
fQAFolder(0x0)
{
//ctor
- if (GetDebug()) Info("AliLoader(const Char_t* detname,const Char_t* eventfoldername)",
- "detname = %s eventfoldername = %s",detname,eventfoldername);
+ AliDebug(1, Form("detname = %s eventfoldername = %s",detname,eventfoldername));
//try to find folder eventfoldername in top alice folder
//safe because GetTopFolder will abort in case of failure
// dummy copy constructor
if(&source==this)return;
- Fatal("AliLoader","Copy constructor not implemented. Aborting");
+ AliFatal("Copy constructor not implemented. Aborting");
return;
}
// dummy assignment operator
if(&source==this) return *this;
- Fatal("AliLoader","Assignment operator not implemented. Aborting");
+ AliFatal("Assignment operator not implemented. Aborting");
return *this;
}
//
if (dl == 0x0)
{
- Error("AddDataLoader","Pointer is NULL");
+ AliError("Pointer is NULL");
return;
}
if (fDataLoaders->FindObject(dl->GetName()))
{
- Error("AddDataLoader","Such a loader exists");
+ AliError("Such a loader exists");
return;
}
fDataLoaders->AddLast(dl);
retval = dl->GetEvent();
if (retval)
{
- Error("GetEvent","Error occured while GetEvent for %s",dl->GetName());
+ AliError(Form("Error occured while GetEvent for %s",dl->GetName()));
return retval;
}
}
if (!fDataFolder)
{
- Fatal("GetDataFolder","Can not find AliRoot data folder. Aborting");
+ AliFatal("Can not find AliRoot data folder. Aborting");
return 0x0;
}
}
if (!fTasksFolder)
{
- Fatal("GetTasksFolder","Can not find tasks folder. Aborting");
+ AliFatal("Can not find tasks folder. Aborting");
return 0x0;
}
}
if (!fModuleFolder)
{
- Fatal("GetModulesFolder","Can not find modules folder. Aborting");
+ AliFatal("Can not find modules folder. Aborting");
return 0x0;
}
}
if (fQAFolder == 0x0)
{
- Fatal("GetQAFolder","Can not find Quality Assurance folder. Aborting");
+ AliFatal("Can not find Quality Assurance folder. Aborting");
return 0x0;
}
}
TTask* qat = AliRunLoader::GetRunQATask();
if ( qat == 0x0 )
{
- Error("QAtask","Can not get RunQATask. (Name:%s)",GetName());
+ AliError(Form("Can not get RunQATask. (Name:%s)",GetName()));
return 0x0;
}
if ( dqat == 0x0 )
{
- Error("QAtask","Can not find QATask in RunQATask for %s",GetDetectorName().Data());
+ AliError(Form("Can not find QATask in RunQATask for %s",GetDetectorName().Data()));
return 0x0;
}
if(taskname.BeginsWith(name))
return task ;
}
- Error("QAtask","Can not find sub-task with name starting with %s in task %s",name,dqat->GetName());
+ AliError(Form("Can not find sub-task with name starting with %s in task %s",name,dqat->GetName()));
return 0x0;
}
/*****************************************************************************/
if (file == 0x0)
{
- ::Error("AliLoader::ChangeDir","File is null");
+ AliErrorClass("File is null");
return 0x0;
}
if (file->IsOpen() == kFALSE)
{
- ::Error("AliLoader::ChangeDir","File is not opened");
+ AliErrorClass("File is not opened");
return 0x0;
}
TString dirname("Event");
dirname+=eventno;
- if (AliLoader::fgDebug > 1)
- ::Info("AliLoader::ChangeDir","Changing Dir to %s in file %s.",dirname.Data(),file->GetName());
+ AliDebugClass(1, Form("Changing Dir to %s in file %s.",dirname.Data(),file->GetName()));
Bool_t result;
if (dir == 0x0)
{
- if (AliLoader::fgDebug > 1)
- ::Info("AliLoader::ChangeDir","Can not find directory %s in file %s, creating...",
- dirname.Data(),file->GetName());
+ AliDebugClass(1, Form("Can not find directory %s in file %s, creating...",
+ dirname.Data(),file->GetName()));
if (file->IsWritable() == kFALSE)
{
- ::Error("AliLoader::ChangeDir","Can not create directory. File %s in not writable.",
- file->GetName());
+ AliErrorClass(Form("Can not create directory. File %s in not writable.",
+ file->GetName()));
return 0x0;
}
TDirectory* newdir = file->mkdir(dirname);
if (newdir == 0x0)
{
- ::Error("AliLoader::ChangeDir","Failed to create new directory in file %s.",
- file->GetName());
+ AliErrorClass(Form("Failed to create new directory in file %s.",
+ file->GetName()));
return 0x0;
}
result = file->cd(dirname);
AliDataLoader* dl;
while ((dl = (AliDataLoader*)next()))
{
- if (GetDebug()) Info("CleanFolders","name = %s cleaning",dl->GetName());
+ AliDebug(1, Form("name = %s cleaning",dl->GetName()));
dl->Clean();
}
}
//removes and deletes detector task from Run Task
if ( GetSDigitsDataLoader()->GetBaseTaskLoader() == 0x0 )
{
- Warning("CleanSDigitizer","Task Loader for SDigits does not exist");
+ AliWarning("Task Loader for SDigits does not exist");
return;
}
GetSDigitsDataLoader()->GetBaseTaskLoader()->Clean();
//removes and deletes detector task from Run Task
if ( GetDigitsDataLoader()->GetBaseTaskLoader() == 0x0 )
{
- Warning("CleanDigitizer","Task Loader for Digits does not exist");
+ AliWarning("Task Loader for Digits does not exist");
return;
}
GetDigitsDataLoader()->GetBaseTaskLoader()->Clean();
//removes and deletes detector Reconstructioner from Run Reconstructioner
if ( GetRecPointsDataLoader()->GetBaseTaskLoader() == 0x0 )
{
- Warning("CleanSDigitizer","Task Loader for SDigits does not exist");
+ AliWarning("Task Loader for SDigits does not exist");
return;
}
GetRecPointsDataLoader()->GetBaseTaskLoader()->Clean();
//removes and deletes detector task from Run Task
if ( GetTracksDataLoader()->GetBaseTaskLoader() == 0x0 )
{
- Warning("CleanTracker","Task Loader for Tracks does not exist");
+ AliWarning("Task Loader for Tracks does not exist");
return;
}
GetTracksDataLoader()->GetBaseTaskLoader()->Clean();
if ( GetRecParticlesDataLoader()->GetBaseTaskLoader() == 0x0 )
{
- Warning("CleanPIDTask","Task Loader for Reconstructed Particles does not exist");
+ AliWarning("Task Loader for Reconstructed Particles does not exist");
return;
}
GetRecParticlesDataLoader()->GetBaseTaskLoader()->Clean();
Int_t err = dl->Reload();
if (err)
{
- Error("ReloadAll","Reload returned error for %s",dl->GetName());
+ AliError(Form("Reload returned error for %s",dl->GetName()));
return err;
}
}
//sets the event folder
if (eventfolder == 0x0)
{
- Error("SetEventFolder","Stupid joke. Argument is NULL");
+ AliError("Stupid joke. Argument is NULL");
return 1;
}
//creation of folder structure as well (some detectors needs folders
//alrady in constructors)
- if (GetDebug()) Info("Register","Name is %s.",GetName());
+ AliDebug(1, Form("Name is %s.",GetName()));
if (eventFolder == 0x0)
{
- Error("Register","Event folder is not set.");
+ AliError("Event folder is not set.");
return 1;
}
Int_t retval = AliConfig::Instance()->AddDetector(eventFolder,fDetectorName,fDetectorName);
if(retval)
{
- Error("SetEventFolder","Can not create tasks and/or folders for %s. Event folder name is %s",
- fDetectorName.Data(),eventFolder->GetName());
+ AliError(Form("Can not create tasks and/or folders for %s. Event folder name is %s",
+ fDetectorName.Data(),eventFolder->GetName()));
return retval;
}
SetEventFolder(eventFolder);
TObject* obj = GetDetectorDataFolder()->FindObject(name);
if(obj)
{
- if (GetDebug())
- Info("Clean(const TString&)","name=%s, cleaning %s.",GetName(),name.Data());
+ AliDebug(1, Form("name=%s, cleaning %s.",GetName(),name.Data()));
GetDetectorDataFolder()->Remove(obj);
delete obj;
}
}
/*****************************************************************************/
+Int_t AliLoader::GetDebug()
+{
+ AliWarningClass("Don't use this method any more, use AliDebug instead");
+ return AliDebugLevelClass();
+}
+/*****************************************************************************/
+
+void AliLoader::SetDebug(Int_t deb)
+{
+ // Sets debug level
+ AliLog::SetClassDebugLevel("AliRunLoader", deb);
+ AliLog::SetClassDebugLevel("AliLoader", deb);
+ AliLog::SetClassDebugLevel("AliDataLoader", deb);
+ AliLog::SetClassDebugLevel("AliBaseLoader", deb);
+ AliLog::SetClassDebugLevel("AliObjectLoader", deb);
+ AliLog::SetClassDebugLevel("AliTreeLoader", deb);
+ AliLog::SetClassDebugLevel("AliTaskLoader", deb);
+ AliLog::SetClassDebugLevel("AliConfig", deb);
+}
+/*****************************************************************************/
+
void AliLoader::SetTAddrInDet()
{
//calls SetTreeAddress for corresponding detector
static Bool_t TestFileOption(Option_t* opt);//checks is file is created from scratch
static Bool_t IsOptionWritable(const TString& opt);
- static Int_t GetDebug() {return fgDebug;}
- static void SetDebug(Int_t deb = 1){fgDebug = deb;}//Sets debugging information
+ static Int_t GetDebug();
+ static void SetDebug(Int_t deb = 1);//Sets debugging information
protected:
//descendant classes should
//use protected interface methods to access these folders
- static Int_t fgDebug; //debug flag for loaders
-
ClassDef(AliLoader,2)
};
/******************************************************************/
#include <TSystem.h>
#include <TVirtualMC.h>
+#include "AliLog.h"
#include "AliDetector.h"
#include "AliGenerator.h"
#include "AliHeader.h"
fSum2Energy(0),
fTrRmax(1.e10),
fTrZmax(1.e10),
- fDebug(0),
fImedia(0),
fTransParName("\0"),
fMCQA(0),
fSum2Energy(0),
fTrRmax(1.e10),
fTrZmax(1.e10),
- fDebug(0),
fImedia(new TArrayI(1000)),
fTransParName("\0"),
fMCQA(0),
fSum2Energy(0),
fTrRmax(1.e10),
fTrZmax(1.e10),
- fDebug(0),
fImedia(0),
fTransParName("\0"),
fMCQA(0),
void AliMC::Copy(TObject &) const
{
//dummy Copy function
- Fatal("Copy","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________
TStopwatch stw;
TIter next(gAlice->Modules());
AliModule *detector;
- if (GetDebug()) Info("ConstructGeometry","Geometry creation:");
+ AliDebug(1, "Geometry creation:");
while((detector = dynamic_cast<AliModule*>(next()))) {
stw.Start();
// Initialise detector materials and geometry
detector->CreateMaterials();
detector->CreateGeometry();
- printf("%10s R:%.2fs C:%.2fs\n",
- detector->GetName(),stw.RealTime(),stw.CpuTime());
+ AliInfo(Form("%10s R:%.2fs C:%.2fs",
+ detector->GetName(),stw.RealTime(),stw.CpuTime()));
}
}
// Initialize detectors and display geometry
//
- printf("Initialisation:\n");
+ AliInfo("Initialisation:");
TStopwatch stw;
TIter next(gAlice->Modules());
AliModule *detector;
// Initialise detector and display geometry
detector->Init();
detector->BuildGeometry();
- printf("%10s R:%.2fs C:%.2fs\n",
- detector->GetName(),stw.RealTime(),stw.CpuTime());
+ AliInfo(Form("%10s R:%.2fs C:%.2fs",
+ detector->GetName(),stw.RealTime(),stw.CpuTime()));
}
}
//
if(fGenerator)
if(generator)
- Warning("ResetGenerator","Replacing generator %s with %s\n",
- fGenerator->GetName(),generator->GetName());
+ AliWarning(Form("Replacing generator %s with %s",
+ fGenerator->GetName(),generator->GetName()))
else
- Warning("ResetGenerator","Replacing generator %s with NULL\n",
- fGenerator->GetName());
+ AliWarning(Form("Replacing generator %s with NULL",
+ fGenerator->GetName()));
fGenerator = generator;
}
void AliMC::FinishRun()
{
// Clean generator information
- if (GetDebug()) Info("FinishRun"," fGenerator->FinishRun()");
+ AliDebug(1, "fGenerator->FinishRun()");
fGenerator->FinishRun();
//Output energy summary tables
- if (GetDebug()) {
- Info("FinishRun"," EnergySummary()");
- EnergySummary();
- }
-
+ AliDebug(1, "EnergySummary()");
+ ToAliDebug(1, EnergySummary());
}
//_______________________________________________________________________
//
// Clean-up previous event
// Energy scores
- if (GetDebug())
- {
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent"," BEGINNING EVENT ");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- }
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, " BEGINNING EVENT ");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
AliRunLoader *runloader=gAlice->GetRunLoader();
//Set the next event in Run Loader -> Cleans trees (TreeK and all trees in detectors),
gAlice->SetEventNrInRun(gAlice->GetEventNrInRun()+1);
runloader->SetEventNumber(gAlice->GetEventNrInRun());// sets new files, cleans the previous event stuff, if necessary, etc.,
- if (GetDebug()) Info("BeginEvent","EventNr is %d",gAlice->GetEventNrInRun());
+ AliDebug(1, Form("EventNr is %d",gAlice->GetEventNrInRun()));
fEventEnergy.Reset();
// Clean detector information
if(gAlice->Lego() == 0x0)
{
- if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTree(K)");
+ AliDebug(1, "fRunLoader->MakeTree(K)");
runloader->MakeTree("K");
}
- if (GetDebug()) Info("BeginEvent"," gMC->SetStack(fRunLoader->Stack())");
+ AliDebug(1, "gMC->SetStack(fRunLoader->Stack())");
gMC->SetStack(gAlice->GetRunLoader()->Stack());//Was in InitMC - but was moved here
//because we don't have guarantee that
//stack pointer is not going to change from event to event
}
- if (GetDebug()) Info("BeginEvent"," ResetHits()");
+ AliDebug(1, "ResetHits()");
ResetHits();
- if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTree(H)");
+ AliDebug(1, "fRunLoader->MakeTree(H)");
runloader->MakeTree("H");
- if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTrackRefsContainer()");
+ AliDebug(1, "fRunLoader->MakeTrackRefsContainer()");
runloader->MakeTrackRefsContainer();//for insurance
AliModule *detector;
while((detector = (AliModule*)next()))
{
- if (GetDebug()) Info("BeginEvent"," %s->MakeBranch(H)",detector->GetName());
+ AliDebug(2, Form("%s->MakeBranch(H)",detector->GetName()));
detector->MakeBranch("H");
- if (GetDebug()) Info("BeginEvent"," %s->MakeBranchTR()",detector->GetName());
+ AliDebug(2, Form("%s->MakeBranchTR()",detector->GetName()));
detector->MakeBranchTR();
- if (GetDebug()) Info("BeginEvent"," %s->SetTreeAddress()",detector->GetName());
+ AliDebug(2, Form("%s->SetTreeAddress()",detector->GetName()));
detector->SetTreeAddress();
}
// make branch for AliRun track References
AliStack* stack = runloader->Stack();
if ( (header == 0x0) || (stack == 0x0) )
{//check if we got header and stack. If not cry and exit aliroot
- Fatal("AliRun","Can not get the stack or header from LOADER");
+ AliFatal("Can not get the stack or header from LOADER");
return;//never reached
}
// Update Header information
}
else
{
- Error("FinishEvent","Can not get TreeE from RL");
+ AliError("Can not get TreeE from RL");
}
if(gAlice->Lego() == 0x0)
runloader->WriteHits("OVERWRITE");
}
- if (GetDebug())
- {
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent"," FINISHING EVENT ");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- }
+ AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ AliDebug(1, " FINISHING EVENT ");
+ AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
}
//_______________________________________________________________________
det->HiMedium() = 0;
} else {
if(det->HiMedium() > fImedia->GetSize()) {
- Error("MediaTable","Increase fImedia from %d to %d",
- fImedia->GetSize(),det->HiMedium());
+ AliError(Form("Increase fImedia from %d to %d",
+ fImedia->GetSize(),det->HiMedium()));
return;
}
// Tag all materials in rage as belonging to detector kz
}
//
// Print summary table
- printf(" Traking media ranges:\n");
+ AliInfo("Tracking media ranges:");
+ ToAliInfo(
for(i=0;i<(ndets-1)/6+1;i++) {
for(k=0;k< (6<ndets-i*6?6:ndets-i*6);k++) {
ind=i*6+k;
}
printf("\n");
}
+ )
}
//_______________________________________________________________________
lun=fopen(filtmp,"r");
delete [] filtmp;
if(!lun) {
- Warning("ReadTransPar","File %s does not exist!\n",fTransParName.Data());
+ AliWarning(Form("File %s does not exist!",fTransParName.Data()));
return;
}
//
- if(fDebug) {
- printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n");
- printf(" *%59s\n","*");
- printf(" * Please check carefully what you are doing!%10s\n","*");
- printf(" *%59s\n","*");
- }
- //
while(1) {
// Initialise cuts and flags
for(i=0;i<kncuts;i++) cut[i]=-99;
if(iret<0) {
//End of file
fclose(lun);
- if(fDebug){
- printf(" *%59s\n","*");
- printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n");
- }
return;
}
// Read the end of line
if(!iret) continue;
if(iret<0) {
//reading error
- Warning("ReadTransPar","Error reading file %s\n",fTransParName.Data());
+ AliWarning(Form("Error reading file %s",fTransParName.Data()));
continue;
}
// Check that the module exist
if(0<=itmed && itmed < 100) {
ktmed=idtmed[itmed];
if(!ktmed) {
- Warning("ReadTransPar","Invalid tracking medium code %d for %s\n",itmed,mod->GetName());
+ AliWarning(Form("Invalid tracking medium code %d for %s",itmed,mod->GetName()));
continue;
}
// Set energy thresholds
for(kz=0;kz<kncuts;kz++) {
if(cut[kz]>=0) {
- if(fDebug) printf(" * %-6s set to %10.3E for tracking medium code %4d for %s\n",
- kpars[kz],cut[kz],itmed,mod->GetName());
+ AliDebug(2, Form("%-6s set to %10.3E for tracking medium code %4d for %s",
+ kpars[kz],cut[kz],itmed,mod->GetName()));
gMC->Gstpar(ktmed,kpars[kz],cut[kz]);
}
}
// Set transport mechanisms
for(kz=0;kz<knflags;kz++) {
if(flag[kz]>=0) {
- if(fDebug) printf(" * %-6s set to %10d for tracking medium code %4d for %s\n",
- kpars[kncuts+kz],flag[kz],itmed,mod->GetName());
+ AliDebug(2, Form("%-6s set to %10d for tracking medium code %4d for %s",
+ kpars[kncuts+kz],flag[kz],itmed,mod->GetName()));
gMC->Gstpar(ktmed,kpars[kncuts+kz],Float_t(flag[kz]));
}
}
} else {
- Warning("ReadTransPar","Invalid medium code %d *\n",itmed);
+ AliWarning(Form("Invalid medium code %d",itmed));
continue;
}
} else {
- if(fDebug) printf("%s::ReadTransParModule: %s not present\n",ClassName(),detName);
+ AliDebug(1, Form("%s not present",detName));
continue;
}
}
//
// add a trackrefernce to the list
if (!fTrackReferences) {
- cerr<<"Container trackrefernce not active\n";
+ AliError("Container trackrefernce not active");
return;
}
Int_t nref = fTrackReferences->GetEntriesFast();
virtual void ResetHits();
virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10)
{fTrRmax=rmax; fTrZmax=zmax;}
- Int_t GetDebug() const {return fDebug;}
- virtual void SetDebug(Int_t level=0) {fDebug = level;}
virtual void Init();
virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts");
virtual void Browse(TBrowser *b);
TArrayF fSum2Energy; //! Energy squared per event in each volume
Float_t fTrRmax; // Maximum radius for tracking
Float_t fTrZmax; // Maximu z for tracking
- Int_t fDebug; // Debug flag
TArrayI *fImedia; //! Array of correspondence between media and detectors
TString fTransParName; // Name of the transport parameters file
AliMCQA *fMCQA; // Pointer to MC Quality assurance class
TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
- ClassDef(AliMC,1)
+ ClassDef(AliMC,2)
};
#include <TROOT.h>
#include <TVirtualMC.h>
+#include "AliLog.h"
#include "AliMC.h"
#include "AliMCQA.h"
#include "AliModule.h"
//_______________________________________________________________________
void AliMCQA::Copy(TObject &) const
{
- Fatal("Copy ctor","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________
#include <malloc.h>
#endif
// --- AliRoot header files ---
+#include "AliLog.h"
#include "AliMemoryWatcher.h"
// --- ROOT system ---
#include "TSystem.h"
fTIME[fSize] = fTimer->CpuTime();
fSize++;
#else
- ::Fatal("Watch","Please SetUseMallinfo to kFALSE on this system");
+ AliFatal("Please SetUseMallinfo to kFALSE on this system");
#endif
} else {
static Int_t vsize, rssize;
}
else {
fDisabled=true;
- Error("watch", "I'm full !" ) ;
+ AliError("I'm full !" ) ;
}
}
//_____________________________________________________________________________
#include "TSystem.h"
#include "AliRndm.h"
+#include "AliLog.h"
ClassImp(AliRndm)
//_______________________________________________________________________
void AliRndm::Copy(AliRndm&) const
{
- ::Fatal("Copy","Not implemented\n");
+ AliFatalClass("Not implemented");
}
TFile *file = new TFile(fntmp,"r");
delete [] fntmp;
if(!file) {
- printf("AliRndm:: Could not open file %s\n",filename);
+ AliErrorClass(Form("Could not open file %s",filename));
} else {
if(!fRandom) fRandom = new TRandom();
fRandom->Read("Random");
TFile *file = new TFile(fntmp,"new");
delete [] fntmp;
if(!file) {
- printf("AliRndm:: Could not open file %s\n",filename);
+ AliErrorClass(Form("Could not open file %s",filename));
} else {
fRandom->Write();
file->Close();
#include <TSystem.h>
#include <TVirtualMC.h>
//
+#include "AliLog.h"
#include "AliDetector.h"
#include "AliDisplay.h"
#include "AliHeader.h"
fEvent(0),
fEventNrInRun(0),
fEventsPerRun(0),
- fDebug(0),
fModules(0),
fGeometry(0),
fMCApp(0),
fEvent(0),
fEventNrInRun(0),
fEventsPerRun(0),
- fDebug(0),
fModules(0),
fGeometry(0),
fMCApp(0),
fEvent(0),
fEventNrInRun(0),
fEventsPerRun(0),
- fDebug(0),
fModules(new TObjArray(77)), // Support list for the Detectors
fGeometry(0),
fMCApp(0),
//_______________________________________________________________________
void AliRun::Copy(TObject &) const
{
- Fatal("Copy","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________
fField = new AliMagFDM("Map4",filename,type,scale,maxField);
fField->ReadField();
} else {
- Warning("SetField","Invalid map %d\n",version);
+ AliWarning(Form("Invalid map %d",version));
}
}
void AliRun::InitLoaders()
{
//creates list of getters
- if (GetDebug()) Info("InitLoaders","");
+ AliDebug(1, "");
TIter next(fModules);
AliModule *mod;
while((mod = (AliModule*)next()))
AliDetector *det = dynamic_cast<AliDetector*>(mod);
if (det)
{
- if (GetDebug()) Info("InitLoaders"," Adding %s ",det->GetName());
+ AliDebug(2, Form("Adding %s", det->GetName()));
fRunLoader->AddLoader(det);
}
}
- if (GetDebug()) Info("InitLoaders","Done");
+ AliDebug(1, "Done");
}
//_____________________________________________________________________________
if(fLego)
{
- if (GetDebug()) Info("FinishRun"," Finish Lego");
+ AliDebug(1, "Finish Lego");
fRunLoader->CdGAFile();
fLego->FinishRun();
}
TIter next(fModules);
AliModule *detector;
while((detector = dynamic_cast<AliModule*>(next()))) {
- if (GetDebug()) Info("FinishRun"," %s->FinishRun()",detector->GetName());
+ AliDebug(2, Form("%s->FinishRun()", detector->GetName()));
detector->FinishRun();
}
- if (GetDebug()) Info("FinishRun"," fRunLoader->WriteHeader(OVERWRITE)");
+ AliDebug(1, "fRunLoader->WriteHeader(OVERWRITE)");
fRunLoader->WriteHeader("OVERWRITE");
// Write AliRun info and all detectors parameters
fRunLoader->Write(0,TObject::kOverwrite);//write RunLoader itself
// Clean tree information
- if (GetDebug()) Info("FinishRun"," fRunLoader->Stack()->FinishRun()");
+ AliDebug(1, "fRunLoader->Stack()->FinishRun()");
fRunLoader->Stack()->FinishRun();
if(fMCApp) fMCApp->FinishRun();
//
if (fRunLoader == 0x0)
{
- Error("GetEvent","RunLoader is not set. Can not load data.");
+ AliError("RunLoader is not set. Can not load data.");
return -1;
}
/*****************************************/
Announce();
if(fInitDone) {
- Warning("Init","Cannot initialise AliRun twice!\n");
+ AliWarning("Cannot initialise AliRun twice!");
return;
}
// Main function to be called to reconstruct Alice event
//
Int_t nev = fRunLoader->GetNumberOfEvents();
- if (GetDebug()) Info("RunReco","Found %d events",nev);
+ AliDebug(1, Form("Found %d events", nev));
Int_t nFirst = first;
Int_t nLast = (last < 0)? nev : last;
for (Int_t nevent = nFirst; nevent <= nLast; nevent++) {
- if (GetDebug()) Info("RunReco","Processing event %d",nevent);
+ AliDebug(1, Form("Processing event %d", nevent));
GetEvent(nevent);
Digits2Reco(selected);
}
if (oS)
{
- if (GetDebug()) Info("Tree2Tree","Processing Hits2SDigits for %s ...",detector->GetName());
+ AliDebug(1, Form("Processing Hits2SDigits for %s ...", detector->GetName()));
loader->LoadHits("read");
if (loader->TreeS() == 0x0) loader->MakeTree("S");
detector->MakeBranch(option);
}
if (oD)
{
- if (GetDebug()) Info("Tree2Tree","Processing SDigits2Digits for %s ...",detector->GetName());
+ AliDebug(1, Form("Processing SDigits2Digits for %s ...", detector->GetName()));
loader->LoadSDigits("read");
if (loader->TreeD() == 0x0) loader->MakeTree("D");
detector->MakeBranch(option);
}
if (oR)
{
- if (GetDebug()) Info("Tree2Tree","Processing Digits2Reco for %s ...",detector->GetName());
+ AliDebug(1, Form("Processing Digits2Reco for %s ...", detector->GetName()));
loader->LoadDigits("read");
if (loader->TreeR() == 0x0) loader->MakeTree("R");
detector->MakeBranch(option);
for (Int_t j=0; j<3; j++) b[j] = bfloat[j];
}
else {
- printf("No mag field defined!\n");
+ AliError("No mag field defined!");
b[0]=b[1]=b[2]=0.;
}
}
//Returns number of current event
if (fRunLoader == 0x0)
{
- Error("GetEvent","RunLoader is not set. Can not load data.");
+ AliError("RunLoader is not set. Can not load data.");
return -1;
}
TString evfoldname;
TFolder* evfold = fRunLoader->GetEventFolder();
if (evfold) evfoldname = evfold->GetName();
- else Warning("SetRunLoader","Did not get Event Folder from Run Loader");
+ else AliWarning("Did not get Event Folder from Run Loader");
if ( fRunLoader->GetAliRun() )
{//if alrun already exists in folder
if (fRunLoader->GetAliRun() != this )
{//and is different than this - crash
- Fatal("AliRun","AliRun is already in Folder and it is not this object");
+ AliFatal("AliRun is already in Folder and it is not this object");
return;//pro forma
}//else do nothing
}
AliLoader* loader = fRunLoader->GetLoader(detector);
if (loader == 0x0)
{
- Error("SetRunLoader","Can not get loader for detector %s",detector->GetName());
+ AliError(Form("Can not get loader for detector %s", detector->GetName()));
}
else
{
- if (GetDebug()) Info("SetRunLoader","Setting loader for detector %s",detector->GetName());
+ AliDebug(1, Form("Setting loader for detector %s", detector->GetName()));
detector->SetLoader(loader);
}
}
if (strlen(mod->GetName()) == 0) return;
if (GetModuleID(mod->GetName()) >= 0) return;
- if (GetDebug()) Info("AddModule","%s",mod->GetName());
+ AliDebug(1, mod->GetName());
if (fRunLoader == 0x0) AliConfig::Instance()->Add(mod);
else AliConfig::Instance()->Add(mod,fRunLoader->GetEventFolder()->GetName());
fNdets++;
}
+
+
+//_______________________________________________________________________
+Int_t AliRun::GetDebug() const
+{
+ AliWarning("Don't use this method any more, use AliDebug instead");
+ return AliDebugLevel();
+}
+
+//_______________________________________________________________________
+void AliRun::SetDebug(Int_t level)
+{
+ AliWarning("Don't use this method any more, use AliLog instead");
+ AliLog::SetClassDebugLevel("AliRun", level);
+}
Int_t GetEventNrInRun() const {return fEventNrInRun;}
Int_t GetEventsPerRun() const {return fEventsPerRun;}
Int_t GetNdets() const {return fNdets;}
- Int_t GetDebug() const {return fDebug;}
+ Int_t GetDebug() const;
AliModule *GetModule(const char *name) const;
AliDetector *GetDetector(const char *name) const;
Int_t GetModuleID(const char *name) const;
Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL);
virtual Bool_t IsLegoRun() const {return (fLego!=0);}
virtual void RunReco(const char *detector=0, Int_t first = 0, Int_t last = 0);
- virtual void SetDebug(Int_t level=0) {fDebug = level;}
+ virtual void SetDebug(Int_t level=0);
virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}
virtual void SetField(Int_t type=2, Int_t version=1, Float_t scale=1, Float_t maxField=10, const char* filename="$(ALICE_ROOT)/data/field01.dat");
virtual void SetField(AliMagF* magField);
Int_t fEvent; //! Current event number (from 1)
Int_t fEventNrInRun; //! Current unique event number in run
Int_t fEventsPerRun; // Number of events per run
- Int_t fDebug; // Debug flag
TObjArray *fModules; // List of Detectors
TGeometry *fGeometry; // Pointer to geometry
AliMC *fMCApp; // Pointer to virtual MC Application
private:
void Copy(TObject &arun) const;
- ClassDef(AliRun,9) //Supervisor class for all Alice detectors
+ ClassDef(AliRun,10) //Supervisor class for all Alice detectors
};
R__EXTERN AliRun *gAlice;
class TTask;
#include <TTree.h>
+#include "AliLog.h"
#include "AliRun.h"
#include "AliConfig.h"
#include "AliLoader.h"
if(topfolder == 0x0)
{
TString errmsg("Parameter is NULL");
- Error("AliRunLoader(TFolder*)","%s",errmsg.Data());
+ AliError(errmsg.Data());
throw errmsg;
return;
}
errmsg+=fEventFolder->GetName();
errmsg+=" object named "+fgkRunLoaderName+" already exists. I am confused ...";
- Error("AliRunLoader(const char*)","%s",errmsg.Data());
+ AliError(errmsg.Data());
throw errmsg;
return;//never reached
}
void AliRunLoader::Copy(TObject &) const
{
- Fatal("Copy","Not implemented");
+ AliFatal("Not implemented");
}
/**************************************************************************/
if (evno < 0)
{
- Error("GetEvent","Can not give the event with negative number");
+ AliError("Can not give the event with negative number");
return 4;
}
if (evno >= GetNumberOfEvents())
{
- Error("GetEvent","There is no event with number %d",evno);
+ AliError(Form("There is no event with number %d",evno));
return 3;
}
- if (GetDebug())
- {
- Info("GetEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("GetEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("GetEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("GetEvent"," GETTING EVENT %d",evno);
- Info("GetEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("GetEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("GetEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- }
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, Form(" GETTING EVENT %d",evno));
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
fCurrentEvent = evno;
retval = TreeE()->GetEvent(fCurrentEvent);
if ( retval == 0)
{
- Error("GetEvent","Cannot find event: %d\n ",fCurrentEvent);
+ AliError(Form("Cannot find event: %d\n ",fCurrentEvent));
return 5;
}
}
}
else
{
- Warning("GetEvent","Stack not found in header");
+ AliWarning("Stack not found in header");
}
retval = SetEvent();
if (retval)
{
- Error("GetEvent","Error occured while setting event %d",evno);
+ AliError(Form("Error occured while setting event %d",evno));
return 1;
}
retval = fTrackRefsDataLoader->GetEvent();
if (retval)
{
- Error("GetEvent","Error occured while GetEvent for Track References. Event %d",evno);
+ AliError(Form("Error occured while GetEvent for Track References. Event %d",evno));
return 2;
}
fKineDataLoader->GetEvent();
if (retval)
{
- Error("GetEvent","Error occured while GetEvent for Kinematics. Event %d",evno);
+ AliError(Form("Error occured while GetEvent for Kinematics. Event %d",evno));
return 2;
}
retval = loader->GetEvent();
if (retval)
{
- Error("GetEvent","Error occured while getting event for %s. Event %d.",
- loader->GetDetectorName().Data(), evno);
+ AliError(Form("Error occured while getting event for %s. Event %d.",
+ loader->GetDetectorName().Data(), evno));
return 3;
}
}
retval = fKineDataLoader->SetEvent();
if (retval)
{
- Error("SetEvent","SetEvent for Kinamtics Data Loader retutned error.");
+ AliError("SetEvent for Kinamtics Data Loader retutned error.");
return retval;
}
retval = fTrackRefsDataLoader->SetEvent();
if (retval)
{
- Error("SetEvent","SetEvent for Track References Data Loader retutned error.");
+ AliError("SetEvent for Track References Data Loader retutned error.");
return retval;
}
retval = loader->SetEvent();
if (retval)
{
- Error("SetEvent","SetEvent for %s Data Loader retutned error.",loader->GetName());
+ AliError(Form("SetEvent for %s Data Loader retutned error.",loader->GetName()));
return retval;
}
}
//in case of error returns NULL
static const TString kwebaddress("http://alisoft.cern.ch/people/skowron/codedoc/split/index.html");
- if (AliLoader::GetDebug())
- ::Info("AliRunLoader::Open",
- "\n\n\nNew I/O strcture: See more info:\n %s\n\n\n",kwebaddress.Data());
+ AliDebugClass(1,Form("\n\n\nNew I/O strcture: See more info:\n %s\n\n\n",kwebaddress.Data()));
AliRunLoader* result = 0x0;
TFolder* fold = dynamic_cast<TFolder*>(obj);
if (fold == 0x0)
{
- ::Error("AliRunLoader::Open","Such a obejct already exists in top alice folder and it is not a folder.");
+ AliErrorClass("Such a obejct already exists in top alice folder and it is not a folder.");
return 0x0;
}
result = AliRunLoader::GetRunLoader(eventfoldername);
if (result == 0x0)
{
- ::Error("AliRunLoader::Open",
- "Folder %s already exists, and can not find session there. Can not mount.",eventfoldername);
+ AliErrorClass(Form("Folder %s already exists, and can not find session there. Can not mount.",eventfoldername));
return 0x0;
}
if (result->GetFileName().CompareTo(filename) != 0)
{
- ::Error("AliRunLoader::Open","Other file is mounted in demanded folder. Can not mount.");
+ AliErrorClass("Other file is mounted in demanded folder. Can not mount.");
return 0x0;
}
//check if now is demanded (re)creation
if ( AliLoader::TestFileOption(option) == kFALSE)
{
- ::Error("AliRunLoader::Open",
- "Session already exists in folder %s and this session option is %s. Unable to proceed.",
- eventfoldername,option);
+ AliErrorClass(Form("Session already exists in folder %s and this session option is %s. Unable to proceed.",
+ eventfoldername,option));
return 0x0;
}
if ( (tmpstr.CompareTo("update",TString::kIgnoreCase) == 0) &&
(result->fGAFile->IsWritable() == kFALSE) )
{
- ::Error("AliRunLoader::Open",
- "Session already exists in folder %s and is not writable while this session option is %s. Unable to proceed.",
- eventfoldername,option);
+ AliErrorClass(Form("Session already exists in folder %s and is not writable while this session option is %s. Unable to proceed.",
+ eventfoldername,option));
return 0x0;
}
- ::Warning("AliRunLoader::Open","Session is already opened and mounted in demanded folder");
+ AliWarningClass("Session is already opened and mounted in demanded folder");
return result;
} //end of checking in case of existance of object named identically that folder session is being opened
TFile * gAliceFile = TFile::Open(filename,option);//open a file
if (!gAliceFile)
{//null pointer returned
- ::Fatal("AliRunLoader::Open","Can not open file %s.",filename);
+ AliFatalClass(Form("Can not open file %s.",filename));
return 0x0;
}
if (gAliceFile->IsOpen() == kFALSE)
{//pointer to valid object returned but file is not opened
- ::Error("AliRunLoader::Open","Can not open file %s.",filename);
+ AliErrorClass(Form("Can not open file %s.",filename));
return 0x0;
}
//else create new AliRunLoader
if ( AliLoader::TestFileOption(option) )
{
- if (AliLoader::GetDebug())
- ::Info("AliRunLoader::Open","Reading RL from file");
+ AliDebugClass(1, "Reading RL from file");
result = dynamic_cast<AliRunLoader*>(gAliceFile->Get(fgkRunLoaderName));//get the run Loader from the file
if (result == 0x0)
{//didn't get
- ::Error("AliRunLoader::Open","Can not find run-Loader in file %s.",filename);
+ AliErrorClass(Form("Can not find run-Loader in file %s.",filename));
delete gAliceFile;//close the file
return 0x0;
}
Int_t tmp = result->SetEventFolderName(eventfoldername);//mount a event folder
if (tmp)//if SetEvent returned error
{
- ::Error("AliRunLoader::Open","Can not mount event in folder %s.",eventfoldername);
+ AliErrorClass(Form("Can not mount event in folder %s.",eventfoldername));
delete result; //delete run-Loader
delete gAliceFile;//close the file
return 0x0;
}
else
{
- if (AliLoader::GetDebug())
- ::Info("AliRunLoader::Open","Creating new AliRunLoader. Folder name is %s",eventfoldername);
+ AliDebugClass(1, Form("Creating new AliRunLoader. Folder name is %s",eventfoldername));
try
{
result = new AliRunLoader(eventfoldername);
}
catch (TString& errmsg)
{
- ::Error("Open","AliRunLoader constrcutor has thrown exception: %s\n",errmsg.Data());
+ AliErrorClass(Form("AliRunLoader constrcutor has thrown exception: %s\n",errmsg.Data()));
delete result;
delete gAliceFile;//close the file
return 0x0;
}
else dirname = fname.Remove(nsl);//slash found
- if (AliLoader::GetDebug())
- ::Info("AliRunLoader::Open","Dir name is : %s",dirname.Data());
+ AliDebugClass(1, Form("Dir name is : %s",dirname.Data()));
result->SetDirName(dirname);
result->SetGAliceFile(gAliceFile);//set the pointer to gAliceFile
retval = LoadHeader();
if (retval)
{
- Error("GetNumberOfEvents","Error occured while loading header");
+ AliError("Error occured while loading header");
return -1;
}
}
void AliRunLoader::MakeHeader()
{
//Makes header and connects it to header tree (if it exists)
- if (GetDebug()) Info("MakeHeader","");
+ AliDebug(1, "");
if(fHeader == 0x0)
{
- if (GetDebug()) Info("MakeHeader","Creating new Header Object");
+ AliDebug(1, "Creating new Header Object");
fHeader= new AliHeader();
}
TTree* tree = TreeE();
if (tree)
{
- if (GetDebug()) Info("MakeHeader","Got Tree from folder.");
+ AliDebug(1, "Got Tree from folder.");
TBranch* branch = tree->GetBranch(fgkHeaderBranchName);
if (branch == 0x0)
{
- if (GetDebug()) Info("MakeHeader","Creating new branch");
+ AliDebug(1, "Creating new branch");
branch = tree->Branch(fgkHeaderBranchName, "AliHeader", &fHeader, 4000, 0);
branch->SetAutoDelete(kFALSE);
}
else
{
- if (GetDebug()) Info("MakeHeader","Got Branch from Tree");
+ AliDebug(1, "Got Branch from Tree");
branch->SetAddress(&fHeader);
tree->GetEvent(fCurrentEvent);
fStack = fHeader->Stack(); //should be safe - if we created Stack, header returns pointer to the same object
}
else
{
- if (GetDebug()) Info("MakeHeader","Haeder do not have a stack.");
+ AliDebug(1, "Header does not have a stack.");
}
}
}
- if (GetDebug()) Info("MakeHeader","Exiting MakeHeader method");
+ AliDebug(1, "Exiting MakeHeader method");
}
/**************************************************************************/
{
if (fKineDataLoader->GetBaseLoader(0)->IsLoaded() == kFALSE)
{
- Error("MakeTree(\"K\")","Load Kinematics first");
+ AliError("Load Kinematics first");
}
else
{
//Loads gAlice from file
if (GetAliRun())
{
- Warning("LoadgAlice","AliRun is already in folder. Unload first.");
+ AliWarning("AliRun is already in folder. Unload first.");
return 0;
}
AliRun* alirun = dynamic_cast<AliRun*>(fGAFile->Get(fgkGAliceName));
if (alirun == 0x0)
{
- Error("LoadgAlice"," Can not find gAlice in file %s",fGAFile->GetName());
+ AliError(Form("Can not find gAlice in file %s",fGAFile->GetName()));
return 2;
}
alirun->SetRunLoader(this);
if (gAlice)
{
- Warning("LoadgAlice","gAlice already exists. Putting retrived object in folder named %s",
- GetEventFolder()->GetName());
+ AliWarning(Form("gAlice already exists. Putting retrived object in folder named %s",
+ GetEventFolder()->GetName()));
}
else
{
//loads treeE and reads header object for current event
if (TreeE())
{
- Warning("LoadHeader","Header is already loaded. Use ReloadHeader to force reload. Nothing done");
+ AliWarning("Header is already loaded. Use ReloadHeader to force reload. Nothing done");
return 0;
}
if (GetEventFolder() == 0x0)
{
- Error("LoadHeader","Event folder not specified yet");
+ AliError("Event folder not specified yet");
return 1;
}
if (fGAFile == 0x0)
{
- Error("LoadHeader","Session not opened. Use AliRunLoader::Open");
+ AliError("Session not opened. Use AliRunLoader::Open");
return 2;
}
if (fGAFile->IsOpen() == kFALSE)
{
- Error("LoadHeader","Session not opened. Use AliRunLoader::Open");
+ AliError("Session not opened. Use AliRunLoader::Open");
return 2;
}
TTree* tree = dynamic_cast<TTree*>(fGAFile->Get(fgkHeaderContainerName));
if (tree == 0x0)
{
- Error("LoadHeader","Can not find header tree named %s in file %s",
- fgkHeaderContainerName.Data(),fGAFile->GetName());
+ AliError(Form("Can not find header tree named %s in file %s",
+ fgkHeaderContainerName.Data(),fGAFile->GetName()));
return 2;
}
Int_t retval = fKineDataLoader->GetBaseLoader(0)->Load(option);
if (retval)
{
- Error("LoadKinematics","Error occured while loading kinamatics tree.");
+ AliError("Error occured while loading kinamatics tree.");
return retval;
}
if (fStack)
retval = fStack->GetEvent();
if ( retval == kFALSE)
{
- Error("LoadKinematics","Error occured while loading kinamatics tree.");
+ AliError("Error occured while loading kinamatics tree.");
return retval;
}
{
if (file->IsOpen() == kFALSE)
{//pointer is not null but file is not opened
- Warning("OpenDataFile","Pointer to file is not null, but file is not opened");//risky any way
+ AliWarning("Pointer to file is not null, but file is not opened");//risky any way
delete file;
file = 0x0; //proceed with opening procedure
}
else
{
- Warning("OpenDataFile","File %s already opened",filename.Data());
+ AliWarning(Form("File %s already opened",filename.Data()));
return 0;
}
}
{
if(file->IsOpen() == kTRUE)
{
- Warning("OpenDataFile","File %s already opened by sombody else.",file->GetName());
+ AliWarning(Form("File %s already opened by sombody else.",file->GetName()));
return 0;
}
}
file = TFile::Open(filename,opt);
if (file == 0x0)
{//file is null
- Error("LoadKinematics","Can not open file %s",filename.Data());
+ AliError(Form("Can not open file %s",filename.Data()));
return 1;
}
if (file->IsOpen() == kFALSE)
{//file is not opened
- Error("LoadKinematics","Can not open file %s",filename.Data());
+ AliError(Form("Can not open file %s",filename.Data()));
return 1;
}
dir = AliLoader::ChangeDir(file,fCurrentEvent);
if (dir == 0x0)
{
- Error("OpenKineFile","Can not change to root directory in file %s",filename.Data());
+ AliError(Form("Can not change to root directory in file %s",filename.Data()));
return 3;
}
return 0;
TTree* AliRunLoader::TreeE() const
{
//returns the tree from folder; shortcut method
- if (GetDebug() > 10) fEventFolder->ls();
+ if (AliDebugLevel() > 10) fEventFolder->ls();
TObject *obj = fEventFolder->FindObject(fgkHeaderContainerName);
return (obj)?dynamic_cast<TTree*>(obj):0x0;
}
TGeometry* geo = GetAliRun()->GetGeometry();
if (geo == 0x0)
{
- Error("WriteGeometry","Can not get geometry from gAlice");
+ AliError("Can not get geometry from gAlice");
return 1;
}
geo->Write();
Int_t AliRunLoader::WriteHeader(Option_t* opt)
{
//writes treeE
- if (GetDebug()) Info("WriteHeader"," WRITING HEADER");
+ AliDebug(1, "WRITING HEADER");
TTree* tree = TreeE();
if ( tree == 0x0)
{
- Warning("WriteHeader","Can not find Header Tree in Folder");
+ AliWarning("Can not find Header Tree in Folder");
return 0;
}
if (fGAFile->IsWritable() == kFALSE)
{
- Error("WriteHeader","File %s is not writable",fGAFile->GetName());
+ AliError(Form("File %s is not writable",fGAFile->GetName()));
return 1;
}
TString tmp(opt);
if(tmp.Contains("OVERWRITE",TString::kIgnoreCase) == 0)
{//if it is not used - give an error message and return an error code
- Error("WriteHeader","Tree already exisists. Use option \"OVERWRITE\" to overwrite previous data");
+ AliError("Tree already exisists. Use option \"OVERWRITE\" to overwrite previous data");
return 3;
}
}
tree->SetDirectory(fGAFile);
tree->Write(0,TObject::kOverwrite);
- if (GetDebug()) Info("WriteHeader","WRITTEN\n\n");
+ AliDebug(1, "WRITTEN\n\n");
return 0;
}
res = loader->WriteHits(opt);
if (res)
{
- Error("WriteHits","Failed to write hits for %s (%d)",loader->GetDetectorName().Data(),res);
+ AliError(Form("Failed to write hits for %s (%d)",loader->GetDetectorName().Data(),res));
result = 1;
}
}
res = loader->WriteSDigits(opt);
if (res)
{
- Error("WriteSDigits","Failed to write summable digits for %s.",loader->GetDetectorName().Data());
+ AliError(Form("Failed to write summable digits for %s.",loader->GetDetectorName().Data()));
result = 1;
}
}
res = loader->WriteDigits(opt);
if (res)
{
- Error("WriteDigits","Failed to write digits for %s.",loader->GetDetectorName().Data());
+ AliError(Form("Failed to write digits for %s.",loader->GetDetectorName().Data()));
result = 1;
}
}
res = loader->WriteRecPoints(opt);
if (res)
{
- Error("WriteRecPoints","Failed to write Reconstructed Points for %s.",
- loader->GetDetectorName().Data());
+ AliError(Form("Failed to write Reconstructed Points for %s.",
+ loader->GetDetectorName().Data()));
result = 1;
}
}
res = loader->WriteTracks(opt);
if (res)
{
- Error("WriteTracks","Failed to write Tracks for %s.",
- loader->GetDetectorName().Data());
+ AliError(Form("Failed to write Tracks for %s.",
+ loader->GetDetectorName().Data()));
result = 1;
}
}
//sets top folder name for this run; of alread
if (name.IsNull())
{
- Error("SetTopFolderName","Name is empty");
+ AliError("Name is empty");
return 1;
}
TFolder* fold = dynamic_cast<TFolder*>(obj);
if (fold == 0x0)
{
- Error("SetTopFolderName","Such a obejct already exists in top alice folder and it is not a folder.");
+ AliError("Such a obejct already exists in top alice folder and it is not a folder.");
return 2;
}
//folder which was found is our folder
}
else
{
- Error("SetTopFolderName","Such a folder already exists in top alice folder. Can not mount.");
+ AliError("Such a folder already exists in top alice folder. Can not mount.");
return 2;
}
}
fTrackRefsDataLoader = new AliDataLoader(fgkDefaultTrackRefsFileName,fgkTrackRefsContainerName,"Track References");
//build the event folder structure
- if (GetDebug()) Info("SetEventFolderName","Creating new event folder named %s",name.Data());
+ AliDebug(1, Form("Creating new event folder named %s",name.Data()));
fEventFolder = AliConfig::Instance()->BuildEventFolder(name,"Event Folder");
fEventFolder->Add(this);//put myself to the folder to accessible for all
//Adds the Loader for given detector
if (loader == 0x0) //if null shout and exit
{
- Error("AddLoader","Parameter is NULL");
+ AliError("Parameter is NULL");
return;
}
loader->SetDirName(fUnixDirName);
if (get)
{
- if (GetDebug()) Info("AddLoader","Detector: %s Loader : %s",det->GetName(),get->GetName());
+ AliDebug(1, Form("Detector: %s Loader : %s",det->GetName(),get->GetName()));
AddLoader(get);
}
}
if(det == 0x0) return 0x0;
TString getname(det->GetName());
getname+="Loader";
- if (GetDebug()) Info("GetLoader(AliDetector* det)"," Loader name is %s",getname.Data());
+ AliDebug(1, Form(" Loader name is %s",getname.Data()));
return GetLoader(getname);
}
{
//LoadHits in selected detectors i.e. detectors="ITS TPC TRD" or "all"
- if (GetDebug()) Info("LoadHits","Loading Hits");
+ AliDebug(1, "Loading Hits");
TObjArray* loaders;
TObjArray arr;
const char* oAll = strstr(detectors,"all");
if (oAll)
{
- if (GetDebug()) Info("LoadHits","Option is All");
+ AliDebug(1, "Option is All");
loaders = fLoaders;
}
else
loaders = &arr;//get the pointer array
}
- if (GetDebug()) Info("LoadHits","For detectors. Number of detectors chosen for loading %d",loaders->GetEntries());
+ AliDebug(1, Form("For detectors. Number of detectors chosen for loading %d",loaders->GetEntries()));
TIter next(loaders);
AliLoader *loader;
while((loader = (AliLoader*)next()))
{
- if (GetDebug()) Info("LoadHits"," Calling LoadHits(%s) for %s",opt,loader->GetName());
+ AliDebug(1, Form(" Calling LoadHits(%s) for %s",opt,loader->GetName()));
loader->LoadHits(opt);
}
- if (GetDebug()) Info("LoadHits","Done");
+ AliDebug(1, "Done");
return 0;
}
//run loader object
AliRunLoader* runLoader = GetRunLoader(eventfoldername);
if (!runLoader) {
- ::Error("AliRunLoader::GetDetectorLoader","No run loader found");
+ AliErrorClass("No run loader found");
return NULL;
}
return runLoader->GetDetectorLoader(detname);
sprintf(loadername, "%sLoader", detname);
AliLoader* loader = GetLoader(loadername);
if (!loader) {
- Error("GetDetectorLoader", "No loader for %s found", detname);
+ AliError(Form("No loader for %s found", detname));
return NULL;
}
return loader;
}
else
{
- Error("GetListOfDetectors","Can not find Loader for %s",buff);
+ AliError(Form("Can not find Loader for %s",buff));
}
buff[0] = 0;
TObject* obj = GetEventFolder()->FindObject(name);
if(obj)
{
- if (GetDebug()) Info("Clean(const TString&)","name=%s, cleaning %s.",GetName(),name.Data());
+ AliDebug(1, Form("name=%s, cleaning %s.",GetName(),name.Data()));
GetEventFolder()->Remove(obj);
delete obj;
}
TFolder* topf = AliConfig::Instance()->GetTaskFolder();
if (topf == 0x0)
{
- ::Error("AliRunLoader::GetRunQATask","Can not get task folder from AliConfig");
+ AliErrorClass("Can not get task folder from AliConfig");
return 0x0;
}
TObject* obj = topf->FindObjectAny(AliConfig::Instance()->GetQATaskName());
//Unloads gAlice
if (gAlice == GetAliRun())
{
- if (GetDebug()) Info("UnloadgAlice","Set gAlice = 0x0");
+ AliDebug(1, "Set gAlice = 0x0");
gAlice = 0x0;//if gAlice is the same that in folder (to be deleted by the way of folder)
}
AliRun* alirun = GetAliRun();
const TString& offfsetdotroot = offset + dotroot;
TString out = fname;
out = out.ReplaceAll(dotroot,offfsetdotroot);
- if (GetDebug()) Info("SetFileOffset"," in=%s out=%s",fname.Data(),out.Data());
+ AliDebug(1, Form(" in=%s out=%s",fname.Data(),out.Data()));
return out;
}
/*****************************************************************************/
#include <TParticlePDG.h>
#include <TTree.h>
+#include "AliLog.h"
#include "AliHit.h"
#include "AliModule.h"
#include "AliRun.h"
//_______________________________________________________________________
void AliStack::Copy(TObject&) const
{
- Fatal("Copy","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________
vpos[0], vpos[1], vpos[2], tof, polar[0], polar[1], polar[2],
mech, ntr, weight, is);
} else {
- Warning("PushTrack", "Particle type %d not defined in PDG Database !\n", pdg);
- Warning("PushTrack", "Particle skipped !\n");
+ AliWarning(Form("Particle type %d not defined in PDG Database !", pdg));
+ AliWarning("Particle skipped !");
}
}
if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack);
}
else {
- printf("Error in AliStack::PushTrack: Parent %d does not exist\n",parent);
+ AliError(Form("Parent %d does not exist",parent));
}
}
else {
// When all primaries were filled no particle!=0
// should be left => to be removed later.
- if (allFilled) printf("Why != 0 part # %d?\n",i);
+ if (allFilled) AliWarning(Form("Why != 0 part # %d?\n",i));
}
else
{
// and the fParticleFileMap[i] give the same;
// give the fatal error if not
if (entry != fParticleFileMap[i]) {
- Fatal("Particle",
+ AliFatal(Form(
"!! The algorithmic way and map are different: !!\n entry: %d map: %d",
- entry, fParticleFileMap[i]);
+ entry, fParticleFileMap[i]));
}
TreeK()->GetEntry(entry);
if (current)
return current->GetFirstMother();
else {
- Warning("GetCurrentParentTrackNumber", "Current track not found in the stack");
+ AliWarning("Current track not found in the stack");
return -1;
}
}
AliRunLoader *rl = AliRunLoader::GetRunLoader(fEventFolderName);
if (rl == 0x0)
{
- Fatal("TreeK","Can not get RunLoader from event folder named %s",fEventFolderName.Data());
+ AliFatal(Form("Can not get RunLoader from event folder named %s",fEventFolderName.Data()));
return 0x0;//pro forma
}
fTreeK = rl->TreeK();
else
{
//don't panic - could be Lego
- if (AliLoader::GetDebug())
- {
- Warning("TreeK","Can not get TreeK from RL. Ev. Folder is %s",fEventFolderName.Data());
- }
+ AliWarning(Form("Can not get TreeK from RL. Ev. Folder is %s",fEventFolderName.Data()));
}
}
return fTreeK;//never reached
//
// Creates branch for writing particles
//
- if (AliLoader::GetDebug()) Info("ConnectTree","Connecting TreeK");
+ AliDebug(1, "Connecting TreeK");
if (fTreeK == 0x0)
{
if (TreeK() == 0x0)
{
- Fatal("ConnectTree","Parameter is NULL");//we don't like such a jokes
+ AliFatal("Parameter is NULL");//we don't like such a jokes
return;
}
return;//in this case TreeK() calls back this method (ConnectTree)
// Create a branch for particles
- if (AliLoader::GetDebug())
- Info("ConnectTree","Tree name is %s",fTreeK->GetName());
+ AliDebug(2, Form("Tree name is %s",fTreeK->GetName()));
if (fTreeK->GetDirectory())
{
- if (AliLoader::GetDebug())
- Info("ConnectTree","and dir is %s",fTreeK->GetDirectory()->GetName());
+ AliDebug(2, Form("and dir is %s",fTreeK->GetDirectory()->GetName()));
}
else
- Warning("ConnectTree","DIR IS NOT SET !!!");
+ AliWarning("DIR IS NOT SET !!!");
TBranch *branch=fTreeK->GetBranch(AliRunLoader::GetKineBranchName());
if(branch == 0x0)
{
branch = fTreeK->Branch(AliRunLoader::GetKineBranchName(), "TParticle", &fParticleBuffer, 4000);
- if (AliLoader::GetDebug()) Info("ConnectTree","Creating Branch in Tree");
+ AliDebug(2, "Creating Branch in Tree");
}
else
{
- if (AliLoader::GetDebug()) Info("ConnectTree","Branch Found in Tree");
+ AliDebug(2, "Branch Found in Tree");
branch->SetAddress(&fParticleBuffer);
}
if (branch->GetDirectory())
{
- if (AliLoader::GetDebug())
- Info("ConnectTree","Branch Dir Name is %s",branch->GetDirectory()->GetName());
+ AliDebug(1, Form("Branch Dir Name is %s",branch->GetDirectory()->GetName()));
}
else
- Warning("ConnectTree","Branch Dir is NOT SET");
+ AliWarning("Branch Dir is NOT SET");
}
//__________________________________________________________________________________________
if (TreeK() == 0x0) //forces connecting
{
- Error("GetEvent","cannot find Kine Tree for current event\n");
+ AliError("cannot find Kine Tree for current event");
return kFALSE;
}
#include <Riostream.h>
+#include "AliLog.h"
#include "AliTrackMap.h"
ClassImp(AliTrackMap)
//_______________________________________________________________________
void AliTrackMap::Copy(TObject& ) const
{
- Fatal("Copy","Not implemented\n");
+ AliFatal("Not implemented");
}
//_______________________________________________________________________
// label label
//
if (label < 0 || label >= fSize) {
- cerr<<"AliTrackMap::At: label "<<label<<" out of range, fSize = "<<fSize<<endl;
+ AliError(Form("label %d out of range, fSize = %d", label, fSize));
return kOutOfBounds;
}
return fArray[label];
#include "TStopwatch.h"
#include "TTree.h"
+#include "AliLog.h"
#include "AliDetector.h"
#include "AliHit.h"
#include "AliLoader.h"
timer.Start();
TFile *fileMap=TFile::Open(fnMap,"new");
- if (!fileMap->IsOpen()) {cerr<<"Can't open output file "<<fnMap<<"!\n"; return;}
+ if (!fileMap->IsOpen()) {AliErrorClass(Form("Can't open output file %s!", fnMap)); return;}
AliRunLoader* rl = AliRunLoader::Open(fnHits);
- if (rl == 0x0) {cerr<<"Can't open input file "<<fnHits<<"!\n"; return;}
+ if (rl == 0x0) {AliErrorClass(Form("Can't open input file %s!\n", fnHits)); return;}
if (rl->LoadgAlice())
{
- ::Error("AliTrackMapper::CreateMap","Error occured while loading AliRun");
+ AliErrorClass("Error occured while loading AliRun");
return;
}
if (!(gAlice=rl->GetAliRun())) {
- cerr<<"gAlice have not been found on session !\n";
+ AliErrorClass("gAlice have not been found on session !");
return;
}
TTree *treeK = rl->TreeK();
if (!treeK) {
- cerr<<"Error: Event "<<eventNr<<", treeK not found."<<endl;
+ AliErrorClass(Form("Event %d, treeK not found.", eventNr));
return -1;
}
Int_t nAllParticles = static_cast<Int_t>(treeK->GetEntries());
TObjArray *modules = gAlice->Detectors();
if (!modules) {
- cerr<<"TObjArray with modules not found."<<endl;
+ AliErrorClass("TObjArray with modules not found.");
return -1;
}
Int_t nModules = static_cast<Int_t>(modules->GetEntries());
AliLoader* loader = detector->GetLoader();
if (loader == 0x0)
{
- ::Warning("AliTrackMapper::CreateMap",
- "Can not get loader from detector %s.",detector->GetName());
+ AliWarningClass(Form("Can not get loader from detector %s.",
+ detector->GetName()));
continue;
}
Int_t retval = loader->LoadHits();
if (retval) {
- ::Error("AliTrackMapper::CreateMap",
- "Event %d: error occured while loading hits for %s",
- eventNr,detector->GetName());
+ AliErrorClass(Form("Event %d: error occured while loading hits for %s",
+ eventNr,detector->GetName()));
return -1;
}
TTree *treeH = loader->TreeH();
if (!treeH) {
- ::Error("AliTrackMapper::CreateMap","Event %d: Can not get TreeH for %s",
- eventNr,detector->GetName());
+ AliErrorClass(Form("Event %d: Can not get TreeH for %s",
+ eventNr,detector->GetName()));
return -1;
}
Int_t treeHEntries = static_cast<Int_t>(treeH->GetEntries());
- if (fDEBUG > 1) cout<<"treeHEntries "<<treeHEntries<<endl;
+ AliDebugClass(2, Form("treeHEntries %d", treeHEntries));
detector->ResetHits();
label=hit->Track();
if (lastLabel != label) {
if (label < 0 || label >= nAllParticles) {
- cerr<<"Error: label out of range. ";
- cerr<<"Event "<<eventNr<<" treeHIndex "<<treeHIndex<<" label = "<<label<<endl;
+ AliErrorClass(Form("label out of range. Event %d treeHIndex %d label = %d",
+ eventNr, treeHIndex, label));
return -2;
}
if (trackMap[label] >=0 && trackMap[label] != treeHIndex) {
- cerr<<"Error: different treeHIndex for label "<<label
- <<" indeces: "<<trackMap[label]<<" != "<<treeHIndex;
- cerr<<" event "<<eventNr<<" detector "<<detector->GetName()<<endl;
+ AliErrorClass(Form("different treeHIndex for label %d indeces: %d != %d event %d detector %s",
+ label, trackMap[label], treeHIndex, eventNr, detector->GetName()));
return -3;
}
trackMap[label] = treeHIndex;
- if (fDEBUG > 2) cout<<"treeHIndex, label = "<<treeHIndex<<" "<<label<<endl;
+ AliDebugClass(3, Form("treeHIndex, label = %d %d", treeHIndex, label));
lastLabel = label;
}
}
loader->UnloadHits();
}//loop over modules
- if (fDEBUG > 2) {
+ ToAliDebugClass(3,
for (Int_t i = 0; i < nAllParticles; i++) {
cout<<eventNr<<"\t"<<i<<"\t"<<trackMap[i]<<endl;
}
- }
+ )
fileMap->cd();
AliTrackMap* trackMapObject = new AliTrackMap(nAllParticles, trackMap);
trackMapObject->SetEventNr(eventNr);
// the file fileMap
//
fileMap=TFile::Open(fnMap);
- if (!fileMap->IsOpen()) {cerr<<"Can't open file "<<fnMap<<" with map!\n"; return 0;}
+ if (!fileMap->IsOpen()) {AliErrorClass(Form("Can't open file %s with map!", fnMap)); return 0;}
char mapName[20];
sprintf(mapName,"AliTrackMap_%5.5d",eventNr);
AliTrackMap* trackMapObject = dynamic_cast<AliTrackMap*>(fileMap->Get(mapName));
if (!trackMapObject) {
- cerr<<"Error: map named "<<mapName<<" not found."<<endl;
+ AliErrorClass(Form("map named %s not found.", mapName));
return 0;
}
return trackMapObject;