From 21bf7095173459ea18fc36cc9387a9bb563fa194 Mon Sep 17 00:00:00 2001 From: tkuhr Date: Wed, 3 Nov 2004 08:30:38 +0000 Subject: [PATCH] use AliLog message scheme --- STEER/AliConfig.cxx | 63 ++++----- STEER/AliDataLoader.cxx | 232 ++++++++++++++------------------- STEER/AliDataLoader.h | 2 - STEER/AliFieldMap.cxx | 7 +- STEER/AliLego.cxx | 15 ++- STEER/AliLegoGenerator.cxx | 5 +- STEER/AliLegoGeneratorEta.cxx | 5 +- STEER/AliLegoGeneratorPhiZ.cxx | 5 +- STEER/AliLegoGeneratorXYZ.cxx | 5 +- STEER/AliLoader.cxx | 98 ++++++++------ STEER/AliLoader.h | 6 +- STEER/AliMC.cxx | 130 ++++++++---------- STEER/AliMC.h | 5 +- STEER/AliMCQA.cxx | 3 +- STEER/AliMemoryWatcher.cxx | 5 +- STEER/AliRndm.cxx | 7 +- STEER/AliRun.cxx | 65 +++++---- STEER/AliRun.h | 7 +- STEER/AliRunLoader.cxx | 210 ++++++++++++++--------------- STEER/AliStack.cxx | 47 +++---- STEER/AliTrackMap.cxx | 5 +- STEER/AliTrackMapper.cxx | 47 ++++--- 22 files changed, 465 insertions(+), 509 deletions(-) diff --git a/STEER/AliConfig.cxx b/STEER/AliConfig.cxx index 5de18d35b5e..32b77489dbc 100644 --- a/STEER/AliConfig.cxx +++ b/STEER/AliConfig.cxx @@ -40,6 +40,7 @@ #include "AliDetector.h" #include "AliGenerator.h" #include "AliLoader.h" +#include "AliLog.h" enum { @@ -130,7 +131,7 @@ AliConfig::AliConfig(): // 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"); } //____________________________________________________________________________ @@ -147,8 +148,7 @@ AliConfig::AliConfig(const AliConfig& conf): // 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"); } //____________________________________________________________________________ @@ -159,8 +159,7 @@ AliConfig& AliConfig::operator=(const AliConfig& /*conf*/) // 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; } //____________________________________________________________________________ @@ -178,7 +177,7 @@ AliConfig::AliConfig(const char *name, const char *title): //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(); @@ -250,12 +249,12 @@ Int_t AliConfig::AddSubTask(const char *taskname, const char* name,const char* t //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(obj):0x0; if (task) { - if (AliLoader::GetDebug()) Info("AddSubTask"," Got"); + AliDebug(1, " Got"); TTask * subtask = static_cast(task->GetListOfTasks()->FindObject(name)); if (!subtask) { @@ -264,12 +263,12 @@ Int_t AliConfig::AddSubTask(const char *taskname, const char* name,const char* t } 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; @@ -316,9 +315,8 @@ void AliConfig::Add(AliModule* obj,const char* eventfolder) // 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); } //____________________________________________________________________________ @@ -330,7 +328,7 @@ Int_t AliConfig::AddDetector(TFolder* evntfolder, const char *name, const char* 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; @@ -344,7 +342,7 @@ Int_t AliConfig::AddDetector(const char* evntfoldername,const char *name, const 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); @@ -360,16 +358,14 @@ Int_t AliConfig::AddDetector(const char* evntfoldername,const char *name, const 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(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()); @@ -389,8 +385,7 @@ Int_t AliConfig::CreateDetectorFolders(const char* evntfoldername,const char *n TFolder* evfolder = dynamic_cast(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); @@ -411,7 +406,7 @@ Int_t AliConfig::CreateDetectorFolders(TFolder* evntfolder,const char *name, co 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++; @@ -430,8 +425,8 @@ Int_t AliConfig::CreateDetectorTasks(const char *name, const char* title) 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++; @@ -475,7 +470,7 @@ void AliConfig::Add (char *list) while (token != NULL) { - Info("Add(char *list)","Configuring token=%s",token); + AliInfo(Form("Configuring token=%s",token)); TObject *obj; TIter next (dirlist); @@ -522,11 +517,11 @@ void AliConfig::Add (char *list) 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); } @@ -738,7 +733,7 @@ Int_t AliConfig::AddSubFolder(TFolder* topfolder, const char* infoler, if (topfolder == 0x0)//check if exists top folder { - Error("AddSubFodler(TFolder*, ....","Parameter TFolder* points to NULL."); + AliError("Parameter TFolder* points to NULL."); return 1; } @@ -748,7 +743,7 @@ Int_t AliConfig::AddSubFolder(TFolder* topfolder, const char* infoler, folder = dynamic_cast(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 @@ -757,7 +752,7 @@ Int_t AliConfig::AddSubFolder(TFolder* topfolder, const char* infoler, 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 @@ -766,11 +761,9 @@ Int_t AliConfig::AddSubFolder(TFolder* topfolder, const char* infoler, TFolder* fol = dynamic_cast(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; } diff --git a/STEER/AliDataLoader.cxx b/STEER/AliDataLoader.cxx index ad55ed51d10..60cf6749f98 100644 --- a/STEER/AliDataLoader.cxx +++ b/STEER/AliDataLoader.cxx @@ -33,6 +33,7 @@ #include #include +#include "AliLog.h" #include "AliRunLoader.h" ClassImp(AliDataLoader) @@ -74,8 +75,7 @@ AliDataLoader::AliDataLoader(const char* filename, const char* contname, const c // 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; @@ -89,12 +89,12 @@ AliDataLoader::AliDataLoader(const char* filename, const char* contname, const c /*****************************************************************************/ 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; } /*****************************************************************************/ @@ -112,7 +112,7 @@ Int_t AliDataLoader::SetEvent() AliRunLoader* rl = GetRunLoader(); if (rl == 0x0) { - Error("SetEvent","Can not get RunGettr"); + AliError("Can not get RunGettr"); return 1; } @@ -131,14 +131,14 @@ Int_t AliDataLoader::SetEvent() { 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; } } @@ -189,13 +189,13 @@ Int_t AliDataLoader::OpenFile(Option_t* opt) { 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; } @@ -208,8 +208,8 @@ Int_t AliDataLoader::OpenFile(Option_t* opt) { 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; } } @@ -218,12 +218,12 @@ Int_t AliDataLoader::OpenFile(Option_t* opt) 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; } @@ -232,7 +232,7 @@ Int_t AliDataLoader::OpenFile(Option_t* opt) 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(); @@ -240,7 +240,7 @@ Int_t AliDataLoader::OpenFile(Option_t* opt) 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; @@ -297,7 +297,7 @@ Int_t AliDataLoader::Reload() 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; } } @@ -310,9 +310,8 @@ Int_t AliDataLoader::Reload() 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); } /*****************************************************************************/ @@ -329,12 +328,11 @@ Int_t AliDataLoader::SetEventFolder(TFolder* eventfolder) //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; @@ -346,11 +344,11 @@ Int_t AliDataLoader::SetFolder(TFolder* folder) // 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); @@ -368,7 +366,7 @@ Int_t AliDataLoader::SetFolder(TFolder* folder) 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; } /*****************************************************************************/ @@ -380,7 +378,7 @@ AliRunLoader* AliDataLoader::GetRunLoader() TFolder* ef = GetEventFolder(); if (ef == 0x0) { - Error("GetRunLoader","Can not get event folder."); + AliError("Can not get event folder."); return 0; } rg = dynamic_cast(ef->FindObject(AliRunLoader::GetRunLoaderName())); @@ -398,8 +396,7 @@ void AliDataLoader::CloseFile() if (bl->IsLoaded()) return; } - if (GetDebug()) - Info("CloseFile","Closing and deleting (object) file."); + AliDebug(1, "Closing and deleting (object) file."); delete fFile; fFile = 0x0; @@ -431,18 +428,14 @@ void AliDataLoader::SetFileNameSuffix(const TString& suffix) //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())); } /*****************************************************************************/ @@ -472,7 +465,7 @@ const TString AliDataLoader::SetFileOffset(const TString& fname) 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; } @@ -495,21 +488,13 @@ void AliDataLoader::SetCompressionLevel(Int_t cl) } /*****************************************************************************/ -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(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(); @@ -556,15 +541,15 @@ void AliDataLoader::AddBaseLoader(AliBaseLoader* bl) 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; } @@ -602,19 +587,19 @@ TTree* AliDataLoader::Tree() const 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() @@ -646,7 +631,7 @@ void AliDataLoader::SetBaseDataLoader(AliBaseLoader* bl) //sets data base loader if (bl == 0x0) { - Error("SetBaseDataLoader","Parameter is null"); + AliError("Parameter is null"); return; } if (GetBaseDataLoader()) delete GetBaseDataLoader(); @@ -658,7 +643,7 @@ void AliDataLoader::SetBaseTaskLoader(AliTaskLoader* bl) //sets Task base loader if (bl == 0x0) { - Error("SetBaseTaskLoader","Parameter is null"); + AliError("Parameter is null"); return; } if (GetBaseTaskLoader()) delete GetBaseTaskLoader(); @@ -670,7 +655,7 @@ void AliDataLoader::SetBaseQALoader(AliBaseLoader* bl) //sets QA base loader if (bl == 0x0) { - Error("SetBaseQALoader","Parameter is null"); + AliError("Parameter is null"); return; } if (GetBaseQALoader()) delete GetBaseQALoader(); @@ -682,7 +667,7 @@ void AliDataLoader::SetBaseQATaskLoader(AliTaskLoader* bl) //sets QA Task base loader if (bl == 0x0) { - Error("SetBaseQATaskLoader","Parameter is null"); + AliError("Parameter is null"); return; } if (GetBaseQATaskLoader()) delete GetBaseQATaskLoader(); @@ -729,12 +714,12 @@ AliBaseLoader::AliBaseLoader(const TString& name, AliDataLoader* dl, Bool_t sto /*****************************************************************************/ 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; } /*****************************************************************************/ @@ -742,13 +727,11 @@ AliBaseLoader& AliBaseLoader::operator=(const AliBaseLoader& /*source*/) { 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; } @@ -758,10 +741,10 @@ Int_t AliBaseLoader::Load(Option_t* opt) { 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; } } @@ -770,7 +753,7 @@ Int_t AliBaseLoader::Load(Option_t* opt) 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; } } @@ -786,7 +769,7 @@ Int_t AliBaseLoader::Load(Option_t* opt) 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; } @@ -801,7 +784,7 @@ Int_t AliBaseLoader::Post() 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; } @@ -817,15 +800,12 @@ Int_t AliBaseLoader::Post() 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; } } @@ -838,25 +818,25 @@ Int_t AliBaseLoader::Post(TObject* data) //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); @@ -867,14 +847,13 @@ Int_t AliBaseLoader::WriteData(Option_t* opt) { //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; } @@ -886,14 +865,14 @@ Int_t AliBaseLoader::WriteData(Option_t* opt) 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; } @@ -906,18 +885,18 @@ Int_t AliBaseLoader::WriteData(Option_t* opt) 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. @@ -942,12 +921,11 @@ Int_t AliBaseLoader::Reload() 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; } @@ -967,18 +945,12 @@ AliDataLoader* AliBaseLoader::GetDataLoader() const // 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 @@ -1011,7 +983,7 @@ TFolder* AliObjectLoader::GetFolder() const TFolder* df = GetDataLoader()->GetFolder(); if (df == 0x0) { - Fatal("GetFolder","Data Folder is NULL"); + AliFatal("Data Folder is NULL"); } return df; } @@ -1019,12 +991,12 @@ TFolder* AliObjectLoader::GetFolder() const 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; } /*****************************************************************************/ @@ -1071,12 +1043,12 @@ AliTreeLoader::AliTreeLoader(const TString& name, AliDataLoader* dl,Bool_t store 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; } @@ -1087,14 +1059,13 @@ Int_t AliTreeLoader::WriteData(Option_t* opt) //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; } @@ -1106,14 +1077,14 @@ Int_t AliTreeLoader::WriteData(Option_t* opt) 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; } @@ -1126,22 +1097,22 @@ Int_t AliTreeLoader::WriteData(Option_t* opt) 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(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. @@ -1156,19 +1127,17 @@ void AliTreeLoader::MakeTree() //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 @@ -1201,12 +1170,12 @@ AliTaskLoader::AliTaskLoader(const TString& name, AliDataLoader* dl, TTask* pare 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; } /*****************************************************************************/ @@ -1215,12 +1184,11 @@ void AliTaskLoader::Clean() //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); } } @@ -1239,7 +1207,7 @@ Int_t AliTaskLoader::AddToBoard(TObject* obj) TTask* task = dynamic_cast(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); diff --git a/STEER/AliDataLoader.h b/STEER/AliDataLoader.h index 70b71ad6fb0..a54c9655cc1 100644 --- a/STEER/AliDataLoader.h +++ b/STEER/AliDataLoader.h @@ -110,7 +110,6 @@ class AliDataLoader: public TNamed void Synchronize(); protected: - Int_t GetDebug() const; AliRunLoader* GetRunLoader();//gets the run-loader from event folder private: @@ -175,7 +174,6 @@ class AliBaseLoader: public TNamed 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 diff --git a/STEER/AliFieldMap.cxx b/STEER/AliFieldMap.cxx index edcc523c866..081506e05fa 100644 --- a/STEER/AliFieldMap.cxx +++ b/STEER/AliFieldMap.cxx @@ -27,6 +27,7 @@ #include +#include "AliLog.h" #include "AliFieldMap.h" ClassImp(AliFieldMap) @@ -134,8 +135,8 @@ void AliFieldMap::ReadField() 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"); @@ -273,7 +274,7 @@ void AliFieldMap::Copy(TObject & /* magf */) const // // Copy *this onto magf -- Not implemented // - Fatal("Copy","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ diff --git a/STEER/AliLego.cxx b/STEER/AliLego.cxx index 81e9ccd70c8..28554ffaceb 100644 --- a/STEER/AliLego.cxx +++ b/STEER/AliLego.cxx @@ -51,6 +51,7 @@ #include "TString.h" #include "TVirtualMC.h" +#include "AliLog.h" #include "AliDebugVolume.h" #include "AliLego.h" #include "AliLegoGenerator.h" @@ -143,7 +144,7 @@ AliLego::AliLego(const char *title, Int_t ntheta, Float_t thetamin, // fVolumesFwd = new TClonesArray("AliDebugVolume",1000); fVolumesBwd = new TClonesArray("AliDebugVolume",1000); - fDebug = gAlice->GetDebug(); + fDebug = AliDebugLevel(); } //_______________________________________________________________________ @@ -187,7 +188,7 @@ AliLego::AliLego(const char *title, AliLegoGenerator* generator): fVolumesFwd = new TClonesArray("AliDebugVolume",1000); fVolumesBwd = new TClonesArray("AliDebugVolume",1000); - fDebug = gAlice->GetDebug(); + fDebug = AliDebugLevel(); } //_______________________________________________________________________ @@ -215,7 +216,7 @@ void AliLego::BeginEvent() fTotGcm2 = 0; if (fDebug) { - if (fErrorCondition) DumpVolumes(); + if (fErrorCondition) ToAliDebug(1, DumpVolumes()); fVolumesFwd->Delete(); fVolumesBwd->Delete(); fStepsForward = 0; @@ -254,7 +255,7 @@ void AliLego::FinishRun() fHistAbso->Delete(); fHistAbso=0; fHistGcm2->Delete(); fHistGcm2=0; // - if (fErrorCondition) DumpVolumes(); + if (fErrorCondition) ToAliError(DumpVolumes()); } //_______________________________________________________________________ @@ -263,7 +264,7 @@ void AliLego::Copy(TObject&) const // // Copy *this onto lego -- not implemented // - Fatal("Copy","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ @@ -405,8 +406,8 @@ void AliLego::StepManager() AliDebugVolume* tmp = dynamic_cast((*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 diff --git a/STEER/AliLegoGenerator.cxx b/STEER/AliLegoGenerator.cxx index 3fd56ab3187..e6ba5e14b94 100644 --- a/STEER/AliLegoGenerator.cxx +++ b/STEER/AliLegoGenerator.cxx @@ -25,6 +25,7 @@ #include "AliLegoGenerator.h" #include "AliRun.h" #include "AliMC.h" +#include "AliLog.h" ClassImp(AliLegoGenerator) @@ -94,11 +95,11 @@ void AliLegoGenerator::Generate() // 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++; diff --git a/STEER/AliLegoGeneratorEta.cxx b/STEER/AliLegoGeneratorEta.cxx index ca803d5a179..e1844441553 100644 --- a/STEER/AliLegoGeneratorEta.cxx +++ b/STEER/AliLegoGeneratorEta.cxx @@ -25,6 +25,7 @@ #include "AliLegoGeneratorEta.h" #include "AliRun.h" #include "AliMC.h" +#include "AliLog.h" ClassImp(AliLegoGeneratorEta) @@ -45,11 +46,11 @@ void AliLegoGeneratorEta::Generate() // 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++; diff --git a/STEER/AliLegoGeneratorPhiZ.cxx b/STEER/AliLegoGeneratorPhiZ.cxx index e8ea0376b37..7ffaa4df63e 100644 --- a/STEER/AliLegoGeneratorPhiZ.cxx +++ b/STEER/AliLegoGeneratorPhiZ.cxx @@ -25,6 +25,7 @@ #include "AliLegoGeneratorPhiZ.h" #include "AliRun.h" #include "AliMC.h" +#include "AliLog.h" ClassImp(AliLegoGeneratorPhiZ) @@ -45,11 +46,11 @@ void AliLegoGeneratorPhiZ::Generate() // 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); diff --git a/STEER/AliLegoGeneratorXYZ.cxx b/STEER/AliLegoGeneratorXYZ.cxx index 740c56c0920..72de0f141de 100644 --- a/STEER/AliLegoGeneratorXYZ.cxx +++ b/STEER/AliLegoGeneratorXYZ.cxx @@ -25,6 +25,7 @@ #include "AliLegoGeneratorXYZ.h" #include "AliRun.h" #include "AliMC.h" +#include "AliLog.h" ClassImp(AliLegoGeneratorXYZ) @@ -99,11 +100,11 @@ void AliLegoGeneratorXYZ::Generate() // 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++; diff --git a/STEER/AliLoader.cxx b/STEER/AliLoader.cxx index dadc3ed9b6d..a2f1213bc1f 100644 --- a/STEER/AliLoader.cxx +++ b/STEER/AliLoader.cxx @@ -19,6 +19,7 @@ #include //AliRoot includes +#include #include #include #include @@ -26,8 +27,6 @@ #include #include "AliConfig.h" -Int_t AliLoader::fgDebug = 0; - const TString AliLoader::fgkDefaultHitsContainerName("TreeH"); const TString AliLoader::fgkDefaultDigitsContainerName = "TreeD"; const TString AliLoader::fgkDefaultSDigitsContainerName = "TreeS"; @@ -77,8 +76,7 @@ AliLoader::AliLoader(const Char_t* detname,const Char_t* eventfoldername): 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 @@ -116,7 +114,7 @@ AliLoader::AliLoader(const AliLoader& source):TNamed(source) { // dummy copy constructor if(&source==this)return; - Fatal("AliLoader","Copy constructor not implemented. Aborting"); + AliFatal("Copy constructor not implemented. Aborting"); return; } @@ -125,7 +123,7 @@ AliLoader& AliLoader::operator=(const AliLoader& source) { // dummy assignment operator if(&source==this) return *this; - Fatal("AliLoader","Assignment operator not implemented. Aborting"); + AliFatal("Assignment operator not implemented. Aborting"); return *this; } @@ -197,12 +195,12 @@ void AliLoader::AddDataLoader(AliDataLoader* dl) // 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); @@ -255,7 +253,7 @@ Int_t AliLoader::GetEvent() 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; } } @@ -288,7 +286,7 @@ TFolder* AliLoader::GetDataFolder() if (!fDataFolder) { - Fatal("GetDataFolder","Can not find AliRoot data folder. Aborting"); + AliFatal("Can not find AliRoot data folder. Aborting"); return 0x0; } } @@ -306,7 +304,7 @@ TFolder* AliLoader::GetTasksFolder() if (!fTasksFolder) { - Fatal("GetTasksFolder","Can not find tasks folder. Aborting"); + AliFatal("Can not find tasks folder. Aborting"); return 0x0; } } @@ -324,7 +322,7 @@ TFolder* AliLoader::GetModulesFolder() if (!fModuleFolder) { - Fatal("GetModulesFolder","Can not find modules folder. Aborting"); + AliFatal("Can not find modules folder. Aborting"); return 0x0; } } @@ -343,7 +341,7 @@ TFolder* AliLoader::GetQAFolder() if (fQAFolder == 0x0) { - Fatal("GetQAFolder","Can not find Quality Assurance folder. Aborting"); + AliFatal("Can not find Quality Assurance folder. Aborting"); return 0x0; } } @@ -395,7 +393,7 @@ TTask* AliLoader::QAtask(const char* name) const 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; } @@ -404,7 +402,7 @@ TTask* AliLoader::QAtask(const char* name) const 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; } @@ -420,7 +418,7 @@ TTask* AliLoader::QAtask(const char* name) const 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; } /*****************************************************************************/ @@ -433,19 +431,18 @@ TDirectory* AliLoader::ChangeDir(TFile* file, Int_t eventno) 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; @@ -453,22 +450,21 @@ TDirectory* AliLoader::ChangeDir(TFile* file, Int_t eventno) 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); @@ -656,7 +652,7 @@ void AliLoader::CleanFolders() 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(); } } @@ -669,7 +665,7 @@ void AliLoader::CleanSDigitizer() //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(); @@ -681,7 +677,7 @@ void AliLoader::CleanDigitizer() //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(); @@ -693,7 +689,7 @@ void AliLoader::CleanReconstructioner() //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(); @@ -705,7 +701,7 @@ void AliLoader::CleanTracker() //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(); @@ -718,7 +714,7 @@ void AliLoader::CleanPIDTask() 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(); @@ -736,7 +732,7 @@ Int_t AliLoader::ReloadAll() 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; } } @@ -761,7 +757,7 @@ Int_t AliLoader::SetEventFolder(TFolder* eventfolder) //sets the event folder if (eventfolder == 0x0) { - Error("SetEventFolder","Stupid joke. Argument is NULL"); + AliError("Stupid joke. Argument is NULL"); return 1; } @@ -788,17 +784,17 @@ Int_t AliLoader::Register(TFolder* eventFolder) //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); @@ -879,8 +875,7 @@ void AliLoader::Clean(const TString& name) 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; } @@ -899,6 +894,27 @@ Bool_t AliLoader::IsOptionWritable(const TString& opt) } /*****************************************************************************/ +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 diff --git a/STEER/AliLoader.h b/STEER/AliLoader.h index 4f59a504e55..32f2dc3e62a 100644 --- a/STEER/AliLoader.h +++ b/STEER/AliLoader.h @@ -295,8 +295,8 @@ class AliLoader: public TNamed 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: @@ -372,8 +372,6 @@ class AliLoader: public TNamed //descendant classes should //use protected interface methods to access these folders - static Int_t fgDebug; //debug flag for loaders - ClassDef(AliLoader,2) }; /******************************************************************/ diff --git a/STEER/AliMC.cxx b/STEER/AliMC.cxx index 3ad70446c83..defade3d1b2 100644 --- a/STEER/AliMC.cxx +++ b/STEER/AliMC.cxx @@ -27,6 +27,7 @@ #include #include +#include "AliLog.h" #include "AliDetector.h" #include "AliGenerator.h" #include "AliHeader.h" @@ -48,7 +49,6 @@ AliMC::AliMC() : fSum2Energy(0), fTrRmax(1.e10), fTrZmax(1.e10), - fDebug(0), fImedia(0), fTransParName("\0"), fMCQA(0), @@ -68,7 +68,6 @@ AliMC::AliMC(const char *name, const char *title) : fSum2Energy(0), fTrRmax(1.e10), fTrZmax(1.e10), - fDebug(0), fImedia(new TArrayI(1000)), fTransParName("\0"), fMCQA(0), @@ -93,7 +92,6 @@ AliMC::AliMC(const AliMC &mc) : fSum2Energy(0), fTrRmax(1.e10), fTrZmax(1.e10), - fDebug(0), fImedia(0), fTransParName("\0"), fMCQA(0), @@ -127,7 +125,7 @@ AliMC::~AliMC() void AliMC::Copy(TObject &) const { //dummy Copy function - Fatal("Copy","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ @@ -140,14 +138,14 @@ void AliMC::ConstructGeometry() TStopwatch stw; TIter next(gAlice->Modules()); AliModule *detector; - if (GetDebug()) Info("ConstructGeometry","Geometry creation:"); + AliDebug(1, "Geometry creation:"); while((detector = dynamic_cast(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())); } } @@ -158,7 +156,7 @@ void AliMC::InitGeometry() // Initialize detectors and display geometry // - printf("Initialisation:\n"); + AliInfo("Initialisation:"); TStopwatch stw; TIter next(gAlice->Modules()); AliModule *detector; @@ -167,8 +165,8 @@ void AliMC::InitGeometry() // 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())); } } @@ -200,11 +198,11 @@ void AliMC::ResetGenerator(AliGenerator *generator) // 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; } @@ -212,15 +210,12 @@ void AliMC::ResetGenerator(AliGenerator *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()); } //_______________________________________________________________________ @@ -355,16 +350,13 @@ void AliMC::BeginEvent() // // 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(); @@ -377,7 +369,7 @@ void AliMC::BeginEvent() //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 @@ -389,11 +381,11 @@ void AliMC::BeginEvent() 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 @@ -413,13 +405,13 @@ void AliMC::BeginEvent() } - 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 @@ -428,11 +420,11 @@ void AliMC::BeginEvent() 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 @@ -534,7 +526,7 @@ void AliMC::FinishEvent() 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 @@ -554,7 +546,7 @@ void AliMC::FinishEvent() } else { - Error("FinishEvent","Can not get TreeE from RL"); + AliError("Can not get TreeE from RL"); } if(gAlice->Lego() == 0x0) @@ -564,16 +556,13 @@ void AliMC::FinishEvent() 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, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); } //_______________________________________________________________________ @@ -645,8 +634,8 @@ void AliMC::MediaTable() 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 @@ -658,7 +647,8 @@ void AliMC::MediaTable() } // // 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< (6GetName()); + AliWarning(Form("Invalid tracking medium code %d for %s",itmed,mod->GetName())); continue; } // Set energy thresholds for(kz=0;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=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; } } @@ -985,7 +965,7 @@ void AliMC::AddTrackReference(Int_t label){ // // 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(); diff --git a/STEER/AliMC.h b/STEER/AliMC.h index 61c3f778adf..238e9b76c00 100644 --- a/STEER/AliMC.h +++ b/STEER/AliMC.h @@ -65,8 +65,6 @@ public: 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); @@ -114,7 +112,6 @@ private: 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 @@ -122,7 +119,7 @@ private: 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) }; diff --git a/STEER/AliMCQA.cxx b/STEER/AliMCQA.cxx index a3e1b805774..5c18c8344e2 100644 --- a/STEER/AliMCQA.cxx +++ b/STEER/AliMCQA.cxx @@ -38,6 +38,7 @@ #include #include +#include "AliLog.h" #include "AliMC.h" #include "AliMCQA.h" #include "AliModule.h" @@ -172,7 +173,7 @@ AliMCQA::AliMCQA(Int_t ndets): //_______________________________________________________________________ void AliMCQA::Copy(TObject &) const { - Fatal("Copy ctor","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ diff --git a/STEER/AliMemoryWatcher.cxx b/STEER/AliMemoryWatcher.cxx index 96389b696ca..c19464746a7 100644 --- a/STEER/AliMemoryWatcher.cxx +++ b/STEER/AliMemoryWatcher.cxx @@ -50,6 +50,7 @@ class assert ; #include #endif // --- AliRoot header files --- +#include "AliLog.h" #include "AliMemoryWatcher.h" // --- ROOT system --- #include "TSystem.h" @@ -124,7 +125,7 @@ void AliMemoryWatcher::Watch(Int_t x) 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; @@ -146,7 +147,7 @@ void AliMemoryWatcher::Watch(Int_t x) } else { fDisabled=true; - Error("watch", "I'm full !" ) ; + AliError("I'm full !" ) ; } } //_____________________________________________________________________________ diff --git a/STEER/AliRndm.cxx b/STEER/AliRndm.cxx index 302d644a1fc..446c83faef7 100644 --- a/STEER/AliRndm.cxx +++ b/STEER/AliRndm.cxx @@ -29,6 +29,7 @@ #include "TSystem.h" #include "AliRndm.h" +#include "AliLog.h" ClassImp(AliRndm) @@ -54,7 +55,7 @@ AliRndm::AliRndm(const AliRndm& rn): //_______________________________________________________________________ void AliRndm::Copy(AliRndm&) const { - ::Fatal("Copy","Not implemented\n"); + AliFatalClass("Not implemented"); } @@ -83,7 +84,7 @@ void AliRndm::ReadRandom(const char *filename) 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"); @@ -102,7 +103,7 @@ void AliRndm::WriteRandom(const char *filename) const 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(); diff --git a/STEER/AliRun.cxx b/STEER/AliRun.cxx index d3eeaf5e748..c2cbff57663 100644 --- a/STEER/AliRun.cxx +++ b/STEER/AliRun.cxx @@ -50,6 +50,7 @@ #include #include // +#include "AliLog.h" #include "AliDetector.h" #include "AliDisplay.h" #include "AliHeader.h" @@ -74,7 +75,6 @@ AliRun::AliRun(): fEvent(0), fEventNrInRun(0), fEventsPerRun(0), - fDebug(0), fModules(0), fGeometry(0), fMCApp(0), @@ -103,7 +103,6 @@ AliRun::AliRun(const AliRun& arun): fEvent(0), fEventNrInRun(0), fEventsPerRun(0), - fDebug(0), fModules(0), fGeometry(0), fMCApp(0), @@ -131,7 +130,6 @@ AliRun::AliRun(const char *name, const char *title): fEvent(0), fEventNrInRun(0), fEventsPerRun(0), - fDebug(0), fModules(new TObjArray(77)), // Support list for the Detectors fGeometry(0), fMCApp(0), @@ -214,7 +212,7 @@ AliRun::~AliRun() //_______________________________________________________________________ void AliRun::Copy(TObject &) const { - Fatal("Copy","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ @@ -295,7 +293,7 @@ void AliRun::SetField(Int_t type, Int_t version, Float_t scale, fField = new AliMagFDM("Map4",filename,type,scale,maxField); fField->ReadField(); } else { - Warning("SetField","Invalid map %d\n",version); + AliWarning(Form("Invalid map %d",version)); } } @@ -304,7 +302,7 @@ void AliRun::SetField(Int_t type, Int_t version, Float_t scale, void AliRun::InitLoaders() { //creates list of getters - if (GetDebug()) Info("InitLoaders",""); + AliDebug(1, ""); TIter next(fModules); AliModule *mod; while((mod = (AliModule*)next())) @@ -313,11 +311,11 @@ void AliRun::InitLoaders() AliDetector *det = dynamic_cast(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"); } //_____________________________________________________________________________ @@ -329,7 +327,7 @@ void AliRun::FinishRun() if(fLego) { - if (GetDebug()) Info("FinishRun"," Finish Lego"); + AliDebug(1, "Finish Lego"); fRunLoader->CdGAFile(); fLego->FinishRun(); } @@ -338,11 +336,11 @@ void AliRun::FinishRun() TIter next(fModules); AliModule *detector; while((detector = dynamic_cast(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 @@ -351,7 +349,7 @@ void AliRun::FinishRun() 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(); @@ -419,7 +417,7 @@ Int_t AliRun::GetEvent(Int_t 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; } /*****************************************/ @@ -537,7 +535,7 @@ void AliRun::InitMC(const char *setup) Announce(); if(fInitDone) { - Warning("Init","Cannot initialise AliRun twice!\n"); + AliWarning("Cannot initialise AliRun twice!"); return; } @@ -620,12 +618,12 @@ void AliRun::RunReco(const char *selected, Int_t first, Int_t last) // 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); } @@ -683,7 +681,7 @@ void AliRun::Tree2Tree(Option_t *option, const char *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); @@ -694,7 +692,7 @@ void AliRun::Tree2Tree(Option_t *option, const char *selected) } 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); @@ -705,7 +703,7 @@ void AliRun::Tree2Tree(Option_t *option, const char *selected) } 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); @@ -829,7 +827,7 @@ void AliRun::Field(const Double_t* x, Double_t *b) const 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.; } } @@ -866,7 +864,7 @@ Int_t AliRun::GetEvNumber() const //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; } @@ -885,13 +883,13 @@ void AliRun::SetRunLoader(AliRunLoader* rloader) 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 } @@ -912,11 +910,11 @@ void AliRun::SetRunLoader(AliRunLoader* rloader) 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); } } @@ -932,7 +930,7 @@ void AliRun::AddModule(AliModule* mod) 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()); @@ -940,3 +938,18 @@ void AliRun::AddModule(AliModule* mod) 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); +} diff --git a/STEER/AliRun.h b/STEER/AliRun.h index d8319114983..63eff8cc5e4 100644 --- a/STEER/AliRun.h +++ b/STEER/AliRun.h @@ -57,7 +57,7 @@ public: 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; @@ -91,7 +91,7 @@ public: 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); @@ -136,7 +136,6 @@ protected: 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 @@ -155,7 +154,7 @@ protected: 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; diff --git a/STEER/AliRunLoader.cxx b/STEER/AliRunLoader.cxx index 1d03489c7e0..e6ba36cf73e 100644 --- a/STEER/AliRunLoader.cxx +++ b/STEER/AliRunLoader.cxx @@ -55,6 +55,7 @@ class TTask; #include +#include "AliLog.h" #include "AliRun.h" #include "AliConfig.h" #include "AliLoader.h" @@ -178,7 +179,7 @@ AliRunLoader::AliRunLoader(TFolder* topfolder): if(topfolder == 0x0) { TString errmsg("Parameter is NULL"); - Error("AliRunLoader(TFolder*)","%s",errmsg.Data()); + AliError(errmsg.Data()); throw errmsg; return; } @@ -190,7 +191,7 @@ AliRunLoader::AliRunLoader(TFolder* topfolder): 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 } @@ -204,7 +205,7 @@ AliRunLoader::AliRunLoader(TFolder* topfolder): void AliRunLoader::Copy(TObject &) const { - Fatal("Copy","Not implemented"); + AliFatal("Not implemented"); } /**************************************************************************/ @@ -216,26 +217,23 @@ Int_t AliRunLoader::GetEvent(Int_t evno) 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; @@ -247,7 +245,7 @@ Int_t AliRunLoader::GetEvent(Int_t 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; } } @@ -260,13 +258,13 @@ Int_t AliRunLoader::GetEvent(Int_t evno) } 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; } @@ -274,7 +272,7 @@ Int_t AliRunLoader::GetEvent(Int_t evno) 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; } @@ -282,7 +280,7 @@ Int_t AliRunLoader::GetEvent(Int_t evno) 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; } @@ -296,8 +294,8 @@ Int_t AliRunLoader::GetEvent(Int_t evno) 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; } } @@ -316,13 +314,13 @@ Int_t AliRunLoader::SetEvent() 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; } @@ -333,7 +331,7 @@ Int_t AliRunLoader::SetEvent() 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; } } @@ -360,9 +358,7 @@ AliRunLoader* AliRunLoader::Open //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; @@ -376,7 +372,7 @@ AliRunLoader* AliRunLoader::Open TFolder* fold = dynamic_cast(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; } @@ -384,23 +380,21 @@ AliRunLoader* AliRunLoader::Open 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; } @@ -409,13 +403,12 @@ AliRunLoader* AliRunLoader::Open 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 @@ -423,13 +416,13 @@ AliRunLoader* AliRunLoader::Open 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; } @@ -437,20 +430,19 @@ AliRunLoader* AliRunLoader::Open //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(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; @@ -458,15 +450,14 @@ AliRunLoader* AliRunLoader::Open } 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; @@ -485,8 +476,7 @@ AliRunLoader* AliRunLoader::Open } 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 @@ -503,7 +493,7 @@ Int_t AliRunLoader::GetNumberOfEvents() retval = LoadHeader(); if (retval) { - Error("GetNumberOfEvents","Error occured while loading header"); + AliError("Error occured while loading header"); return -1; } } @@ -514,26 +504,26 @@ Int_t AliRunLoader::GetNumberOfEvents() 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 @@ -544,11 +534,11 @@ void AliRunLoader::MakeHeader() } 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"); } /**************************************************************************/ @@ -574,7 +564,7 @@ void AliRunLoader::MakeTree(Option_t *option) { if (fKineDataLoader->GetBaseLoader(0)->IsLoaded() == kFALSE) { - Error("MakeTree(\"K\")","Load Kinematics first"); + AliError("Load Kinematics first"); } else { @@ -609,20 +599,20 @@ Int_t AliRunLoader::LoadgAlice() //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(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 { @@ -638,33 +628,33 @@ Int_t AliRunLoader::LoadHeader() //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(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; } @@ -684,7 +674,7 @@ Int_t AliRunLoader::LoadKinematics(Option_t* option) 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) @@ -692,7 +682,7 @@ Int_t AliRunLoader::LoadKinematics(Option_t* option) retval = fStack->GetEvent(); if ( retval == kFALSE) { - Error("LoadKinematics","Error occured while loading kinamatics tree."); + AliError("Error occured while loading kinamatics tree."); return retval; } @@ -708,13 +698,13 @@ Int_t AliRunLoader::OpenDataFile(const TString& filename,TFile*& file,TDirectory { 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; } } @@ -724,7 +714,7 @@ Int_t AliRunLoader::OpenDataFile(const TString& filename,TFile*& file,TDirectory { 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; } } @@ -732,12 +722,12 @@ Int_t AliRunLoader::OpenDataFile(const TString& filename,TFile*& file,TDirectory 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; } @@ -746,7 +736,7 @@ Int_t AliRunLoader::OpenDataFile(const TString& filename,TFile*& file,TDirectory 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; @@ -756,7 +746,7 @@ Int_t AliRunLoader::OpenDataFile(const TString& filename,TFile*& file,TDirectory 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(obj):0x0; } @@ -801,7 +791,7 @@ Int_t AliRunLoader::WriteGeometry(Option_t* /*opt*/) 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(); @@ -812,17 +802,17 @@ Int_t AliRunLoader::WriteGeometry(Option_t* /*opt*/) 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; } @@ -832,7 +822,7 @@ Int_t AliRunLoader::WriteHeader(Option_t* opt) 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; } } @@ -840,7 +830,7 @@ Int_t AliRunLoader::WriteHeader(Option_t* opt) tree->SetDirectory(fGAFile); tree->Write(0,TObject::kOverwrite); - if (GetDebug()) Info("WriteHeader","WRITTEN\n\n"); + AliDebug(1, "WRITTEN\n\n"); return 0; } @@ -880,7 +870,7 @@ Int_t AliRunLoader::WriteHits(Option_t* opt) 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; } } @@ -900,7 +890,7 @@ Int_t AliRunLoader::WriteSDigits(Option_t* opt) 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; } } @@ -920,7 +910,7 @@ Int_t AliRunLoader::WriteDigits(Option_t* opt) 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; } } @@ -940,8 +930,8 @@ Int_t AliRunLoader::WriteRecPoints(Option_t* opt) 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; } } @@ -961,8 +951,8 @@ Int_t AliRunLoader::WriteTracks(Option_t* opt) 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; } } @@ -984,7 +974,7 @@ Int_t AliRunLoader::SetEventFolderName(const TString& name) //sets top folder name for this run; of alread if (name.IsNull()) { - Error("SetTopFolderName","Name is empty"); + AliError("Name is empty"); return 1; } @@ -995,7 +985,7 @@ Int_t AliRunLoader::SetEventFolderName(const TString& name) TFolder* fold = dynamic_cast(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 @@ -1005,7 +995,7 @@ Int_t AliRunLoader::SetEventFolderName(const TString& name) } 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; } } @@ -1024,7 +1014,7 @@ Int_t AliRunLoader::SetEventFolderName(const TString& name) 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 @@ -1051,7 +1041,7 @@ void AliRunLoader::AddLoader(AliLoader* loader) //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); @@ -1070,7 +1060,7 @@ void AliRunLoader::AddLoader(AliDetector* det) 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); } } @@ -1092,7 +1082,7 @@ AliLoader* AliRunLoader::GetLoader(AliDetector* det) const 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); } @@ -1147,14 +1137,14 @@ Int_t AliRunLoader::LoadHits(Option_t* detectors,Option_t* opt) { //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 @@ -1163,16 +1153,16 @@ Int_t AliRunLoader::LoadHits(Option_t* detectors,Option_t* opt) 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; } @@ -1522,7 +1512,7 @@ AliLoader* AliRunLoader::GetDetectorLoader(const char* detname, const char* even //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); @@ -1538,7 +1528,7 @@ AliLoader* AliRunLoader::GetDetectorLoader(const char* 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; @@ -1717,7 +1707,7 @@ void AliRunLoader::GetListOfDetectors(const char * namelist,TObjArray& pointerar } else { - Error("GetListOfDetectors","Can not find Loader for %s",buff); + AliError(Form("Can not find Loader for %s",buff)); } buff[0] = 0; @@ -1732,7 +1722,7 @@ void AliRunLoader::Clean(const TString& name) 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; } @@ -1793,7 +1783,7 @@ TTask* AliRunLoader::GetRunQATask() 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()); @@ -1860,7 +1850,7 @@ void AliRunLoader::UnloadgAlice() //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(); @@ -1920,7 +1910,7 @@ const TString AliRunLoader::SetFileOffset(const TString& fname) 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; } /*****************************************************************************/ diff --git a/STEER/AliStack.cxx b/STEER/AliStack.cxx index 2fc8d5a25a7..fbf97c7e118 100644 --- a/STEER/AliStack.cxx +++ b/STEER/AliStack.cxx @@ -31,6 +31,7 @@ #include #include +#include "AliLog.h" #include "AliHit.h" #include "AliModule.h" #include "AliRun.h" @@ -104,7 +105,7 @@ AliStack::AliStack(const AliStack& st): //_______________________________________________________________________ void AliStack::Copy(TObject&) const { - Fatal("Copy","Not implemented!\n"); + AliFatal("Not implemented!"); } //_______________________________________________________________________ @@ -169,8 +170,8 @@ void AliStack::PushTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom, 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 !"); } } @@ -233,7 +234,7 @@ void AliStack::PushTrack(Int_t done, Int_t parent, Int_t pdg, 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 { @@ -608,7 +609,7 @@ void AliStack::FinishEvent() // 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 { @@ -720,9 +721,9 @@ TParticle* AliStack::Particle(Int_t i) // 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); @@ -772,7 +773,7 @@ Int_t AliStack::GetCurrentParentTrackNumber() const 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; } } @@ -934,7 +935,7 @@ TTree* AliStack::TreeK() 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(); @@ -945,10 +946,7 @@ TTree* AliStack::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 @@ -960,12 +958,12 @@ void AliStack::ConnectTree() // // 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) @@ -975,35 +973,32 @@ void AliStack::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"); } //__________________________________________________________________________________________ @@ -1031,7 +1026,7 @@ Bool_t AliStack::GetEvent() 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; } diff --git a/STEER/AliTrackMap.cxx b/STEER/AliTrackMap.cxx index bc1ffd0876a..8f2b6609c88 100644 --- a/STEER/AliTrackMap.cxx +++ b/STEER/AliTrackMap.cxx @@ -34,6 +34,7 @@ #include +#include "AliLog.h" #include "AliTrackMap.h" ClassImp(AliTrackMap) @@ -75,7 +76,7 @@ AliTrackMap::AliTrackMap(Int_t size, Int_t *array): //_______________________________________________________________________ void AliTrackMap::Copy(TObject& ) const { - Fatal("Copy","Not implemented\n"); + AliFatal("Not implemented"); } //_______________________________________________________________________ @@ -95,7 +96,7 @@ Int_t AliTrackMap::At(Int_t label) const // label label // if (label < 0 || label >= fSize) { - cerr<<"AliTrackMap::At: label "<IsOpen()) {cerr<<"Can't open output file "<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 "<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; } @@ -107,7 +108,7 @@ Int_t AliTrackMapper::CreateMap(Int_t eventNr, TFile* fileMap,AliRunLoader* rl) TTree *treeK = rl->TreeK(); if (!treeK) { - cerr<<"Error: Event "<(treeK->GetEntries()); @@ -117,7 +118,7 @@ Int_t AliTrackMapper::CreateMap(Int_t eventNr, TFile* fileMap,AliRunLoader* rl) TObjArray *modules = gAlice->Detectors(); if (!modules) { - cerr<<"TObjArray with modules not found."<(modules->GetEntries()); @@ -129,26 +130,25 @@ Int_t AliTrackMapper::CreateMap(Int_t eventNr, TFile* fileMap,AliRunLoader* rl) 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(treeH->GetEntries()); - if (fDEBUG > 1) cout<<"treeHEntries "<ResetHits(); @@ -163,18 +163,17 @@ Int_t AliTrackMapper::CreateMap(Int_t eventNr, TFile* fileMap,AliRunLoader* rl) label=hit->Track(); if (lastLabel != label) { if (label < 0 || label >= nAllParticles) { - cerr<<"Error: label out of range. "; - cerr<<"Event "<=0 && trackMap[label] != treeHIndex) { - cerr<<"Error: different treeHIndex for label "<