Give the right name to the task posted on the folders
Remove retieval for tasks from the file because of a problem in SetAdress I could not solve
Complete the removal of objects posted on the folders
while ( (folder = static_cast<TFolder*>(next())) )
emcalF->Remove(folder) ;
while ( (folder = static_cast<TFolder*>(next())) )
emcalF->Remove(folder) ;
delete fFile ;
fFile = 0 ;
delete fFile ;
fFile = 0 ;
//____________________________________________________________________________
void AliEMCALGetter::CloseFile()
{
//____________________________________________________________________________
void AliEMCALGetter::CloseFile()
{
-// delete gAlice ;
-// gAlice = 0 ;
- fFile->Close() ;
+ delete gAlice ;
+ gAlice = 0 ;
}
//____________________________________________________________________________
}
//____________________________________________________________________________
{
// Returns the pointer of the unique instance already defined
{
// Returns the pointer of the unique instance already defined
- AliEMCALGetter * rv = 0 ;
- if ( fgObjGetter )
- rv = fgObjGetter ;
- else
- cout << "AliEMCALGetter::GetInstance ERROR: not yet initialized" << endl ;
-
- fFile->cd() ;
- return rv ;
+ if ( fgObjGetter ) {
+ fFile->cd() ;
+ return fgObjGetter ;
+ }
+ else {
+ // cout << "AliEMCALGetter::GetInstance ERROR: not yet initialized" << endl ;
+ return 0 ;
+ }
}
//____________________________________________________________________________
}
//____________________________________________________________________________
- AliEMCALClusterizerv1 * emcalcl = new AliEMCALClusterizerv1() ;
+ TList * l = emcal->GetListOfTasks() ;
+ TIter it(l) ;
- clun+=":clu-v1" ;
- emcalcl->SetName(clun) ;
+ clun+=":clu" ;
+ TTask * task ;
+ while((task = static_cast<TTask *>(it.Next()) )){
+ TString taskname(task->GetName()) ;
+ if(taskname.BeginsWith(clun))
+ return kTRUE ;
+ }
+
+ AliEMCALClusterizerv1 * emcalcl = new AliEMCALClusterizerv1() ;
emcal->Add(emcalcl) ;
return kTRUE;
emcal->Add(emcalcl) ;
return kTRUE;
// read the Digitizer
if(!Digitizer(fDigitsTitle))
PostDigitizer(fDigitsTitle) ;
// read the Digitizer
if(!Digitizer(fDigitsTitle))
PostDigitizer(fDigitsTitle) ;
- digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
- digitizerbranch->GetEntry(0) ;
+
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ // digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
+ // digitizerbranch->GetEntry(0) ;
if(!Clusterizer(fRecPointsTitle) )
PostClusterizer(fRecPointsTitle) ;
if(!Clusterizer(fRecPointsTitle) )
PostClusterizer(fRecPointsTitle) ;
- clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
- clusterizerbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ //clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
+ //clusterizerbranch->GetEntry(0) ;
//------------------- TrackSegments ---------------------
//------------------- TrackSegments ---------------------
// // Read and Post the TrackSegment Maker
// if(!TrackSegmentMaker(fTrackSegmentsTitle))
// PostTrackSegmentMaker(fTrackSegmentsTitle) ;
// // Read and Post the TrackSegment Maker
// if(!TrackSegmentMaker(fTrackSegmentsTitle))
// PostTrackSegmentMaker(fTrackSegmentsTitle) ;
-// tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
-// tsmakerbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+// //tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
+// //tsmakerbranch->GetEntry(0) ;
// //------------ RecParticles ----------------------------
// //------------ RecParticles ----------------------------
// // Read and Post the PID
// if(!PID(fRecParticlesTitle))
// PostPID(fRecParticlesTitle) ;
// // Read and Post the PID
// if(!PID(fRecParticlesTitle))
// PostPID(fRecParticlesTitle) ;
-// pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
-// pidbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+// //pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
+// //pidbranch->GetEntry(0) ;
sdname+=folder->GetName() ;
if(!SDigitizer(sdname) )
PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
sdname+=folder->GetName() ;
if(!SDigitizer(sdname) )
PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
- sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
- sdigitizerBranch->GetEntry(0) ;
+
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ // sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
+ // sdigitizerBranch->GetEntry(0) ;
TTask * emcal = 0 ;
TList * lofTasks = 0 ;
TTask * emcal = 0 ;
TList * lofTasks = 0 ;
+ if (opt == "S") { // SDigitizer
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
if (!task)
return ;
}
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
if (!task)
return ;
}
+ else if (opt == "D") { // Digitizer
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
if (!task)
return ;
}
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
if (!task)
return ;
}
+ else if (opt == "C") { // Clusterizer
+ task = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
+ if (!task)
+ return ;
+ }
- cerr << "WARNING: AliPHOSGetter::RemoveTask -> Unknown option " << opt.Data() << endl ;
+ cerr << "WARNING: AliEMCALGetter::RemoveTask -> Unknown option " << opt.Data() << endl ;
emcal = dynamic_cast<TTask*>(task->GetListOfTasks()->FindObject("EMCAL")) ;
if (!emcal)
return ;
emcal = dynamic_cast<TTask*>(task->GetListOfTasks()->FindObject("EMCAL")) ;
if (!emcal)
return ;
if (obj)
lofTasks->Remove(obj) ;
}
if (obj)
lofTasks->Remove(obj) ;
}
//____________________________________________________________________________
void AliEMCALGetter::RemoveObjects(TString opt, TString name) const
{
//____________________________________________________________________________
void AliEMCALGetter::RemoveObjects(TString opt, TString name) const
{
TFolder * emcal = 0 ;
TFolder * emcalmain = 0 ;
TFolder * emcal = 0 ;
TFolder * emcalmain = 0 ;
+ if (opt == "H") { // Hits
emcal = dynamic_cast<TFolder*>(fHitsFolder->FindObject("EMCAL")) ;
if (!emcal)
return ;
name = "Hits" ;
}
emcal = dynamic_cast<TFolder*>(fHitsFolder->FindObject("EMCAL")) ;
if (!emcal)
return ;
name = "Hits" ;
}
- else if ( opt == "S") {
+ else if ( opt == "S") { // SDigits
emcalmain = dynamic_cast<TFolder*>(fSDigitsFolder->FindObject("EMCAL")) ;
if (!emcalmain)
return ;
emcalmain = dynamic_cast<TFolder*>(fSDigitsFolder->FindObject("EMCAL")) ;
if (!emcalmain)
return ;
+ else if (opt == "D") { // Digits
emcal = dynamic_cast<TFolder*>(fDigitsFolder->FindObject("EMCAL")) ;
if (!emcal)
return ;
}
emcal = dynamic_cast<TFolder*>(fDigitsFolder->FindObject("EMCAL")) ;
if (!emcal)
return ;
}
+
+ else if (opt == "RT") { // Tower RecPoints
+ emcal = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL/TowerRecPoints")) ;
+ if (!emcal)
+ return ;
+ }
+
+ else if (opt == "RP") { // Preshower RecPoints
+ emcal = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL/PreShoRecPoints")) ;
+ if (!emcal)
+ return ;
+ }
+
else {
cerr << "WARNING: AliEMCALGetter::RemoveObjects -> Unknown option " << opt.Data() << endl ;
return ;
else {
cerr << "WARNING: AliEMCALGetter::RemoveObjects -> Unknown option " << opt.Data() << endl ;
return ;
// ................
// please->GetEvent(event) ; // reads new event from galice.root
//
// ................
// please->GetEvent(event) ; // reads new event from galice.root
//
-//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
-//*-- Completely redesigned by Dmitri Peressounko March 2001
+//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)//*-- Completely redesigned by Dmitri Peressounko March 2001
//
//*-- YS June 2001 : renamed the original AliPHOSIndexToObject and make
//*-- systematic usage of TFolders without changing the interface
//
//*-- YS June 2001 : renamed the original AliPHOSIndexToObject and make
//*-- systematic usage of TFolders without changing the interface
#include "TFile.h"
#include "TTree.h"
#include "TROOT.h"
#include "TFile.h"
#include "TTree.h"
#include "TROOT.h"
//____________________________________________________________________________
void AliPHOSGetter::CloseFile()
{
//____________________________________________________________________________
void AliPHOSGetter::CloseFile()
{
-// delete gAlice ;
-// gAlice = 0 ;
- fFile->Close() ;
+ delete gAlice ;
+ gAlice = 0 ;
}
//____________________________________________________________________________
}
//____________________________________________________________________________
{
// Returns the pointer of the unique instance already defined
{
// Returns the pointer of the unique instance already defined
- AliPHOSGetter * rv = 0 ;
- if ( fgObjGetter )
- rv = fgObjGetter ;
- else
- cout << "AliPHOSGetter::GetInstance ERROR: not yet initialized" << endl ;
-
- fFile->cd() ;
- return rv ;
+ if ( fgObjGetter ) {
+ fFile->cd() ;
+ return fgObjGetter ;
+ }
+ else {
+ //cout << "WARNING: AliPHOSGetter::GetInstance ERROR: not yet initialized" << endl ;
+ return 0 ;
+ }
}
//____________________________________________________________________________
}
//____________________________________________________________________________
}
else // another file than the existing one is required, scratch the getter
fgObjGetter->~AliPHOSGetter() ; // delete it already exists another version
}
else // another file than the existing one is required, scratch the getter
fgObjGetter->~AliPHOSGetter() ; // delete it already exists another version
fgObjGetter = new AliPHOSGetter(headerFile,branchTitle) ;
if (fgObjGetter->HasFailed() )
fgObjGetter = new AliPHOSGetter(headerFile,branchTitle) ;
if (fgObjGetter->HasFailed() )
// Posts a few item to the white board (folders)
// fgObjGetter->CreateWhiteBoard() ;
// Posts a few item to the white board (folders)
// fgObjGetter->CreateWhiteBoard() ;
+ if (fFile)
+ fFile->cd() ;
TTask * task = dynamic_cast<TTask*>(phos->GetListOfTasks()->FindObject(name)) ;
TTask * task = dynamic_cast<TTask*>(phos->GetListOfTasks()->FindObject(name)) ;
+ cout << "AliPHOSGetter::DigitizerRef " << task->GetName() << endl ;
+ cout << "AliPHOSGetter::DigitizerRef " << phos->GetName() << endl ;
+ cout << "AliPHOSGetter::DigitizerRef " << task->GetListOfTasks() << endl ;
+ cout << "AliPHOSGetter::DigitizerRef " << task->GetListOfTasks()->GetObjectRef(task) << endl ;
+
+
return phos->GetListOfTasks()->GetObjectRef(task) ;
}
return phos->GetListOfTasks()->GetObjectRef(task) ;
}
TTask * phos = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("PHOS")) ;
if ( !phos ) {
if (fDebug) {
TTask * phos = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("PHOS")) ;
if ( !phos ) {
if (fDebug) {
- cout <<"WARNING: AliPHOSGetter::Post Rer -> //" << fTasksFolder << "/ReconstructionerPHOS not found!" << endl;
+ cout <<"WARNING: AliPHOSGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/PHOS not found!" << endl;
cout <<"INFO: AliPHOSGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl;
}
phos = new TTask("PHOS", "") ;
cout <<"INFO: AliPHOSGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/PHOS" << endl;
}
phos = new TTask("PHOS", "") ;
}
AliPHOSClusterizerv1 * phoscl = new AliPHOSClusterizerv1() ;
}
AliPHOSClusterizerv1 * phoscl = new AliPHOSClusterizerv1() ;
- phoscl->SetName(clun) ;
phos->Add(phoscl) ;
return kTRUE;
phos->Add(phoscl) ;
return kTRUE;
TList * l = phos->GetListOfTasks() ;
TIter it(l) ;
TString tsn(name);
TList * l = phos->GetListOfTasks() ;
TIter it(l) ;
TString tsn(name);
TTask * task ;
while((task = static_cast<TTask *>(it.Next()) )){
TString taskname(task->GetName()) ;
TTask * task ;
while((task = static_cast<TTask *>(it.Next()) )){
TString taskname(task->GetName()) ;
Bool_t AliPHOSGetter::PostRecParticles(const char * name) const
{ // -------------------- RecParticles ------------------------
Bool_t AliPHOSGetter::PostRecParticles(const char * name) const
{ // -------------------- RecParticles ------------------------
- // the hierarchy is //Folders/Run/Event/RecData/PHOS/TrackSegments/name
+ // the hierarchy is //Folders/Run/Event/RecData/PHOS/RecParticles/name
TFolder * phosFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("PHOS")) ;
TFolder * phosFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("PHOS")) ;
TList * l = phos->GetListOfTasks() ;
TIter it(l) ;
TString pidname(name) ;
TList * l = phos->GetListOfTasks() ;
TIter it(l) ;
TString pidname(name) ;
TTask * task ;
while((task = static_cast<TTask *>(it.Next()) )){
TString taskname(task->GetName()) ;
TTask * task ;
while((task = static_cast<TTask *>(it.Next()) )){
TString taskname(task->GetName()) ;
// read the Digitizer
if(!Digitizer(fDigitsTitle))
PostDigitizer(fDigitsTitle) ;
// read the Digitizer
if(!Digitizer(fDigitsTitle))
PostDigitizer(fDigitsTitle) ;
- digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
- digitizerbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ // digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
+ // digitizerbranch->GetEntry(0) ;
} else {
if(!Clusterizer(fRecPointsTitle) )
PostClusterizer(fRecPointsTitle) ;
} else {
if(!Clusterizer(fRecPointsTitle) )
PostClusterizer(fRecPointsTitle) ;
- clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
- clusterizerbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ //clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
+ //clusterizerbranch->GetEntry(0) ;
}
//------------------- TrackSegments ---------------------
}
//------------------- TrackSegments ---------------------
// Read and Post the TrackSegment Maker
if(!TrackSegmentMaker(fTrackSegmentsTitle))
PostTrackSegmentMaker(fTrackSegmentsTitle) ;
// Read and Post the TrackSegment Maker
if(!TrackSegmentMaker(fTrackSegmentsTitle))
PostTrackSegmentMaker(fTrackSegmentsTitle) ;
- tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
- tsmakerbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ //tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
+ //tsmakerbranch->GetEntry(0) ;
// Read and Post the PID
if(!PID(fRecParticlesTitle))
PostPID(fRecParticlesTitle) ;
// Read and Post the PID
if(!PID(fRecParticlesTitle))
PostPID(fRecParticlesTitle) ;
- pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
- pidbranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ //pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
+ //pidbranch->GetEntry(0) ;
while ( (folder = static_cast<TFolder*>(next())) ) {
TString fileName(folder->GetName()) ;
fileName.ReplaceAll("_","/") ;
while ( (folder = static_cast<TFolder*>(next())) ) {
TString fileName(folder->GetName()) ;
fileName.ReplaceAll("_","/") ;
- cout << "ALiPHOSGetter::ReadTreeS " << fileName.Data() << " " << fHeaderFile.Data() << endl ;
if(fHeaderFile.CompareTo(fileName) == 0 )
treeS=gAlice->TreeS() ;
else{
if(fHeaderFile.CompareTo(fileName) == 0 )
treeS=gAlice->TreeS() ;
else{
sdname+=folder->GetName() ;
if(!SDigitizer(sdname) )
PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
sdname+=folder->GetName() ;
if(!SDigitizer(sdname) )
PostSDigitizer(fSDigitsTitle,folder->GetName()) ;
-
- sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
- sdigitizerBranch->GetEntry(0) ;
+ //!!!!!!!!!!!!!!!!!!!!!!!!!! Weird problem, the following line causes a seg fault
+ // sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
+ // sdigitizerBranch->GetEntry(0) ;
}
// After SDigits have been read from all files, return to the first one
}
// After SDigits have been read from all files, return to the first one
{
// remove a task from the folder
// path is fTasksFolder/SDigitizer/PHOS/name
{
// remove a task from the folder
// path is fTasksFolder/SDigitizer/PHOS/name
TTask * task = 0 ;
TTask * phos = 0 ;
TList * lofTasks = 0 ;
TTask * task = 0 ;
TTask * phos = 0 ;
TList * lofTasks = 0 ;
+ if (opt == "S") { // SDigitizer
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
if (!task)
return ;
}
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
if (!task)
return ;
}
-
- else if (opt == "D") {
+ else if (opt == "D") { // Digitizer
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
if (!task)
return ;
}
task = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
if (!task)
return ;
}
+ else if (opt == "C" || opt == "T" || opt == "P" ) { // Clusterizer, TrackSegmentMaker, PID
+ task = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
+ if (!task)
+ return ;
+ }
else {
cerr << "WARNING: AliPHOSGetter::RemoveTask -> Unknown option " << opt.Data() << endl ;
return ;
else {
cerr << "WARNING: AliPHOSGetter::RemoveTask -> Unknown option " << opt.Data() << endl ;
return ;
TObject * obj = lofTasks->FindObject(name) ;
if (obj)
lofTasks->Remove(obj) ;
TObject * obj = lofTasks->FindObject(name) ;
if (obj)
lofTasks->Remove(obj) ;
}
//____________________________________________________________________________
}
//____________________________________________________________________________
TFolder * phos = 0 ;
TFolder * phosmain = 0 ;
TFolder * phos = 0 ;
TFolder * phosmain = 0 ;
+ if (opt == "H") { // Hits
phos = dynamic_cast<TFolder*>(fHitsFolder->FindObject("PHOS")) ;
if (!phos)
return ;
name = "Hits" ;
}
phos = dynamic_cast<TFolder*>(fHitsFolder->FindObject("PHOS")) ;
if (!phos)
return ;
name = "Hits" ;
}
- else if ( opt == "S") {
+ else if ( opt == "S") { // SDigits
phosmain = dynamic_cast<TFolder*>(fSDigitsFolder->FindObject("PHOS")) ;
if (!phosmain)
return ;
phosmain = dynamic_cast<TFolder*>(fSDigitsFolder->FindObject("PHOS")) ;
if (!phosmain)
return ;
+ else if (opt == "D") { // Digits
phos = dynamic_cast<TFolder*>(fDigitsFolder->FindObject("PHOS")) ;
if (!phos)
return ;
}
phos = dynamic_cast<TFolder*>(fDigitsFolder->FindObject("PHOS")) ;
if (!phos)
return ;
}
+
+ else if (opt == "RE") { // EMCARecPoints
+ phos = dynamic_cast<TFolder*>(fRecoFolder->FindObject("PHOS/EMCARecPoints")) ;
+ if (!phos)
+ return ;
+ }
+
+ else if (opt == "RC") { // CPVRecPoints
+ phos = dynamic_cast<TFolder*>(fRecoFolder->FindObject("PHOS/CPVRecPoints")) ;
+ if (!phos)
+ return ;
+ }
+
+ else if (opt == "T") { // TrackSegments
+ phos = dynamic_cast<TFolder*>(fRecoFolder->FindObject("PHOS/TrackSegments")) ;
+ if (!phos)
+ return ;
+ }
+
+ else if (opt == "P") { // RecParticles
+ phos = dynamic_cast<TFolder*>(fRecoFolder->FindObject("PHOS/RecParticles")) ;
+ if (!phos)
+ return ;
+ }
+
else {
cerr << "WARNING: AliPHOSGetter::RemoveObjects -> Unknown option " << opt.Data() << endl ;
return ;
else {
cerr << "WARNING: AliPHOSGetter::RemoveObjects -> Unknown option " << opt.Data() << endl ;
return ;