From 21cd0c07a367c6e6836907ecf5222aef9cb05c05 Mon Sep 17 00:00:00 2001 From: schutz Date: Tue, 29 Oct 2002 09:02:52 +0000 Subject: [PATCH] removed iostream --- PHOS/AliPHOS.cxx | 1 - PHOS/AliPHOSAnalyze.cxx | 156 +++++++------- PHOS/AliPHOSCalibrationDB.cxx | 11 +- PHOS/AliPHOSClusterizer.cxx | 1 - PHOS/AliPHOSClusterizer.h | 51 +++-- PHOS/AliPHOSClusterizerv1.cxx | 175 +++++++-------- PHOS/AliPHOSClusterizerv2.cxx | 35 +-- PHOS/AliPHOSConTableDB.cxx | 33 +-- PHOS/AliPHOSCpvRecPoint.cxx | 30 +-- PHOS/AliPHOSDebug.cxx | 8 +- PHOS/AliPHOSDigit.cxx | 15 +- PHOS/AliPHOSDigitizer.cxx | 175 ++++++++------- PHOS/AliPHOSEmcRecPoint.cxx | 29 ++- PHOS/AliPHOSEvalRecPoint.cxx | 69 +++--- PHOS/AliPHOSFastRecParticle.cxx | 19 +- PHOS/AliPHOSGeometry.cxx | 17 +- PHOS/AliPHOSGetter.cxx | 319 ++++++++++++++-------------- PHOS/AliPHOSGetter.h | 3 +- PHOS/AliPHOSHit.cxx | 4 +- PHOS/AliPHOSHit.h | 2 - PHOS/AliPHOSIhepAnalyze.cxx | 71 +++---- PHOS/AliPHOSMemoryWatcher.cxx | 2 +- PHOS/AliPHOSPID.cxx | 38 ---- PHOS/AliPHOSPIDv0.cxx | 83 +++----- PHOS/AliPHOSPIDv1.cxx | 94 ++++---- PHOS/AliPHOSPpsdRecPoint.cxx | 12 +- PHOS/AliPHOSQAAlarm.cxx | 3 +- PHOS/AliPHOSQAChecker.cxx | 9 +- PHOS/AliPHOSQAFloatCheckable.cxx | 4 +- PHOS/AliPHOSQAIntCheckable.cxx | 4 +- PHOS/AliPHOSQAMeanChecker.cxx | 7 +- PHOS/AliPHOSQAObjectCheckable.cxx | 6 +- PHOS/AliPHOSQAVirtualCheckable.cxx | 14 +- PHOS/AliPHOSRaw2Digits.cxx | 65 +++--- PHOS/AliPHOSRecCpvManager.cxx | 6 +- PHOS/AliPHOSRecManager.cxx | 2 - PHOS/AliPHOSRecParticle.cxx | 5 +- PHOS/AliPHOSRecPoint.cxx | 3 +- PHOS/AliPHOSReconstructioner.cxx | 95 ++++----- PHOS/AliPHOSSDigitizer.cxx | 85 ++++---- PHOS/AliPHOSTrackSegment.cxx | 12 +- PHOS/AliPHOSTrackSegmentMaker.cxx | 36 ---- PHOS/AliPHOSTrackSegmentMaker.h | 25 ++- PHOS/AliPHOSTrackSegmentMakerv1.cxx | 56 +++-- PHOS/AliPHOSv0.cxx | 21 +- PHOS/AliPHOSv1.cxx | 4 +- PHOS/AliPHOSv3.cxx | 10 +- PHOS/AliPHOSvFast.cxx | 4 +- PHOS/PHOSHistos.cxx | 4 +- 49 files changed, 906 insertions(+), 1027 deletions(-) diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index 2b1230cb2f7..00178743a2a 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -32,7 +32,6 @@ class TFile; #include "TFolder.h" // --- Standard library --- -#include // --- AliRoot header files --- #include "AliPHOS.h" diff --git a/PHOS/AliPHOSAnalyze.cxx b/PHOS/AliPHOSAnalyze.cxx index 853ce1b29c0..e87192a6e66 100644 --- a/PHOS/AliPHOSAnalyze.cxx +++ b/PHOS/AliPHOSAnalyze.cxx @@ -28,8 +28,7 @@ // Contamination(...) - calculates contamination of the photon spectrum and // pobability of reconstruction of several primaries as // kGAMMA,kELECTRON etc. -// -// User Case: +//// User Case: // root [0] AliPHOSAnalyze * a = new AliPHOSAnalyze("galice.root") // // set the file you want to analyse // root [1] a->DrawRecon(1,3) @@ -77,8 +76,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliRun.h" @@ -131,7 +128,7 @@ void AliPHOSAnalyze::DrawRecon(Int_t Nevent,Int_t Nmod,const char * branchName,c //========== Create ObjectGetter AliPHOSGetter * gime = AliPHOSGetter::GetInstance(ffileName.Data(),branchTitle) ; if(Nevent >= gAlice->TreeE()->GetEntries() ) { - cout << "There is no event " << Nevent << ", only " << gAlice->TreeE()->GetEntries() << "events available " <TreeE()->GetEntries() ) ; return ; } const AliPHOSGeometry * phosgeom = gime->PHOSGeometry() ; @@ -236,10 +233,10 @@ void AliPHOSAnalyze::DrawRecon(Int_t Nevent,Int_t Nmod,const char * branchName,c } } } - cout << "Number of EMC + CPV SDigits per module: " <TreeS()->GetListOfBranches() ; - cout << "TreeS: " << endl ; + TString message ; + message = "TreeS:\n" ; for(ibranch = 0;ibranch GetEntries();ibranch++){ TBranch * branch=(TBranch *) branches->At(ibranch) ; - if(strstr(branch->GetName(),"PHOS") ) - cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ; + if(strstr(branch->GetName(),"PHOS") ){ + message += " " ; + message += branch->GetName() ; + message += " " ; + message += branch->GetTitle() ; + message += "\n" ; + } } - cout << endl ; - branches = gAlice->TreeD()->GetListOfBranches() ; - cout << "TreeD: " << endl ; + message += "TreeD:\n" ; for(ibranch = 0;ibranch GetEntries();ibranch++){ TBranch * branch=(TBranch *) branches->At(ibranch) ; - if(strstr(branch->GetName(),"PHOS") ) - cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ; + if(strstr(branch->GetName(),"PHOS") ) { + message += " "; + message += branch->GetName() ; + message += " " ; + message += branch->GetTitle() ; + message +="\n" ; + } } - cout << endl ; - branches = gAlice->TreeR()->GetListOfBranches() ; - cout << "TreeR: " << endl ; + message += "TreeR: \n" ; for(ibranch = 0;ibranch GetEntries();ibranch++){ TBranch * branch=(TBranch *) branches->At(ibranch) ; - if(strstr(branch->GetName(),"PHOS") ) - cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ; + if(strstr(branch->GetName(),"PHOS") ) { + message += " " ; + message += branch->GetName() ; + message += " " ; + message += branch->GetTitle() ; + message += "\n" ; + } } - cout << endl ; - - + Info("LS", message.Data()) ; } //____________________________________________________________________________ void AliPHOSAnalyze::InvariantMass(const char* branchTitle) @@ -448,7 +455,7 @@ void AliPHOSAnalyze::Ls(){ Int_t iRecParticle ; TClonesArray * rp = gime->RecParticles() ; if(!rp){ - cout << "AliPHOSAnalyze::InvariantMass --> Can't find RecParticles " << endl ; + Error("InvariantMass", "Can't find RecParticles") ; return ; } @@ -575,20 +582,17 @@ void AliPHOSAnalyze::Ls(){ Int_t iRecParticle ; TClonesArray * rp = gime->RecParticles() ; if(!rp) { - cout << "AliPHOSAnalyze::EnergyResolution --> Event " <TrackSegments() ; if(!ts) { - cout << "AliPHOSAnalyze::EnergyResolution --> Event " <EmcRecPoints() ; if(!emcrp){ - cout << "AliPHOSAnalyze::EnergyResolution --> Event " <Event(ievent) ; TClonesArray * rp = gime->RecParticles() ; if(!rp) { - cout << "AliPHOSAnalyze::PositionResolution --> Event " <TrackSegments() ; if(!ts) { - cout << "AliPHOSAnalyze::PositionResolution --> Event " <EmcRecPoints() ; if(!emcrp){ - cout << "AliPHOSAnalyze::PositionResolution --> Event " <RecParticles() ; if(!rp) { - cout << "AliPHOSAnalyze::Contamination --> Event " <TrackSegments() ; if(!ts) { - cout << "AliPHOSAnalyze::Contamination --> Event " <EmcRecPoints() ; if(!emcrp){ - cout << "AliPHOSAnalyze::Contamination --> Event " <TreeE()->GetEntries() ; - // cout << "Resolutions: Analyzed " << gime->MaxEvent() << " event(s)" << endl ; - cout << "Resolutions: Analyzed " << maxevent << " event(s)" << endl ; - cout << endl ; - - cout << " Primary: Photon Neutron Antineutron Charged hadron AntiProton" << endl ; - cout << "--------------------------------------------------------------------------------" << endl ; - cout << " kGAMMA: " - << setw(8) << counter[2][0] << setw(9) << counter[2][1] << setw(13) << counter[2][2] - << setw(15)<< counter[2][3] << setw(13) << counter[2][4] << endl ; - cout << " kGAMMAHA: " - << setw(8) << counter[3][0] << setw(9) << counter[3][1] << setw(13) << counter[3][2] - << setw(15)<< counter[3][3] << setw(13) << counter[3][4] << endl ; - cout << " kNEUTRALEM: " - << setw(8) << counter[0][0] << setw(9) << counter[0][1] << setw(13) << counter[0][2] - << setw(15)<< counter[0][3] << setw(13) << counter[0][4] << endl ; - cout << " kNEUTRALHA: " - << setw(8) << counter[1][0] << setw(9) << counter[1][1] << setw(13) << counter[1][2] - << setw(15)<< counter[1][3] << setw(13) << counter[1][4] << endl ; - cout << " kABSURDEM: " - << setw(8) << counter[4][0] << setw(9) << counter[4][1] << setw(13) << counter[4][2] - << setw(15)<< counter[4][3] << setw(13) << counter[4][4] << endl ; - cout << " kABSURDHA: " - << setw(8) << counter[5][0] << setw(9) << counter[5][1] << setw(13) << counter[5][2] - << setw(15)<< counter[5][3] << setw(13) << counter[5][4] << endl ; - cout << " kELECTRON: " - << setw(8) << counter[6][0] << setw(9) << counter[6][1] << setw(13) << counter[6][2] - << setw(15)<< counter[6][3] << setw(13) << counter[6][4] << endl ; - cout << " kCHARGEDHA: " - << setw(8) << counter[7][0] << setw(9) << counter[7][1] << setw(13) << counter[7][2] - << setw(15)<< counter[7][3] << setw(13) << counter[7][4] << endl ; - cout << "--------------------------------------------------------------------------------" << endl ; - + TString message ; + message = "Resolutions: Analyzed %d event(s)\n" ; + + message += " Primary: Photon Neutron Antineutron Charged hadron AntiProton\n" ; + message += "--------------------------------------------------------------------------------\n" ; + message += " kGAMMA: " ; + message += "%d %d %d %d %d\n" ; + message += " kGAMMAHA: " ; + message += "%d %d %d %d %d\n" ; + message += " kNEUTRALEM: " ; + message += "%d %d %d %d %d\n" ; + message += " kNEUTRALHA: " ; + message += "%d %d %d %d %d\n" ; + message += " kABSURDEM: "; + message += "%d %d %d %d %d\n" ; + message += " kABSURDHA: " ; + message += "%d %d %d %d %d\n" ; + message += " kELECTRON: " ; + message += "%d %d %d %d %d\n" ; + message += " kCHARGEDHA: " ; + message += "%d %d %d %d %d\n" ; + + message += "--------------------------------------------------------------------------------" ; + + Int_t totalInd = 0 ; for(i1 = 0; i1<8; i1++) for(i2 = 0; i2<5; i2++) totalInd+=counter[i1][i2] ; - cout << "Indentified particles: " << totalInd << endl ; + message += "Indentified particles: %d" ; + Info("Contamination", message.Data(), maxevent, + counter[2][0], counter[2][1], counter[2][2], counter[2][3], counter[2][4], + counter[3][0], counter[3][1], counter[3][2], counter[3][3], counter[3][4], + counter[0][0], counter[0][1], counter[0][2], counter[0][3], counter[0][4], + counter[1][0], counter[1][1], counter[1][2], counter[1][3], counter[1][4], + counter[4][0], counter[4][1], counter[4][2], counter[4][3], counter[4][4], + counter[5][0], counter[5][1], counter[5][2], counter[5][3], counter[5][4], + counter[6][0], counter[6][1], counter[6][2], counter[6][3], counter[6][4], + counter[7][0], counter[7][1], counter[7][2], counter[7][3], counter[7][4], + totalInd ) ; + } diff --git a/PHOS/AliPHOSCalibrationDB.cxx b/PHOS/AliPHOSCalibrationDB.cxx index 7c766ee4933..a988b0993f2 100644 --- a/PHOS/AliPHOSCalibrationDB.cxx +++ b/PHOS/AliPHOSCalibrationDB.cxx @@ -24,7 +24,6 @@ // --- ROOT system --- #include "TFile.h" // --- Standard library --- -#include #include // --- AliRoot header files --- @@ -86,7 +85,7 @@ void AliPHOSCalibrationDB::SetAll(Float_t pedestal, Float_t slope){ fSlopes->AddAt(slope,i); } else - cout << "Please, create me with non-default constructor!" << endl; + Warning("SetAll", "Please, create me with non-default constructor!") ; } //____________________________________________________________________________ void AliPHOSCalibrationDB::ReadCalibrationParameters(const char * filename, Option_t* opt){ @@ -94,7 +93,7 @@ void AliPHOSCalibrationDB::ReadCalibrationParameters(const char * filename, Opti if(strcmp(opt,"gains")==0){ //read gains if(!fctdb){ - cout << "Specify Connections Table Database first" << endl ; + Error("ReadCalibrationParameters", "Specify Connections Table Database first") ; return ; } ifstream gainfile(filename) ; @@ -108,7 +107,7 @@ void AliPHOSCalibrationDB::ReadCalibrationParameters(const char * filename, Opti else if(strstr(opt,"pedest")){ //read pedestals if(!fctdb){ - cout << "Specify Connections Table Database first" << endl ; + Error("ReadCalibrationParameters", "Specify Connections Table Database first") ; return ; } ifstream pfile(filename) ; @@ -120,9 +119,7 @@ void AliPHOSCalibrationDB::ReadCalibrationParameters(const char * filename, Opti pfile.close(); } else{ - cout << "Available options are " << endl ; - cout << " `gains' : to read gains " << endl ; - cout << " `pedestals : to read pedestals " << endl ; + Warning("ReadCalibrationParameters", "Available options are\n `gains' : to read gains\n `pedestals : to read pedestals ") ; } } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSClusterizer.cxx b/PHOS/AliPHOSClusterizer.cxx index 214f6a787a9..4aadfa7a031 100644 --- a/PHOS/AliPHOSClusterizer.cxx +++ b/PHOS/AliPHOSClusterizer.cxx @@ -28,7 +28,6 @@ #include "TTree.h" // --- Standard library --- -#include #include // --- AliRoot header files --- diff --git a/PHOS/AliPHOSClusterizer.h b/PHOS/AliPHOSClusterizer.h index 5cd8953610d..5e555d63b39 100644 --- a/PHOS/AliPHOSClusterizer.h +++ b/PHOS/AliPHOSClusterizer.h @@ -13,7 +13,6 @@ #include "TTask.h" // --- Standard library --- -#include // --- AliRoot header files --- @@ -27,31 +26,31 @@ public: AliPHOSClusterizer(const char * headerFile, const char * name, const Bool_t toSplit) ; virtual ~AliPHOSClusterizer() ; // dtor - virtual Float_t GetEmcClusteringThreshold()const {cout << "Not Defined" << endl ; return 0. ; } - virtual Float_t GetEmcLocalMaxCut()const {cout << "Not Defined" << endl ; return 0. ; } - virtual Float_t GetEmcLogWeight()const {cout << "Not Defined" << endl ; return 0. ; } - virtual Float_t GetEmcTimeGate() const {cout << "Not Defined" << endl ; return 0. ; } ; - virtual Float_t GetCpvClusteringThreshold()const {cout << "Not Defined" << endl ; return 0. ; } - virtual Float_t GetCpvLocalMaxCut()const {cout << "Not Defined" << endl ; return 0. ; } - virtual Float_t GetCpvLogWeight()const {cout << "Not Defined" << endl ; return 0. ; } - virtual const char * GetRecPointsBranch() const {cout << "Not Defined" << endl ; return 0 ; } ; - virtual const Int_t GetRecPointsInRun() const {cout << "Not Defined" << endl ; return 0 ; } - virtual const char * GetDigitsBranch() const{cout << "Not Defined" << endl ; return 0 ; } ; - - virtual void MakeClusters() {cout << "Not Defined" << endl ; } - virtual void Print(Option_t * option)const {cout << "Not Defined" << endl ; } - - virtual void SetEmcClusteringThreshold(Float_t cluth) {cout << "Not Defined" << endl ; } - virtual void SetEmcLocalMaxCut(Float_t cut) {cout << "Not Defined" << endl ; } - virtual void SetEmcLogWeight(Float_t w) {cout << "Not Defined" << endl ; } - virtual void SetEmcTimeGate(Float_t gate) {cout << "Not Defined" << endl ; } - virtual void SetCpvClusteringThreshold(Float_t cluth) {cout << "Not Defined" << endl ; } - virtual void SetCpvLocalMaxCut(Float_t cut) {cout << "Not Defined" << endl ; } - virtual void SetCpvLogWeight(Float_t w) {cout << "Not Defined" << endl ; } - virtual void SetDigitsBranch(const char * title) {cout << "Not Defined" << endl ; } - virtual void SetRecPointsBranch(const char *title) {cout << "Not Defined" << endl ; } - virtual void SetUnfolding(Bool_t toUnfold ){cout << "Not Defined" << endl ;} - virtual const char * Version() const {cout << "Not Defined" << endl ; return 0 ; } + virtual Float_t GetEmcClusteringThreshold()const {Warning("GetEmcClusteringThreshold", "Not Defined" ) ; return 0. ; } + virtual Float_t GetEmcLocalMaxCut()const {Warning("GetEmcLocalMaxCut", "Not Defined" ) ; return 0. ; } + virtual Float_t GetEmcLogWeight()const {Warning("GetEmcLogWeight", "Not Defined" ) ; return 0. ; } + virtual Float_t GetEmcTimeGate() const {Warning("GetEmcTimeGate", "Not Defined" ) ; return 0. ; } ; + virtual Float_t GetCpvClusteringThreshold()const {Warning("GetCpvClusteringThreshold", "Not Defined" ) ; return 0. ; } + virtual Float_t GetCpvLocalMaxCut()const {Warning("GetCpvLocalMaxCut", "Not Defined" ) ; return 0. ; } + virtual Float_t GetCpvLogWeight()const {Warning("GetCpvLogWeight", "Not Defined" ) ; return 0. ; } + virtual const char * GetRecPointsBranch() const {Warning("GetRecPointsBranch", "Not Defined" ) ; return 0 ; } ; + virtual const Int_t GetRecPointsInRun() const {Warning("GetRecPointsInRun", "Not Defined" ) ; return 0 ; } + virtual const char * GetDigitsBranch() const{Warning("GetDigitsBranch", "Not Defined" ) ; return 0 ; } ; + + virtual void MakeClusters() {Warning("MakeClusters", "Not Defined" ) ; } + virtual void Print(Option_t * option)const {Warning("Print", "Not Defined" ) ; } + + virtual void SetEmcClusteringThreshold(Float_t cluth) {Warning("SetEmcClusteringThreshold", "Not Defined" ) ; } + virtual void SetEmcLocalMaxCut(Float_t cut) {Warning("SetEmcLocalMaxCut", "Not Defined" ) ; } + virtual void SetEmcLogWeight(Float_t w) {Warning("SetEmcLogWeight", "Not Defined" ) ; } + virtual void SetEmcTimeGate(Float_t gate) {Warning("SetEmcTimeGate", "Not Defined" ) ; } + virtual void SetCpvClusteringThreshold(Float_t cluth) {Warning("SetCpvClusteringThreshold", "Not Defined" ) ; } + virtual void SetCpvLocalMaxCut(Float_t cut) {Warning("SetCpvLocalMaxCut", "Not Defined" ) ; } + virtual void SetCpvLogWeight(Float_t w) {Warning("SetCpvLogWeight", "Not Defined" ) ; } + virtual void SetDigitsBranch(const char * title) {Warning("SetDigitsBranch", "Not Defined" ) ; } + virtual void SetRecPointsBranch(const char *title) {Warning("SetRecPointsBranch", "Not Defined" ) ; } + virtual void SetUnfolding(Bool_t toUnfold ){Warning("SetUnfolding", "Not Defined" ) ;} + virtual const char * Version() const {Warning("Version", "Not Defined" ) ; return 0 ; } protected: diff --git a/PHOS/AliPHOSClusterizerv1.cxx b/PHOS/AliPHOSClusterizerv1.cxx index 7b46e720d4a..ec168fd5c6d 100644 --- a/PHOS/AliPHOSClusterizerv1.cxx +++ b/PHOS/AliPHOSClusterizerv1.cxx @@ -68,9 +68,6 @@ // --- Standard library --- -#include -#include - // --- AliRoot header files --- #include "AliPHOSCalibrationDB.h" #include "AliPHOSClusterizerv1.h" @@ -180,12 +177,10 @@ void AliPHOSClusterizerv1::Exec(Option_t * option) if(strstr(option,"tim")){ gBenchmark->Stop("PHOSClusterizer"); - cout << "AliPHOSClusterizer:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSClusterizer") << " seconds for Clusterizing " - << gBenchmark->GetCpuTime("PHOSClusterizer")/nevents << " seconds per event " << endl ; - cout << endl ; + Info("Exec", " took %f seconds for Clusterizing %f seconds per event \n", + gBenchmark->GetCpuTime("PHOSClusterizer"), + gBenchmark->GetCpuTime("PHOSClusterizer")/nevents ) ; } - } //____________________________________________________________________________ @@ -236,19 +231,19 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** gMinuit->mnparm(index, "x", x, 0.1, 0, 0, ierflg) ; index++ ; if(ierflg != 0){ - cout << "PHOS Unfolding> Unable to set initial value for fit procedure : x = " << x << endl ; + Warning("FindFit", "PHOS Unfolding unable to set initial value for fit procedure : x = %f\n", x ) ; return kFALSE; } gMinuit->mnparm(index, "z", z, 0.1, 0, 0, ierflg) ; index++ ; if(ierflg != 0){ - cout << "PHOS Unfolding> Unable to set initial value for fit procedure : z = " << z << endl ; + Warning("FindFit", "PHOS Unfolding unable to set initial value for fit procedure : z =%f\n", z ) ; return kFALSE; } gMinuit->mnparm(index, "Energy", energy , 0.05*energy, 0., 4.*energy, ierflg) ; index++ ; if(ierflg != 0){ - cout << "PHOS Unfolding> Unable to set initial value for fit procedure : energy = " << energy << endl ; + Warning("FindFit", "PHOS Unfolding unable to set initial value for fit procedure : energy = %f\n", energy ) ; return kFALSE; } } @@ -266,7 +261,7 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** gMinuit->mnexcm("MIGRAD", &p0, 0, ierflg) ; // minimize if(ierflg == 4){ // Minimum not found - cout << "PHOS Unfolding> Fit not converged, cluster abandoned "<< endl ; + Warning("FindFit", "PHOS Unfolding fit not converged, cluster abandoned\n" ); return kFALSE ; } for(index = 0; index < nPar; index++){ @@ -315,7 +310,7 @@ void AliPHOSClusterizerv1::Init() AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(),branchname.Data(), fToSplit ) ; if ( gime == 0 ) { - cerr << "ERROR: AliPHOSClusterizerv1::Init -> Could not obtain the Getter object !" << endl ; + Error("Init", "Could not obtain the Getter object !") ; return ; } @@ -559,8 +554,7 @@ void AliPHOSClusterizerv1::MakeClusters() TClonesArray * digits = gime->Digits() ; if ( !digits ) { - cerr << "ERROR: AliPHOSClusterizerv1::MakeClusters -> Digits with name " - << GetName() << " not found ! " << endl ; + Error("MakeClusters", "Digits with name %s not found !") ; abort() ; } TClonesArray * digitsC = (TClonesArray*)digits->Clone() ; @@ -974,35 +968,45 @@ void AliPHOSClusterizerv1::Print(Option_t * option)const { // Print clusterizer parameters - if( strcmp(GetName(), "") !=0 ){ - + TString message ; + TString taskName(GetName()) ; + taskName.ReplaceAll(Version(), "") ; + + if( strcmp(GetName(), "") !=0 ) { // Print parameters - - TString taskName(GetName()) ; - taskName.ReplaceAll(Version(), "") ; - - cout << "---------------"<< taskName.Data() << " " << GetTitle()<< "-----------" << endl - << "Clusterizing digits from the file: " << taskName.Data() << endl - << " Branch: " << GetName() << endl - << endl - << " EMC Clustering threshold = " << fEmcClusteringThreshold << endl - << " EMC Local Maximum cut = " << fEmcLocMaxCut << endl - << " EMC Logarothmic weight = " << fW0 << endl - << endl - << " CPV Clustering threshold = " << fCpvClusteringThreshold << endl - << " CPV Local Maximum cut = " << fCpvLocMaxCut << endl - << " CPV Logarothmic weight = " << fW0CPV << endl - << endl ; + message = "\n--------------- %s %s -----------\n" ; + message += "Clusterizing digits from the file: %s\n" ; + message += " Branch: %s\n" ; + message += " EMC Clustering threshold = %f\n" ; + message += " EMC Local Maximum cut = %f\n" ; + message += " EMC Logarothmic weight = %f\n" ; + message += " CPV Clustering threshold = %f\n" ; + message += " CPV Local Maximum cut = %f\n" ; + message += " CPV Logarothmic weight = %f\n" ; if(fToUnfold) - cout << " Unfolding on " << endl ; + message += " Unfolding on\n" ; else - cout << " Unfolding off " << endl ; + message += " Unfolding off\n" ; - cout << "------------------------------------------------------------------" <EmcRecPoints(BranchName()) ; TObjArray * cpvRecPoints = AliPHOSGetter::GetInstance()->CpvRecPoints(BranchName()) ; - cout << "AliPHOSClusterizerv1: : event "<GetEvNumber() << endl ; - cout << " Found "<< emcRecPoints->GetEntriesFast() << " EMC Rec Points and " - << cpvRecPoints->GetEntriesFast() << " CPV RecPoints" << endl ; - + TString message ; + message = "event %d\n" ; + message += " Found %d EMC RecPoints and %d CPV RecPoints \n" ; + Info("PrintRecPoints", message.Data(), + gAlice->GetEvNumber(), + emcRecPoints->GetEntriesFast(), + cpvRecPoints->GetEntriesFast() ) ; + fRecPointsInRun += emcRecPoints->GetEntriesFast() ; fRecPointsInRun += cpvRecPoints->GetEntriesFast() ; - + if(strstr(option,"all")) { - cout << "EMC clusters " << endl ; - cout << " Index Ene(MeV) Multi Module X Y Z Lambda 1 Lambda 2 # of prim Primaries list " << endl; - + message = "EMC clusters " ; + message += " Index Ene(MeV) Multi Module X Y Z Lambda 1 Lambda 2 # of prim Primaries list " ; + Info("PrintRecPoints", message.Data() ) ; Int_t index ; for (index = 0 ; index < emcRecPoints->GetEntries() ; index++) { AliPHOSEmcRecPoint * rp = (AliPHOSEmcRecPoint * )emcRecPoints->At(index) ; @@ -1032,57 +1040,52 @@ void AliPHOSClusterizerv1::PrintRecPoints(Option_t * option) Int_t * primaries; Int_t nprimaries; primaries = rp->GetPrimaries(nprimaries); - - cout << setw(4) << rp->GetIndexInList() << " " - << setw(7) << setprecision(3) << rp->GetEnergy() << " " - << setw(3) << rp->GetMultiplicity() << " " - << setw(1) << rp->GetPHOSMod() << " " - << setw(6) << setprecision(2) << locpos.X() << " " - << setw(6) << setprecision(2) << locpos.Y() << " " - << setw(6) << setprecision(2) << locpos.Z() << " " - << setw(4) << setprecision(2) << lambda[0] << " " - << setw(4) << setprecision(2) << lambda[1] << " " - << setw(2) << nprimaries << " " ; + message = " %d %f %d %f %f %f %f %f %d\n" ; + Info("PrintRecPoints", message.Data(), + rp->GetIndexInList(), + rp->GetEnergy(), + rp->GetMultiplicity(), + rp->GetPHOSMod(), + locpos.X(), + locpos.Y(), + locpos.Z(), + lambda[0], + lambda[1], + nprimaries ) ; - for (Int_t iprimary=0; iprimaryGetEntries() ; index++) { AliPHOSRecPoint * rp = (AliPHOSRecPoint * )cpvRecPoints->At(index) ; - cout << setw(6) << rp->GetIndexInList() << " "; - cout << setw(6) << rp->GetPHOSMod() << " CPV "; - + TVector3 locpos; rp->GetLocalPosition(locpos); - cout << setw(6) << locpos.X() << " "; - cout << setw(6) << locpos.Y() << " "; - cout << setw(6) << locpos.Z() << " "; - + Int_t * primaries; Int_t nprimaries ; + + message = " %d %d CPV %f %f %f %d" ; + Info("PrintRecPoints", message.Data(), + rp->GetIndexInList(), + rp->GetPHOSMod(), + locpos.X(), + locpos.Y(), + locpos.Z(), + nprimaries) ; + primaries = rp->GetPrimaries(nprimaries); - cout << setw(6) << nprimaries << " "; - - for (Int_t iprimary=0; iprimary -#include // --- AliRoot header files --- #include "AliPHOSClusterizerv2.h" @@ -62,9 +60,9 @@ void AliPHOSClusterizerv2::Exec(Option_t* option) // if(!ReadDigits(ievent)) //reads digits for event fEvent // continue; - cout<<" MakeClusters invoked.."; + Info("Exec", "MakeClusters invoked..") ; MakeClusters() ; - cout<<" done."<Remove(recCpv); delete recCpv; - cout<<" "<CpvRecPoints()->GetEntries()<GetEntries()<<" cpvRecPoints."<CpvRecPoints()->GetEntries() ) ; + Info("Exec", " %d cpvRecPoints", cpvRecPoints->GetEntries() ) ; // Now Emc reconstruction @@ -132,13 +130,20 @@ void AliPHOSClusterizerv2::Exec(Option_t* option) wPoolF->Remove(recEmc); delete recEmc; - cout<<" "<CpvRecPoints()->GetEntries()<GetEntries()<<" cpvRecPoints."<EmcRecPoints()->GetEntries()<GetEntries()<<" emcRecPoints."<CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(), + nOldEmc, + gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() ) ; WriteRecPoints(ievent); @@ -147,12 +152,8 @@ void AliPHOSClusterizerv2::Exec(Option_t* option) if(strstr(option,"tim")) { gBenchmark->Stop("PHOSClusterizer"); - cout << "AliPHOSClusterizer:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSClusterizer") << " seconds for Clusterizing " << endl; - cout << endl ; - + Info("Exec","took %f seconds for Clusterizing", gBenchmark->GetCpuTime("PHOSClusterizer") ) ; } - } //--------------------------------------------------------------------------------- Int_t AliPHOSClusterizerv2::AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) const diff --git a/PHOS/AliPHOSConTableDB.cxx b/PHOS/AliPHOSConTableDB.cxx index c6dd74e780b..2011f94ce98 100644 --- a/PHOS/AliPHOSConTableDB.cxx +++ b/PHOS/AliPHOSConTableDB.cxx @@ -26,7 +26,7 @@ #include "TH2S.h" // --- Standard library --- -#include + // --- AliRoot header files --- #include "AliPHOSGeometry.h" #include "AliPHOSConTableDB.h" @@ -73,8 +73,7 @@ void AliPHOSConTableDB::BuildDB(void) //assuming, that prototype is centered in the third module of the PHOS fNcrInProto =fProtoRaws*fProtoColumns ; if(!fNcrInProto){ - cout << "configuratio of prototype is not known!!!" << endl ; - cout << "specify number of raws and columns in prototype" << endl ; + Error("BuildDB", "configuratio of prototype is not known!!!\n Specify number of raws and columns in prototype") ; return ; } fRawOffset = (fGeom->GetNPhi() - fProtoRaws)/2 ; @@ -148,17 +147,23 @@ Int_t AliPHOSConTableDB::Raw2AbsId(Int_t rawId){ //____________________________________________________________________________ void AliPHOSConTableDB::Print(Option_t * option)const { - cout << GetName() << " " << GetTitle() << endl ; - cout << "PHOS Geometry configured for " ; + TString message ; + message = " %s %s\n" ; + message += "PHOS Geometry configured for " ; if(fGeom) - cout << fGeom->GetName() << " " << fGeom->GetTitle() << endl ; + message += "%s %s \n" ; else - cout << " null " << endl ; - cout << "-------Prototype parameters--------" << endl ; - cout << " number of columns: " << fProtoColumns << endl ; - cout << " number of raws: " << fProtoRaws << endl ; - cout << " centered in third PHOS module with offsets: " <GetNPhi() << endl ; - cout << " col: " << fColOffset << " of " << fGeom->GetNZ() << endl ; - cout << "------------------------------------" << endl ; + message += " null \n" ; + + Info("Print", message.Data(), GetName(), GetTitle(), fGeom->GetName(), fGeom->GetTitle() ) ; + + message = "-------Prototype parameters--------\n" ; + message += " number of columns: %d" ; + message += " number of raws: %d" ; + message += " centered in third PHOS module with offsets: " ; + message += " raw: %d of %d\n" ; + message += " col: %d of %d\n" ; + message += "------------------------------------" ; + + Info("Print", message.Data(), fProtoColumns, fProtoRaws, fRawOffset, fGeom->GetNPhi(), fColOffset,fGeom->GetNZ() ); } diff --git a/PHOS/AliPHOSCpvRecPoint.cxx b/PHOS/AliPHOSCpvRecPoint.cxx index d5acafb9d7c..0aa12cb5cb7 100644 --- a/PHOS/AliPHOSCpvRecPoint.cxx +++ b/PHOS/AliPHOSCpvRecPoint.cxx @@ -31,8 +31,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSCpvRecPoint.h" @@ -285,8 +283,8 @@ void AliPHOSCpvRecPoint::EvalLocalPosition(Float_t logWeight,TClonesArray * digi } else { x = -1e6 ; z = -1e6 ; - if (fMulDigit != 0) cout << "AliPHOSCpvRecPoint: too low log weight factor " - << "to evaluate cluster's center\n"; + if (fMulDigit != 0) + Warning(":EvalLocalPosition", "Too low log weight factor to evaluate cluster's center" ) ; } fLocPos.SetX(x) ; fLocPos.SetY(0.) ; @@ -349,22 +347,24 @@ void AliPHOSCpvRecPoint::Print(Option_t * option) { // Print the list of digits belonging to the cluster - cout << "AliPHOSCpvRecPoint: " << endl ; - + TString message ; + message = "AliPHOSCpvRecPoint: " ; + message += "Digits # " ; + Info("Print", message.Data()) ; + Int_t iDigit; - cout << "Digits # " ; for(iDigit=0; iDigitIsInitialized() ) - cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << GetGeometry()->GetName() << endl ; + Info("AliPHOSv1", "AliPHOS %d : PHOS geometry intialized for %s", Version(), GetGeometry()->GetName() ); else - cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ; + Info("AliPHOSv1", "AliPHOS %d : PHOS geometry initialization failed !", Version() ) ; // Defining the PHOS Reconstructioner @@ -289,7 +289,7 @@ void AliPHOSv1::SDigits2Digits() //we assume, that there is al least one EMC digit... if(fSDigits->GetEntries() == 0) { - cout << "PHOS::SDigits2Digits> No SDigits !!! Do not produce Digits " << endl ; + Warning("SDigits2Digits", "No SDigits !!! Do not produce Digits ") ; return ; } @@ -722,8 +722,6 @@ void AliPHOSv1::CPVDigitize (TLorentzVector p, Float_t *zxhit, Int_t moduleNumbe Float_t pNorm = p.Py(); Float_t eloss = kdEdx; -// cout << "CPVDigitize: YVK : "<GetCPVGasThickness(); Float_t dXY = pX/pNorm * GetGeometry()->GetCPVGasThickness(); gRandom->Rannor(rnor1,rnor2); diff --git a/PHOS/AliPHOSDigit.cxx b/PHOS/AliPHOSDigit.cxx index dd21e808984..6e69b62886e 100644 --- a/PHOS/AliPHOSDigit.cxx +++ b/PHOS/AliPHOSDigit.cxx @@ -28,8 +28,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSDigit.h" @@ -178,7 +176,7 @@ AliPHOSDigit& AliPHOSDigit::operator+(AliPHOSDigit const & digit) fPrimary[fNprimary] = (digit.fPrimary)[index] ; fNprimary++ ; if(fNprimary>fNMaxPrimary) { - cout << "AliPHOSDigit >> Increase NMaxPrimary "<< endl ; + Error("Operator +", "Increase NMaxPrimary") ; return *this ; } } @@ -192,11 +190,12 @@ ostream& operator << ( ostream& out , const AliPHOSDigit & digit) { // Prints the data of the digit - out << "ID " << digit.fId << " Energy = " << digit.fAmp << " Time = " << digit.fTime << endl ; - Int_t i ; - for(i=0;i // --- AliRoot header files --- #include "AliRun.h" @@ -166,7 +165,7 @@ void AliPHOSDigitizer::Digitize(const Int_t event) // get first the sdigitizer from the tasks list (must have same name as the digitizer) const AliPHOSSDigitizer * sDigitizer = gime->SDigitizer(GetName()); if ( !sDigitizer) { - cerr << "ERROR: AliPHOSDigitizer::Digitize -> SDigitizer with name " << GetName() << " not found " << endl ; + Error("Digitize", "SDigitizer with name %s not found", GetName() ) ; abort() ; } @@ -181,8 +180,7 @@ void AliPHOSDigitizer::Digitize(const Int_t event) if ( (sdigits = (TClonesArray*)folder->FindObject(GetName()) ) ) { TString fileName(folder->GetName()) ; fileName.ReplaceAll("_","/") ; -// cout << "INFO: AliPHOSDigitizer::Digitize -> Adding SDigits " -// << GetName() << " from " << fileName << endl ; +// Info("Digitize", "Adding SDigits %s from %s", GetName(), fileName() ) ; sdigArray->AddAt(sdigits, input) ; input++ ; } @@ -416,13 +414,11 @@ void AliPHOSDigitizer::Exec(Option_t *option) } if ( phosfound ) { - cerr << "WARNING: AliPHOSDigitizer -> Digits branch with name " << GetName() - << " already exits" << endl ; + Error("Exec", "Digits branch with name %s already exists", GetName() ) ; return ; } if ( digitizerfound ) { - cerr << "WARNING: AliPHOSDigitizer -> Digitizer branch with name " << GetName() - << " already exits" << endl ; + Error("Exec", "Digitizer branch with name %s already exists", GetName() ); return ; } } @@ -443,7 +439,7 @@ void AliPHOSDigitizer::Exec(Option_t *option) for(input = 0 ; input < fManager->GetNinputs(); input ++){ TTree * treeS = fManager->GetInputTreeS(input) ; if(!treeS){ - cerr << "AliPHOSDigitizer::Exec -> No Input " << endl ; + Error("Exec", "No Input") ; return ; } gime->ReadTreeS(treeS,input) ; @@ -466,12 +462,12 @@ void AliPHOSDigitizer::Exec(Option_t *option) if(strstr(option,"tim")){ gBenchmark->Stop("PHOSDigitizer"); - cout << "AliPHOSDigitizer:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSDigitizer") << " seconds for Digitizing " - << gBenchmark->GetCpuTime("PHOSDigitizer")/nevents << " seconds per event " << endl ; - cout << endl ; - } - + TString message ; + message = " took %f seconds for Digitizing %f seconds per event\n" ; + Info("Exec", message.Data(), + gBenchmark->GetCpuTime("PHOSDigitizer"), + gBenchmark->GetCpuTime("PHOSDigitizer")/nevents ); + } } //____________________________________________________________________________ @@ -504,7 +500,7 @@ Bool_t AliPHOSDigitizer::Init() AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), GetName(), fToSplit) ; if ( gime == 0 ) { - cerr << "ERROR: AliPHOSDigitizer::Init -> Could not obtain the Getter object !" << endl ; + Error("Init", "Could not obtain the Getter object !") ; return kFALSE; } @@ -590,7 +586,7 @@ void AliPHOSDigitizer::MixWith(const char* headerFile) Init() ; if(fManager){ - cout << "Can not use this method under AliRunDigitizer " << endl ; + Warning("MixWith", "Can not use this method under AliRunDigitizer\n" ) ; return ; } @@ -605,10 +601,10 @@ void AliPHOSDigitizer::MixWith(const char* headerFile) path += "/" ; path += GetName() ; if ( gROOT->FindObjectAny(path.Data()) ) { - cerr << "WARNING: AliPHOSDigitizer::MixWith -> Entry already exists, do not add" << endl ; + Warning("MixWith", "Entry already exists, do not add\n" ) ; return; } - + gime->PostSDigits(GetName(),headerFile) ; // check if the requested file is already open or exist and if SDigits Branch exist @@ -616,114 +612,131 @@ void AliPHOSDigitizer::MixWith(const char* headerFile) if ( !file ) { file = new TFile(headerFile, "READ") ; if (!file) { - cerr << "ERROR: AliPHOSDigitizer::MixWith -> File " << headerFile << " does not exist!" << endl ; + Error("MixWith", "File %s does not exist\n", headerFile ); return ; } } - } //__________________________________________________________________ -void AliPHOSDigitizer::Print(Option_t* option)const { +void AliPHOSDigitizer::Print(Option_t* option)const +{ // Print Digitizer's parameters if( strcmp(GetName(), "") != 0 ){ - - cout << "------------------- "<< GetName() << " -------------" << endl ; + TString message("\n-------------------") ; + message += GetName() ; + message += "-------------\n" ; const Int_t nStreams = GetNInputStreams() ; if (nStreams) { Int_t index = 0 ; - for (index = 0 ; index < nStreams ; index++) - cout << "Adding SDigits " << GetName() << " from " << fManager->GetInputFileName(index, 0) << endl ; - - cout << endl ; - cout << "Writing digits to " << fManager->GetInputFileName(0, 0) << endl ; + for (index = 0 ; index < nStreams ; index++) { + message += "Adding SDigits " ; + message += GetName() ; + message += "from " ; + message += fManager->GetInputFileName(index, 0) ; + } + message += "\nWriting digits to " ; + message += fManager->GetInputFileName(0, 0) ; } else { -// AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; -// gime->Folder("sdigits") ; -// cout << "Digitizing sDigits from file(s): " <Folder("sdigits")->GetListOfFolders() ; -// TIter next(folderslist) ; -// TFolder * folder = 0 ; + // AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; + // gime->Folder("sdigits") ; + // TCollection * folderslist = gime->Folder("sdigits")->GetListOfFolders() ; + // TIter next(folderslist) ; + // TFolder * folder = 0 ; -// while ( (folder = (TFolder*)next()) ) { -// if ( folder->FindObject(GetName()) ) - // cout << "Adding SDigits " << GetName() << " from " << GetSDigitsFileName() << endl ; -// } - cout << endl ; - cout << "Writing digits to " << GetTitle() << endl ; + // while ( (folder = (TFolder*)next()) ) { + // if ( folder->FindObject(GetName()) ) + // } + message += "\nWriting digits to " ; + message += GetTitle() ; } - cout << endl ; - cout << "With following parameters: " << endl ; - cout << " Electronics noise in EMC (fPinNoise) = " << fPinNoise << endl ; - cout << " Threshold in EMC (fEMCDigitThreshold) = " << fEMCDigitThreshold << endl ; ; - cout << " Noise in CPV (fCPVNoise) = " << fCPVNoise << endl ; - cout << " Threshold in CPV (fCPVDigitThreshold) = " << fCPVDigitThreshold << endl ; - cout << "---------------------------------------------------" << endl ; + message += "\nWith following parameters:\n" ; + message += " Electronics noise in EMC (fPinNoise) = %f\n" ; + message += " Threshold in EMC (fEMCDigitThreshold) = %f\n" ; + message += " Noise in CPV (fCPVNoise) = %f\n" ; + message += " Threshold in CPV (fCPVDigitThreshold) = %f\n" ; + message += "---------------------------------------------------\n" ; + Info("Print", message.Data(), + fPinNoise, + fEMCDigitThreshold, + fCPVNoise, + fCPVDigitThreshold ) ; } else - cout << "AliPHOSDigitizer not initialized " << endl ; + Info("Print", "AliPHOSDigitizer not initialized\n" ) ; } - + //__________________________________________________________________ -void AliPHOSDigitizer::PrintDigits(Option_t * option){ - // Print a table of digits - - AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; - TClonesArray * digits = gime->Digits() ; - - cout << "AliPHOSDigitiser: event " << gAlice->GetEvNumber() << endl ; - cout << " Number of entries in Digits list " << digits->GetEntriesFast() << endl ; - cout << endl ; - if(strstr(option,"all")||strstr(option,"EMC")){ + void AliPHOSDigitizer::PrintDigits(Option_t * option) +{ + // Print a table of digits + + AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; + TClonesArray * digits = gime->Digits() ; + + TString message ; + message = "event %d\n" ; + message += " Number of entries in Digits list %d\n" ; + Info("Print", message.Data(), gAlice->GetEvNumber(), digits->GetEntriesFast() ) ; + if(strstr(option,"all")||strstr(option,"EMC")){ //loop over digits AliPHOSDigit * digit; - cout << "EMC digits (with primaries): " << endl ; - cout << "Digit Id Amplitude Index Nprim Primaries list " << endl; + message = "EMC digits (with primaries):\n" ; + message += "Digit Id Amplitude Index Nprim Primaries list\n" ; + Info("Print", message.Data()) ; Int_t maxEmc = gime->PHOSGeometry()->GetNModules()*gime->PHOSGeometry()->GetNCristalsInModule() ; Int_t index ; for (index = 0 ; (index < digits->GetEntriesFast()) && (((AliPHOSDigit * ) digits->At(index))->GetId() <= maxEmc) ; index++) { digit = (AliPHOSDigit * ) digits->At(index) ; - if(digit->GetNprimary() == 0) continue; - cout << setw(6) << digit->GetId() << " " << setw(10) << digit->GetAmp() << " " - << setw(6) << digit->GetIndexInList() << " " - << setw(5) << digit->GetNprimary() <<" "; + if(digit->GetNprimary() == 0) + continue; + message = " %d %d %d %d\n" ; + Info("Print", message.Data(), + digit->GetId(), + digit->GetAmp(), + digit->GetIndexInList(), + digit->GetNprimary() ) ; Int_t iprimary; - for (iprimary=0; iprimaryGetNprimary(); iprimary++) - cout << setw(5) << digit->GetPrimary(iprimary+1) << " "; - cout << endl; - } - cout << endl; + for (iprimary=0; iprimaryGetNprimary(); iprimary++) { + message = " %d\n" ; + Info("Print", message.Data(), digit->GetPrimary(iprimary+1) ) ; + } + } } if(strstr(option,"all")||strstr(option,"CPV")){ //loop over CPV digits AliPHOSDigit * digit; - cout << "CPV digits: " << endl ; - cout << "Digit Id Amplitude Index Nprim Primaries list " << endl; + message = "CPV digits:\n" ; + message += "Digit Id Amplitude Index Nprim Primaries list\n" ; + Info("Print", message.Data()) ; Int_t maxEmc = gime->PHOSGeometry()->GetNModules()*gime->PHOSGeometry()->GetNCristalsInModule() ; Int_t index ; for (index = 0 ; index < digits->GetEntriesFast(); index++) { digit = (AliPHOSDigit * ) digits->At(index) ; if(digit->GetId() > maxEmc){ - cout << setw(6) << digit->GetId() << " " << setw(10) << digit->GetAmp() << " " - << setw(6) << digit->GetIndexInList() << " " - << setw(5) << digit->GetNprimary() <<" "; + message = " %d %d %d %d\n" ; + Info("Print", message.Data(), + digit->GetId(), + digit->GetAmp(), + digit->GetIndexInList(), + digit->GetNprimary() ) ; Int_t iprimary; - for (iprimary=0; iprimaryGetNprimary(); iprimary++) - cout << setw(5) << digit->GetPrimary(iprimary+1) << " "; - cout << endl; - } + for (iprimary=0; iprimaryGetNprimary(); iprimary++) { + message = " %d\n" ; + Info("Print", message.Data(), digit->GetPrimary(iprimary+1) ) ; + } + } } } - } //__________________________________________________________________ diff --git a/PHOS/AliPHOSEmcRecPoint.cxx b/PHOS/AliPHOSEmcRecPoint.cxx index a74c4e4703c..ef96e42f750 100644 --- a/PHOS/AliPHOSEmcRecPoint.cxx +++ b/PHOS/AliPHOSEmcRecPoint.cxx @@ -30,8 +30,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliGenerator.h" @@ -660,28 +658,29 @@ void AliPHOSEmcRecPoint::Print(Option_t * option) { // Print the list of digits belonging to the cluster - cout << "AliPHOSEmcRecPoint: " << endl ; + TString message ; + message = "AliPHOSEmcRecPoint:\n" ; + message += " digits # = " ; + Info("Print", message.Data()) ; Int_t iDigit; - cout << " digits # = " ; for(iDigit=0; iDigit ClassImp(AliPHOSEvalRecPoint) @@ -36,7 +35,7 @@ AliPHOSEvalRecPoint::AliPHOSEvalRecPoint(Bool_t cpv, AliPHOSEvalRecPoint* parent // fParent=parent; TObjArray* wPool = (TObjArray*)GetWorkingPool(); if(!wPool) { - cout<<" Couldn't find working pool. Exit."<FindObject("WhiteBoard/RecPoints/PHOS/SmP"); AliPHOSClusterizer* clu = (AliPHOSClusterizer*)wPoolF->FindObject("PHOS:clu-v1"); if(!clu) { - cout<<" Couldn't find Clusterizer. Exit."<AG(e1c,dx1,dy1,a1,gx1,gy1); Float_t dx2 = x2c - ix; Float_t dy2 = y2c - iy; -// cout<<" "<<" dx2 "<AG(e2c,dx2,dy2,a2,gx2,gy2); @@ -490,8 +489,8 @@ void AliPHOSEvalRecPoint::TwoGam(Float_t* gamma1, Float_t* gamma2) loop20: ; Float_t step = st*gr; - - cout<<" Iteration "<AG(eMax,dz,dx,single_shower_gain,gxMax,gyMax); Float_t total_gain = eFit[iDigit]; Float_t ratio = single_shower_gain/total_gain; -// cout<<" ratio -> "<AddDigit(*digit,eDigit); } - - cout<<"======= Split: daughter rec point "<Print(""); } delete[] eFit; - cout<AG(E,dx,dy,A,gx,gy); Float_t dd; - cout<<" (ix iy xc yc dx dy) "<OneGamChi2(A,eDigit,E,dd); // Exclude digit with too large chisquare. @@ -721,7 +721,7 @@ void AliPHOSEvalRecPoint::EvaluatePosition() Float_t grc = TMath::Sqrt(grxc*grxc + gryc*gryc); if(grc<1.e-10) grc=1.e-10; Float_t sc = 1. + chisqc/chisq; - cout<<" chisq: "<chisq) goto loop20; @@ -740,8 +740,8 @@ void AliPHOSEvalRecPoint::EvaluatePosition() loop20: ; Float_t step = st*gr; - - cout<<" Iteration "<GetLocalPosition(pos); -// cout<<" (x,z)[old] = ("<KillGamMinEnergy(); if(GetEnergy()Print(""); - cout<<"+++++++ and point 2: ++++++++++"<Print(""); //merge two rec. points @@ -868,7 +865,7 @@ void AliPHOSEvalRecPoint::MergeClosePoint() RemoveFromWorkingPool(rp); delete rp; - cout<<"++++++ Resulting point: ++++++++"<Print(""); break; @@ -897,7 +894,7 @@ Int_t AliPHOSEvalRecPoint::UnfoldLocalMaxima() // AliPHOSClusterizer* clusterizer = fGetter->Clusterizer("PHOSclu-v1"); AliPHOSClusterizer* clusterizer = GetClusterizer(); if(!clusterizer) { - cout<<" Cannot get clusterizer. Exit."<AG(eMax,dz,dx,single_shower_gain,gxMax,gyMax); Float_t total_gain = eFit[iDigit]; Float_t ratio = single_shower_gain/total_gain; - cout<<" ratio -> "< %f", ratio) ; eDigit = eDigit*ratio; newRP->AddDigit(*digit,eDigit); } } newRP->EvalLocalPosition(LogWeight,digits); - cout<<"======= Unfold: daughter rec point "<Print(""); } // RemoveFromWorkingPool(this); delete[] eFit; - cout<FindObject("WhiteBoard/RecPoints/PHOS/SmP"); AliPHOSRecManager* recMng = (AliPHOSRecManager*)wPoolF->FindObject("AliPHOSRecManager"); if(!recMng) { - cout<<" Couldn't find Reconstruction Manager. Exit."<FindObject("WhiteBoard/RecPoints/PHOS/SmP"); TObject* wPool = wPoolF->FindObject("SmartPoints"); if(!wPool) { - cout<<" Couldn't find Working Pool. Exit."< - // --- AliRoot header files --- #include "AliPHOSFastRecParticle.h" @@ -245,9 +243,16 @@ void AliPHOSFastRecParticle::Print(const char * opt) { // Print the type, energy and momentum of the reconstructed particle - cout << "AliPHOSFastRecParticle > " << "type is " << Name() << endl - << " " << "Energy = " << fE << endl - << " " << "Px = " << fPx << endl - << " " << "Py = " << fPy << endl - << " " << "Pz = " << fPz << endl ; + TString message ; + message = "AliPHOSFastRecParticle > type is %s\n" ; + message += " Energy = %f\n" ; + message += " Px = %f\n" ; + message += " Py = %f\n" ; + message += " Pz = %f\n" ; + Info("Print", message.Data(), + Name().Data(), + fE, + fPx, + fPy, + fPz ); } diff --git a/PHOS/AliPHOSGeometry.cxx b/PHOS/AliPHOSGeometry.cxx index 3607b05d04f..7769ab6bb19 100644 --- a/PHOS/AliPHOSGeometry.cxx +++ b/PHOS/AliPHOSGeometry.cxx @@ -35,7 +35,6 @@ // --- Standard library --- -#include #include // --- AliRoot header files --- @@ -71,8 +70,7 @@ void AliPHOSGeometry::Init(void) TString test(GetName()) ; if (test != "IHEP" && test != "GPS2" && test != "MIXT") { - cerr << "ERROR: " << ClassName() << "::Init -> " << test.Data() - << " is not a known geometry (choose among IHEP, GPS2 and MIXT)" << endl ; + Error("Init", "%s is not a known geometry (choose among IHEP, GPS2 and MIXT)", test.Data() ) ; abort() ; } @@ -139,10 +137,8 @@ AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t } } else { - if ( strcmp(fgGeom->GetName(), name) != 0 ) { - cout << "AliPHOSGeometry : current geometry is " << fgGeom->GetName() << endl - << " you cannot call " << name << endl ; - } + if ( strcmp(fgGeom->GetName(), name) != 0 ) + ::Error("GetInstance", "Current geometry is %s. You cannot call %s", fgGeom->GetName(), name) ; else rv = (AliPHOSGeometry *) fgGeom ; } @@ -158,8 +154,7 @@ void AliPHOSGeometry::SetPHOSAngles() Float_t pphi = 2 * TMath::ATan( GetOuterBoxSize(0) / ( 2.0 * GetIPtoUpperCPVsurface() ) ) ; pphi *= kRADDEG ; if (pphi > fAngle){ - cout << "AliPHOSGeometry: PHOS modules overlap!\n"; - cout << "pphi = " << pphi << " fAngle " << fAngle << endl ; + Error("SetPHOSAngles", "PHOS modules overlap!\n pphi = %f fAngle = %f", pphi, fAngle); } pphi = fAngle; @@ -217,7 +212,7 @@ void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t else if ( opt == Degre() ) conv = 180. / TMath::Pi() ; else { - cout << " AliPHOSGeometry::EmcXtalCoverage : " << opt << " unknown option; result in radian " << endl ; + Warning("EmcModuleCoverage", "%s unknown option; result in radian", opt) ; conv = 1. ; } @@ -252,7 +247,7 @@ void AliPHOSGeometry::EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t else if ( opt == Degre() ) conv = 180. / TMath::Pi() ; else { - cout << " AliPHOSGeometry::EmcXtalCoverage : " << opt << " unknown option; result in radian " << endl ; + Warning("EmcXtalCoverage", "%s unknown option; result in radian", opt) ; conv = 1. ; } diff --git a/PHOS/AliPHOSGetter.cxx b/PHOS/AliPHOSGetter.cxx index 0f1f8403d25..cca93bd13d8 100644 --- a/PHOS/AliPHOSGetter.cxx +++ b/PHOS/AliPHOSGetter.cxx @@ -57,7 +57,6 @@ #include "TParticle.h" // --- Standard library --- -#include // --- AliRoot header files --- #include "AliRun.h" @@ -84,7 +83,7 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle, co // This is the ctor called by GetInstance and the only one that can be used if( fHeaderFile.Contains("_") ) { - cerr << "AliPHOSGetter::AliPHOSGetter -> Invalid file name (_ not allowed) " << fHeaderFile.Data() << endl ; + Error("AliPHOSGetter", "Invalid file name (_ not allowed) %s", fHeaderFile.Data() ) ; abort() ; } @@ -118,7 +117,7 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle, co if(!fFile) { //if file was not opened yet, read gAlice fFile = TFile::Open(fHeaderFile.Data(),"update") ; if (!fFile->IsOpen()) { - cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot open " << fHeaderFile.Data() << endl ; + Error("AliPHOSGetter", "Cannot open %s", fHeaderFile.Data() ) ; fFailed = kTRUE ; return ; } @@ -127,20 +126,20 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle, co } if (!gAlice) { - cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ; + Error("AliPHOSGetter", "Cannot find gAlice in %s", fHeaderFile.Data() ) ; fFailed = kTRUE ; return ; } if (!PHOS()) { if (fDebug) - cout << "INFO: AliPHOSGetter:AliPHOSGetter -> Posting PHOS to Folders" << endl ; + Info("AliPHOSGetter", "-> Posting PHOS to Folders") ; if (gAlice->GetDetector("PHOS")) { AliConfig * conf = AliConfig::Instance() ; conf->Add(static_cast(gAlice->GetDetector("PHOS"))) ; conf->Add(static_cast(gAlice->GetDetector("PHOS"))) ; } else - cerr << "ERROR: AliPHOSGetter:AliPHOSGetter -> detector PHOS not found" << endl ; + Error("AliPHOSGetter", "detector PHOS not found") ; } fDebug=0; @@ -192,7 +191,7 @@ const TFolder * AliPHOSGetter::Folder(const TString what) const { else if ( what == "digits" ) return dynamic_cast(fDigitsFolder->FindObject("PHOS")) ; else { - cerr << "ERROR: AliPHOSGetter::GetFolder -> " << what.Data() << " illegal option (hits, sdigits, digits) " << endl ; + Error("GetFolder", " %s illegal option (hits, sdigits, digits)", what.Data() ) ; return 0 ; } } @@ -206,7 +205,7 @@ AliPHOSGetter * AliPHOSGetter::GetInstance() return fgObjGetter ; } else { - //cout << "WARNING: AliPHOSGetter::GetInstance ERROR: not yet initialized" << endl ; + //Warning("GetInstance", "not yet initialized") ; return 0 ; } } @@ -336,13 +335,11 @@ const Bool_t AliPHOSGetter::BranchExists(const TString recName) const TString branchName(branch->GetName() ) ; TString branchTitle(branch->GetTitle() ) ; if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){ - cerr << "WARNING: AliPHOSGetter::BranchExists -> branch " << dataname.Data() << " with title " << fBranchTitle << " already exits in " - << name.Data() << endl; + Warning("BranchExists", "branch %s with title %s already exists in %s", dataname.Data(), fBranchTitle.Data(), name.Data() ) ; return kTRUE ; } if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){ - cerr << "WARNING: AliPHOSGetter::BranchExists -> branch AliPHOS... with title " << branch->GetTitle() << " already exits in " - << name.Data() << endl; + Warning("BranchExists", "branch AliPHOS... with title %s already exists in %s", branch->GetTitle(), name.Data() ) ; return kTRUE ; } } @@ -372,45 +369,45 @@ void AliPHOSGetter::ListBranches(Int_t event) const TTree * t = gAlice->TreeH() ; if(t){ - cout << "INFO: AliPHOSGetter::ListBranches -> ****** Hits : " << endl ; + Info("ListBranches", "-> ****** Hits : ") ; TObjArray * lob = t->GetListOfBranches() ; TIter next(lob) ; while ( (branch = static_cast(next())) ) - cout << " " << branch->GetName() << endl ; + Info("ListBranches", " %s", branch->GetName()) ; } else - cerr << "WARNING::AliPHOSGetter::ListBranches -> TreeH not found for event " << event << endl ; + Warning("ListBranches", "TreeH not found for event %d", event ) ; t = gAlice->TreeS() ; if(t){ - cout << "INFO: AliPHOSGetter::ListBranches -> ****** SDigits : " << endl ; + Info("ListBranches", "-> ****** SDigits : ") ; TObjArray * lob = t->GetListOfBranches() ; TIter next(lob) ; while ( (branch = static_cast(next())) ) - cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ; + Info("ListBranches", " %s %s", branch->GetName(), branch->GetTitle()) ; } else - cerr << "WARNING::AliPHOSGetter::ListBranches -> TreeS not found for event " << event << endl ; + Warning("ListBranches", "TreeS not found for event %d", event) ; t = gAlice->TreeD() ; if(t){ - cout << "INFO: AliPHOSGetter::ListBranches -> ****** Digits : " << endl ; + Info("ListBranches", "-> ****** Digits : ") ; TObjArray * lob = t->GetListOfBranches() ; TIter next(lob) ; while ( (branch = static_cast(next())) ) - cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ; + Info("ListBranches", " %s %s", branch->GetName(), branch->GetTitle()) ; } else - cerr << "WARNING::AliPHOSGetter::ListBranches -> TreeD not found for event " << event << endl ; + Warning("ListBranches", "TreeD not found for event %d", event) ; t = gAlice->TreeR() ; if(t){ - cout << "INFO: AliPHOSGetter::ListBranches -> ****** Recon : " << endl ; + Info("ListBranches", "-> ****** Recon : ") ; TObjArray * lob = t->GetListOfBranches() ; TIter next(lob) ; while ( (branch = static_cast(next())) ) - cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ; + Info("ListBranches", " %s %s", branch->GetName(), branch->GetTitle()) ; } else - cerr << "WARNING::AliPHOSGetter::ListBranches -> TreeR not found for event " << event << endl ; + Warning("ListBranches", "TreeR not found for event %d", event) ; } @@ -432,7 +429,7 @@ Bool_t AliPHOSGetter::NewFile(TString name) if(!fFile) { //if file was not opened yet, read gAlice fFile = TFile::Open(fHeaderFile.Data(),"update") ; if (!fFile->IsOpen()) { - cerr << "ERROR : AliPHOSGetter::NewFile -> Cannot open " << fHeaderFile.Data() << endl ; + Error("NewFile", "Cannot open %s", fHeaderFile.Data() ) ; fFailed = kTRUE ; return fFailed ; } @@ -440,7 +437,7 @@ Bool_t AliPHOSGetter::NewFile(TString name) } if (!gAlice) { - cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ; + Error("AliPHOSGetter", "Cannot find gAlice in %s", fHeaderFile.Data() ) ; fFailed = kTRUE ; return fFailed ; } @@ -454,7 +451,7 @@ const AliPHOS * AliPHOSGetter::PHOS() AliPHOS * phos = dynamic_cast(fModuleFolder->FindObject("PHOS")) ; if (!phos) if (fDebug) - cout << "WARNING: AliPHOSGetter::PHOS -> PHOS module not found in Folders" << endl ; + Warning("PHOS", "-> PHOS module not found in Folders") ; return phos ; } @@ -476,8 +473,8 @@ const Bool_t AliPHOSGetter::PostPrimaries(void) const TFolder * primariesFolder = dynamic_cast(fPrimariesFolder->FindObject("Primaries")) ; if ( !primariesFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post Primaries -> Folder //" << fPrimariesFolder->GetName() << "/Primaries/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post Primaries -> Adding Folder //" << fPrimariesFolder->GetName() << "/Primaries/" << endl; + Warning("PostPrimaries", "-> Folder //%s/Primaries/ not found!", fPrimariesFolder->GetName()) ; + Info("PostPrimaries", "-> Adding Folder //%s/Primaries", fPrimariesFolder->GetName()) ; } primariesFolder = fPrimariesFolder->AddFolder("Primaries", "Primaries particles from TreeK") ; } @@ -495,19 +492,19 @@ TObject** AliPHOSGetter::PrimariesRef(void) const // the hierarchy is //Folders/RunMC/Event/Data/Primaries if ( !fPrimariesFolder ) { - cerr << "ERROR: AliPHOSGetter::PrimariesRef -> Folder //" << fPrimariesFolder << " not found!" << endl; + Error("PrimariesRef", "Folder //%s not found", fPrimariesFolder) ; abort() ; } TFolder * primariesFolder = dynamic_cast(fPrimariesFolder->FindObject("Primaries")) ; if ( !primariesFolder ) { - cerr << "ERROR: AliPHOSGetter::PrimariesRef -> Folder //" << fPrimariesFolder << "/Primaries/ not found!" << endl; + Error("PrimariesRef", "Folder //%s/Primaries/ not found", fPrimariesFolder) ; abort() ; } TObject * p = primariesFolder->FindObject("Primaries") ; if(!p) { - cerr << "ERROR: AliPHOSGetter::PrimariesRef -> " << primariesFolder->GetName() << "/Primaries not found !" << endl ; + Error("PrimariesRef","%s /Primaries not found !", primariesFolder->GetName() ) ; abort() ; } else @@ -523,8 +520,8 @@ const Bool_t AliPHOSGetter::PostHits(void) const TFolder * phosFolder = dynamic_cast(fHitsFolder->FindObject("PHOS")) ; if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post H -> Folder //" << fHitsFolder << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post H -> Adding Folder //" << fHitsFolder << "/PHOS/" << endl; + Warning("PostHits", "-> Folder //%s/PHOS/ not found!", fHitsFolder) ; + Info("PostHits", "-> Adding Folder //%s/PHOS/", fHitsFolder) ; } phosFolder = fHitsFolder->AddFolder("PHOS", "Hits from PHOS") ; } @@ -542,19 +539,19 @@ TObject** AliPHOSGetter::HitsRef(void) const // the hierarchy is //Folders/RunMC/Event/Data/PHOS/Hits if ( !fHitsFolder ) { - cerr << "ERROR: AliPHOSGetter::HitsRef -> Folder //" << fHitsFolder << " not found!" << endl; + Error("HitsRef", "Folder //%s not found !", fHitsFolder) ; abort() ; } TFolder * phosFolder = dynamic_cast(fHitsFolder->FindObject("PHOS")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::HitsRef -> Folder //" << fHitsFolder << "/PHOS/ not found!" << endl; + Error("HitsRef", "Folder //%s/PHOS/ not found !", fHitsFolder) ; abort() ; } TObject * h = phosFolder->FindObject("Hits") ; if(!h) { - cerr << "ERROR: AliPHOSGetter::HitsRef -> " << phosFolder->GetName() << "/Hits not found !" << endl ; + Error("HitsRef", "%s/Hits not fount !", phosFolder->GetName() ) ; abort() ; } else @@ -572,8 +569,8 @@ const Bool_t AliPHOSGetter::PostSDigits(const char * name, const char * headerFi TFolder * phosFolder = dynamic_cast(fSDigitsFolder->FindObject("PHOS")) ; if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post S -> Folder //" << fSDigitsFolder << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post S -> Adding Folder //" << fHitsFolder << "/PHOS/" << endl; + Warning("PostSDigits", "-> Folder //%s/PHOS/ not found!", fSDigitsFolder) ; + Info("PostSDigits", "-> Adding Folder //%s/PHOS/", fHitsFolder) ; } phosFolder = fSDigitsFolder->AddFolder("PHOS", "SDigits from PHOS") ; } @@ -601,13 +598,13 @@ TObject** AliPHOSGetter::SDigitsRef(const char * name, const char * file) const // the hierarchy is //Folders/RunMC/Event/Data/PHOS/SDigits/filename/SDigits if ( !fSDigitsFolder ) { - cerr << "ERROR: AliPHOSGetter::SDigitsRef -> Folder //" << fSDigitsFolder << " not found!" << endl; + Error("SDigitsRef", "Folder //%s not found !", fSDigitsFolder) ; abort() ; } TFolder * phosFolder = dynamic_cast(fSDigitsFolder->FindObject("PHOS")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::SDigitsRef -> Folder //" << fSDigitsFolder << "/PHOS/ not found!" << endl; + Error("SDigitsRef", "Folder //%s/PHOS not found !", fSDigitsFolder) ; abort() ; } @@ -618,13 +615,13 @@ TObject** AliPHOSGetter::SDigitsRef(const char * name, const char * file) const phosSubFolder = dynamic_cast(phosFolder->FindObject(fHeaderFile)) ; if(!phosSubFolder) { - cerr << "ERROR: AliPHOSGetter::DigitesSRef -> Folder //Folders/RunMC/Event/Data/PHOS/" << file << "not found!" << endl; + Error("SDigitsRef", "Folder //Folders/RunMC/Event/Data/PHOS/%s not found !", file) ; abort() ; } TObject * dis = phosSubFolder->FindObject(name) ; if(!dis){ - cerr << "ERROR: AliPHOSGetter::DigitesSRef -> object " << name << " not found! " << endl ; + Error("SDigitsRef", "object %s not found !", name) ; abort() ; } else @@ -642,14 +639,14 @@ const Bool_t AliPHOSGetter::PostSDigitizer(AliPHOSSDigitizer * sdigitizer) const TTask * sd = dynamic_cast(fTasksFolder->FindObject("SDigitizer")) ; if ( !sd ) { - cerr << "ERROR: AliPHOSGetter::Post Ser -> Task //" << fTasksFolder << "/SDigitizer not found!" << endl; + Error("PostDigitizer", "Task //%s/SDigitizer not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(sd->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Ser ->//" << fTasksFolder << "/SDigitizer/PHOS/ not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Ser -> Adding //" << fTasksFolder << "/SDigitizer/PHOS/" << endl; + Warning("PostSDigitizer", "->//%s/SDigitizer/PHOS/ not found!", fTasksFolder) ; + Info("PostSDigitizer", "-> Adding //%s/SDigitizer/PHOS/", fTasksFolder) ; } phos = new TTask("PHOS", "") ; sd->Add(phos) ; @@ -657,7 +654,7 @@ const Bool_t AliPHOSGetter::PostSDigitizer(AliPHOSSDigitizer * sdigitizer) const AliPHOSSDigitizer * phossd = dynamic_cast(phos->GetListOfTasks()->FindObject( sdigitizer->GetName() )); if (phossd) { if (fDebug) - cout << "INFO: AliPHOSGetter::Post Ser -> Task " << sdigitizer->GetName() << " already exists" << endl ; + Info("PostSDigitizer", "-> Task %s already exists", sdigitizer->GetName()) ; phos->GetListOfTasks()->Remove(phossd) ; } phos->Add(sdigitizer) ; @@ -671,13 +668,13 @@ TObject** AliPHOSGetter::SDigitizerRef(const char * name) const TTask * sd = dynamic_cast(fTasksFolder->FindObject("SDigitizer")) ; if ( !sd ) { - cerr << "ERROR: AliPHOSGetter::Post SerRef -> Task //" << fTasksFolder << "/SDigitizer not found!" << endl; + Error("SDigitizerRef", "Task //%s/SDigitizer not found !", fTasksFolder) ; abort(); } TTask * phos = dynamic_cast(sd->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { - cerr <<"ERROR: AliPHOSGetter::Post SerRef -> //" << fTasksFolder << "/SDigitizer/PHOS not found!" << endl; + Error("SDigitizerRef", "//%s/SDigitizer/PHOS not found !", fTasksFolder) ; abort(); } @@ -695,15 +692,15 @@ const Bool_t AliPHOSGetter::PostSDigitizer(const char * name, const char * file) TTask * sd = dynamic_cast(fTasksFolder->FindObject("SDigitizer")) ; if ( !sd ) { - cerr << "ERROR: AliPHOSGetter::Post Ser -> Task //" << fTasksFolder << "/SDigitizer not found!" << endl; + Error("PostSDigitizer", "Task //%s/SDigitizer not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(sd->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Ser -> //" << fTasksFolder << "/SDigitizer/PHOS/ not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Ser -> Adding //" << fTasksFolder << "/SDigitizer/PHOS" << endl; + Error("PostSDigitizer", "-> //%s/SDigitizer/PHOS/ not found!", fTasksFolder) ; + Info("PostSDigitizer", "-> Adding //%s/SDigitizer/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; sd->Add(phos) ; @@ -735,8 +732,8 @@ const Bool_t AliPHOSGetter::PostDigits(const char * name) const if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post D -> Folder //" << fDigitsFolder << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post D -> Adding Folder //" << fDigitsFolder << "/PHOS/" << endl; + Warning("PostDigitizer", "-> Folder //%s/PHOS/ not found!", fDigitsFolder) ; + Info("PostDigitizer", "-> Adding Folder //%s/PHOS/", fDigitsFolder) ; } phosFolder = fDigitsFolder->AddFolder("PHOS", "Digits from PHOS") ; } @@ -757,19 +754,19 @@ TObject** AliPHOSGetter::DigitsRef(const char * name) const // the hierarchy is //Folders/Run/Event/Data/PHOS/Digits/name if ( !fDigitsFolder ) { - cerr << "ERROR: AliPHOSGetter::DigitsRef -> Folder //" << fDigitsFolder << " not found!" << endl; + Error("DigitsRef", "Folder //%s not found !", fDigitsFolder) ; abort() ; } TFolder * phosFolder = dynamic_cast(fDigitsFolder->FindObject("PHOS")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::DigitsRef -> Folder //" << fDigitsFolder << "/PHOS/ not found!" << endl; + Error("DigitsRef", "Folder //%s/PHOS/ not found !", fDigitsFolder) ; abort() ; } TObject * d = phosFolder->FindObject(name) ; if(!d) { - cerr << "ERROR: AliPHOSGetter::DigitsRef -> object " << name << " not found! " << endl ; + Error("DigitsRef", "object %s not found !", name) ; abort() ; } else @@ -784,14 +781,14 @@ const Bool_t AliPHOSGetter::PostDigitizer(AliPHOSDigitizer * digitizer) const TTask * sd = dynamic_cast(fTasksFolder->FindObject("Digitizer")) ; if ( !sd ) { - cerr << "ERROR: AliPHOSGetter::Post Der -> Task //" << fTasksFolder << "/Digitizer not found!" << endl; + Error("PostDigitizer", "Task //%s/Digitizer not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(sd->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Der -> //" << fTasksFolder << "/Digitizer/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Der -> Adding //" << fTasksFolder << "/Digitizer/PHOS" << endl; + Error("PostDigitizer", "//%s/Digitizer/PHOS not found!", fTasksFolder) ; + Info("PostDigitizer", "Adding //%s/Digitizer/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; sd->Add(phos) ; @@ -814,15 +811,15 @@ const Bool_t AliPHOSGetter::PostDigitizer(const char * name) const TTask * d = dynamic_cast(fTasksFolder->FindObject("Digitizer")) ; if ( !d ) { - cerr << "ERROR: AliPHOSGetter::Post Der -> Task //" << fTasksFolder << "/Digitizer not found!" << endl; + Error("PostDigitizer", "Task //%s/Digitizer not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(d->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Der -> //" << fTasksFolder << "/Digitizer/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Der -> Adding //" << fTasksFolder << "/Digitizer/PHOS" << endl; + Warning("PostDigitizer", "//%s/Digitizer/PHOS not found!", fTasksFolder) ; + Info("PostDigitizer", "Adding //%s/Digitizer/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; d->Add(phos) ; @@ -851,13 +848,13 @@ TObject** AliPHOSGetter::DigitizerRef(const char * name) const { TTask * sd = dynamic_cast(fTasksFolder->FindObject("Digitizer")) ; if ( !sd ) { - cerr << "ERROR: AliPHOSGetter::Post DerRef -> Task //" << fTasksFolder << "/Digitizer not found!" << endl; + Error("DigitizerRef", "Task //%s/Digitizer not found !", fTasksFolder) ; abort(); } TTask * phos = dynamic_cast(sd->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { - cerr <<"ERROR: AliPHOSGetter::Post DerRef -> //" << fTasksFolder << "/Digitizer/PHOS" << endl; + Error("DigitizerRef", "//%s/Digitizer/PHOS", fTasksFolder) ; abort(); } @@ -878,8 +875,8 @@ const Bool_t AliPHOSGetter::PostRecPoints(const char * name) const if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post RPo -> Folder //" << fRecoFolder->GetName() << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post Rpo -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/" << endl; + Warning("PostRecPoints", "-> Folder //%s/PHOS/ not found!", fRecoFolder->GetName()) ; + Info("PostRecPoints", "-> Adding Folder //%s/PHOS/", fRecoFolder->GetName()) ; } phosFolder = fRecoFolder->AddFolder("PHOS", "Reconstructed data from PHOS") ; } @@ -888,8 +885,8 @@ const Bool_t AliPHOSGetter::PostRecPoints(const char * name) const TFolder * phosRPoEMCAFolder = dynamic_cast(phosFolder->FindObject("EMCARecPoints")) ; if ( !phosRPoEMCAFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post RPo -> Folder //" << fRecoFolder->GetName() << "/PHOS/EMCARecPoints/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post Rpo -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/EMCARecPoints" << endl; + Warning("PostRecPoints", "-> Folder //%s/PHOS/EMCARecPoints/ not found!", fRecoFolder->GetName()) ; + Info("PostRecPoints", "-> Adding Folder //%s/PHOS/EMCARecPoints", fRecoFolder->GetName()) ; } phosRPoEMCAFolder = phosFolder->AddFolder("EMCARecPoints", "EMCA RecPoints from PHOS") ; } @@ -905,8 +902,8 @@ const Bool_t AliPHOSGetter::PostRecPoints(const char * name) const TFolder * phosRPoCPVFolder = dynamic_cast(phosFolder->FindObject("CPVRecPoints")) ; if ( !phosRPoCPVFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post RPo -> Folder //" << fRecoFolder->GetName() << "/PHOS/CPVRecPoints/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post Rpo -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/CPVRecPoints/" << endl; + Warning("PostRecPoints", "-> Folder //%s/PHOS/CPVRecPoints/ not found!", fRecoFolder->GetName()) ; + Info("PostRecPoints", "-> Adding Folder //%s/PHOS/CPVRecPoints/", fRecoFolder->GetName()) ; } phosRPoCPVFolder = phosFolder->AddFolder("CPVRecPoints", "CPV RecPoints from PHOS") ; } @@ -927,20 +924,20 @@ TObject** AliPHOSGetter::EmcRecPointsRef(const char * name) const // the hierarchy is //Folders/Run/Event/RecData/PHOS/EMCARecPoints/name if ( !fRecoFolder ) { - cerr << "ERROR: AliPHOSGetter::EmcRecPointsRef -> Folder //" << fRecoFolder->GetName() << " not found!" << endl; + Error("EmcRecPointsRef", "Folder //%s not found !", fRecoFolder->GetName() ) ; abort() ; } TFolder * phosFolder = dynamic_cast(fRecoFolder->FindObject("PHOS/EMCARecPoints")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::EmcRecPointsRef -> Folder //" << fRecoFolder->GetName() << "/PHOS/EMCARecPoints/ not found!" << endl; + Error("EmcRecPointsRef", "Folder //%s/PHOS/EMCARecPoints/ not found !", fRecoFolder->GetName() ) ; abort() ; } TObject * erp = phosFolder->FindObject(name ) ; if ( !erp ) { - cerr << "ERROR: AliPHOSGetter::EmcRecPointsRef -> object " << name << " not found! " << endl ; + Error("EmcRecPointsRef", "object %s not found !", name) ; abort() ; } return phosFolder->GetListOfFolders()->GetObjectRef(erp) ; @@ -954,19 +951,19 @@ TObject** AliPHOSGetter::CpvRecPointsRef(const char * name) const // the hierarchy is //Folders/Run/Event/RecData/PHOS/CPVRecPoints/name if ( !fRecoFolder ) { - cerr << "ERROR: AliPHOSGetter::CpvRecPointsRef -> Folder //" << fRecoFolder->GetName() << " not found!" << endl; + Error("CpvRecPointsRef", "Folder //%s not found !", fRecoFolder->GetName() ) ; abort() ; } TFolder * phosFolder = dynamic_cast(fRecoFolder->FindObject("PHOS/CPVRecPoints")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::CpvRecPointsRef -> Folder //" << fRecoFolder->GetName() << "/PHOS/CPVRecPoints/" << endl; + Error("CpvRecPointsRef", "Folder //%s/PHOS/CPVRecPoints/ not found !", fRecoFolder->GetName() ) ; abort() ; } TObject * crp = phosFolder->FindObject(name ) ; if ( !crp ) { - cerr << "ERROR: AliPHOSGetter::CpvRecPointsRef -> object " << name << " not found " << endl ; + Error("CpvRecPointsRef", "object %s nott found", name ) ; abort() ; } return phosFolder->GetListOfFolders()->GetObjectRef(crp) ; @@ -982,15 +979,15 @@ const Bool_t AliPHOSGetter::PostClusterizer(AliPHOSClusterizer * clu) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::Post Rer -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl; + Error("PostClusterizer", "Task //%s/Reconstructioner not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl; + Warning("PostClusterizer", "//%s/Reconstructioner/PHOS not found!", fTasksFolder) ; + Info("PostClusterizer", "Adding //%s/Reconstructioner/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; tasks->Add(phos) ; @@ -999,7 +996,7 @@ const Bool_t AliPHOSGetter::PostClusterizer(AliPHOSClusterizer * clu) const AliPHOSClusterizer * phoscl = dynamic_cast(phos->GetListOfTasks()->FindObject(clu->GetName())) ; if (phoscl) { if (fDebug) - cout << "INFO: AliPHOSGetter::Post Rer -> Task " << clu->GetName() << " already exists" << endl ; + Info("PostClusterizer", "Task %s already exists", clu->GetName()) ; phoscl->Delete() ; phos->GetListOfTasks()->Remove(phoscl) ; } @@ -1014,13 +1011,13 @@ TObject** AliPHOSGetter::ClusterizerRef(const char * name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::ClusterizerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl; + Error("ClusterizerRef", "Task //%s/Reconstructioner not found !", fTasksFolder->GetName() ) ; abort() ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { - cerr <<"WARNING: AliPHOSGetter::ClusterizerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS" << endl; + Error("ClusterizerRef", " //%s/Reconstructioner/PHOS not founf !", fTasksFolder->GetName() ) ; abort() ; } @@ -1041,7 +1038,7 @@ TObject** AliPHOSGetter::ClusterizerRef(const char * name) const if(clu) return l->GetObjectRef(clu) ; else{ - cerr << "ERROR: AliPHOSGetter::ClusterizerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner/clusterizer " << name << " not found!" << endl; + Error("ClusterizerRef", "Task //%s/Reconstructioner/clusterizer/%s not found", fTasksFolder->GetName(), name) ; abort() ; } } @@ -1055,15 +1052,15 @@ const Bool_t AliPHOSGetter::PostClusterizer(const char * name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::Post Rer -> Task//" << fTasksFolder << "/Reconstructioner not found!" << endl; + Error("PostClusterizer", "Task//%s/Reconstructioner not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl; + Warning("PostClusterizer", "//%s/Reconstructioner/PHOS not found!", fTasksFolder) ; + Info("PostClusterizer", "Adding //%s/Reconstructioner/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; tasks->Add(phos) ; @@ -1099,8 +1096,8 @@ const Bool_t AliPHOSGetter::PostTrackSegments(const char * name) const if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post TS -> Folder //" << fRecoFolder->GetName() << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post TS -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS" << endl; + Warning("PostTrackSegments", "-> Folder //%s/PHOS/ not found", fRecoFolder->GetName()) ; + Info("PostTrackSegments", "-> Adding Folder //%s/PHOS", fRecoFolder->GetName()) ; } phosFolder = fRecoFolder->AddFolder("PHOS", "Reconstructed data from PHOS") ; } @@ -1108,8 +1105,8 @@ const Bool_t AliPHOSGetter::PostTrackSegments(const char * name) const TFolder * phosTSFolder = dynamic_cast(phosFolder->FindObject("TrackSegments")) ; if ( !phosTSFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post TS -> Folder //" << fRecoFolder->GetName() << "/PHOS/TrackSegments/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post TS -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/TrackSegments/" << endl; + Warning("PostTrackSegments", "-> Folder //%s/PHOS/TrackSegments/ not found!", fRecoFolder->GetName() ) ; + Info("PostTrackSegments", "-> Adding Folder //%s/PHOS/TrackSegments/", fRecoFolder->GetName()) ; } phosTSFolder = phosFolder->AddFolder("TrackSegments", "TrackSegments from PHOS") ; } @@ -1130,19 +1127,19 @@ TObject** AliPHOSGetter::TrackSegmentsRef(const char * name) const // the hierarchy is //Folders/Run/Event/RecData/PHOS/TrackSegments/name if ( !fRecoFolder ) { - cerr << "ERROR: AliPHOSGetter::TrackSegmentsRef -> Folder //" << fRecoFolder->GetName() << "not found!" << endl; + Error("TrackSegmentsRef", "Folder //%s not found !", fRecoFolder->GetName() ) ; abort() ; } TFolder * phosFolder = dynamic_cast(fRecoFolder->FindObject("PHOS/TrackSegments")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::TrackSegmentsRef -> Folder //" << fRecoFolder->GetName() << "/PHOS/TrackSegments/ not found!" << endl; + Error("TrackSegmentsRef", "Folder //%s/PHOS/TrackSegments/ not found !", fRecoFolder->GetName() ) ; abort() ; } TObject * tss = phosFolder->FindObject(name) ; if (!tss) { - cerr << "ERROR: AliPHOSGetter::TrackSegmentsRef -> object " << name << " not found! " << endl ; + Error("TrackSegmentsRef", "object %s not found !", name) ; abort() ; } return phosFolder->GetListOfFolders()->GetObjectRef(tss) ; @@ -1157,15 +1154,15 @@ const Bool_t AliPHOSGetter::PostTrackSegmentMaker(AliPHOSTrackSegmentMaker * tsm TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::Post Ter -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl; + Error("PostTrackSegmentMaker", "Task //%s/Reconstructioner not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl; + Warning("PostTrackSegmentMaker", "//%s/Reconstructioner/PHOS not found!", fTasksFolder) ; + Info("PostTrackSegmentMaker", "Adding //%s/Reconstructioner/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; tasks->Add(phos) ; @@ -1190,15 +1187,15 @@ const Bool_t AliPHOSGetter::PostTrackSegmentMaker(const char * name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::Post Ter -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl; + Error("PostTrackSegmentMaker", "Task //%s/Reconstructioner not found !", fTasksFolder->GetName() ) ; return kFALSE ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Ter -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Ter -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS" << endl; + Warning("PostTrackSegmentMaker", "//%s/Reconstructioner/PHOS not found!", fTasksFolder->GetName() ) ; + Info("PostTrackSegmentMaker", "Adding //%s/Reconstructioner/PHOS", fTasksFolder->GetName()) ; } phos = new TTask("PHOS", "") ; tasks->Add(phos) ; @@ -1231,13 +1228,13 @@ TObject** AliPHOSGetter::TSMakerRef(const char * name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::TSMakerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl; + Error("TSMakerRef", "Task //%s/Reconstructioner not found !", fTasksFolder->GetName() ) ; abort() ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { - cerr <<"WARNING: AliPHOSGetter::TSMakerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; + Error("TSMakerRef", "//%s/Reconstructioner/PHOS not found !", fTasksFolder->GetName() ) ; abort() ; } @@ -1258,7 +1255,7 @@ TObject** AliPHOSGetter::TSMakerRef(const char * name) const if(tsm) return l->GetObjectRef(tsm) ; else { - cerr << "ERROR: AliPHOSGetter::TSMakerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS/TrackSegmentMarker/" << name << " not found!" << endl; + Error("TSMakerRef", "Task //%s/Reconstructioner/PHOS/TrackSegmentMarker/%s not found !", fTasksFolder->GetName(), name) ; abort() ; } } @@ -1273,8 +1270,8 @@ const Bool_t AliPHOSGetter::PostRecParticles(const char * name) const if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post RPa -> Folder //" << fRecoFolder->GetName() << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post Rpa -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/" << endl; + Warning("PostRecParticles", "-> Folder //%s/PHOS/ not found!", fRecoFolder->GetName()) ; + Info("PostRecParticles", "-> Adding Folder //%s/PHOS/", fRecoFolder->GetName()) ; } phosFolder = fRecoFolder->AddFolder("PHOS", "Reconstructed data from PHOS") ; } @@ -1282,8 +1279,8 @@ const Bool_t AliPHOSGetter::PostRecParticles(const char * name) const TFolder * phosRPaFolder = dynamic_cast(phosFolder->FindObject("RecParticles")) ; if ( !phosRPaFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post RPa -> Folder //" << fRecoFolder->GetName() << "/PHOS/RecParticles/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post RPa -> Adding Folder //" << fRecoFolder->GetName() << "/PHOS/RecParticles/" << endl; + Warning("PostRecParticles", "-> Folder //%s/PHOS/RecParticles/ not found!", fRecoFolder->GetName()) ; + Info("PostRecParticles", "-> Adding Folder //%s/PHOS/RecParticles/", fRecoFolder->GetName()) ; } phosRPaFolder = phosFolder->AddFolder("RecParticles", "RecParticles from PHOS") ; } @@ -1304,19 +1301,19 @@ TObject** AliPHOSGetter::RecParticlesRef(const char * name) const // the hierarchy is //Folders/Run/Event/RecData/PHOS/TrackSegments/name if ( !fRecoFolder ) { - cerr << "ERROR: AliPHOSGetter::RecParticlesRef -> Folder//" << fRecoFolder->GetName() << " not found!" << endl; + Error("RecParticlesRef", "Folder//%s not found !", fRecoFolder->GetName() ) ; abort() ; } TFolder * phosFolder = dynamic_cast(fRecoFolder->FindObject("PHOS/RecParticles")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::RecParticlesRef -> Folder //" << fRecoFolder->GetName() << "/PHOS/RecParticles/ not found!" << endl; + Error("RecParticlesRef", "Folder //%s/PHOS/RecParticles/ not found !", fRecoFolder->GetName() ) ; abort() ; } TObject * tss = phosFolder->FindObject(name ) ; if (!tss) { - cerr << "ERROR: AliPHOSGetter::RecParticlesRef -> object " << name << " not found! " << endl ; + Error("RecParticlesRef", "object %s not found !", name) ; abort() ; } return phosFolder->GetListOfFolders()->GetObjectRef(tss) ; @@ -1329,15 +1326,15 @@ const Bool_t AliPHOSGetter::PostPID(AliPHOSPID * pid) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::Post Per -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl; + Error("PostPID", "Task //%s/Reconstructioner not found !", fTasksFolder) ; return kFALSE ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Per -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Per -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl; + Warning("PostPID", "//%s/Reconstructioner/PHOS not found!", fTasksFolder) ; + Info("PostPID", "Adding //%s/Reconstructioner/PHOS", fTasksFolder) ; } phos = new TTask("PHOS", "") ; tasks->Add(phos) ; @@ -1346,8 +1343,7 @@ const Bool_t AliPHOSGetter::PostPID(AliPHOSPID * pid) const AliPHOSPID * phospid = dynamic_cast(phos->GetListOfTasks()->FindObject(pid->GetName())) ; if (phospid) { if (fDebug) - cout << "INFO: AliPHOSGetter::Post Per -> Task " << pid->GetName() - << " already exists" << endl ; + Info("PostPID", "-> Task %s qlready exists", pid->GetName()) ; phos->GetListOfTasks()->Remove(phospid) ; } @@ -1363,15 +1359,15 @@ const Bool_t AliPHOSGetter::PostPID(const char * name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::Post Per -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl; + Error("PostPID", "Task //%s/Reconstructioner not found !", fTasksFolder->GetName() ) ; return kFALSE ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { if (fDebug) { - cout <<"WARNING: AliPHOSGetter::Post Per -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; - cout <<"INFO: AliPHOSGetter::Post Per -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS" << endl; + Warning("PostPID", "//%s/Reconstructioner/PHOS not found!", fTasksFolder->GetName()) ; + Info("PostPID", "Adding //%s/Reconstructioner/PHOS", fTasksFolder->GetName()) ; } phos = new TTask("PHOS", "") ; tasks->Add(phos) ; @@ -1404,13 +1400,13 @@ TObject** AliPHOSGetter::PIDRef(const char * name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject("Reconstructioner")) ; if ( !tasks ) { - cerr << "ERROR: AliPHOSGetter::PIDRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl; - abort() ; + Error("PIDRef", "Task //%s/Reconstructioner not found !", fTasksFolder->GetName() ) ; + abort() ; } TTask * phos = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if ( !phos ) { - cerr << "ERROR: AliPHOSGetter::PIDRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS not found!" << endl; + Error("PIDRef", "//%s/Reconstructioner/PHOS not found !", fTasksFolder->GetName() ) ; abort() ; } @@ -1431,7 +1427,7 @@ TObject** AliPHOSGetter::PIDRef(const char * name) const if(pid) return l->GetObjectRef(pid) ; else { - cerr << "ERROR: AliPHOSGetter::PIDRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner/PHOS/PID/" << name << " not found!" << endl; + Error("PIDRef", "Task //%s/Reconstructioner/PHOS/PID/%s not found !", fTasksFolder->GetName(), name) ; abort() ; } @@ -1446,8 +1442,8 @@ const Bool_t AliPHOSGetter::PostQA(void) const TFolder * phosFolder = dynamic_cast(fQAFolder->FindObject("PHOS")) ; if ( !phosFolder ) { if (fDebug) { - cout << "WARNING: AliPHOSGetter::Post Q -> Folder //" << fQAFolder << "/PHOS/ not found!" << endl; - cout << "INFO: AliPHOSGetter::Post Q -> Adding Folder //" << fQAFolder << "/PHOS/" << endl; + Warning("PostQA", "-> Folder //%s/PHOS/ not found!", fQAFolder) ; + Info("PostQA", "-> Adding Folder //%s/PHOS", fQAFolder) ; } phosFolder = fQAFolder->AddFolder("PHOS", "QA from PHOS") ; } @@ -1462,13 +1458,13 @@ TObject** AliPHOSGetter::AlarmsRef(void) const // the hierarchy is //Folders/Run/Conditions/QA/PHOS if ( !fQAFolder ) { - cerr << "ERROR: AliPHOSGetter::AlarmsRef -> Folder //" << fQAFolder << " not found!" << endl; + Error("AlarmsRef", "Folder //%s not found !", fQAFolder) ; abort() ; } TFolder * phosFolder = dynamic_cast(fQAFolder->FindObject("PHOS")) ; if ( !phosFolder ) { - cerr << "ERROR: AliPHOSGetter::AlarmsRef -> Folder //" << fQAFolder << "/PHOS/ not found!" << endl; + Error("AlarmsRef", "Folder //%s/PHOS/ not found !", fQAFolder) ; abort() ; } @@ -1498,7 +1494,7 @@ TTree * AliPHOSGetter::TreeK(TString filename) treeName += EventNumber() ; TTree * tree = static_cast(file->Get(treeName.Data())) ; if (!tree && fDebug) - cout << "WARNING: AliPHOSGetter::TreeK -> " << treeName.Data() << " not found in " << filename.Data() << endl ; + Warning("TreeK", "-> %s not found in %s", treeName.Data(), filename.Data()) ; return tree ; } @@ -1522,7 +1518,7 @@ TTree * AliPHOSGetter::TreeH(TString filename) treeName += EventNumber() ; TTree * tree = static_cast(file->Get(treeName.Data())) ; if (!tree && fDebug) - cout << "WARNING: AliPHOSGetter::TreeH -> " << treeName.Data() << " not found in " << filename.Data() << endl ; + Warning("TreeH", "-> %s not found in %s", treeName.Data(), filename.Data()) ; return tree ; } @@ -1546,7 +1542,7 @@ TTree * AliPHOSGetter::TreeS(TString filename) treeName += EventNumber() ; TTree * tree = static_cast(file->Get(treeName.Data())) ; if (!tree && fDebug) - cout << "WARNING: AliPHOSGetter::TreeS -> " << treeName.Data() << " not found in " << filename.Data() << endl ; + Warning("TreeS", "-> %s not found in %s", treeName.Data(), filename.Data() ); return tree ; } @@ -1570,7 +1566,7 @@ TTree * AliPHOSGetter::TreeD(TString filename) treeName += EventNumber() ; TTree * tree = static_cast(file->Get(treeName.Data())) ; if (!tree && fDebug) - cout << "WARNING: AliPHOSGetter::TreeD -> " << treeName.Data() << " not found in " << filename.Data() << endl ; + Warning("TreeD", "-> %s not found in %s", treeName.Data(), filename.Data()) ; return tree ; } @@ -1626,7 +1622,7 @@ Int_t AliPHOSGetter::ReadTreeD(const Int_t event) treeD = dynamic_cast(file->Get(treeName.Data())); if(!treeD){ // TreeD not found in header file if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeD -> Cannot find TreeD in " << fDigitsFileName.Data() << endl; + Warning("ReadTreeD", "-> Cannot find TreeD in %s", fDigitsFileName.Data()) ; return 1; } } @@ -1655,8 +1651,7 @@ Int_t AliPHOSGetter::ReadTreeD(const Int_t event) if ( !phosfound || !digitizerfound ) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeD -> Cannot find Digits and/or Digitizer with name " - << fDigitsTitle << endl ; + Warning("ReadTreeD", "-> Cannot find Digits and/or Digitizer with name %s", fDigitsTitle.Data()) ; return 2; } @@ -1707,14 +1702,14 @@ void AliPHOSGetter::ReadCalibrationDB(const char * database,const char * filenam if(!file) file = TFile::Open(filename); if(!file){ - cout << "Can not open file " << filename << endl ; + Error ("ReadCalibrationDB", "Cannot open file %s", filename) ; return ; } if(fcdb) fcdb->Delete() ; fcdb = dynamic_cast(file->Get("AliPHOSCalibrationDB")) ; if(!fcdb) - cout << "No database " << database << " in file " << filename << endl ; + Error ("ReadCalibrationDB", "No database %s in file %s", database, filename) ; } //____________________________________________________________________________ @@ -1727,7 +1722,7 @@ Int_t AliPHOSGetter::ReadTreeH() if(!treeH) {// TreeH not found in header file if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeH -> Cannot find TreeH in " << fHeaderFile << endl ; + Warning("ReadTreeH", "-> Cannot find TreeH in %s", fHeaderFile.Data() ) ; TString searchFileName("PHOS.Hits") ; if((strcmp(fBranchTitle.Data(),"Default")!=0)&&(strcmp(fBranchTitle.Data(),"")!=0)){ @@ -1738,10 +1733,10 @@ Int_t AliPHOSGetter::ReadTreeH() if ( (treeH = TreeH(searchFileName)) ) { //found TreeH in the file which contains the hits if (fDebug) - cout << "INFO: AliPHOSGetter::ReadTreeH -> TreeH found in " << searchFileName.Data() << endl ; + Info("ReadTreeH", "-> TreeH found in %s", searchFileName.Data()) ; } else { - cerr << "ERROR: AliPHOSGetter::ReadTreeH -> TreeH not found " << endl ; + Error("ReadTreeH", "TreeH not found") ; return 1; } } @@ -1749,7 +1744,7 @@ Int_t AliPHOSGetter::ReadTreeH() TBranch * hitsbranch = static_cast(treeH->GetBranch("PHOS")) ; if ( !hitsbranch ) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeH -> Cannot find branch PHOS" << endl ; + Warning("ReadTreeH", "-> Cannot find branch PHOS") ; return 2; } if(!Hits()) @@ -1782,19 +1777,19 @@ Int_t AliPHOSGetter::ReadTreeH() } //____________________________________________________________________________ -void AliPHOSGetter::Track(Int_t itrack) +void AliPHOSGetter::Track(const Int_t itrack) { // Read the first entry of PHOS branch in hit tree gAlice->TreeH() if(gAlice->TreeH()== 0){ - cerr << "ERROR: AliPHOSGetter::ReadTreeH: -> Cannot read TreeH " << endl ; + Error("Track", "Cannot read TreeH") ; return ; } TBranch * hitsbranch = dynamic_cast(gAlice->TreeH()->GetListOfBranches()->FindObject("PHOS")) ; if ( !hitsbranch ) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeH -> Cannot find branch PHOS" << endl ; + Warning("Track", "Cannot find branch PHOS") ; return ; } if(!Hits()) @@ -1813,14 +1808,14 @@ void AliPHOSGetter::ReadTreeQA() // so far only PHOS knows about this Tree if(PHOS()->TreeQA()== 0){ - cerr << "ERROR: AliPHOSGetter::ReadTreeQA: can not read TreeQA " << endl ; + Error("ReadTreeQA", "Cannot read TreeQA") ; return ; } TBranch * qabranch = PHOS()->TreeQA()->GetBranch("PHOS") ; if (!qabranch) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeQA -> Cannot find QA Alarms for PHOS" << endl ; + Warning("ReadTreeQA", "Cannot find QA Alarms for PHOS"); return ; } @@ -1864,7 +1859,7 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event) treeR = dynamic_cast(file->Get(treeName.Data())); if(!treeR){ // TreeR not found in header file if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeD -> Cannot find TreeR in " << fRecPointsFileName.Data() << endl; + Warning("ReadTreeD", "-> Cannot find TreeR in %s", fRecPointsFileName.Data()) ; return 1; } } @@ -1900,8 +1895,7 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event) if ( !phosemcrpfound || !phoscpvrpfound || !clusterizerfound) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find RecPoints and/or Clusterizer with name " - << fRecPointsTitle << endl ; + Warning("ReadTreeR", "-> Cannot find RecPoints and/or Clusterizer with name %s", fRecPointsTitle.Data() ) ; } else { if(!EmcRecPoints(fRecPointsTitle) ) @@ -1940,8 +1934,7 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event) if ( !phostsfound || !tsmakerfound ) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find TrackSegments and/or TrackSegmentMaker with name " - << fTrackSegmentsTitle << endl ; + Warning("ReadTreeR", "-> Cannot find TrackSegments and/or TrackSegmentMaker with name %s", fTrackSegmentsTitle.Data() ) ; } else { // Read and Post the TrackSegments if(!TrackSegments(fTrackSegmentsTitle)) @@ -1977,8 +1970,7 @@ Int_t AliPHOSGetter::ReadTreeR(const Int_t event) if ( !phosrpafound || !pidfound ) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find RecParticles and/or PID with name " - << fRecParticlesTitle << endl ; + Warning("ReadTreeR", "-> Cannot find RecParticles and/or PID with name %s", fRecParticlesTitle.Data() ) ; } else { // Read and Post the RecParticles if(!RecParticles(fRecParticlesTitle)) @@ -2030,7 +2022,7 @@ Int_t AliPHOSGetter::ReadTreeS(const Int_t event) if(!treeS){ // TreeS not found in header file if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeS -> Cannot find TreeS in " << fileName.Data() << endl; + Warning("ReadTreeS", "-> Cannot find TreeS in %s", fileName.Data()) ; return 1; } @@ -2056,8 +2048,7 @@ Int_t AliPHOSGetter::ReadTreeS(const Int_t event) } if ( !phosfound || !sdigitizerfound ) { if (fDebug) - cout << "WARNING: AliPHOSDigitizer::ReadSDigits -> Digits and/or Digitizer branch with name " << GetName() - << " not found" << endl ; + Warning("ReadSDigits", "-> Digits and/or Digitizer branch with name %s not found", GetName()) ; return 2; } @@ -2116,7 +2107,7 @@ void AliPHOSGetter::ReadTreeS(TTree * treeS, Int_t input) } if ( !phosfound || !sdigitizerfound ) { if (fDebug) - cout << "WARNING: AliPHOSGetter::ReadTreeS -> Digits and/or Digitizer branch not found" << endl ; + Warning("ReadTreeS", "-> Digits and/or Digitizer branch not found") ; return ; } @@ -2153,13 +2144,13 @@ void AliPHOSGetter::ReadPrimaries() if (TreeK(fHeaderFile)) { // treeK found in header file if (fDebug) - cout << "INFO: AliPHOSGetter::ReadPrimaries -> TreeK found in " << fHeaderFile.Data() << endl ; + Info("ReadPrimaries", "-> TreeK found in %s", fHeaderFile.Data() ); fNPrimaries = gAlice->GetNtrack() ; fAlice = 0 ; } else { // treeK not found in header file - cerr << "ERROR: AliPHOSGetter::ReadPrimaries -> TreeK not found " << endl ; + Error("ReadPrimaries", "TreeK not found") ; return ; } @@ -2175,7 +2166,7 @@ void AliPHOSGetter::Event(const Int_t event, const char* opt) // Reads the content of all Tree's S, D and R if (event >= gAlice->TreeE()->GetEntries() ) { - cerr << "ERROR: AliPHOSGetter::Event -> " << event << " not found in TreeE!" << endl ; + Error("Event", "%d not found in TreeE !", event) ; return ; } @@ -2292,7 +2283,7 @@ TObject * AliPHOSGetter::ReturnO(TString what, TString name, TString file) const } if (!phosO) { if(fDebug) - cerr << "WARNING : AliPHOSGetter::ReturnO -> Object " << what << " not found in PHOS" << endl ; + Warning("ReturnO", "Object %s not found in PHOS", what.Data() ) ; return 0 ; } @@ -2318,13 +2309,13 @@ const TTask * AliPHOSGetter::ReturnT(TString what, TString name) const TTask * tasks = dynamic_cast(fTasksFolder->FindObject(search)) ; if (!tasks) { - cerr << "ERROR: AliPHOSGetter::ReturnT -> Task " << what << " not found!" << endl ; + Error("ReturnT", "Task %s not found !", what.Data() ) ; return 0 ; } TTask * phosT = dynamic_cast(tasks->GetListOfTasks()->FindObject("PHOS")) ; if (!phosT) { - cerr << "ERROR: AliPHOSGetter::ReturnT -> Task " << what << "/PHOS not found!" << endl ; + Error("ReturnT", "Task %s/PHOS not found !", what.Data() ) ; return 0 ; } @@ -2365,7 +2356,7 @@ const TTask * AliPHOSGetter::ReturnT(TString what, TString name) const } if(fDebug) - cout << "WARNING: AliPHOSGetter::ReturnT -> Task " << search << "/PHOS/" << name << " not found!" << endl ; + Warning("ReturnT", "-> Task %s/PHOS/%s not found", search.Data(), name.Data() ) ; return 0 ; } @@ -2395,7 +2386,7 @@ void AliPHOSGetter::RemoveTask(TString opt, TString name) const return ; } else { - cerr << "WARNING: AliPHOSGetter::RemoveTask -> Unknown option " << opt.Data() << endl ; + Warning("RemoveTask", "Unknown option %s", opt.Data() ); return ; } phos = dynamic_cast(task->GetListOfTasks()->FindObject("PHOS")) ; @@ -2466,7 +2457,7 @@ void AliPHOSGetter::RemoveObjects(TString opt, TString name) const } else { - cerr << "WARNING: AliPHOSGetter::RemoveObjects -> Unknown option " << opt.Data() << endl ; + Warning("RemoveObjects", "Unknown option %s", opt.Data() ) ; return ; } diff --git a/PHOS/AliPHOSGetter.h b/PHOS/AliPHOSGetter.h index e15f6d6aca6..a62c4915188 100644 --- a/PHOS/AliPHOSGetter.h +++ b/PHOS/AliPHOSGetter.h @@ -27,7 +27,6 @@ class TTask ; // --- Standard library --- #include -#include // --- AliRoot header files --- @@ -52,7 +51,7 @@ class AliPHOSGetter : public TObject { public: AliPHOSGetter(){ // ctor: this is a singleton, the ctor should never be called but cint needs it as public - cerr << "ERROR: AliPHOSGetter is a singleton default ctor not callable" << endl ; + Error("ctor", "AliPHOSGetter is a singleton default ctor not callable") ; abort() ; } AliPHOSGetter(const AliPHOSGetter & obj) { diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index 03c803cc624..4185f61cff6 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -26,7 +26,6 @@ // --- Standard library --- #include #include -#include // --- AliRoot header files --- #include "AliPHOSHit.h" @@ -142,7 +141,8 @@ ostream& operator << (ostream& out, const AliPHOSHit& hit) { // Print out Id and energy - out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << " " << hit.GetTime() << endl ; + //out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << " " << hit.GetTime() << endl ; + Warning("operator <<", "Implement differently") ; return out ; } diff --git a/PHOS/AliPHOSHit.h b/PHOS/AliPHOSHit.h index e278613cfe6..c8dd1e3f31f 100644 --- a/PHOS/AliPHOSHit.h +++ b/PHOS/AliPHOSHit.h @@ -19,8 +19,6 @@ // --- Standard library --- -#include - class AliPHOSHit : public AliHit { diff --git a/PHOS/AliPHOSIhepAnalyze.cxx b/PHOS/AliPHOSIhepAnalyze.cxx index ff75b0666dd..09d7bb31b39 100644 --- a/PHOS/AliPHOSIhepAnalyze.cxx +++ b/PHOS/AliPHOSIhepAnalyze.cxx @@ -37,8 +37,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSIhepAnalyze.h" @@ -92,19 +90,19 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents) AliPHOSGetter * please = AliPHOSGetter::GetInstance(GetFileName().Data(),"PHOS"); const AliPHOSGeometry * fGeom = please->PHOSGeometry(); - cout << "Start CPV Analysis-1. Resolutions, cluster multiplicity and lengths"<GetEvent(ievent); - cout<<" >>>>>>>Event "<>>>>>>Event %d .<<<<<<<", ievent) ; // Get branch of CPV impacts if (! (branchCPVimpacts =gAlice->TreeH()->GetBranch("PHOSCpvImpacts")) ) { - cout<<" Couldn't find branch PHOSCpvImpacts. Exit."<Fill(dxmin); hDz ->Fill(dzmin); // hDr ->Fill(TMath::Sqrt(r2min)); @@ -223,9 +221,8 @@ void AliPHOSIhepAnalyze::AnalyzeCPV1(Int_t Nevents) } delete [] hitsPerModule; - cout<<"++++ Event "<CpvRecPoints()->GetEntries() - <<" rec. points."<CpvRecPoints()->GetEntries()) ; } // Save histograms @@ -312,17 +309,17 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents) AliPHOSGetter * please = AliPHOSGetter::GetInstance(GetFileName().Data(),"PHOS"); const AliPHOSGeometry * fGeom = please->PHOSGeometry(); - cout << "Start EMC Analysis-1. Resolutions, cluster multiplicity and lengths"<GetEvent(ievent); - cout<<" >>>>>>>Event "<>>>>>>Event %d .<<<<<<<", ievent) ; // Get branch of EMC impacts if (! (branchEMCimpacts =gAlice->TreeH()->GetBranch("PHOSEmcImpacts")) ) { - cout<<" Couldn't find branch PHOSEmcImpacts. Exit."<Fill(dxmin); hDz ->Fill(dzmin); // hDr ->Fill(TMath::Sqrt(r2min)); @@ -436,8 +433,8 @@ void AliPHOSIhepAnalyze::AnalyzeEMC1(Int_t Nevents) } delete [] hitsPerModule; - cout<<"++++ Event "<EmcRecPoints()->GetEntriesFast()<<" Emc rec. points."<EmcRecPoints()->GetEntriesFast()) ; } // Save histograms @@ -540,7 +537,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV2(Int_t Nevents) for (Int_t itrack=0; itrackSetAddress(&fCpvImpacts); - cout<<" branchCPVimpacts ->SetAddress(&fCpvImpacts) OK."<SetAddress(&fCpvImpacts) OK."); branchCPVimpacts ->GetEntry(itrack,0); for (Int_t iModule=0; iModule < nOfModules; iModule++) { @@ -573,7 +570,7 @@ void AliPHOSIhepAnalyze::AnalyzeCPV2(Int_t Nevents) Float_t dz = GenHit1->Z() - GenHit2->Z(); Float_t dr = TMath::Sqrt(dx*dx + dz*dz); hDrij_cpv_g->Fill(dr); -// cout<<"(dx dz dr): "<Fill(rpMultX); hNrpZ->Fill(rpMultZ); hChi2->Fill(((AliPHOSEvalRecPoint*)pt)->Chi2Dof()); - cout<<"+++++ Event "<SetAddress(&fCpvImpacts); - cout<<" branchCPVimpacts ->SetAddress(&fCpvImpacts) OK."<SetAddress(&fCpvImpacts) OK."); branchCPVimpacts ->GetEntry(itrack,0); for (Int_t iModule=0; iModule < nOfModules; iModule++) { @@ -778,35 +777,35 @@ void AliPHOSIhepAnalyze::HitsCPV(TClonesArray& hits, Int_t nev) // Int_t ntracks = gAlice->GetEvent(ievent); // Int_t nOfModules = fGeom->GetNModules(); -// cout<<" Tracks: "<TreeH()->GetBranch("PHOSCpvImpacts")) ) return; // for (Int_t itrack=0; itrackSetAddress(&fCpvImpacts); -// cout<<" branchCPVimpacts ->SetAddress(&fCpvImpacts) OK."<SetAddress(&fCpvImpacts) OK."); // branchCPVimpacts ->GetEntry(itrack,0); -// cout<<" branchCPVimpacts ->GetEntry(itrack,0) OK."<GetEntry(itrack,0) OK."); // for (Int_t iModule=0; iModule < nOfModules; iModule++) { // impacts = (TClonesArray *)fCpvImpacts->At(iModule); -// cout<<" fCpvImpacts->At(iModule) OK."<At(iModule) OK."); // // Do loop over impacts in the module // for (Int_t iImpact=0; iImpactGetEntries(); iImpact++) { // impact=(AliPHOSImpact*)impacts->At(iImpact); // impact->Print(); // if(IsCharged(impact->GetPid())) // { -// cout<<" Add charged hit.."; +// Info("AnalyzeCPV1", " Add charged hit.."; // new(hits[hits.GetEntriesFast()]) AliPHOSImpact(*impact); -// cout<<"done."<Clear(); // } -// cout<<" PHOS event "<GetEntries()<<" charged CPV hits."<GetEntries()<<" charged CPV hits."); // } Bool_t AliPHOSIhepAnalyze::IsCharged(Int_t pdg_code) { // For HIJING - cout<<" pdg_code "< #include @@ -69,40 +68,3 @@ AliPHOSPID::~AliPHOSPID() fSplitFile = 0 ; } - -// //____________________________________________________________________________ -// void AliPHOSPID::SetSplitFile(const TString splitFileName) const -// { -// // Diverts the Digits in a file separate from the hits file - - -// TDirectory * cwd = gDirectory ; -// TFile * splitFile = gAlice->InitTreeFile("R",splitFileName.Data()); -// splitFile->cd() ; -// gAlice->Write(0, TObject::kOverwrite); - -// TTree *treeE = gAlice->TreeE(); -// if (!treeE) { -// cerr << "ERROR: AliPHOSPID::SetSplitFile -> No TreeE found "<SetBranchAddress("Header", &header); -// treeE->SetBranchStatus("*",1); -// TTree *treeENew = treeE->CloneTree(); -// treeENew->Write(0, TObject::kOverwrite); - -// // copy AliceGeom -// TGeometry *AliceGeom = static_cast(cwd->Get("AliceGeom")); -// if (!AliceGeom) { -// cerr << "ERROR: AliPHOSPID::SetSplitFile -> AliceGeom was not found in the input file "<Write(0, TObject::kOverwrite) ; - -// gAlice->MakeTree("R",splitFile); -// cwd->cd() ; -// cout << "INFO: AliPHOSPID::SetSPlitMode -> RecParticles will be stored in " << splitFileName.Data() << endl ; -// } diff --git a/PHOS/AliPHOSPIDv0.cxx b/PHOS/AliPHOSPIDv0.cxx index 4f601c2073e..ac6adde79b6 100644 --- a/PHOS/AliPHOSPIDv0.cxx +++ b/PHOS/AliPHOSPIDv0.cxx @@ -68,9 +68,6 @@ #include "TBenchmark.h" // --- Standard library --- -#include -#include - // --- AliRoot header files --- #include "AliRun.h" @@ -202,8 +199,7 @@ void AliPHOSPIDv0::Exec(Option_t * option) // } // if ( phospidfound || pidfound ) { -// cerr << "WARNING: AliPHOSPIDv0::Exec -> RecParticles and/or PIDtMaker branch with name " -// << taskName.Data() << " already exits" << endl ; +// Error("Exec", "RecParticles and/or PIDtMaker branch with name %s already exists", taskName.Data() ) ; // return ; // } @@ -212,7 +208,7 @@ void AliPHOSPIDv0::Exec(Option_t * option) for(ievent = 0; ievent < nevents; ievent++){ gime->Event(ievent,"R") ; - cout << "event " << ievent << " " << gime->EmcRecPoints() << " " << gime->TrackSegments() << endl ; + Info("Exec", "event %d %d %d", ievent, gime->EmcRecPoints(), gime->TrackSegments()) ; MakeRecParticles() ; WriteRecParticles(ievent); @@ -227,10 +223,8 @@ void AliPHOSPIDv0::Exec(Option_t * option) if(strstr(option,"tim")){ gBenchmark->Stop("PHOSPID"); - cout << "AliPHOSPID:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSPID") << " seconds for PID " - << gBenchmark->GetCpuTime("PHOSPID")/nevents << " seconds per event " << endl ; - cout << endl ; + Info("Exec", "took %f seconds for PID %f seconds per event", + gBenchmark->GetCpuTime("PHOSPID"), gBenchmark->GetCpuTime("PHOSPID")/nevents) ; } } @@ -248,7 +242,7 @@ void AliPHOSPIDv0::Init() AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), taskName.Data(),fToSplit) ; if ( gime == 0 ) { - cerr << "ERROR: AliPHOSPIDv0::Init -> Could not obtain the Getter object !" << endl ; + Error("Init", "Could not obtain the Getter object !") ; return ; } @@ -367,23 +361,28 @@ void AliPHOSPIDv0::MakeRecParticles(){ void AliPHOSPIDv0:: Print(Option_t * option) const { // Print the parameters used for the particle type identification - cout << "=============== AliPHOSPID1 ================" << endl ; - cout << "Making PID "<< endl ; - cout << " Headers file: " << fHeaderFileName.Data() << endl ; - cout << " RecPoints branch title: " << fRecPointsTitle.Data() << endl ; - cout << " TrackSegments Branch title: " << fTrackSegmentsTitle.Data() << endl ; - cout << " RecParticles Branch title " << fRecParticlesTitle.Data() << endl; - cout << "with parameters: " << endl ; - cout << " Maximal EMC - CPV distance (cm) " << fCpvEmcDistance << endl ; - if(fIDOptions.Contains("dis",TString::kIgnoreCase )) - cout << " dispersion cut " << fDispersion << endl ; - if(fIDOptions.Contains("ell",TString::kIgnoreCase )){ - cout << " Eliptic cuts function: " << endl ; - cout << fFormula->GetTitle() << endl ; - } - if(fIDOptions.Contains("tim",TString::kIgnoreCase )) - cout << " Time Gate uzed: " << fTimeGate << endl ; - cout << "============================================" << endl ; + TString message ; + message = "=============== AliPHOSPID1 ================\n" ; + message += "Making PID\n" ; + message += " Headers file: %s\n" ; + message += " RecPoints branch title: %s\n" ; + message += " TrackSegments Branch title: %s\n" ; + message += " RecParticles Branch title %s\n" ; + message += "with parameters:\n" ; + message += " Maximal EMC - CPV distance (cm) %f\n" ; + Info("Print", message.Data(), + fHeaderFileName.Data(), + fRecPointsTitle.Data(), + fTrackSegmentsTitle.Data(), + fRecParticlesTitle.Data(), + fCpvEmcDistance ); + + if(fIDOptions.Contains("dis",TString::kIgnoreCase )) + Info("Print", " dispersion cut %f", fDispersion ) ; + if(fIDOptions.Contains("ell",TString::kIgnoreCase )) + Info("Print", " Eliptic cuts function: %s", fFormula->GetTitle() ) ; + if(fIDOptions.Contains("tim",TString::kIgnoreCase )) + Info("Print", " Time Gate used: %f", fTimeGate) ; } //____________________________________________________________________________ @@ -558,18 +557,13 @@ void AliPHOSPIDv0::PrintRecParticles(Option_t * option) taskName.Remove(taskName.Index(Version())-1) ; TClonesArray * recParticles = gime->RecParticles(taskName) ; - cout << "AliPHOSPIDv0: event "<GetEvNumber() << endl ; - cout << " found " << recParticles->GetEntriesFast() << " RecParticles " << endl ; - + TString message ; + message = "event %d\n" ; + message += " found %d RecParticles\n" ; + Info("PrintRecParticles", message.Data(), gAlice->GetEvNumber(), recParticles->GetEntriesFast() ) ; + if(strstr(option,"all")) { // printing found TS - - cout << " PARTICLE " - << " Index " << endl ; - // << " X " - // << " Y " - // << " Z " - // << " # of primaries " - // << " Primaries list " << endl; + Info("PrintRecParticles"," PARTICLE Index \n" ) ; Int_t index ; for (index = 0 ; index < recParticles->GetEntries() ; index++) { @@ -607,16 +601,9 @@ void AliPHOSPIDv0::PrintRecParticles(Option_t * option) // Int_t nprimaries; // primaries = rp->GetPrimaries(nprimaries); - cout << setw(10) << particle << " " - << setw(5) << rp->GetIndexInList() << " " ; - // << setw(4) << nprimaries << " "; - // for (Int_t iprimary=0; iprimaryGetIndexInList()) ; } - cout << "-------------------------------------------" << endl ; - } - + } } diff --git a/PHOS/AliPHOSPIDv1.cxx b/PHOS/AliPHOSPIDv1.cxx index 2e4704bfed7..6dc869aa3bf 100644 --- a/PHOS/AliPHOSPIDv1.cxx +++ b/PHOS/AliPHOSPIDv1.cxx @@ -194,7 +194,7 @@ void AliPHOSPIDv1::Init() // gime->SetRecParticlesTitle(BranchName()) ; if ( gime == 0 ) { - cerr << "ERROR: AliPHOSPIDv1::Init -> Could not obtain the Getter object !" << endl ; + Error("Init", "Could not obtain the Getter object !" ) ; return ; } @@ -349,7 +349,8 @@ const Int_t AliPHOSPIDv1::GetPrincipalSign(const Double_t* P,const Int_t eff_pu if((eff_pur==1)&&(R <2. )) prinsign= 1; if((eff_pur==0)&&(R <9./2.)) prinsign= 1; - if(R<0)cout<<"Error: Negative square?"<4)||(i<0)) - cout<<"Error:: No parameter with index "<4)||(i<0)) - cout<<"Error:: No parameter with index "< RecParticles and/or PIDtMaker branch with name " -// << taskName.Data() << " already exits" << endl ; +// Error("Exec", "RecParticles and/or PIDtMaker branch with name %s already exists", taskName.Data() ) ; // return ; // } // } @@ -621,12 +622,10 @@ void AliPHOSPIDv1::Exec(Option_t * option) if(strstr(option,"tim")){ gBenchmark->Stop("PHOSPID"); - cout << "AliPHOSPID:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSPID") << " seconds for PID " - << gBenchmark->GetCpuTime("PHOSPID")/nevents << " seconds per event " << endl ; - cout << endl ; - } - + Info("Exec", "took %f seconds for PID %f seconds per event", + gBenchmark->GetCpuTime("PHOSPID"), + gBenchmark->GetCpuTime("PHOSPID")/nevents) ; + } } //____________________________________________________________________________ @@ -639,7 +638,7 @@ void AliPHOSPIDv1::MakeRecParticles(){ TObjArray * cpvRecPoints = gime->CpvRecPoints() ; TClonesArray * trackSegments = gime->TrackSegments() ; if ( !emcRecPoints || !cpvRecPoints || !trackSegments ) { - cerr << "ERROR: AliPHOSPIDv1::MakeRecParticles -> RecPoints or TrackSegments not found ! " << endl ; + Error("MakeRecParticles", "RecPoints or TrackSegments not found !") ; abort() ; } TClonesArray * recParticles = gime->RecParticles() ; @@ -671,8 +670,7 @@ void AliPHOSPIDv1::MakeRecParticles(){ // YK: check if (emc != 0) !!! if (!emc) { - cerr << "ERROR: AliPHOSPIDv1::MakeRecParticles -> emc(" - <GetEmcIndex()<<") = " < emc(%d) = %d", ts->GetEmcIndex(), emc ) ; abort(); } Float_t e = emc->GetEnergy() ; @@ -754,21 +752,18 @@ void AliPHOSPIDv1::MakeRecParticles(){ void AliPHOSPIDv1:: Print() { // Print the parameters used for the particle type identification - cout << "=============== AliPHOSPID1 ================" << endl ; - cout << "Making PID "<< endl ; -// cout << " Headers file: " << fHeaderFileName.Data() << endl ; -// cout << " RecPoints branch title: " << fRecPointsTitle.Data() << endl ; -// cout << " TrackSegments Branch title: " << fTrackSegmentsTitle.Data() << endl ; -// cout << " RecParticles Branch title " << fRecParticlesTitle.Data() << endl; - cout << " Pricipal analysis file from 0.5 to 100 " << fFileName.Data() << endl; - cout << " Name of parameters file "<Print() ; - cout << "============================================" << endl ; } //____________________________________________________________________________ @@ -856,26 +851,25 @@ void AliPHOSPIDv1::PrintRecParticles(Option_t * option) AliPHOSGetter *gime = AliPHOSGetter::GetInstance() ; TClonesArray * recParticles = gime->RecParticles(BranchName()) ; - - cout << "AliPHOSPIDv1: event "<GetEvNumber() << endl ; - cout << " found " << recParticles->GetEntriesFast() << " RecParticles " << endl ; - + + TString message ; + message = "event %d\n" ; + message += " found %d RecParticles\n" ; + Info("PrintRecParticles", message.Data(), gAlice->GetEvNumber(), recParticles->GetEntriesFast() ) ; if(strstr(option,"all")) { // printing found TS - - cout << " PARTICLE " - << " Index " << endl ; + message = " PARTICLE Index \n" ; + Info("PrintRecParticles", message.Data() ) ; Int_t index ; for (index = 0 ; index < recParticles->GetEntries() ; index++) { - AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) recParticles->At(index) ; - - cout << setw(10) << rp->Name() << " " - << setw(5) << rp->GetIndexInList() << " " <GetType() << endl; + AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) recParticles->At(index) ; + message = " %s %d Type %d\n" ; + Info("PrintRecParticles", message.Data(), + rp->Name().Data(), + rp->GetIndexInList(), + rp->GetType() ); } - cout << "-------------------------------------------" << endl ; - } - + } } diff --git a/PHOS/AliPHOSPpsdRecPoint.cxx b/PHOS/AliPHOSPpsdRecPoint.cxx index 609bcc5d1eb..d16d22e141c 100644 --- a/PHOS/AliPHOSPpsdRecPoint.cxx +++ b/PHOS/AliPHOSPpsdRecPoint.cxx @@ -267,16 +267,14 @@ void AliPHOSPpsdRecPoint::Print(Option_t * option) { // Print the digits information - cout << "AliPHOSPpsdRecPoint: " << endl ; + Info("Print","AliPHOSPpsdRecPoint: " ) ; Int_t iDigit; - cout << " Digit{s} # " ; + Info("Print"," Digit{s} # ") ; for(iDigit=0; iDigit // --- AliRoot header files --- #include "AliPHOSQAAlarm.h" @@ -55,5 +54,5 @@ ClassImp(AliPHOSQAAlarm) { // print the message - cout << "Event# " << fEvent << " " << fMessage << endl; + Info("Print", "Event# %d %s", fEvent, fMessage.Data()) ; } diff --git a/PHOS/AliPHOSQAChecker.cxx b/PHOS/AliPHOSQAChecker.cxx index 4723bf4e245..87893921bbf 100644 --- a/PHOS/AliPHOSQAChecker.cxx +++ b/PHOS/AliPHOSQAChecker.cxx @@ -27,7 +27,6 @@ // --- Standard library --- -#include // --- AliRoot header files --- #include "AliPHOSQAChecker.h" @@ -159,7 +158,7 @@ ClassImp(AliPHOSQAChecker) { // print the checker and sub-checkers, if any, name. - cout << "Checker : " << GetName() << endl ; + Info("Print", "Checker : %s", GetName()) ; } @@ -167,7 +166,7 @@ ClassImp(AliPHOSQAChecker) void AliPHOSQAChecker::PrintAlarms() { // Prints the alarms of all attached checkables - cout << "Checker name : " << GetName() << endl ; + Info("PrintAlarms", "Checker name : %s", GetName()) ; if ( !(fCheckablesList->IsEmpty() ) ) { TIter next( fCheckablesList ) ; AliPHOSQAVirtualCheckable * checkable ; @@ -181,9 +180,9 @@ ClassImp(AliPHOSQAChecker) { // Prints the checkables attached to this checker if ( fCheckablesList->IsEmpty() ) - cout << "No checkables are checked by " << GetName() << endl ; + Info("Status", "No checkables are checked by %s", GetName()) ; else { - cout << "The following checkables are checked by " << GetName() << endl ; + Info("Status", "The following checkables are checked by %s", GetName()) ; TIter next(fCheckablesList) ; AliPHOSQAVirtualCheckable * checkable ; while ( (checkable = (AliPHOSQAVirtualCheckable*)next() ) ) diff --git a/PHOS/AliPHOSQAFloatCheckable.cxx b/PHOS/AliPHOSQAFloatCheckable.cxx index 178cb4f5536..9ad160d8b67 100644 --- a/PHOS/AliPHOSQAFloatCheckable.cxx +++ b/PHOS/AliPHOSQAFloatCheckable.cxx @@ -27,8 +27,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSQAFloatCheckable.h" @@ -56,7 +54,7 @@ ClassImp(AliPHOSQAFloatCheckable) void AliPHOSQAFloatCheckable::Print() const { // Print the chekable name and its value - cout << " Checkable-> " << GetName() << " : value = " << fValue << endl ; + Info("Print", "Checkable-> %s : value = %f", GetName(), fValue) ; } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSQAIntCheckable.cxx b/PHOS/AliPHOSQAIntCheckable.cxx index cc49b77822e..2421fe60818 100644 --- a/PHOS/AliPHOSQAIntCheckable.cxx +++ b/PHOS/AliPHOSQAIntCheckable.cxx @@ -27,8 +27,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSQAIntCheckable.h" @@ -55,7 +53,7 @@ ClassImp(AliPHOSQAIntCheckable) void AliPHOSQAIntCheckable::Print() const { // Print the chekable name and its value - cout << " Checkable-> " << GetName() << " : value = " << fValue << endl ; + Info("Print", "Checkable-> %s : value = %d", GetName(), fValue) ; } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSQAMeanChecker.cxx b/PHOS/AliPHOSQAMeanChecker.cxx index b4ec8e0afe6..216fffd4dc5 100644 --- a/PHOS/AliPHOSQAMeanChecker.cxx +++ b/PHOS/AliPHOSQAMeanChecker.cxx @@ -69,9 +69,8 @@ TString AliPHOSQAMeanChecker::CheckingOperation() Float_t checked = 0. ; if ( (fCheckable->HasA() == "I") && (fCheckable->HasA() == "F") ) { - cout << " ERROR : checker " << GetName() << " says you got the wrong checkable " - << fCheckable->GetName() << endl ; - cout << " or the checkable has no value !" << endl ; + Error("CheckingOperation", "checker %s says you got the wrong checkable %s \n + or the checkable has no value !", GetName(), fCheckable->GetName()) ; } else { checked = fCheckable->GetValue(); if (checked < fMean-fRms || checked > fMean+fRms) { @@ -90,5 +89,5 @@ TString AliPHOSQAMeanChecker::CheckingOperation() { // print the name - cout << "Checker : " << GetName() << " : " << GetTitle() << " : Mean = " << fMean << " Rms = " << fRms << endl ; + Info("Print", "Checker : %s : %s : Mean = %f Rms = %f", GetName(), GetTitle(), fMean, fRms) ; } diff --git a/PHOS/AliPHOSQAObjectCheckable.cxx b/PHOS/AliPHOSQAObjectCheckable.cxx index 15d8c976f62..5fc9aca635a 100644 --- a/PHOS/AliPHOSQAObjectCheckable.cxx +++ b/PHOS/AliPHOSQAObjectCheckable.cxx @@ -27,8 +27,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSQAObjectCheckable.h" @@ -52,10 +50,10 @@ ClassImp(AliPHOSQAObjectCheckable) //____________________________________________________________________________ void AliPHOSQAObjectCheckable::Print() const { - cout << " Checkable-> " << GetName() << " : value = " << endl ; + Info("Print", "Checkable-> %s : value = ", GetName()) ; if( fObject ) fObject->Print() ; else - cerr << "ERROR : no object specified yet " << endl ; + Info("Print", "no object specified yet" ) ; } diff --git a/PHOS/AliPHOSQAVirtualCheckable.cxx b/PHOS/AliPHOSQAVirtualCheckable.cxx index 006b3be409e..f1813550ef6 100644 --- a/PHOS/AliPHOSQAVirtualCheckable.cxx +++ b/PHOS/AliPHOSQAVirtualCheckable.cxx @@ -31,8 +31,6 @@ // --- Standard library --- -#include - // --- AliRoot header files --- #include "AliPHOSQAVirtualCheckable.h" @@ -88,7 +86,7 @@ ClassImp(AliPHOSQAVirtualCheckable) // Prints all the alarms TObjArray * alarms = GetAlarms() ; if (alarms->IsEmpty() ) - cout << " No alarms raised for checkable " << GetName() << endl ; + Info("Alarms", "No alarms raised for checkable %s", GetName()) ; else { TIter next(alarms); AliPHOSQAAlarm * alarm ; @@ -109,7 +107,7 @@ void AliPHOSQAVirtualCheckable::CheckMe() void AliPHOSQAVirtualCheckable::RaiseAlarm(const char * time, const char * checked, const char * checker, const char * message) { // Raise an alarm and store it in the appropriate folder : //Folders/Run/Conditions/QA/PHOS.. - // cout << message ; + // Info("RaiseAlarm", "%s", message) ; AliPHOSQAAlarm * alarm = new AliPHOSQAAlarm(time, checked, checker, message) ; GetAlarms()->Add(alarm) ; } @@ -131,10 +129,10 @@ void AliPHOSQAVirtualCheckable::RaiseAlarm(const char * time, const char * check // resets the list of alarms (delete the alarms from the list) TObjArray * alarms = GetAlarms() ; if (alarms->IsEmpty() ) - cout << " No alarms raised for checkable " << GetName() << endl ; + Info("ResetAlarms", "No alarms raised for checkable %s", GetName()) ; else { alarms->Delete() ; - cout << " Reset alarms for checkable " << GetName() << endl ; + Info("ResetAlarms", " Reset alarms for checkable %s", GetName()) ; } } @@ -144,9 +142,9 @@ void AliPHOSQAVirtualCheckable::RaiseAlarm(const char * time, const char * check // Tells which checkers are attached to this checkable TList * list = fChecker->GetListOfTasks(); if (list->IsEmpty() ) - cout << "No checkers are in use for " << GetName() << endl ; + Info("Status", "No checkers are in use for %s", GetName()) ; else { - cout << "The following checkers are in use for " << GetName() << endl ; + Info("Status", "The following checkers are in use for %s", GetName()) ; TIter next(list) ; AliPHOSQAChecker * checker ; while ( (checker = (AliPHOSQAChecker*)next() ) ) diff --git a/PHOS/AliPHOSRaw2Digits.cxx b/PHOS/AliPHOSRaw2Digits.cxx index 675c2ec6e5e..541223d59fb 100644 --- a/PHOS/AliPHOSRaw2Digits.cxx +++ b/PHOS/AliPHOSRaw2Digits.cxx @@ -30,7 +30,6 @@ #include "TTree.h" // --- Standard library --- -#include //#include #include #include @@ -190,7 +189,7 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ sprintf(command,"zcat %s",fInName.Data()); FILE *dataFile = popen(command, "r"); if (dataFile == NULL) { - cout << " Can not open file " << fInName.Data() << endl ; + Warning("ProcessRawFile", " Cannot open file %s\n", fInName.Data() ) ; perror(fInName.Data()) ; fStatus = -1 ; return kFALSE ; @@ -201,7 +200,7 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ UInt_t w = 0x12345678; Int_t swapo = memcmp(&w, "\x78\x56\x34\x12", sizeof(UInt_t)) == 0; if(fDebug) - cout << "swapo=" << swapo << endl; + Info("ProcessRawFile", "swapo=%f\n", swapo ) ; UInt_t recBuf[300] ; @@ -213,20 +212,20 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ if (n < 0 ) perror(fInName.Data()); else - cout << "Could not read physical record control words" << endl; + Error("ProcessRawFile", "Could not read physical record control words" ) ; fStatus = -2 ; return kFALSE; } if(fDebug) - cout << "recbuf[0] = " << recBuf[0] << endl ; + Info("ProcessRawFile", "recbuf[0] = %d\n", recBuf[0] ); // Check if it is a ZEBRA file and if the words are swapped UInt_t swapi = 0 ; if (recBuf[0] != fMK1) { Swab4(recBuf, &w, 1); if (w != fMK1) { - cout << "Does not look like a ZEBRA file\n"; + Error("ProcessRawFile", "Does not look like a ZEBRA file\n" ) ; pclose(dataFile) ; fStatus = -2 ; return kFALSE; @@ -235,8 +234,10 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ } if(fDebug){ - cout << " w = " << w << endl ;; - cout << " swapi = " << swapi << endl ;; + TString message ; + message = " w = %f\n" ; + message += " swapi = %f\n" ; + Info("ProcessRawFile", message.Data(), w, swapi ) ; } // Get number of words in physical record @@ -300,7 +301,7 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ UInt_t * recptr = recBuf; //Pointer to current position if(recptr[7] != 1) { - cout << "Can not handle fast blocks" << endl; + Error("ProcessRawFile", "Cannot handle fast blocks" ) ; fStatus = -2 ; return kFALSE; } @@ -309,14 +310,14 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ // Logical record control words UInt_t lrtyp = recptr[1]; if (lrtyp != 3) { - cout << "Can not handle logical record type " << lrtyp << endl ; + Error("ProcessRawFile", "Can not handle logical record type %d", lrtyp ) ; fStatus = -2 ; return kFALSE; } recptr += 2; if (recptr[0] != fCKW) { - cout << "Bad check word" << endl; + Error("ProcessRawFile", "Bad check word" ) ; fStatus = -2 ; return kFALSE; } @@ -332,7 +333,7 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ UInt_t evtno = recptr[2]; /* Event number */ if(fDebug) - cout << "evtno=" << evtno << endl; + Info("ProcessRawFile", "evtno= %d", evtno); UInt_t nh = recptr[4]; /* Number of header words in data bank */ recptr += nh; @@ -370,7 +371,7 @@ Bool_t AliPHOSRaw2Digits::ProcessRawFile(){ new((*fDigits)[i])AliPHOSDigit(-1,absID,peak,0.,i) ; if(fDebug){ if(peak>(UShort_t)1000) - cout << "event=" << fEvent << " peak[" << i << "] = "<GetName() << " " << fctdb->GetTitle() << endl ; + message += "%s %s \n" ; else - cout << " no DB " << endl ; - + message += " no DB \n" ; + + Info("Print", message.Data(), + fInName.Data(), + GetTitle(), + fEvent, + fctdb->GetName(), fctdb->GetTitle() ) ; } diff --git a/PHOS/AliPHOSRecCpvManager.cxx b/PHOS/AliPHOSRecCpvManager.cxx index 8a59b994f2a..276a5da1190 100644 --- a/PHOS/AliPHOSRecCpvManager.cxx +++ b/PHOS/AliPHOSRecCpvManager.cxx @@ -89,7 +89,7 @@ Float_t AliPHOSRecCpvManager::OneGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, F Float_t dd = da/D; Gi = dd*(2.- dd*Const*(1.-2.*Ai/Etot)); - cout<<" OneGamChi2 (Ai,Ei,Etot,&Gi,chi2) "<GetPadSizeZ(); Float_t CelY = geom->GetPadSizePhi(); -// // cout<<"CelZ: "< - // --- AliRoot header files --- #include "AliPHOSRecManager.h" diff --git a/PHOS/AliPHOSRecParticle.cxx b/PHOS/AliPHOSRecParticle.cxx index 763502ef2b7..f37206c0ef8 100644 --- a/PHOS/AliPHOSRecParticle.cxx +++ b/PHOS/AliPHOSRecParticle.cxx @@ -93,8 +93,7 @@ const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const { if ( index > GetNPrimariesToRecParticles() ) { if (fDebug) - cout << "WARNING : AliPHOSRecParticle::GetPrimary -> " << index << " is larger that the number of primaries " - << GetNPrimaries() << endl ; + Warning("GetPrimary", "%d is larger that the number of primaries %d", index, GetNPrimaries()) ; return 0 ; } else { Int_t dummy ; @@ -103,7 +102,7 @@ const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const Int_t primaryindex = ((AliPHOSEmcRecPoint*)gime->EmcRecPoints()->At(emcRPindex))->GetPrimaries(dummy)[index] ; // if (primaryindex >= 10000000) { // it comes from backgroundfile // if (fDebug) -// cout << "WARNING : AliPHOSRecParticle::GetPrimary -> not a signal primary" << endl ; +// Warning("GetPrimary","-> not a signal primary") ; // return 0 ; // } else return gime->Primary(primaryindex) ; diff --git a/PHOS/AliPHOSRecPoint.cxx b/PHOS/AliPHOSRecPoint.cxx index 3490d20095a..8749900f07d 100644 --- a/PHOS/AliPHOSRecPoint.cxx +++ b/PHOS/AliPHOSRecPoint.cxx @@ -25,7 +25,6 @@ #include "TClonesArray.h" // --- Standard library --- -#include // --- AliRoot header files --- @@ -210,7 +209,7 @@ void AliPHOSRecPoint::EvalPrimaries(TClonesArray * digits) for ( jndex = 0 ; jndex < nprimaries ; jndex++ ) { // all primaries in digit if ( fMulTrack > fMaxTrack ) { fMulTrack = - 1 ; - cout << "AliPHOSRecPoint::GetNprimaries ERROR > increase fMaxTrack " << endl ; + Error("EvalPrimaries", "GetNprimaries ERROR > increase fMaxTrack" ) ; break ; } Int_t newprimary = newprimaryarray[jndex] ; diff --git a/PHOS/AliPHOSReconstructioner.cxx b/PHOS/AliPHOSReconstructioner.cxx index 7345f885bad..3a3fec86651 100644 --- a/PHOS/AliPHOSReconstructioner.cxx +++ b/PHOS/AliPHOSReconstructioner.cxx @@ -28,8 +28,7 @@ // Thanks to getters, one can set // parameters to reconstruction briks. The full set of parameters is saved in the // corresponding branch: e.g. parameters of clusterizer are stored in branch -// TreeR::AliPHOSClusterizer with the same title as the branch containing the RecPoints. -// TTree does not support overwriting, therefore one can not produce several +// TreeR::AliPHOSClusterizer with the same title as the branch containing the RecPoints. // TTree does not support overwriting, therefore one can not produce several // branches with the same names and titles - use different titles. // // Use case: @@ -66,7 +65,6 @@ #include "TFile.h" // --- Standard library --- -#include // --- AliRoot header files --- #include "AliRun.h" @@ -139,6 +137,7 @@ void AliPHOSReconstructioner::Exec(Option_t *option) if(!fIsInitialized) Init() ; + TString message(" ") ; // gAlice->GetEvent(0) ; // if(fSDigitizer->IsActive()&& gAlice->TreeS()){ //Will produce SDigits @@ -166,11 +165,10 @@ void AliPHOSReconstructioner::Exec(Option_t *option) // } // if(!(sdigitizerNotFound && phosNotFound)){ -// cout << "AliPHOSReconstructioner error: "<< endl ; -// cout << " Branches ''PHOS'' or ''AliPHOSSDigitizer'' with title ``" << fSDigitsBranch.Data() << "''" << endl ; -// cout << " already exist in TreeS. ROOT does not allow updating/overwriting." << endl ; -// cout << " Specify another title for branches or use ''StartFrom()'' method" << endl ; - +// message = " Branches PHOS or AliPHOSSDigitizer with title %s\n" ; +// message += " already exist in TreeS. ROOT does not allow updating/overwriting.\n" ; +// message += " Specify another title for branches or use StartFrom() method\n" ; +// Error("Exec", message.Data(), fSDigitsBranch.Data() ) ; // //mark all tasks as inactive // TIter next(fTasks); // TTask *task; @@ -206,11 +204,10 @@ void AliPHOSReconstructioner::Exec(Option_t *option) // } // if(!(digitizerNotFound && phosNotFound)){ -// cout << "AliPHOSReconstructioner error: "<< endl ; -// cout << " Branches ''PHOS'' or ''AliPHOSDigitizer'' with title ``" << fDigitsBranch.Data() << "''" << endl ; -// cout << " already exist in TreeD. ROOT does not allow updating/overwriting." << endl ; -// cout << " Specify another title for branches or use ''StartFrom()'' method" << endl ; - +// message = " Branches PHOS or AliPHOSDigitizer with title %s\n" ; +// message += " already exist in TreeD. ROOT does not allow updating/overwriting.\n" ; +// message += " Specify another title for branches or use StartFrom() method" ; +// Error("Exec", message>Data(), fDigitsBranch.Data() ) ; // //mark all tasks as inactive // TIter next(fTasks); // TTask *task; @@ -255,12 +252,10 @@ void AliPHOSReconstructioner::Exec(Option_t *option) // } // if(!(clusterizerNotFound && emcNotFound && cpvNotFound)){ -// cout << "AliPHOSReconstructioner error: "<< endl ; -// cout << " Branches ''PHOSEmcRP'', ''PHOSCpvRP'' or ''AliPHOSClusterizer'' with title ``" -// << fRecPointBranch.Data() << "''" << endl ; -// cout << " already exist in TreeR. ROOT does not allow updating/overwriting." << endl ; -// cout << " Specify another title for branches or use ''StartFrom()'' method" << endl ; - +// message = " Branches PHOSEmcRP, PHOSCpvRP or AliPHOSClusterizer with title %s\n" ; +// message += " already exist in TreeR. ROOT does not allow updating/overwriting.\n" ; +// message += " Specify another title for branches or use StartFrom() method\n" ; +// Error("Exec", message.Data(),fRecPointBranch.Data() ) ; // //mark all tasks as inactive // TIter next(fTasks); // TTask *task; @@ -295,12 +290,10 @@ void AliPHOSReconstructioner::Exec(Option_t *option) // } // if(!(tsMakerNotFound &&tsNotFound) ){ -// cout << "AliPHOSReconstructioner error: "<< endl ; -// cout << " Branches ''PHOSTS'' or ''AliPHOSTrackSegmentMaker'' with title ``" -// << fTSBranch.Data() << "''" << endl ; -// cout << " already exist in TreeR. ROOT does not allow updating/overwriting." << endl ; -// cout << " Specify another title for branches or use ''StartFrom()'' method" << endl ; - +// message = " Branches PHOSTS or AliPHOSTrackSegmentMaker with title %s\n" ; +// message += " already exist in TreeR. ROOT does not allow updating/overwriting.\n" ; +// message += " Specify another title for branches or use StartFrom() method\n" ; +// Error("Exec", message.Data(),fTSBranch.Data() ) ; // //mark all tasks as inactive // TIter next(fTasks); // TTask *task; @@ -337,12 +330,10 @@ void AliPHOSReconstructioner::Exec(Option_t *option) // } // if(!pidNotFound || !rpNotFound ){ -// cout << "AliPHOSReconstructioner error: "<< endl ; -// cout << " Branches ''PHOSRP'' or ''AliPHOSPID'' with title ``" -// << fRecPartBranch.Data() << "''" << endl ; -// cout << " already exist in TreeR. ROOT does not allow updating/overwriting." << endl ; -// cout << " Specify another title for branches." << endl ; - +// message = " Branches PHOSRP or AliPHOSPID with title %s\n" ; +// message += " already exist in TreeR. ROOT does not allow updating/overwriting.\n" ; +// message += " Specify another title for branches.\n" ; +// Error("Exec", message.Data(), fRecPartBranch.Data() ) ; // //mark all tasks as inactive // TIter next(fTasks); // TTask *task; @@ -453,9 +444,11 @@ AliPHOSReconstructioner::~AliPHOSReconstructioner() // return ; // } -// cout << "There is no branch " << branch << "!"<< endl ; -// cout << "Available branches `SDigits', `Digits', `RecPoints', `TrackSegments' and `RecParticles' " << endl ; - +// +// TString message ; +// message = "There is no branch %s !\n" ; +// message += "Available branches `SDigits', `Digits', `RecPoints', `TrackSegments' and `RecParticles'\n" ; +// Warning("SetBranchTitle", message.Data(), branch ) ; // } // //____________________________________________________________________________ // void AliPHOSReconstructioner::StartFrom(char * module,char* title) @@ -488,7 +481,7 @@ AliPHOSReconstructioner::~AliPHOSReconstructioner() // if(strstr(module,"PID") || strstr(module,"Particle") || strstr(module,"RP") ) // sprintf(moduleName,"AliPHOSPID") ; // else{ -// cout << "Do not know such a module / Rec Object " << endl; +// Warning("StartFrom", "Do not know such a module / Rec Object ") ; // return ; // } @@ -537,34 +530,34 @@ AliPHOSReconstructioner::~AliPHOSReconstructioner() void AliPHOSReconstructioner::Print(Option_t * option)const { // Print reconstructioner data - cout << "-----------------AliPHOSReconstructioner---------------" << endl ; - cout << " Reconstruction of the header file " <IsActive()){ - cout << " (+) " << fSDigitizer->GetName() << " to branch : " << fSDigitsBranch.Data() << endl ; - cout << endl ; + message += " (+) %s to branch %s\n" ; } if(fDigitizer->IsActive()){ - cout << " (+) " << fDigitizer->GetName() << " to branch : " << fDigitsBranch.Data() << endl ; - cout << endl ; + message += " (+) %s to branch %s\n" ; } if(fClusterizer->IsActive()){ - cout << " (+) " <GetName() << " to branch : " <IsActive()){ - cout << " (+) " << fTSMaker->GetName() << " to branch : " << fTSBranch.Data() << endl ; - cout << endl ; + message += " (+) %s to branch %s\n" ; } - if(fPID->IsActive()){ - cout << " (+) " << fPID->GetName() << " to branch : " <GetName(), fSDigitsBranch.Data(), + fDigitizer->GetName(), fDigitsBranch.Data() , + fClusterizer->GetName(), fRecPointBranch.Data(), + fTSMaker->GetName(), fTSBranch.Data() , + fPID->GetName(), fRecPartBranch.Data() ) ; } diff --git a/PHOS/AliPHOSSDigitizer.cxx b/PHOS/AliPHOSSDigitizer.cxx index 704809538b6..89e5dab9eb4 100644 --- a/PHOS/AliPHOSSDigitizer.cxx +++ b/PHOS/AliPHOSSDigitizer.cxx @@ -61,7 +61,6 @@ #include "TGeometry.h" // --- Standard library --- -#include // --- AliRoot header files --- #include "AliRun.h" @@ -117,8 +116,7 @@ void AliPHOSSDigitizer::Init() AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), GetName(),fToSplit) ; if ( gime == 0 ) { - cerr << "ERROR: AliPHOSSDigitizer::Init -> Could not obtain the Getter object !" - << endl ; + Error("Init" ,"Could not obtain the Getter object !") ; return ; } @@ -266,10 +264,8 @@ void AliPHOSSDigitizer::Exec(Option_t *option) if(strstr(option,"tim")){ gBenchmark->Stop("PHOSSDigitizer"); - cout << "AliPHOSSDigitizer:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSSDigitizer") << " seconds for SDigitizing " - << gBenchmark->GetCpuTime("PHOSSDigitizer")/nevents << " seconds per event " << endl ; - cout << endl ; + Info("Exec"," took %f seconds for SDigitizing %f seconds per event", + gBenchmark->GetCpuTime("PHOSSDigitizer"), gBenchmark->GetCpuTime("PHOSSDigitizer")/nevents) ; } } @@ -288,11 +284,11 @@ void AliPHOSSDigitizer::SetSDigitsBranch(const char * title ) const char * sdigitsTitle = sdigitsBranch ->GetTitle() ; const char * sdigitizerTitle = sdigitizerBranch ->GetTitle() ; if ( stitle.CompareTo(sdigitsTitle)==0 || stitle.CompareTo(sdigitizerTitle)==0 ){ - cerr << "ERROR: AliPHOSSdigitizer::SetSDigitsBranch -> Cannot overwrite existing branch with title " << title << endl ; + Error("SetSDigitsBranch", "Cannot overwrite existing branch with title %s", title) ; return ; } - cout << "AliPHOSSdigitizer::SetSDigitsBranch -> Changing SDigits file from " << GetName() << " to " << title << endl ; + Info("SetSDigitsBranch", "-> Changing SDigits file from %s to %s", GetName(), title) ; SetName(title) ; @@ -306,12 +302,14 @@ void AliPHOSSDigitizer::SetSDigitsBranch(const char * title ) void AliPHOSSDigitizer::Print(Option_t* option)const { // Prints parameters of SDigitizer - cout << "------------------- "<< GetName() << " -------------" << endl ; - cout << " Writing SDigits to branch with title " << GetName() << endl ; - cout << " with digitization parameters A = " << fA << endl ; - cout << " B = " << fB << endl ; - cout << " Threshold for Primary assignment= " << fPrimThreshold << endl ; - cout << "---------------------------------------------------"<SDigits(sdname.Data()) ; + const TClonesArray * sdigits = gime->SDigits(sdname.Data()) ; - cout << "AliPHOSSDigitiser: event " << gAlice->GetEvNumber() << endl ; - cout << " Number of entries in SDigits list " << sdigits->GetEntriesFast() << endl ; - cout << endl ; + TString message ; + message = "\nAliPHOSSDigitiser: event " ; + message += gAlice->GetEvNumber(); + message += "\n Number of entries in SDigits list " ; + message += sdigits->GetEntriesFast() ; + if(strstr(option,"all")||strstr(option,"EMC")){ //loop over digits AliPHOSDigit * digit; - cout << "EMC sdigits " << endl ; - cout << "Digit Id Amplitude Index Nprim Primaries list " << endl; + message += "\nEMC sdigits\n" ; + message += "Digit Id Amplitude Index Nprim Primaries list\n" ; Int_t maxEmc = gime->PHOSGeometry()->GetNModules()*gime->PHOSGeometry()->GetNCristalsInModule() ; Int_t index ; for (index = 0 ; (index < sdigits->GetEntriesFast()) && ((dynamic_cast (sdigits->At(index)))->GetId() <= maxEmc) ; index++) { digit = dynamic_cast( sdigits->At(index) ) ; - if(digit->GetNprimary() == 0) continue; - cout << setw(6) << digit->GetId() << " " << setw(10) << digit->GetAmp() << " " - << setw(6) << digit->GetIndexInList() << " " - << setw(5) << digit->GetNprimary() <<" "; - + if(digit->GetNprimary() == 0) + continue; + message += digit->GetId() ; + message += digit->GetAmp() ; + message += digit->GetIndexInList() ; + message += digit->GetNprimary() ; Int_t iprimary; for (iprimary=0; iprimaryGetNprimary(); iprimary++) - cout << setw(5) << digit->GetPrimary(iprimary+1) << " "; - cout << endl; + message += digit->GetPrimary(iprimary+1) ; } - cout << endl; } if(strstr(option,"all")||strstr(option,"CPV")){ //loop over CPV digits AliPHOSDigit * digit; - cout << "CPV sdigits " << endl ; - cout << "Digit Id Amplitude Index Nprim Primaries list " << endl; + + message += "CPV sdigits\n" ; + message += "Digit Id Amplitude Index Nprim Primaries list\n" ; Int_t maxEmc = gime->PHOSGeometry()->GetNModules()*gime->PHOSGeometry()->GetNCristalsInModule() ; Int_t index ; for (index = 0 ; index < sdigits->GetEntriesFast(); index++) { digit = dynamic_cast( sdigits->At(index) ) ; if(digit->GetId() > maxEmc){ - cout << setw(6) << digit->GetId() << " " << setw(10) << digit->GetAmp() << " " - << setw(6) << digit->GetIndexInList() << " " - << setw(5) << digit->GetNprimary() <<" "; - + message += "\n" ; + message += digit->GetId() ; + message += " " ; + message += digit->GetAmp() ; + message += " " ; + message += digit->GetIndexInList() ; + message += " " ; + message += digit->GetNprimary() ; + message += " " ; Int_t iprimary; - for (iprimary=0; iprimaryGetNprimary(); iprimary++) - cout << setw(5) << digit->GetPrimary(iprimary+1) << " "; - cout << endl; + for (iprimary=0; iprimaryGetNprimary(); iprimary++) { + message += digit->GetPrimary(iprimary+1) ; + message += "," ; + } } } } - + Info("PrintSDigits", message.Data() ) ; } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSTrackSegment.cxx b/PHOS/AliPHOSTrackSegment.cxx index 2f8aa09033d..86c13b17a90 100644 --- a/PHOS/AliPHOSTrackSegment.cxx +++ b/PHOS/AliPHOSTrackSegment.cxx @@ -80,16 +80,16 @@ void AliPHOSTrackSegment::Print(Option_t * opt) const // Print all information on this track Segment - cout << "--------AliPHOSTrackSegment-------- "<= 0) - cout << "CPV RecPoint # " << fPpsdUpRecPoint << endl ; + Info("Print", "CPV RecPoint # %d", fPpsdUpRecPoint) ; else - cout << "No CPV RecPoint " << endl ; + Info("Print", "No CPV RecPoint "); - cout << "------------------------------------ " << endl ; + Info("Print", "------------------------------------ ") ; } //____________________________________________________________________________ diff --git a/PHOS/AliPHOSTrackSegmentMaker.cxx b/PHOS/AliPHOSTrackSegmentMaker.cxx index ba25ac94caf..d855bbd8f43 100644 --- a/PHOS/AliPHOSTrackSegmentMaker.cxx +++ b/PHOS/AliPHOSTrackSegmentMaker.cxx @@ -61,39 +61,3 @@ AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker() fSplitFile = 0 ; } -// //____________________________________________________________________________ -// void AliPHOSTrackSegmentMaker::SetSplitFile(const TString splitFileName) const -// { -// // Diverts the TrackSegments in a file separate from the Digits file - - -// TDirectory * cwd = gDirectory ; -// TFile * splitFile = gAlice->InitTreeFile("R",splitFileName.Data()); -// splitFile->cd() ; -// gAlice->Write(0, TObject::kOverwrite); - -// TTree *treeE = gAlice->TreeE(); -// if (!treeE) { -// cerr << "ERROR: AliPHOSTrackSegmentMaker::SetSplitFile -> No TreeE found "<SetBranchAddress("Header", &header); -// treeE->SetBranchStatus("*",1); -// TTree *treeENew = treeE->CloneTree(); -// treeENew->Write(0, TObject::kOverwrite); - -// // copy AliceGeom -// TGeometry *AliceGeom = static_cast(cwd->Get("AliceGeom")); -// if (!AliceGeom) { -// cerr << "ERROR: AliPHOSTrackSegmentMaker::SetSplitFile -> AliceGeom was not found in the input file "<Write(0, TObject::kOverwrite); - -// gAlice->MakeTree("R",splitFile); -// cwd->cd() ; -// cout << "INFO: AliPHOSTrackSegmentMaker::SetSPlitMode -> TrackSegments will be stored in " << splitFileName.Data() << endl ; -// } diff --git a/PHOS/AliPHOSTrackSegmentMaker.h b/PHOS/AliPHOSTrackSegmentMaker.h index 8bbbc178ce3..893020273c8 100644 --- a/PHOS/AliPHOSTrackSegmentMaker.h +++ b/PHOS/AliPHOSTrackSegmentMaker.h @@ -14,10 +14,9 @@ // --- ROOT system --- #include "TTask.h" -class TFile ; +class TFile ; // --- Standard library --- -#include // --- AliRoot header files --- @@ -34,20 +33,20 @@ public: virtual ~ AliPHOSTrackSegmentMaker() ; - virtual void Exec(Option_t * option){cout << "Not Defined" << endl ; } - // virtual char* GetRecPointsBranch ()const{cout << "Not Defined" << endl ; return 0 ; } - // virtual char* GetTrackSegmentsBranch ()const{cout << "Not Defined" << endl ; return 0 ; } - virtual const Int_t GetTrackSegmentsInRun() const {cout << "Not Defined" << endl ; return 0 ; } + virtual void Exec(Option_t * option){Warning("Exec", "Not Defined" ) ; } + // virtual char* GetRecPointsBranch ()const{Warning("GetRecPointsBranch", "Not Defined" ) ; return 0 ; } + // virtual char* GetTrackSegmentsBranch ()const{Warning(" GetTrackSegmentsBranch", "Not Defined" ) ; return 0 ; } + virtual const Int_t GetTrackSegmentsInRun() const {Warning("GetTrackSegmentsInRun", "Not Defined" ) ; return 0 ; } - virtual void Print(Option_t * option)const {cout << "Not Defined" << endl ; } + virtual void Print(Option_t * option)const {Warning("Print", "Not Defined" ) ; } // virtual void Set... // method to choose recPoints: along z only, along x ...??? - // virtual void SetChoosingAlgirithm(){cout << "Not Defined" << endl ; return 0 ; } - // virtual void SetMaxEmcCpvDistance(Float_t r) {cout << "Not Defined" << endl ; return 0 ; } - // virtual void SetRecPointsBranch(const char * title){cout << "Not Defined" << endl ; } - // virtual void SetTrackSegmentsBranch(const char * title){cout << "Not Defined" << endl ; } + // virtual void SetChoosingAlgirithm(){Warning("SetChoosingAlgirithm", "Not Defined" ) ; return 0 ; } + // virtual void SetMaxEmcCpvDistance(Float_t r) {Warning("SetMaxEmcCpvDistance", "Not Defined" ) ; return 0 ; } + // virtual void SetRecPointsBranch(const char * title){Warning("SetRecPointsBranch", "Not Defined" ) ; } + // virtual void SetTrackSegmentsBranch(const char * title){Warning("SetTrackSegmentsBranch", "Not Defined" ) ; } // virtual void SetSplitFile(const TString splitFileName = "PHOS.RecData.root") const ; - virtual const char * Version() const {cout << "Not Defined" << endl ; return 0 ; } - virtual void WriteTrackSegments(Int_t event){cout << "Not Defined" << endl ; } + virtual const char * Version() const {Warning("Version", "Not Defined" ) ; return 0 ; } + virtual void WriteTrackSegments(Int_t event){Warning("WriteTrackSegments", "Not Defined" ) ; } protected: diff --git a/PHOS/AliPHOSTrackSegmentMakerv1.cxx b/PHOS/AliPHOSTrackSegmentMakerv1.cxx index 6a46232893d..742a26ea347 100644 --- a/PHOS/AliPHOSTrackSegmentMakerv1.cxx +++ b/PHOS/AliPHOSTrackSegmentMakerv1.cxx @@ -28,8 +28,7 @@ // new TrackSegment. // If there is no CPV/PPSD RecPoint we make TrackSegment // consisting from EMC alone. There is no TrackSegments without EMC RecPoint. -// -// In principle this class should be called from AliPHOSReconstructioner, but +//// In principle this class should be called from AliPHOSReconstructioner, but // one can use it as well in standalone mode. // Use case: // root [0] AliPHOSTrackSegmentMakerv1 * t = new AliPHOSTrackSegmentMaker("galice.root", "tracksegmentsname", "recpointsname") @@ -51,10 +50,8 @@ #include "TTree.h" #include "TSystem.h" #include "TBenchmark.h" -// --- Standard library --- -#include -#include +// --- Standard library --- // --- AliRoot header files --- @@ -220,7 +217,7 @@ void AliPHOSTrackSegmentMakerv1::Init() branchname.Remove(branchname.Index(Version())-1) ; AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(),branchname.Data(), fToSplit ) ; if ( gime == 0 ) { - cerr << "ERROR: AliPHOSTrackSegmentMakerv1::Init -> Could not obtain the Getter object !" << endl ; + Error("Init", "Could not obtain the Getter object !") ; return ; } @@ -418,8 +415,7 @@ void AliPHOSTrackSegmentMakerv1::Exec(Option_t * option) // } // if ( phostsfound || tracksegmentmakerfound ) { -// cerr << "WARNING: AliPHOSTrackSegmentMakerv1::Exec -> TrackSegments and/or TrackSegmentMaker branch with name " -// << branchname.Data() << " already exits" << endl ; +// Warning("Exec", "TrackSegments and/or TrackSegmentMaker branch with name %s already exists", branchname.Data() ) ; // return ; // } // } @@ -466,10 +462,8 @@ void AliPHOSTrackSegmentMakerv1::Exec(Option_t * option) if(strstr(option,"tim")){ gBenchmark->Stop("PHOSTSMaker"); - cout << "AliPHOSTSMaker:" << endl ; - cout << " took " << gBenchmark->GetCpuTime("PHOSTSMaker") << " seconds for making TS " - << gBenchmark->GetCpuTime("PHOSTSMaker")/nevents << " seconds per event " << endl ; - cout << endl ; + Info("Exec", "took %f seconds for making TS %f seconds per event", + gBenchmark->GetCpuTime("PHOSTSMaker"), gBenchmark->GetCpuTime("PHOSTSMaker")/nevents) ; } } @@ -479,18 +473,17 @@ void AliPHOSTrackSegmentMakerv1::Print(Option_t * option)const { // Print TrackSegmentMaker parameters + TString message("") ; if( strcmp(GetName(), "") != 0 ) { - cout << "======== AliPHOSTrackSegmentMakerv1 ========" << endl ; - cout << "Making Track segments "<< endl ; - // cout << " Headers file: " << fHeaderFileName.Data() << endl ; - // cout << " RecPoints branch file name: " << fRecPointsBranchTitle.Data() << endl ; - // cout << " TrackSegments Branch file name: " << fTrackSegmentsBranchTitle.Data() << endl ; - cout << "with parameters: " << endl ; - cout << " Maximal EMC - CPV (PPSD) distance (cm)" << fRcpv << endl ; - cout << "============================================" << endl ; + message = "\n======== AliPHOSTrackSegmentMakerv1 ========\n" ; + message += "Making Track segments\n" ; + message += "with parameters:\n" ; + message += " Maximal EMC - CPV (PPSD) distance (cm) %f\n" ; + message += "============================================\n" ; + Info("Print", message.Data(),fRcpv) ; } else - cout << "AliPHOSTrackSegmentMakerv1 not initialized " << endl ; + Info("Print", "AliPHOSTrackSegmentMakerv1 not initialized ") ; } //____________________________________________________________________________ @@ -558,21 +551,20 @@ void AliPHOSTrackSegmentMakerv1::PrintTrackSegments(Option_t * option) TClonesArray * trackSegments = AliPHOSGetter::GetInstance()->TrackSegments(taskName) ; - - cout << "AliPHOSTrackSegmentMakerv1: event "<GetEvNumber() << endl ; - cout << " Found " << trackSegments->GetEntriesFast() << " trackSegments " << endl ; - + TString message ; + message = "AliPHOSTrackSegmentMakerv1: event %d\n" ; + message += " Found %d TrackSegments\n" ; + if(strstr(option,"all")) { // printing found TS - cout << "TrackSegment # " << " EMC RP# " << " CPV RP# " << endl ; - + message += "TrackSegment # EMC RP# CPV RP# \n" ; + Info("PrintTrackSegments", message.Data(), + gAlice->GetEvNumber(), + trackSegments->GetEntriesFast() ) ; Int_t index; for (index = 0 ; index GetEntriesFast() ; index++) { AliPHOSTrackSegment * ts = (AliPHOSTrackSegment * )trackSegments->At(index) ; - cout<<" "<< setw(4) << ts->GetIndexInList() << " " - <GetEmcIndex()<< " " - <GetCpvIndex()<< " " << endl ; + message = " %d %d %d\n" ; + Info("PrintTrackSegments", message.Data(), ts->GetIndexInList(), ts->GetEmcIndex(), ts->GetCpvIndex() ) ; } - - cout << "-------------------------------------------------------"<< endl ; } } diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx index e0293ea5935..51c8906be2e 100644 --- a/PHOS/AliPHOSv0.cxx +++ b/PHOS/AliPHOSv0.cxx @@ -39,7 +39,6 @@ #include #include -#include // --- AliRoot header files --- @@ -876,25 +875,19 @@ void AliPHOSv0::Init(void) Int_t i; if(fDebug) { - cout << endl ; + TString st ; for(i=0;i<35;i++) - cout <<"*"; - cout << "INFO: " << ClassName() << "::Init "; - for(i=0;i<35;i++) - cout << "*"; - cout << endl; - + st += "*"; + Info("Init", "%s", st.Data()) ; // Here the PHOS initialisation code (if any!) AliPHOSGeometry * geom = GetGeometry() ; if (geom!=0) - cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << geom->GetName() << endl ; + Info("Init", "AliPHOS%s: PHOS geometry intialized for %s", Version().Data(), geom->GetName()) ; else - cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ; - for(i=0;i<80;i++) - cout << "*" ; - cout << endl; - + Info("Init", "AliPHOS%s: PHOS geometry initialization failed !", Version().Data()) ; + + Info("Init", "%s", st.Data()) ; } } diff --git a/PHOS/AliPHOSv1.cxx b/PHOS/AliPHOSv1.cxx index 47c0ebebc26..898cca23018 100644 --- a/PHOS/AliPHOSv1.cxx +++ b/PHOS/AliPHOSv1.cxx @@ -443,7 +443,7 @@ void AliPHOSv1::StepManager(void) xyzte[4] = fAPDFactor * lightYield ; // add current hit to the hit list - //cout << "AliPHOSv1::StepManager " << primary << " " << tracknumber << endl ; + // Info("StepManager","%d %d", primary, tracknumber) ; AddHit(fIshunt, primary,tracknumber, absid, xyzte); // fill the relevant QA Checkables @@ -489,7 +489,7 @@ void AliPHOSv1::CPVDigitize (TLorentzVector p, Float_t *zxhit, Int_t moduleNumbe Float_t pNorm = p.Py(); Float_t eloss = kdEdx; -// cout << "CPVDigitize: YVK : "<GetCPVGasThickness(); Float_t dXY = pX/pNorm * GetGeometry()->GetCPVGasThickness(); diff --git a/PHOS/AliPHOSv3.cxx b/PHOS/AliPHOSv3.cxx index e38f950b7d6..369783bfb17 100644 --- a/PHOS/AliPHOSv3.cxx +++ b/PHOS/AliPHOSv3.cxx @@ -116,9 +116,9 @@ void AliPHOSv3::StepManager(void) // Accumulates hits as long as the track stays in a single crystal or PPSD gas Cell // if (gMC->IsTrackEntering()) -// cout << "Track enters the volume " << gMC->CurrentVolName() << endl; +// Info("StepManager", "Track enters the volume %d", gMC->CurrentVolName()) ; // if (gMC->IsTrackExiting()) -// cout << "Track leaves the volume " << gMC->CurrentVolName() << endl; +// Info("StepManager", "Track leaves the volume %d", gMC->CurrentVolName()) ; Int_t relid[4] ; // (box, layer, row, column) indices Int_t absid ; // absolute cell ID number @@ -309,8 +309,8 @@ if(gMC->CurrentVolID(copy)==gMC->VolId("PXTL")){// We are inside a PBWO4 crystal xyze[3] = (fRecalibrationFactor/100.) * fAPDGain * fLightYield ; - // cout<<"xyze[3]: "<CurrentVolID(copy)==gMC->VolId("PXTL")){// We are inside a PBWO4 crystal // if(gMC->CurrentVolID(copy) == gMC->VolId("PPIN"))//We are inside the PIN diode // { -// cout<<" Inside PIN "<TrackPosition(pos) ; // global[0] = pos[0] ; // global[1] = pos[1] ; diff --git a/PHOS/AliPHOSvFast.cxx b/PHOS/AliPHOSvFast.cxx index 20575eb9a82..75b2cea76f9 100644 --- a/PHOS/AliPHOSvFast.cxx +++ b/PHOS/AliPHOSvFast.cxx @@ -355,8 +355,8 @@ Int_t AliPHOSvFast::MakeType(AliPHOSFastRecParticle & rp ) else test = rp.GetPdgCode() ; - cout << " SHOULD NOT BE USED until values of probabilities are properly set " << endl ; - assert(1==0) ; // NB: ALL VALUES SHOLD BE CHECKED !!!! + Info("MakeType", "SHOULD NOT BE USED until values of probabilities are properly set ") ; + assert(1==0) ; // NB: ALL VALUES SHOULD BE CHECKED !!!! switch (test) { case 22: // it's a photon // NB: ALL VALUES SHOLD BE CHECKED !!!! diff --git a/PHOS/PHOSHistos.cxx b/PHOS/PHOSHistos.cxx index b746f08f472..68756a92290 100644 --- a/PHOS/PHOSHistos.cxx +++ b/PHOS/PHOSHistos.cxx @@ -60,7 +60,7 @@ void PHOSHistos (Text_t* infile, Int_t nevent, Int_t Module) AliPHOSTrackSegmentMakerv1 * tracksegmentmaker = new AliPHOSTrackSegmentMakerv1() ; //========== Creates the particle identifier AliPHOSPIDv1 * particleidentifier = new AliPHOSPIDv1 ; - cout << "AnalyzeOneEvent > using particle identifier " << particleidentifier->GetName() << endl ; + Info("PHOSHistos", "AnalyzeOneEvent > using particle identifier %s\n", particleidentifier->GetName() ) ; TH1F * hEmcDigit = new TH1F("hEmcDigit","hEmcDigit",1000,0.,5.); TH1F * hVetoDigit = new TH1F("hVetoDigit","hVetoDigit",1000,0.,3.e-5); @@ -88,7 +88,7 @@ void PHOSHistos (Text_t* infile, Int_t nevent, Int_t Module) //========== Creates the Reconstructioner AliPHOSReconstructioner * Reconstructioner = new AliPHOSReconstructioner(clusterizer, tracksegmentmaker, particleidentifier) ; - cout << "Event " << ievent <