// --- Standard library ---
// --- AliRoot header files ---
-
-#include "AliEMCALLoader.h"
#include "AliEMCAL.h"
+#include "AliEMCALGetter.h"
#include "AliEMCALHit.h"
+#include "AliEMCALLoader.h"
+#include "AliLog.h"
+#include "AliObjectLoader.h"
ClassImp(AliEMCALLoader)
Clean(fgkECARecPointsName);
Clean(fgkTracksName);
Clean(fgkRecParticlesName);
+ CleanFolders() ;
+ // set to 0x0 the objgetter in AliGetter ... weird isn it !
+ AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ if (gime)
+ gime->Reset() ;
}
//____________________________________________________________________________
if (res)
{//oops, error
- Error("LoadHits","AliLoader::LoadHits returned error");
+ AliError("returned error");
return res;
}
Int_t AliEMCALLoader::LoadTracks(Option_t* opt)
{
//Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
- if (GetDebug())
- printf("LoadTracks: opt = %s",opt);
- if (fTracksLoaded)
- {
- Warning("LoadTracks","Tracks are already loaded");
- return 0;
- }
+ AliDebug(1, Form("opt = %s",opt));
Int_t res;
- //First call the AliLoader's method to send the TreeS to folder
- if (GetTracksDataLoader()->GetBaseLoader(0)->IsLoaded() == kFALSE)
- {//tracks can be loaded by LoadRecPoints
- res = AliLoader::LoadTracks(opt);
- if (res)
- {//oops, error
- Error("LoadTracks","AliLoader::LoadTracks returned error");
- return res;
- }
- }
- res = ReadTracks();
+ res = AliLoader::LoadTracks(opt);
if (res)
- {
- Error("LoadTracks","Error occured while reading Tracks");
+ {//oops, error
+ AliError("returned error");
return res;
- }
+ }
+ return ReadTracks();
- fTracksLoaded = kTRUE;
- return 0;
}
//____________________________________________________________________________
Error("LoadRecParticles","AliLoader::LoadRecParticles returned error");
return res;
}
-
- TFolder * emcalFolder = GetDetectorDataFolder();
- if ( emcalFolder == 0x0 )
- {
- Error("PostDigits","Can not get detector data folder");
- return 1;
- }
return ReadRecParticles();
}
//____________________________________________________________________________
Int_t AliEMCALLoader::PostHits()
{
+ // Post Hits
Int_t reval = AliLoader::PostHits();
if (reval)
{
Error("PostHits","AliLoader:: returned error");
return reval;
}
- return ReadHits();
+ return const_cast<AliEMCALLoader *>(this)->ReadHits();
}
//____________________________________________________________________________
Error("PostSDigits","AliLoader::PostSDigits returned error");
return reval;
}
- return ReadSDigits();
+ return const_cast<AliEMCALLoader *>(this)->ReadSDigits();
}
//____________________________________________________________________________
Error("PostDigits","AliLoader::PostDigits returned error");
return reval;
}
- return ReadDigits();
+ return const_cast<AliEMCALLoader *>(this)->ReadDigits();
}
//____________________________________________________________________________
Error("PostRecPoints","AliLoader::PostRecPoints returned error");
return reval;
}
- return ReadRecPoints();
+ return const_cast<AliEMCALLoader *>(this)->ReadRecPoints();
}
//____________________________________________________________________________
Error("PostRecParticles","AliLoader::PostRecParticles returned error");
return reval;
}
- return ReadRecParticles();
+ return const_cast<AliEMCALLoader *>(this)->ReadRecParticles();
}
//____________________________________________________________________________
Error("PostTracks","AliLoader::PostTracks returned error");
return reval;
}
- return ReadTracks();
+ return const_cast<AliEMCALLoader *>(this)->ReadTracks();
}
//____________________________________________________________________________
if(treeh == 0)
{
- Error("ReadHits"," Cannot read TreeH from folder");
+ AliError("Cannot read TreeH from folder");
return 1;
}
TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
if (hitsbranch == 0)
{
- Error("ReadHits"," Cannot find branch EMCAL");
+ AliError("Cannot find branch EMCAL");
return 1;
}
- if (GetDebug())
- printf("ReadHits: Reading Hits");
+ AliDebug(1, "Reading Hits");
if (hitsbranch->GetEntries() > 1)
{
index++ ;
}
}
+ tempo->Delete() ;
delete tempo;
}
else
//____________________________________________________________________________
Bool_t AliEMCALLoader::BranchExists(const TString& recName)
-{
+{
+ // Check is branch exists
if (fBranchTitle.IsNull()) return kFALSE;
TString dataname, zername ;
TTree* tree;
//____________________________________________________________________________
void AliEMCALLoader::CleanHits()
{
+ // Clean hits
AliLoader::CleanHits();
//Clear an array
TClonesArray* hits = Hits();
- if (hits) hits->Clear();
+ if (hits)
+ hits->Clear();
}
//____________________________________________________________________________
//____________________________________________________________________________
void AliEMCALLoader::MakeRecPointsArray()
{
- if ( ECARecPoints() == 0x0) {
- if (GetDebug()>9)
- printf("MakeRecPointsArray: Making array for ECA");
- TObjArray* eca = new TObjArray(100) ;
- eca->SetName(fgkECARecPointsName) ;
- GetDetectorDataFolder()->Add(eca);
- }
+ // Make recpoints array
+ if ( ECARecPoints() == 0x0)
+ {
+ AliDebug(9, "Making array for ECA");
+ TObjArray* eca = new TObjArray(100) ;
+ eca->SetName(fgkECARecPointsName) ;
+ GetDetectorDataFolder()->Add(eca);
+ }
}
//____________________________________________________________________________