X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALLoader.cxx;h=e51568ffe10e2bd88b92228ba99bdab1286e84ae;hb=c757bafda4b54ae060b86fd764e00e7dd32383ea;hp=9842520f604789479e20fe66fa6406f3a9832141;hpb=d64c959b2712e5f0872a5c693ef5d9f0e0af07ee;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALLoader.cxx b/EMCAL/AliEMCALLoader.cxx index 9842520f604..e51568ffe10 100644 --- a/EMCAL/AliEMCALLoader.cxx +++ b/EMCAL/AliEMCALLoader.cxx @@ -49,6 +49,7 @@ #include "AliEMCALLoader.h" #include "AliEMCAL.h" #include "AliEMCALHit.h" +#include "AliEMCALGetter.h" ClassImp(AliEMCALLoader) @@ -56,15 +57,11 @@ ClassImp(AliEMCALLoader) const TString AliEMCALLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event const TString AliEMCALLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray const TString AliEMCALLoader::fgkDigitsName("DIGITS");//Name for TClonesArray -const TString AliEMCALLoader::fgkPRERecPointsName("PRERECPOINTS");//Name for TClonesArray const TString AliEMCALLoader::fgkECARecPointsName("ECARECPOINTS");//Name for TClonesArray -const TString AliEMCALLoader::fgkHCARecPointsName("HCARECPOINTS");//Name for TClonesArray const TString AliEMCALLoader::fgkTracksName("TRACKS");//Name for TClonesArray const TString AliEMCALLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray -const TString AliEMCALLoader::fgkPRERecPointsBranchName("EMCALPRERP");//Name for branch with PreShower Reconstructed Points const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points -const TString AliEMCALLoader::fgkHCARecPointsBranchName("EMCALHCARP");//Name for branch with HCA Reconstructed Points const TString AliEMCALLoader::fgkTrackSegmentsBranchName("EMCALTS");//Name for branch with TrackSegments const TString AliEMCALLoader::fgkRecParticlesBranchName("EMCALRP");//Name for branch with Reconstructed Particles @@ -90,11 +87,14 @@ AliEMCALLoader::~AliEMCALLoader() Clean(fgkHitsName); Clean(fgkSDigitsName); Clean(fgkDigitsName); - Clean(fgkPRERecPointsName); Clean(fgkECARecPointsName); - Clean(fgkHCARecPointsName); Clean(fgkTracksName); Clean(fgkRecParticlesName); + CleanFolders() ; + // set to 0x0 the objgetter in AliGetter ... weird isn it ! + AliEMCALGetter * gime = AliEMCALGetter::Instance() ; + if (gime) + gime->Reset() ; } //____________________________________________________________________________ @@ -122,9 +122,7 @@ Int_t AliEMCALLoader::SetEvent() if (Hits()) Hits()->Clear(); if (SDigits()) SDigits()->Clear(); if (Digits()) Digits()->Clear(); - if (PRERecPoints()) PRERecPoints()->Clear(); if (ECARecPoints()) ECARecPoints()->Clear(); - if (HCARecPoints()) HCARecPoints()->Clear(); if (TrackSegments()) TrackSegments()->Clear(); if (RecParticles()) RecParticles()->Clear(); @@ -261,7 +259,7 @@ Int_t AliEMCALLoader::LoadTracks(Option_t* opt) { //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts if (GetDebug()) - Info("LoadTracks","opt = %s",opt); + printf("LoadTracks: opt = %s",opt); if (fTracksLoaded) { Warning("LoadTracks","Tracks are already loaded"); @@ -314,6 +312,7 @@ Int_t AliEMCALLoader::LoadRecParticles(Option_t* opt) //____________________________________________________________________________ Int_t AliEMCALLoader::PostHits() { + // Post Hits Int_t reval = AliLoader::PostHits(); if (reval) { @@ -422,7 +421,7 @@ Int_t AliEMCALLoader::ReadHits() } if (GetDebug()) - Info("ReadHits","Reading Hits"); + printf("ReadHits: Reading Hits"); if (hitsbranch->GetEntries() > 1) { @@ -442,6 +441,7 @@ Int_t AliEMCALLoader::ReadHits() index++ ; } } + tempo->Delete() ; delete tempo; } else @@ -571,32 +571,6 @@ void AliEMCALLoader::Track(Int_t itrack) } -//____________________________________________________________________________ -void AliEMCALLoader::ReadTreeQA() -{ - // Read the digit tree gAlice->TreeQA() - // so far only EMCAL knows about this Tree - - if(EMCAL()->TreeQA()== 0){ - cerr << "ERROR: AliEMCALLoader::ReadTreeQA: can not read TreeQA " << endl ; - return ; - } - - TBranch * qabranch = EMCAL()->TreeQA()->GetBranch("EMCAL"); - if (!qabranch) { - if (fDebug) - cout << "WARNING: AliEMCALLoader::ReadTreeQA -> Cannot find QA Alarms for EMCAL" << endl ; - return ; - } - - // if(!Alarms()) PostQA(); - - qabranch->SetAddress(AlarmsRef()) ; - - qabranch->GetEntry(0) ; - -} - //____________________________________________________________________________ Int_t AliEMCALLoader::ReadRecPoints() { @@ -604,10 +578,8 @@ Int_t AliEMCALLoader::ReadRecPoints() //connects branch in tree (if exists), and reads data to array MakeRecPointsArray(); - - TObjArray * pre = 0x0 ; - TObjArray * eca = 0x0 ; - TObjArray * hca = 0x0 ; + + TObjArray * eca = 0x0 ; TTree * treeR = TreeR(); @@ -618,18 +590,7 @@ Int_t AliEMCALLoader::ReadRecPoints() } Int_t retval = 0; - TBranch * prebranch = treeR->GetBranch(fgkPRERecPointsBranchName); - - if (prebranch == 0x0) - { - Error("ReadRecPoints","Can not get branch with PRE Rec. Points named %s",fgkPRERecPointsBranchName.Data()); - retval = 1; - } - else - { - prebranch->SetAddress(&pre) ; - prebranch->GetEntry(0) ; - } + TBranch * ecabranch = treeR->GetBranch(fgkECARecPointsBranchName); if (ecabranch == 0x0) { @@ -637,35 +598,18 @@ Int_t AliEMCALLoader::ReadRecPoints() retval = 2; } else - { - ecabranch->SetAddress(&eca); - ecabranch->GetEntry(0) ; - } - TBranch * hcabranch = treeR->GetBranch(fgkHCARecPointsBranchName); - if (hcabranch == 0x0) - { - Error("ReadRecPoints","Can not get branch with HCA Rec. Points named %s",fgkHCARecPointsBranchName.Data()); - retval = 2; - } - else - { - hcabranch->SetAddress(&hca); - hcabranch->GetEntry(0) ; - } - + { + ecabranch->SetAddress(&eca); + ecabranch->GetEntry(0) ; + } + + Int_t ii ; - Int_t maxpre = pre->GetEntries() ; - for ( ii= 0 ; ii < maxpre ; ii++ ) - PRERecPoints()->Add(pre->At(ii)) ; - + Int_t maxeca = eca->GetEntries() ; for ( ii= 0 ; ii < maxeca ; ii++ ) ECARecPoints()->Add(eca->At(ii)) ; - - Int_t maxhca = hca->GetEntries() ; - for ( ii= 0 ; ii < maxhca ; ii++ ) - HCARecPoints()->Add(hca->At(ii)) ; - + return retval; } @@ -771,7 +715,8 @@ AliEMCALLoader* AliEMCALLoader::GetEMCALLoader(const char* eventfoldername) //____________________________________________________________________________ Bool_t AliEMCALLoader::BranchExists(const TString& recName) -{ +{ + // Check is branch exists if (fBranchTitle.IsNull()) return kFALSE; TString dataname, zername ; TTree* tree; @@ -785,21 +730,11 @@ Bool_t AliEMCALLoader::BranchExists(const TString& recName) dataname = GetDetectorName(); zername = "AliEMCALDigitizer" ; } - else if(recName == "PRERecPoints"){ - tree = TreeR(); - dataname = fgkPRERecPointsBranchName; - zername = "AliEMCALClusterizer" ; - } else if(recName == "ECARecPoints"){ tree = TreeR(); dataname = fgkECARecPointsBranchName; zername = "AliEMCALClusterizer" ; } - else if(recName == "HCARecPoints"){ - tree = TreeR(); - dataname = fgkHCARecPointsBranchName; - zername = "AliEMCALClusterizer" ; - } else if(recName == "TrackSegments"){ tree = TreeT(); dataname = fgkTrackSegmentsBranchName; @@ -850,10 +785,12 @@ void AliEMCALLoader::SetBranchTitle(const TString& btitle) //____________________________________________________________________________ void AliEMCALLoader::CleanHits() { + // Clean hits AliLoader::CleanHits(); //Clear an array TClonesArray* hits = Hits(); - if (hits) hits->Clear(); + if (hits) + hits->Clear(); } //____________________________________________________________________________ @@ -880,15 +817,9 @@ void AliEMCALLoader::CleanRecPoints() { // Cleans the RecPoints array in the folder structure AliLoader::CleanRecPoints(); - TObjArray* recpoints = PRERecPoints(); - if (recpoints) - recpoints->Clear(); - recpoints = ECARecPoints(); - if (recpoints) - recpoints->Clear(); - recpoints = HCARecPoints(); - if (recpoints) - recpoints->Clear(); + TObjArray* recpoints = ECARecPoints(); + if (recpoints) recpoints->Clear(); + } //____________________________________________________________________________ @@ -972,29 +903,15 @@ void AliEMCALLoader::MakeDigitsArray() //____________________________________________________________________________ void AliEMCALLoader::MakeRecPointsArray() -{ - // Create the array for RecPoints - if ( PRERecPoints() == 0x0) { - if (GetDebug()>9) - Info("MakeRecPointsArray","Making array for PRE"); - TObjArray* pre = new TObjArray(100) ; - pre->SetName(fgkPRERecPointsName) ; - GetDetectorDataFolder()->Add(pre); - } +{ + // Make recpoints array if ( ECARecPoints() == 0x0) { if (GetDebug()>9) - Info("MakeRecPointsArray","Making array for ECA"); + printf("MakeRecPointsArray: Making array for ECA"); TObjArray* eca = new TObjArray(100) ; eca->SetName(fgkECARecPointsName) ; GetDetectorDataFolder()->Add(eca); - } - if ( HCARecPoints() == 0x0) { - if (GetDebug()>9) - Info("MakeRecPointsArray","Making array for HCA"); - TObjArray* hca = new TObjArray(100) ; - hca->SetName(fgkHCARecPointsName) ; - GetDetectorDataFolder()->Add(hca); - } + } } //____________________________________________________________________________