1 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Author: The ALICE Off-line Project. *
9 * Contributors are mentioned in the code where appropriate. *
13 * Permission to use, copy, modify and distribute this software and its *
15 * documentation strictly for non-commercial purposes is hereby granted *
17 * without fee, provided that the above copyright notice appears in all *
19 * copies and that both the copyright notice and this permission notice *
21 * appear in the supporting documentation. The authors make no claims *
23 * about the suitability of this software for any purpose. It is *
25 * provided "as is" without express or implied warranty. *
27 **************************************************************************/
37 29.05.2001 Yuri Kharlov:
39 Everywhere reading the treese TTree->GetEvent(i)
41 is replaced by reading the branches TBranch->GetEntry(0)
47 08.2002 Dmitri Peressounko:
55 //_________________________________________________________________________
57 // A singleton. This class should be used in the analysis stage to get
59 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
61 // instead of directly reading them from galice.root file. This container
63 // ensures, that one reads Digits, made of these particular digits, RecPoints,
65 // made of these particular RecPoints, TrackSegments and RecParticles.
67 // This becomes non trivial if there are several identical branches, produced with
69 // different set of parameters.
73 // An example of how to use (see also class AliEMCALAnalyser):
75 // AliEMCALGetter * gime = AliEMCALGetter::GetInstance("galice.root","test") ;
77 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
79 // AliEMCALRecParticle * part = gime->RecParticle(1) ;
83 // please->GetEvent(event) ; // reads new event from galice.root
87 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
89 //*-- Completely redesigned by Dmitri Peressounko March 2001
93 //*-- YS June 2001 : renamed the original AliEMCALIndexToObject and make
95 //*-- systematic usage of TFolders without changing the interface
97 //*-- YS August 2002 : clone PHOS as closely as possible and intoduction
99 // of new IO (à la PHOS)
101 //////////////////////////////////////////////////////////////////////////////
105 // --- ROOT system ---
113 #include "TObjString.h"
117 #include "TParticle.h"
121 // --- Standard library ---
123 #include <iostream.h>
127 // --- AliRoot header files ---
131 #include "AliConfig.h"
133 #include "AliEMCALGetter.h"
135 #include "AliEMCAL.h"
137 #include "AliEMCALDigitizer.h"
139 #include "AliEMCALSDigitizer.h"
141 #include "AliEMCALClusterizerv1.h"
143 //#include "AliEMCALTrackSegmentMakerv1.h"
145 //#include "AliEMCALTrackSegment.h"
147 //#include "AliEMCALPIDv1.h"
149 #include "AliEMCALGeometry.h"
153 ClassImp(AliEMCALGetter)
157 AliEMCALGetter * AliEMCALGetter::fgObjGetter = 0 ;
159 TFile * AliEMCALGetter::fFile = 0 ;
163 //____________________________________________________________________________
165 AliEMCALGetter::AliEMCALGetter(const char* headerFile, const char* branchTitle, const Bool_t toSplit)
169 // This is the ctor called by GetInstance and the only one that can be used
173 if ( fHeaderFile.Contains("_") ) {
175 cerr << "AliEMCALGetter::AliEMCALGetter -> Invalid file name (_ not allowed) " << fHeaderFile.Data() << endl ;
183 //Initialize all data
197 fHeaderFile = headerFile ;
201 fPrimaries = new TObjArray(1) ;
205 fModuleFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Configuration/Modules"));
207 fPrimariesFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/RunMC/Event/Data"));
209 fHitsFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/RunMC/Event/Data/Hits"));
211 fSDigitsFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/RunMC/Event/Data/SDigits"));
213 fDigitsFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Event/Data"));
215 fRecoFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Event/RecData"));
217 //fQAFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Conditions/QA"));
219 fTasksFolder = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Tasks")) ;
223 //Set titles to branches and create PHOS specific folders
225 SetTitle(branchTitle) ;
229 if ( fHeaderFile != "aliroot" ) { // to call the getter without a file
233 fFile = static_cast<TFile*>(gROOT->GetFile(fHeaderFile.Data() ) ) ;
237 if(!fFile){ //if file was not opened yet, read gAlice
239 fFile = TFile::Open(fHeaderFile.Data(), "update") ;
241 if (!fFile->IsOpen()) {
243 cerr << "ERROR : AliEMCALGetter::AliEMCALGetter -> Cannot open " << fHeaderFile.Data() << endl ;
251 gAlice = static_cast<AliRun *>(fFile->Get("gAlice")) ;
261 cerr << "ERROR : AliEMCALGetter::AliEMCALGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ;
273 cout << "INFO: AliEMCALGetter -> Posting EMCAL to Folders" << endl ;
275 if (gAlice->GetDetector("EMCAL")) {
277 AliConfig * conf = AliConfig::Instance() ;
279 conf->Add(static_cast<AliDetector*>(gAlice->GetDetector("EMCAL"))) ;
281 conf->Add(static_cast<AliModule*>(gAlice->GetDetector("EMCAL"))) ;
287 cerr << "ERROR: AliEMCALGetter -> detector EMCAL not found" << endl ;
299 //____________________________________________________________________________
301 AliEMCALGetter::~AliEMCALGetter()
307 fPrimaries->Delete() ;
315 TFolder * emcalF = dynamic_cast<TFolder *>(fSDigitsFolder->FindObject("EMCAL")) ;
317 TCollection * folderslist = emcalF->GetListOfFolders() ;
319 TIter next(folderslist) ;
321 TFolder * folder = 0 ;
323 while ( (folder = static_cast<TFolder*>(next())) )
325 emcalF->Remove(folder) ;
347 //____________________________________________________________________________
349 void AliEMCALGetter::CloseFile()
365 //____________________________________________________________________________
367 const TFolder * AliEMCALGetter::Folder(const TString what) const {
371 // returns the EMCAL folder required by what
373 // what = hits, sdigits, digits
377 if ( what == "hits" )
379 return dynamic_cast<const TFolder *>(fHitsFolder->FindObject("EMCAL")) ;
381 else if ( what == "sdigits" )
383 return dynamic_cast<const TFolder *>(fSDigitsFolder->FindObject("EMCAL")) ;
385 else if ( what == "digits" )
387 return dynamic_cast<const TFolder *>(fDigitsFolder->FindObject("EMCAL")) ;
391 cerr << "ERROR: AliEMCALGetter::GetFolder -> " << what.Data() << " illegal option (hits, sdigits, digits) " << endl ;
401 //____________________________________________________________________________
403 AliEMCALGetter * AliEMCALGetter::GetInstance()
407 // Returns the pointer of the unique instance already defined
419 // cout << "AliEMCALGetter::GetInstance ERROR: not yet initialized" << endl ;
429 //____________________________________________________________________________
431 AliEMCALGetter * AliEMCALGetter::GetInstance(const char* headerFile,
433 const char* branchTitle,
435 const Bool_t toSplit)
439 // Creates and returns the pointer of the unique instance
441 // Must be called only when the environment has changed
447 fgObjGetter = new AliEMCALGetter(headerFile,branchTitle,toSplit) ;
449 if(fgObjGetter->fFailed)
461 //First checks, if header file already opened
463 if(!fgObjGetter->fFile){
465 fgObjGetter = new AliEMCALGetter(headerFile,branchTitle,toSplit) ;
467 if(fgObjGetter->fFailed)
479 if(fgObjGetter->fHeaderFile.CompareTo(headerFile)==0){ //Opened the same header file
481 if((fgObjGetter->fBranchTitle.CompareTo(branchTitle) == 0)&& //Open the same branch title
483 (toSplit==fgObjGetter->fToSplit)){ //Nothing should be cleaned
489 else{ //Clean all data and AliEMCAL...zers
491 if(fgObjGetter->fToSplit)
493 fgObjGetter->CloseSplitFiles() ;
495 fgObjGetter->CleanWhiteBoard() ;
497 fgObjGetter->fToSplit = toSplit ;
499 fgObjGetter->SetTitle(branchTitle) ;
507 else{ //Close already opened files, clean memory and open new header file
515 if(fgObjGetter->fFile){
517 fgObjGetter->fFile->Close() ;
519 fgObjGetter->fFile=0;
523 if(fgObjGetter->fToSplit)
525 fgObjGetter->CloseSplitFiles() ;
527 fgObjGetter->CleanWhiteBoard() ;
529 fgObjGetter = new AliEMCALGetter(headerFile,branchTitle,toSplit) ;
543 //____________________________________________________________________________
545 const Bool_t AliEMCALGetter::BranchExists(const TString recName) const
549 //Looks in the tree Tree"name" if branch with current name olready exists
553 TString filename("") ;
555 TString name, dataname, zername;
557 if(recName == "SDigits"){
559 filename=fSDigitsFileName ;
565 zername = "AliPHOSSDigitizer" ;
571 if(recName == "Digits"){
573 filename=fDigitsFileName ;
579 zername = "AliPHOSDigitizer" ;
585 if(recName =="RecPoints"){
587 filename=fRecPointsFileName ;
591 dataname = "PHOSEmcRP" ;
593 zername = "AliPHOSClusterizer" ;
599 if(recName == "TrackSegments"){
601 filename=fTrackSegmentsFileName ;
605 dataname = "PHOSTS" ;
607 zername = "AliPHOSTrackSegmentMaker" ;
613 if(recName == "RecParticles"){
615 filename= fRecParticlesFileName ;
619 dataname = "PHOSRP" ;
621 zername = "AliPHOSPID" ;
637 file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
641 file = TFile::Open(fSDigitsFileName.Data(),"update");
651 tree = (TTree *)file->Get(name.Data()) ;
661 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
665 TBranch * branch = 0 ;
667 TString titleName(fBranchTitle);
671 while ((branch = (static_cast<TBranch*>(next())))) {
673 TString branchName(branch->GetName() ) ;
675 TString branchTitle(branch->GetTitle() ) ;
677 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
679 cerr << "WARNING: AliEMCALGetter::BranchExists -> branch " << dataname.Data() << " with title " << fBranchTitle << " already exits in "
681 << name.Data() << endl;
687 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
689 cerr << "WARNING: AliEMCALGetter::BranchExists -> branch AliEMCAL... with title " << branch->GetTitle() << " already exits in "
691 << name.Data() << endl;
699 //We can't delete three if gAlice points to it... To be redisigned somehow???!!!
703 if(name.Contains("TreeS"))
705 if(tree!=gAlice->TreeS())
709 if(name.Contains("TreeD"))
711 if(tree!=gAlice->TreeD())
715 if(name.Contains("TreeR"))
717 if(tree!=gAlice->TreeR())
731 //____________________________________________________________________________
733 void AliEMCALGetter::ListBranches(Int_t event) const
739 TBranch * branch = 0 ;
741 if (gAlice->GetEvent(event) == -1)
747 TTree * t = gAlice->TreeH() ;
751 cout << "INFO: AliEMCALGetter::ListBranches -> ****** Hits : " << endl ;
753 TObjArray * lob = t->GetListOfBranches() ;
757 while ( (branch = static_cast<TBranch*>(next())) )
759 cout << " " << branch->GetName() << endl ;
763 cerr << "WARNING::AliEMCALGetter::ListBranches -> TreeH not found for event " << event << endl ;
769 t = gAlice->TreeS() ;
773 cout << "INFO: AliEMCALGetter::ListBranches -> ****** SDigits : " << endl ;
775 TObjArray * lob = t->GetListOfBranches() ;
779 while ( (branch = static_cast<TBranch*>(next())) )
781 cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ;
785 cerr << "WARNING::AliEMCALGetter::ListBranches -> TreeS not found for event " << event << endl ;
789 t = gAlice->TreeD() ;
793 cout << "INFO: AliEMCALGetter::ListBranches -> ****** Digits : " << endl ;
795 TObjArray * lob = t->GetListOfBranches() ;
799 while ( (branch = static_cast<TBranch*>(next())) )
801 cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ;
805 cerr << "WARNING::AliEMCALGetter::ListBranches -> TreeD not found for event " << event << endl ;
811 t = gAlice->TreeR() ;
815 cout << "INFO: AliEMCALGetter::ListBranches -> ****** Recon : " << endl ;
817 TObjArray * lob = t->GetListOfBranches() ;
821 while ( (branch = static_cast<TBranch*>(next())) )
823 cout << " " << branch->GetName() << " " << branch->GetTitle() << endl ;
827 cerr << "WARNING::AliEMCALGetter::ListBranches -> TreeR not found for event " << event << endl ;
835 //____________________________________________________________________________
837 void AliEMCALGetter::NewBranch(TString name, Int_t event)
841 fBranchTitle = fSDigitsTitle = fDigitsTitle = fRecPointsTitle = fTrackSegmentsTitle = fRecParticlesTitle = name ;
849 //____________________________________________________________________________
851 Bool_t AliEMCALGetter::NewFile(TString name)
863 fFile = static_cast<TFile*>(gROOT->GetFile(fHeaderFile.Data() ) ) ;
865 if(!fFile) { //if file was not opened yet, read gAlice
867 fFile = TFile::Open(fHeaderFile.Data(),"update") ;
869 if (!fFile->IsOpen()) {
871 cerr << "ERROR : AliEMCALGetter::NewFile -> Cannot open " << fHeaderFile.Data() << endl ;
879 gAlice = static_cast<AliRun *>(fFile->Get("gAlice")) ;
887 cerr << "ERROR : AliEMCALGetter::AliEMCALGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ;
901 //____________________________________________________________________________
903 const AliEMCAL * AliEMCALGetter::EMCAL()
907 // returns the EMCAL object
909 AliEMCAL * emcal = dynamic_cast<AliEMCAL*>(fModuleFolder->FindObject("EMCAL")) ;
915 cout << "WARNING: AliEMCALGetter::EMCAL -> EMCAL module not found in Folders" << endl ;
923 //____________________________________________________________________________
925 AliEMCALGeometry * AliEMCALGetter::EMCALGeometry()
929 AliEMCALGeometry * rv = 0 ;
933 rv = EMCAL()->GetGeometry() ;
941 //____________________________________________________________________________
943 const Bool_t AliEMCALGetter::PostPrimaries(void) const
945 { //------- Primaries ----------------------
949 // the hierarchy is //Folders/RunMC/Event/Data/Primaries
953 TFolder * primariesFolder = dynamic_cast<TFolder*>(fPrimariesFolder->FindObject("Primaries")) ;
955 if ( !primariesFolder ) {
959 cout << "WARNING: AliEMCALGetter::Post Primaries -> Folder //" << fPrimariesFolder->GetName() << "/Primaries/ not found!" << endl;
961 cout << "INFO: AliEMCALGetter::Post Primaries -> Adding Folder //" << fPrimariesFolder->GetName() << "/Primaries/" << endl;
965 primariesFolder = fPrimariesFolder->AddFolder("Primaries", "Primaries particles from TreeK") ;
969 TClonesArray *primaries= new TClonesArray("TParticle",1000) ;
971 primaries->SetName("Primaries") ;
973 primariesFolder->Add(primaries) ;
983 //____________________________________________________________________________
985 TObject** AliEMCALGetter::PrimariesRef(void) const
987 { //------- Primaries ----------------------
993 // the hierarchy is //Folders/RunMC/Event/Data/Primaries
995 if ( !fPrimariesFolder ) {
997 cerr << "ERROR: AliEMCALGetter::PrimariesRef -> Folder //" << fPrimariesFolder << " not found!" << endl;
1005 TFolder * primariesFolder = dynamic_cast<TFolder *>(fPrimariesFolder->FindObject("Primaries")) ;
1007 if ( !primariesFolder ) {
1009 cerr << "ERROR: AliEMCALGetter::PrimariesRef -> Folder //" << fPrimariesFolder << "/Primaries/ not found!" << endl;
1017 TObject * p = primariesFolder->FindObject("Primaries") ;
1021 cerr << "ERROR: AliEMCALGetter::PrimariesRef -> " << primariesFolder->GetName() << "/Primaries not found !" << endl ;
1029 return primariesFolder->GetListOfFolders()->GetObjectRef(p) ;
1035 //____________________________________________________________________________
1037 const Bool_t AliEMCALGetter::PostHits(void) const
1039 { //------- Hits ----------------------
1043 // the hierarchy is //Folders/RunMC/Event/Data/EMCAL/Hits
1047 TFolder * emcalFolder = dynamic_cast<TFolder*>(fHitsFolder->FindObject("EMCAL")) ;
1049 if ( !emcalFolder ) {
1053 cout << "WARNING: AliEMCALGetter::Post H -> Folder //" << fHitsFolder << "/EMCAL/ not found!" << endl;
1055 cout << "INFO: AliEMCALGetter::Post H -> Adding Folder //" << fHitsFolder << "/EMCAL/" << endl;
1059 emcalFolder = fHitsFolder->AddFolder("EMCAL", "Hits from EMCAL") ;
1063 TClonesArray *hits= new TClonesArray("AliEMCALHit",1000) ;
1065 hits->SetName("Hits") ;
1067 emcalFolder->Add(hits) ;
1077 //____________________________________________________________________________
1079 TObject ** AliEMCALGetter::HitsRef(void) const
1081 { //------- Hits ----------------------
1087 // the hierarchy is //Folders/RunMC/Event/Data/EMCAL/Hits
1089 if ( !fHitsFolder ) {
1091 cerr << "ERROR: AliEMCALGetter::Post H -> Folder //" << fHitsFolder << " not found!" << endl;
1099 TFolder * emcalFolder = dynamic_cast<TFolder *>(fHitsFolder->FindObject("EMCAL")) ;
1101 if ( !emcalFolder ) {
1103 cerr << "ERROR: AliEMCALGetter::Post HRef -> Folder //" << fHitsFolder << "/EMCAL/ not found!" << endl;
1111 TObject * h = emcalFolder->FindObject("Hits") ;
1115 cerr << "ERROR: AliEMCALGetter::HRef -> " << emcalFolder->GetName() << "/Hits not found !" << endl ;
1123 return emcalFolder->GetListOfFolders()->GetObjectRef(h) ;
1129 //____________________________________________________________________________
1131 const Bool_t AliEMCALGetter::PostSDigits(const char * name, const char * headerFile) const
1133 { //---------- SDigits -------------------------
1139 // the hierarchy is //Folders/RunMC/Event/Data/EMCAL/SDigits/headerFile/sdigitsname
1141 // because you can have sdigits from several hit files for mixing
1145 TFolder * emcalFolder = dynamic_cast<TFolder*>(fSDigitsFolder->FindObject("EMCAL")) ;
1147 if ( !emcalFolder ) {
1151 cout << "WARNING: AliEMCALGetter::Post S -> Folder //" << fSDigitsFolder << "/EMCAL/ not found!" << endl;
1153 cout << "INFO: AliEMCALGetter::Post S -> Adding Folder //" << fHitsFolder << "/EMCAL/" << endl;
1157 emcalFolder = fSDigitsFolder->AddFolder("EMCAL", "SDigits from EMCAL") ;
1163 TString subdir(headerFile) ;
1165 subdir.ReplaceAll("/", "_") ;
1167 TFolder * emcalSubFolder = dynamic_cast<TFolder*>(emcalFolder->FindObject(subdir)) ;
1169 if ( !emcalSubFolder )
1171 emcalSubFolder = emcalFolder->AddFolder(subdir, "");
1177 TObject * sd = emcalSubFolder->FindObject(name);
1181 TClonesArray * sdigits = new TClonesArray("AliEMCALDigit",1) ;
1183 sdigits->SetName(name) ;
1185 emcalSubFolder->Add(sdigits) ;
1195 //____________________________________________________________________________
1197 TObject ** AliEMCALGetter::SDigitsRef(const char * name, const char * file) const
1199 { //------- SDigits ----------------------
1203 // the hierarchy is //Folders/RunMC/Event/Data/EMCAL/SDigits/filename/SDigits
1207 if ( !fSDigitsFolder ) {
1209 cerr << "ERROR: AliEMCALGetter::Post SRef -> Folder //" << fSDigitsFolder << " not found!" << endl;
1217 TFolder * emcalFolder = dynamic_cast<TFolder *>(fSDigitsFolder->FindObject("EMCAL")) ;
1219 if ( !emcalFolder ) {
1221 cerr << "ERROR: AliEMCALGetter::Post SRef -> Folder //" << fSDigitsFolder << "/EMCAL/ not found!" << endl;
1229 TFolder * emcalSubFolder = 0 ;
1233 emcalSubFolder = dynamic_cast<TFolder *>(emcalFolder->FindObject(file)) ;
1237 emcalSubFolder = dynamic_cast<TFolder *>(emcalFolder->FindObject(fHeaderFile)) ;
1241 if(!emcalSubFolder) {
1243 cerr << "ERROR: AliEMCALGetter::Post SRef -> Folder //Folders/RunMC/Event/Data/EMCAL/" << file << "not found!" << endl;
1251 TObject * dis = emcalSubFolder->FindObject(name) ;
1255 cerr << "ERROR: AliEMCALGetter::DigitesSRef -> object " << name << " not found! " << endl ;
1263 return emcalSubFolder->GetListOfFolders()->GetObjectRef(dis) ;
1271 //____________________________________________________________________________
1273 const Bool_t AliEMCALGetter::PostSDigitizer(AliEMCALSDigitizer * sdigitizer) const
1275 { //---------- SDigitizer -------------------------
1279 // the hierarchy is //Folders/Tasks/SDigitizer/EMCAL/sdigitsname
1285 TTask * sd = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
1291 cerr << "ERROR: AliEMCALGetter::Post Ser -> Task //" << fTasksFolder << "/SDigitizer not found!" << endl;
1297 TTask * emcal = dynamic_cast<TTask*>(sd->GetListOfTasks()->FindObject("EMCAL")) ;
1303 cout <<"WARNING: AliEMCALGetter::Post Ser ->//" << fTasksFolder << "/SDigitizer/EMCAL/ not found!" << endl;
1305 cout <<"INFO: AliEMCALGetter::Post Ser -> Adding //" << fTasksFolder << "/SDigitizer/EMCAL/" << endl;
1309 emcal = new TTask("EMCAL", "") ;
1315 AliEMCALSDigitizer * emcalsd = dynamic_cast<AliEMCALSDigitizer *>(emcal->GetListOfTasks()->FindObject( sdigitizer->GetName() ));
1321 cout << "INFO: AliEMCALGetter::Post Ser -> Task " << sdigitizer->GetName() << " already exists" << endl ;
1323 emcal->GetListOfTasks()->Remove(emcalsd) ;
1327 emcal->Add(sdigitizer) ;
1337 //____________________________________________________________________________
1339 TObject ** AliEMCALGetter::SDigitizerRef(const char * name) const
1345 TTask * sd = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
1349 cerr << "ERROR: AliEMCALGetter::Post SerRef -> Task //" << fTasksFolder << "/SDigitizer not found!" << endl;
1357 TTask * emcal = dynamic_cast<TTask*>(sd->GetListOfTasks()->FindObject("EMCAL")) ;
1361 cerr <<"ERROR: AliEMCALGetter::Post SerRef -> //" << fTasksFolder << "/SDigitizer/EMCAL not found!" << endl;
1369 TTask * task = dynamic_cast<TTask*>(emcal->GetListOfTasks()->FindObject(name)) ;
1373 return emcal->GetListOfTasks()->GetObjectRef(task) ;
1381 //____________________________________________________________________________
1383 const Bool_t AliEMCALGetter::PostSDigitizer(const char * name, const char * file) const
1385 { //---------- SDigitizer -------------------------
1389 // the hierarchy is //Folders/Tasks/SDigitizer/EMCAL/sdigitsname
1393 TTask * sd = dynamic_cast<TTask*>(fTasksFolder->FindObject("SDigitizer")) ;
1397 cerr << "ERROR: AliEMCALGetter::Post Ser -> Task //" << fTasksFolder << "/SDigitizer not found!" << endl;
1405 TTask * emcal = dynamic_cast<TTask*>(sd->GetListOfTasks()->FindObject("EMCAL")) ;
1411 cout <<"WARNING: AliEMCALGetter::Post Ser -> //" << fTasksFolder << "/SDigitizer/EMCAL/ not found!" << endl;
1413 cout <<"INFO: AliEMCALGetter::Post Ser -> Adding //" << fTasksFolder << "/SDigitizer/EMCAL" << endl;
1417 emcal = new TTask("EMCAL", "") ;
1425 TString sdname(name) ;
1427 sdname.Append(":") ;
1429 sdname.Append(file);
1431 sdname.ReplaceAll("/","_") ;
1433 AliEMCALSDigitizer * emcalsd = dynamic_cast<AliEMCALSDigitizer *>(emcal->GetListOfTasks()->FindObject( sdname ));
1437 emcalsd = new AliEMCALSDigitizer() ;
1439 //Note, we can not call constructor with parameters: it will call Getter and screw up everething
1441 emcalsd->SetName(sdname) ;
1443 emcalsd->SetTitle(file) ;
1445 emcal->Add(emcalsd) ;
1457 //____________________________________________________________________________
1459 const Bool_t AliEMCALGetter::PostDigits(const char * name) const
1461 { //---------- Digits -------------------------
1465 // the hierarchy is //Folders/Run/Event/Data/EMCAL/SDigits/name
1469 TFolder * emcalFolder = dynamic_cast<TFolder*>(fDigitsFolder->FindObject("EMCAL")) ;
1473 if ( !emcalFolder ) {
1477 cout << "WARNING: AliEMCALGetter::Post D -> Folder //" << fDigitsFolder << "/EMCAL/ not found!" << endl;
1479 cout << "INFO: AliEMCALGetter::Post D -> Adding Folder //" << fDigitsFolder << "/EMCAL/" << endl;
1483 emcalFolder = fDigitsFolder->AddFolder("EMCAL", "Digits from EMCAL") ;
1489 TObject* dig = emcalFolder->FindObject( name ) ;
1493 TClonesArray * digits = new TClonesArray("AliEMCALDigit",1000) ;
1495 digits->SetName(name) ;
1497 emcalFolder->Add(digits) ;
1507 //____________________________________________________________________________
1509 TObject ** AliEMCALGetter::DigitsRef(const char * name) const
1511 { //------- Digits ----------------------
1515 // the hierarchy is //Folders/Run/Event/Data/EMCAL/Digits/name
1519 if ( !fDigitsFolder ) {
1521 cerr << "ERROR: AliEMCALGetter::Post DRef -> Folder //" << fDigitsFolder << " not found!" << endl;
1529 TFolder * emcalFolder = dynamic_cast<TFolder*>(fDigitsFolder->FindObject("EMCAL")) ;
1531 if ( !emcalFolder ) {
1533 cerr << "ERROR: AliEMCALGetter::DRef -> Folder //" << fDigitsFolder << "/EMCAL/ not found!" << endl;
1541 TObject * d = emcalFolder->FindObject(name) ;
1545 cerr << "ERROR: AliEMCALGetter::DigitsRef -> object " << name << " not found! " << endl ;
1553 return emcalFolder->GetListOfFolders()->GetObjectRef(d) ;
1561 //____________________________________________________________________________
1563 const Bool_t AliEMCALGetter::PostDigitizer(AliEMCALDigitizer * digitizer) const
1565 { //---------- Digitizer -------------------------
1569 TTask * sd = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
1575 cerr << "ERROR: AliEMCALGetter::Post Der -> Task //" << fTasksFolder << "/Digitizer not found!" << endl;
1581 TTask * emcal = dynamic_cast<TTask*>(sd->GetListOfTasks()->FindObject("EMCAL")) ;
1587 cout <<"WARNING: AliEMCALGetter::Post Der -> //" << fTasksFolder << "/Digitizer/EMCAL not found!" << endl;
1589 cout <<"INFO: AliEMCALGetter::Post Der -> Adding //" << fTasksFolder << "/Digitizer/EMCAL" << endl;
1593 emcal = new TTask("EMCAL", "") ;
1601 AliEMCALDigitizer * emcald = dynamic_cast<AliEMCALDigitizer*>(emcal->GetListOfTasks()->FindObject(digitizer->GetName())) ;
1607 emcal->GetListOfTasks()->Remove(emcald) ;
1611 emcal->Add(digitizer) ;
1619 //____________________________________________________________________________
1621 const Bool_t AliEMCALGetter::PostDigitizer(const char * name) const
1623 { //---------- Digitizer -------------------------
1627 // the hierarchy is //Folders/Tasks/SDigitizer/EMCAL/sdigitsname
1631 TTask * d = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
1635 cerr << "ERROR: AliEMCALGetter::Post Der -> Task //" << fTasksFolder << "/Digitizer not found!" << endl;
1643 TTask * emcal = dynamic_cast<TTask*>(d->GetListOfTasks()->FindObject("EMCAL")) ;
1649 cout <<"WARNING: AliEMCALGetter::Post Der -> //" << fTasksFolder << "/Digitizer/EMCAL not found!" << endl;
1651 cout <<"INFO: AliEMCALGetter::Post Der -> Adding //" << fTasksFolder << "/Digitizer/EMCAL" << endl;
1655 emcal = new TTask("EMCAL", "") ;
1663 AliEMCALDigitizer * emcald = dynamic_cast<AliEMCALDigitizer*>(emcal->GetListOfTasks()->FindObject(name)) ;
1667 emcald = new AliEMCALDigitizer() ;
1669 emcald->SetName(fDigitsTitle) ;
1671 emcald->SetTitle(fHeaderFile) ;
1673 emcal->Add(emcald) ;
1683 //____________________________________________________________________________
1685 TObject ** AliEMCALGetter::DigitizerRef(const char * name) const
1689 TTask * sd = dynamic_cast<TTask*>(fTasksFolder->FindObject("Digitizer")) ;
1693 cerr << "ERROR: AliEMCALGetter::Post DerRef -> Task //" << fTasksFolder->GetName() << "/Digitizer not found!" << endl;
1701 TTask * emcal = dynamic_cast<TTask*>(sd->GetListOfTasks()->FindObject("EMCAL")) ;
1705 cerr <<"ERROR: AliEMCALGetter::Post DerRef -> //" << fTasksFolder->GetName() << "/Digitizer/EMCAL" << endl;
1713 TTask * task = dynamic_cast<TTask*>(emcal->GetListOfTasks()->FindObject(name)) ;
1717 return emcal->GetListOfTasks()->GetObjectRef(task) ;
1725 //____________________________________________________________________________
1727 const Bool_t AliEMCALGetter::PostRecPoints(const char * name) const
1729 { // -------------- RecPoints -------------------------------------------
1733 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/TowerRecPoints/name
1735 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/PreShowerRecPoints/name
1739 TFolder * emcalFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL")) ;
1743 if ( !emcalFolder ) {
1747 cout << "WARNING: AliEMCALGetter::Post RPo -> Folder //" << fRecoFolder << "/EMCAL/ not found!" << endl;
1749 cout << "INFO: AliEMCALGetter::Post Rpo -> Adding Folder //" << fRecoFolder << "/EMCAL/" << endl;
1753 emcalFolder = fRecoFolder->AddFolder("EMCAL", "Reconstructed data from EMCAL") ;
1761 TFolder * emcalRPoTowerFolder = dynamic_cast<TFolder*>(emcalFolder->FindObject("TowerRecPoints")) ;
1763 if ( !emcalRPoTowerFolder ) {
1767 cout << "WARNING: AliEMCALGetter::Post RPo -> Folder //" << fRecoFolder << "/EMCAL/TowerRecPoints/ not found!" << endl;
1769 cout << "INFO: AliEMCALGetter::Post Rpo -> Adding Folder //" << fRecoFolder << "/EMCAL/TowerRecPoints not found!" << endl;
1773 emcalRPoTowerFolder = emcalFolder->AddFolder("TowerRecPoints", "Tower RecPoints from EMCAL") ;
1779 TObject * erp = emcalFolder->FindObject( name ) ;
1783 TObjArray * towerrp = new TObjArray(100) ;
1785 towerrp->SetName(name) ;
1787 emcalRPoTowerFolder->Add(towerrp) ;
1793 // Pre Shower RecPoints
1795 TFolder * emcalRPoPreShoFolder = dynamic_cast<TFolder*>(emcalFolder->FindObject("PreShowerRecPoints")) ;
1797 if ( !emcalRPoPreShoFolder ) {
1801 cout << "WARNING: AliEMCALGetter::Post RPo -> Folder //" << fRecoFolder << "/EMCAL/PreShowerRecPoints/ not found!" << endl;
1803 cout << "INFO: AliEMCALGetter::Post Rpo -> Adding Folder //" << fRecoFolder << "/EMCAL/PreShowerRecPoints/" << endl;
1807 emcalRPoPreShoFolder = emcalFolder->AddFolder("PreShowerRecPoints", "PreSho RecPoints from EMCAL") ;
1813 TObject * crp = emcalRPoPreShoFolder->FindObject( name ) ;
1817 TObjArray * preshorp = new TObjArray(100) ;
1819 preshorp->SetName(name) ;
1821 emcalRPoPreShoFolder->Add(preshorp) ;
1831 //____________________________________________________________________________
1833 TObject ** AliEMCALGetter::TowerRecPointsRef(const char * name) const
1835 { // -------------- RecPoints -------------------------------------------
1839 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/TowerRecPoints/name
1843 if ( !fRecoFolder ) {
1845 cerr << "ERROR: AliEMCALGetter::TowerRecPointsRef -> Folder //" << fRecoFolder << " not found!" << endl;
1853 TFolder * towerFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL/TowerRecPoints")) ;
1855 if ( !towerFolder ) {
1857 cerr << "ERROR: AliEMCALGetter::TowerRecPointsRef -> Folder //" << fRecoFolder << "/EMCAL/TowerRecPoints/ not found!" << endl;
1867 TObject * trp = towerFolder->FindObject(name ) ;
1871 cerr << "ERROR: AliEMCALGetter::TowerRecPointsRef -> Object " << name << " not found!" << endl ;
1877 return towerFolder->GetListOfFolders()->GetObjectRef(trp) ;
1885 //____________________________________________________________________________
1887 TObject ** AliEMCALGetter::PreShowerRecPointsRef(const char * name) const
1889 { // -------------- RecPoints -------------------------------------------
1893 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/PreShowerRecPoints/name
1897 if ( !fRecoFolder ) {
1899 cerr << "ERROR: AliEMCALGetter::PreShowerRecPointsRef -> Folder //" << fRecoFolder << " not found!" << endl;
1907 TFolder * preshoFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL/PreShowerRecPoints")) ;
1909 if ( !preshoFolder ) {
1911 cerr << "ERROR: AliEMCALGetter::PreShowerRecPointsRef -> Folder //" << fRecoFolder << "/EMCAL/PreShowerRecPoints/" << endl;
1919 TObject * prp = preshoFolder->FindObject(name ) ;
1923 cerr << "ERROR: AliEMCALGetter::PreShowerRecPointsRef -> Object " << name << " not found! " << endl ;
1929 return preshoFolder->GetListOfFolders()->GetObjectRef(prp) ;
1937 //____________________________________________________________________________
1939 const Bool_t AliEMCALGetter::PostClusterizer(AliEMCALClusterizer * clu) const
1941 { // ------------------ AliEMCALClusterizer ------------------------
1945 // the hierarchy is //Folders/Tasks/Reconstructioner/EMCAL/sdigitsname
1949 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
1955 cerr << "ERROR: AliEMCALGetter::Post Rer -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
1963 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
1969 cout <<"WARNING: AliEMCALGetter::Post Rer -> //" << fTasksFolder << "/ReconstructionerEMCAL not found!" << endl;
1971 cout <<"INFO: AliEMCALGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl;
1975 emcal = new TTask("EMCAL", "") ;
1983 AliEMCALClusterizerv1 * emcalcl = dynamic_cast<AliEMCALClusterizerv1*>(emcal->GetListOfTasks()->FindObject(clu->GetName())) ;
1989 cout << "INFO: AliEMCALGetter::Post Rer -> Task " << clu->GetName() << " already exists" << endl ;
1993 emcal->GetListOfTasks()->Remove(emcalcl) ;
2005 //____________________________________________________________________________
2007 TObject ** AliEMCALGetter::ClusterizerRef(const char * name) const
2009 { // ------------------ AliEMCALClusterizer ------------------------
2013 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2019 cerr << "ERROR: AliEMCALGetter::Post RerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2027 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2031 cerr <<"WARNING: AliEMCALGetter::Post RerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
2039 TList * l = emcal->GetListOfTasks() ;
2047 TString cluname(name) ;
2051 while((task = static_cast<TTask *>(it.Next()) )){
2053 TString taskname(task->GetName()) ;
2055 if(taskname.BeginsWith(cluname)){
2069 return l->GetObjectRef(clu) ;
2073 cerr << "ERROR: AliEMCALGetter::Post RerRef -> task " << task->GetName() << " not found! " << endl ;
2083 //____________________________________________________________________________
2085 const Bool_t AliEMCALGetter::PostClusterizer(const char * name) const
2087 { // ------------------ AliEMCALClusterizer ------------------------
2091 // the hierarchy is //Folders/Tasks/Reconstructioner/EMCAL/sdigitsname
2095 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2101 cerr << "ERROR: AliEMCALGetter::Post Rer -> Task//" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2109 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2115 cout <<"WARNING: AliEMCALGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/EMCAL not found!" << endl;
2117 cout <<"INFO: AliEMCALGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl;
2121 emcal = new TTask("EMCAL", "") ;
2129 TList * l = emcal->GetListOfTasks() ;
2133 TString clun(name) ;
2139 while((task = static_cast<TTask *>(it.Next()) )){
2141 TString taskname(task->GetName()) ;
2143 if(taskname.BeginsWith(clun))
2151 AliEMCALClusterizerv1 * emcalcl = new AliEMCALClusterizerv1() ;
2155 emcalcl->SetName(clun) ;
2157 emcalcl->SetTitle(fHeaderFile) ;
2159 emcal->Add(emcalcl) ;
2169 //____________________________________________________________________________
2171 /*const Bool_t AliEMCALGetter::PostTrackSegments(const char * name) const
2173 { // ---------------TrackSegments -----------------------------------
2177 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/TrackSegments/name
2181 TFolder * emcalFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL")) ;
2185 if ( !emcalFolder ) {
2189 cout << "WARNING: AliEMCALGetter::Post TS -> Folder //" << fRecoFolder << "/EMCAL/ not found!" << endl;
2191 cout << "INFO: AliEMCALGetter::Post TS -> Adding Folder //" << fRecoFolder << "/EMCAL" << endl;
2195 emcalFolder = fRecoFolder->AddFolder("EMCAL", "Reconstructed data from EMCAL") ;
2201 TFolder * emcalTSFolder = dynamic_cast<TFolder*>(emcalFolder->FindObject("TrackSegments")) ;
2203 if ( !emcalTSFolder ) {
2207 cout << "WARNING: AliEMCALGetter::Post TS -> Folder//" << fRecoFolder << "/EMCAL/TrackSegments/ not found!" << endl;
2209 cout << "INFO: AliEMCALGetter::Post TS -> Adding Folder //" << fRecoFolder << "/EMCAL/TrackSegments/" << endl;
2213 emcalTSFolder = emcalFolder->AddFolder("TrackSegments", "TrackSegments from EMCAL") ;
2219 TObject * tss = emcalTSFolder->FindObject( name ) ;
2223 TClonesArray * ts = new TClonesArray("AliEMCALTrackSegment",100) ;
2227 emcalTSFolder->Add(ts) ;
2237 //____________________________________________________________________________
2239 TObject ** AliEMCALGetter::TrackSegmentsRef(const char * name) const
2241 { // ---------------TrackSegments -----------------------------------
2245 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/TrackSegments/name
2249 if ( !fRecoFolder ) {
2251 cerr << "ERROR: AliEMCALGetter::TrackSegmentsRef -> Folder //" << fRecoFolder << "not found!" << endl;
2259 TFolder * emcalFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL/TrackSegments")) ;
2261 if ( !emcalFolder ) {
2263 cerr << "ERROR: AliEMCALGetter::TrackSegmentsRef -> Folder //" << fRecoFolder << "/EMCAL/TrackSegments/ not found!" << endl;
2271 TObject * tss = emcalFolder->FindObject(name) ;
2275 cerr << "ERROR: AliEMCALGetter::TrackSegmentsRef -> object " << name << " not found! " << endl ;
2281 return emcalFolder->GetListOfFolders()->GetObjectRef(tss) ;
2287 //____________________________________________________________________________
2289 const Bool_t AliEMCALGetter::PostTrackSegmentMaker(AliEMCALTrackSegmentMaker * tsmaker) const
2291 { //------------Track Segment Maker ------------------------------
2295 // the hierarchy is //Folders/Tasks/Reconstructioner/EMCAL/sdigitsname
2299 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2305 cerr << "ERROR: AliEMCALGetter::Post Ter -> Task //" << fTasksFolder << "/Reconstructioner not found!" << endl;
2313 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2319 cout <<"WARNING: AliEMCALGetter::Post Rer -> //" << fTasksFolder << "/Reconstructioner/EMCAL not found!" << endl;
2321 cout <<"INFO: AliEMCALGetter::Post Rer -> Adding //" << fTasksFolder << "/Reconstructioner/EMCAL" << endl;
2325 emcal = new TTask("EMCAL", "") ;
2333 AliEMCALTrackSegmentMaker * emcalts =
2335 dynamic_cast<AliEMCALTrackSegmentMaker*>(emcal->GetListOfTasks()->FindObject(tsmaker->GetName())) ;
2341 emcal->GetListOfTasks()->Remove(emcalts) ;
2345 emcal->Add(tsmaker) ;
2353 //____________________________________________________________________________
2355 const Bool_t AliEMCALGetter::PostTrackSegmentMaker(const char * name) const
2357 { //------------Track Segment Maker ------------------------------
2361 // the hierarchy is //Folders/Tasks/Reconstructioner/EMCAL/sdigitsname
2365 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2371 cerr << "ERROR: AliEMCALGetter::Post Ter -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2379 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2385 cout <<"WARNING: AliEMCALGetter::Post Ter -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl;
2387 cout <<"INFO: AliEMCALGetter::Post Ter -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
2391 emcal = new TTask("EMCAL", "") ;
2399 TList * l = emcal->GetListOfTasks() ;
2409 while((task = static_cast<TTask *>(it.Next()) )){
2411 TString taskname(task->GetName()) ;
2413 if(taskname.BeginsWith(tsn))
2421 AliEMCALTrackSegmentMakerv1 * emcalts = new AliEMCALTrackSegmentMakerv1() ;
2425 emcalts->SetName(tsn) ;
2427 emcalts->SetTitle(fHeaderFile) ;
2429 emcal->Add(emcalts) ;
2445 //____________________________________________________________________________
2447 TObject ** AliEMCALGetter::TSMakerRef(const char * name) const
2449 { //------------Track Segment Maker ------------------------------
2453 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2459 cerr << "ERROR: AliEMCALGetter::TSLakerRef TerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2467 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2471 cerr <<"WARNING: AliEMCALGetter::TSMakerRef TerRef -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl;
2479 TList * l = emcal->GetListOfTasks() ;
2487 TString tsmname(name) ;
2491 while((task = static_cast<TTask *>(it.Next()) )){
2493 TString taskname(task->GetName()) ;
2495 if(taskname.BeginsWith(tsmname)){
2509 return l->GetObjectRef(tsm) ;
2513 cerr << "ERROR: AliEMCALGetter::TSLakerRef -> task " << task->GetName() << " not found! " << endl ;
2523 //____________________________________________________________________________
2525 const Bool_t AliEMCALGetter::PostRecParticles(const char * name) const
2527 { // -------------------- RecParticles ------------------------
2531 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/TrackSegments/name
2535 TFolder * emcalFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL")) ;
2539 if ( !emcalFolder ) {
2543 cout << "WARNING: AliEMCALGetter::Post RPa -> Folder //" << fRecoFolder << "/EMCAL/ not found!" << endl;
2545 cout << "INFO: AliEMCALGetter::Post Rpa -> Adding Folder //" << fRecoFolder << "/EMCAL/" << endl;
2549 emcalFolder = fRecoFolder->AddFolder("EMCAL", "Reconstructed data from EMCAL") ;
2555 TFolder * emcalRPaFolder = dynamic_cast<TFolder*>(emcalFolder->FindObject("RecParticles")) ;
2557 if ( !emcalRPaFolder ) {
2561 cout << "WARNING: AliEMCALGetter::Post RPa -> Folder //" << fRecoFolder << "/EMCAL/RecParticles/ not found!" << endl;
2563 cout << "INFO: AliEMCALGetter::Post RPa -> Adding Folder //" << fRecoFolder << "/EMCAL/RecParticles/" << endl;
2567 emcalRPaFolder = emcalFolder->AddFolder("RecParticles", "RecParticles from EMCAL") ;
2573 TObject * rps = emcalRPaFolder->FindObject( name ) ;
2577 TClonesArray * rp = new TClonesArray("AliEMCALRecParticle",100) ;
2581 emcalRPaFolder->Add(rp) ;
2591 //____________________________________________________________________________
2593 TObject ** AliEMCALGetter::RecParticlesRef(const char * name) const
2595 { // ---------------RecParticles -----------------------------------
2599 // the hierarchy is //Folders/Run/Event/RecData/EMCAL/TrackSegments/name
2603 if ( !fRecoFolder ) {
2605 cerr << "ERROR: AliEMCALGetter::RecParticlesRef -> Folder//" << fRecoFolder << " not found!" << endl;
2613 TFolder * emcalFolder = dynamic_cast<TFolder*>(fRecoFolder->FindObject("EMCAL/RecParticles")) ;
2615 if ( !emcalFolder ) {
2617 cerr << "ERROR: AliEMCALGetter::RecParticlesRef -> Folder //" << fRecoFolder << "/EMCAL/RecParticles/ not found!" << endl;
2625 TObject * tss = emcalFolder->FindObject(name) ;
2629 cerr << "ERROR: AliEMCALGetter::RecParticlesRef -> object " << name << " not found! " << endl ;
2635 return emcalFolder->GetListOfFolders()->GetObjectRef(tss) ;
2641 //____________________________________________________________________________
2643 const Bool_t AliEMCALGetter::PostPID(AliEMCALPID * pid) const
2645 { // ------------AliEMCAL PID -----------------------------
2649 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2655 cerr << "ERROR: AliEMCALGetter::Post Per -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2663 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2669 cout <<"WARNING: AliEMCALGetter::Post Per -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl;
2671 cout <<"INFO: AliEMCALGetter::Post Per -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
2675 emcal = new TTask("EMCAL", "") ;
2683 AliEMCALPID * emcalpid = dynamic_cast<AliEMCALPID*>(emcal->GetListOfTasks()->FindObject(pid->GetName())) ;
2689 cout << "INFO: AliEMCALGetter::Post Per -> Task " << pid->GetName()
2691 << " already exists" << endl ;
2693 emcal->GetListOfTasks()->Remove(emcalpid) ;
2707 //____________________________________________________________________________
2709 const Bool_t AliEMCALGetter::PostPID(const char * name) const
2713 // the hierarchy is //Folders/Tasks/Reconstructioner/EMCAL/sdigitsname
2717 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2723 cerr << "ERROR: AliEMCALGetter::Post Per -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2731 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2737 cout <<"WARNING: AliEMCALGetter::Post Per -> //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL not found!" << endl;
2739 cout <<"INFO: AliEMCALGetter::Post Per -> Adding //" << fTasksFolder->GetName() << "/Reconstructioner/EMCAL" << endl;
2743 emcal = new TTask("EMCAL", "") ;
2751 TList * l = emcal->GetListOfTasks() ;
2755 TString pidname(name) ;
2761 while((task = static_cast<TTask *>(it.Next()) )){
2763 TString taskname(task->GetName()) ;
2765 if(taskname.BeginsWith(pidname))
2773 AliEMCALPIDv1 * emcalpid = new AliEMCALPIDv1() ;
2777 emcalpid->SetName(pidname) ;
2779 emcalpid->SetTitle(fHeaderFile) ;
2781 emcal->Add(emcalpid) ;
2791 //____________________________________________________________________________
2793 TObject ** AliEMCALGetter::PIDRef(const char * name) const
2795 { //------------PID ------------------------------
2799 TTask * tasks = dynamic_cast<TTask*>(fTasksFolder->FindObject("Reconstructioner")) ;
2805 cerr << "ERROR: AliEMCALGetter::PIDRef PerRef -> Task //" << fTasksFolder->GetName() << "/Reconstructioner not found!" << endl;
2813 TTask * emcal = dynamic_cast<TTask*>(tasks->GetListOfTasks()->FindObject("EMCAL")) ;
2817 cerr <<"WARNING: AliEMCALGetter::PIDRef PerRef -> //" << fTasksFolder->GetName() << "/ReconstructionerEMCAL not found!" << endl;
2825 TList * l = emcal->GetListOfTasks() ;
2833 TString pidname(name) ;
2837 while((task = static_cast<TTask *>(it.Next()) )){
2839 TString taskname(task->GetName()) ;
2841 if(taskname.BeginsWith(pidname)){
2855 return l->GetObjectRef(pid) ;
2859 cerr << "ERROR: AliEMCALGetter::PIDRef -> task " << task->GetName() << " not found! " << endl ;
2871 //____________________________________________________________________________
2873 const Bool_t AliEMCALGetter::PostQA(void) const
2875 { // ------------------ QA ---------------------------------
2879 // the hierarchy is //Folders/Run/Conditions/QA/EMCAL/alarmsName
2883 TFolder * emcalFolder = dynamic_cast<TFolder*>(fQAFolder->FindObject("EMCAL")) ;
2885 if ( !emcalFolder ) {
2889 cout << "WARNING: AliEMCALGetter::Post Q -> Folder //" << fQAFolder << "/EMCAL/ not found!" << endl;
2891 cout << "INFO: AliEMCALGetter::Post Q -> Adding Folder //" << fQAFolder << "/EMCAL/" << endl;
2895 emcalFolder = fQAFolder->AddFolder("EMCAL", "QA from EMCAL") ;
2907 //____________________________________________________________________________
2909 TObject ** AliEMCALGetter::AlarmsRef(void) const
2911 { //------- Alarms ----------------------
2917 // the hierarchy is //Folders/Run/Conditions/QA/EMCAL
2921 cerr << "ERROR: AliEMCALGetter::AlarmsRef QRef -> Folder //" << fQAFolder << " not found!" << endl;
2929 TFolder * emcalFolder = dynamic_cast<TFolder *>(fQAFolder->FindObject("EMCAL")) ;
2931 if ( !emcalFolder ) {
2933 cerr << "ERROR: AliEMCALGetter::AlarmsRef QRef -> Folder //" << fQAFolder << "/EMCAL/ not found!" << endl;
2941 return fQAFolder->GetListOfFolders()->GetObjectRef(emcalFolder) ;
2949 //____________________________________________________________________________
2951 TTree * AliEMCALGetter::TreeK(TString filename)
2957 // returns TreeK from file filename
2959 // usefull in case of split file
2963 if ( filename.IsNull() )
2965 filename = fHeaderFile ;
2971 file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
2973 if (file && (filename != fHeaderFile) ) { // file already open
2981 file = TFile::Open(filename.Data(), "read") ;
2983 fAlice = static_cast<AliRun *>(file->Get("gAlice")) ;
2985 TString treeName("TreeK") ;
2987 treeName += EventNumber() ;
2989 TTree * tree = static_cast<TTree *>(file->Get(treeName.Data())) ;
2991 if (!tree && fDebug)
2993 cout << "WARNING: AliEMCALGetter::TreeK -> " << treeName.Data() << " not found in " << filename.Data() << endl ;
3003 //____________________________________________________________________________
3005 TTree * AliEMCALGetter::TreeH(TString filename)
3011 // returns TreeH from file filename
3013 // usefull in case of split file
3017 if ( filename.IsNull() )
3019 filename = fHeaderFile ;
3025 file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
3027 if (!file) { // file not open yet
3029 file = TFile::Open(filename.Data(), "read") ;
3033 TString treeName("TreeH") ;
3035 treeName += EventNumber() ;
3037 TTree * tree = static_cast<TTree *>(file->Get(treeName.Data())) ;
3039 if (!tree && fDebug)
3041 cout << "WARNING: AliEMCALGetter::TreeH -> " << treeName.Data() << " not found in " << filename.Data() << endl ;
3051 //____________________________________________________________________________
3053 TTree * AliEMCALGetter::TreeS(TString filename)
3059 // returns TreeS from file filename
3061 // usefull in case of split file
3065 if ( filename.IsNull() )
3067 filename = fHeaderFile ;
3073 file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
3075 if (!file) { // file not open yet
3077 file = TFile::Open(filename.Data(), "read") ;
3081 TString treeName("TreeS") ;
3083 treeName += EventNumber() ;
3085 TTree * tree = static_cast<TTree *>(file->Get(treeName.Data())) ;
3087 if (!tree && fDebug)
3089 cout << "WARNING: AliEMCALGetter::TreeS -> " << treeName.Data() << " not found in " << filename.Data() << endl ;
3099 //____________________________________________________________________________
3101 TTree * AliEMCALGetter::TreeD(TString filename)
3107 // returns TreeD from file filename
3109 // usefull in case of split file
3113 if ( filename.IsNull() )
3115 filename = fHeaderFile ;
3121 file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
3123 if (!file) { // file not open yet
3125 file = TFile::Open(filename.Data(), "read") ;
3129 TString treeName("TreeD") ;
3131 treeName += EventNumber() ;
3133 TTree * tree = static_cast<TTree *>(file->Get(treeName.Data())) ;
3135 if (!tree && fDebug)
3137 cout << "WARNING: AliEMCALGetter::TreeD -> " << treeName.Data() << " not found in " << filename.Data() << endl ;
3147 //____________________________________________________________________________
3149 const TParticle * AliEMCALGetter::Primary(Int_t index) const
3153 // Return primary particle numbered by <index>
3165 p = fAlice->Particle(index) ;
3169 p = gAlice->Particle(index) ;
3181 //____________________________________________________________________________
3183 const TParticle * AliEMCALGetter::Secondary(TParticle* p, Int_t index) const
3187 // Return first (index=1) or second (index=2) secondary particle of primary particle p
3203 Int_t daughterIndex = p->GetDaughter(index-1) ;
3205 return gAlice->Particle(daughterIndex) ;
3217 //____________________________________________________________________________
3219 Int_t AliEMCALGetter::ReadTreeD(const Int_t event)
3223 // Read the digit tree gAlice->TreeD()
3231 TFile * file = static_cast<TFile*>(gROOT->GetFile(fDigitsFileName));
3235 file = TFile::Open(fDigitsFileName) ;
3237 // Get Digits Tree header from file
3239 TString treeName("TreeD") ;
3243 treeD = dynamic_cast<TTree*>(file->Get(treeName.Data()));
3245 if(!treeD){ // TreeD not found in header file
3249 cout << "WARNING: AliEMCALGetter::ReadTreeD -> Cannot find TreeD in " << fDigitsFileName.Data() << endl;
3259 treeD = gAlice->TreeD() ;
3263 TObjArray * lob = static_cast<TObjArray*>(treeD->GetListOfBranches()) ;
3267 TBranch * branch = 0 ;
3269 TBranch * digitsbranch = 0 ;
3271 TBranch * digitizerbranch = 0 ;
3273 Bool_t emcalfound = kFALSE, digitizerfound = kFALSE ;
3277 while ( (branch = static_cast<TBranch*>(next())) && (!emcalfound || !digitizerfound) ) {
3279 if ( (strcmp(branch->GetName(), "EMCAL")==0) && (strcmp(branch->GetTitle(), fDigitsTitle)==0) ) {
3281 digitsbranch = branch ;
3283 emcalfound = kTRUE ;
3287 else if ( (strcmp(branch->GetName(), "AliEMCALDigitizer")==0) && (strcmp(branch->GetTitle(), fDigitsTitle)==0) ) {
3289 digitizerbranch = branch ;
3291 digitizerfound = kTRUE ;
3299 if ( !emcalfound || !digitizerfound ) {
3303 cout << "WARNING: AliEMCALGetter::ReadTreeD -> Cannot find Digits and/or Digitizer with name "
3305 << fDigitsTitle << endl ;
3315 if(!Digits(fDigitsTitle) )
3317 PostDigits(fDigitsTitle);
3319 digitsbranch->SetAddress(DigitsRef(fDigitsTitle)) ;
3321 digitsbranch->GetEntry(0) ;
3327 // read the Digitizer
3329 RemoveTask("D", fDigitsTitle) ; // I do not understand why I need that
3331 if(!Digitizer(fDigitsTitle))
3333 PostDigitizer(fDigitsTitle) ;
3335 digitizerbranch->SetAddress(DigitizerRef(fDigitsTitle)) ;
3337 digitizerbranch->GetEntry(0) ;
3343 if(gAlice->TreeD()!=treeD)
3353 //____________________________________________________________________________
3355 Int_t AliEMCALGetter::ReadTreeH()
3359 // Read the first entry of EMCAL branch in hit tree gAlice->TreeH()
3363 TTree * treeH = gAlice->TreeH() ;
3367 if(!treeH) {// TreeH not found in header file
3373 cout << "WARNING: AliEMCALGetter::ReadTreeH -> Cannot find TreeH in " << fHeaderFile << endl ;
3377 TString searchFileName("EMCAL.HITS") ;
3379 if((strcmp(fBranchTitle.Data(),"Default")!=0)&&(strcmp(fBranchTitle.Data(),"")!=0)){
3381 searchFileName+="." ;
3383 searchFileName += fBranchTitle ;
3387 searchFileName+=".root" ;
3391 if ( (treeH = TreeH(searchFileName)) ) { //found TreeH in the file which contains the hits
3395 cout << "INFO: AliEMCALGetter::ReadTreeH -> TreeH found in " << searchFileName.Data() << endl ;
3401 cerr << "ERROR: AliEMCALGetter::ReadTreeH -> TreeH not found " << endl ;
3411 TBranch * hitsbranch = static_cast<TBranch*>(gAlice->TreeH()->GetBranch("EMCAL")) ;
3413 if ( !hitsbranch ) {
3417 cout << "WARNING: AliEMCALGetter::ReadTreeH -> Cannot find branch EMCAL" << endl ;
3429 if (hitsbranch->GetEntries() > 1 ) {
3431 (dynamic_cast<TClonesArray*> (*HitsRef()))->Clear() ;
3433 TClonesArray * tempo = new TClonesArray("AliEMCALHit",1000) ;
3435 TClonesArray * hits = dynamic_cast<TClonesArray*>(*HitsRef()) ;
3437 hitsbranch->SetAddress(&tempo) ;
3443 for (i = 0 ; i < hitsbranch->GetEntries() ; i++) {
3445 hitsbranch->GetEntry(i) ;
3449 for ( j = 0 ; j < tempo->GetEntries() ; j++) {
3451 const AliEMCALHit * hit = static_cast<const AliEMCALHit *>(tempo->At(j)) ;
3453 new((*hits)[index]) AliEMCALHit( *hit ) ;
3467 (dynamic_cast<TClonesArray*> (*HitsRef()))->Clear() ;
3469 hitsbranch->SetAddress(HitsRef()) ;
3471 hitsbranch->GetEntry(0) ;
3481 //____________________________________________________________________________
3483 void AliEMCALGetter::Track(const Int_t itrack)
3487 // Read the first entry of EMCAL branch in hit tree gAlice->TreeH()
3491 if(gAlice->TreeH()== 0){
3493 cerr << "ERROR: AliEMCALGetter::ReadTreeH: -> Cannot read TreeH " << endl ;
3501 TBranch * hitsbranch = dynamic_cast<TBranch*>(gAlice->TreeH()->GetListOfBranches()->FindObject("EMCAL")) ;
3503 if ( !hitsbranch ) {
3507 cout << "WARNING: AliEMCALGetter::ReadTreeH -> Cannot find branch EMCAL" << endl ;
3519 (dynamic_cast<TClonesArray*> (*HitsRef()))->Clear() ;
3521 hitsbranch->SetAddress(HitsRef()) ;
3523 hitsbranch->GetEntry(itrack) ;
3531 //____________________________________________________________________________
3533 void AliEMCALGetter::ReadTreeQA()
3539 cout << "WARNING : " << ClassName() << "::ReadTreeQA -> not implemented" << endl ;
3541 // Read the digit tree gAlice->TreeQA()
3543 // so far only EMCAL knows about this Tree
3547 // if(EMCAL()->TreeQA()== 0){
3549 // cerr << "ERROR: AliEMCALGetter::ReadTreeQA: can not read TreeQA " << endl ;
3557 // TBranch * qabranch = EMCAL()->TreeQA()->GetBranch("EMCAL") ;
3563 // cout << "WARNING: AliEMCALGetter::ReadTreeQA -> Cannot find QA Alarms for EMCAL" << endl ;
3577 // qabranch->SetAddress(AlarmsRef()) ;
3581 // qabranch->GetEntry(0) ;
3585 // PostQA("EMCAL") ;
3587 // TFolder * alarmsF = Alarms() ;
3589 // alarmsF->Clear() ;
3591 // qabranch->SetAddress(&alarmsF) ;
3593 // qabranch->GetEntry(0) ;
3601 //____________________________________________________________________________
3603 Int_t AliEMCALGetter::ReadTreeR(const Int_t event)
3607 // Read the reconstrunction tree gAlice->TreeR()
3609 // A particularity has been introduced here :
3611 // if gime->Event(ievent,"R") is called branches with the current title are read, the current title
3613 // being for example give in AliPHOSPID(fileName, title)
3615 // if gime(Event(ievent, "RA") is called the title of the branches is not checked anymore, "A" stands for any
3617 // This is a feature needed by PID to be able to reconstruct several times particles (each time a ther title is given)
3619 // from a given set of TrackSegments (with a given name)
3621 // This is why any is NOT used to read the branch of RecParticles
3623 // any migh have become obsolete : to be checked
3625 // See AliEMCALPIDv1
3633 TFile * file = static_cast<TFile*>(gROOT->GetFile(fRecPointsFileName));
3637 file = TFile::Open(fRecPointsFileName) ;
3639 // Get Digits Tree header from file
3641 TString treeName("TreeR") ;
3645 treeR = dynamic_cast<TTree*>(file->Get(treeName.Data()));
3647 if(!treeR){ // TreeR not found in header file
3651 cout << "WARNING: AliEMCALGetter::ReadTreeD -> Cannot find TreeR in " << fRecPointsFileName.Data() << endl;
3661 treeR = gAlice->TreeR() ;
3667 TObjArray * lob = static_cast<TObjArray*>(treeR->GetListOfBranches()) ;
3671 TBranch * branch = 0 ;
3673 TBranch * towerbranch = 0 ;
3675 TBranch * preshowerbranch = 0 ;
3677 TBranch * clusterizerbranch = 0 ;
3679 Bool_t emcalTowerRPfound = kFALSE, emcalPreShoRPfound = kFALSE, clusterizerfound = kFALSE ;
3685 while ( (branch = static_cast<TBranch*>(next())) && (!emcalTowerRPfound || !emcalPreShoRPfound || !clusterizerfound) ) {
3687 if(strcmp(branch->GetTitle(), fRecPointsTitle)==0 ) {
3689 if ( strcmp(branch->GetName(), "EMCALTowerRP")==0) {
3691 towerbranch = branch ;
3693 emcalTowerRPfound = kTRUE ;
3697 else if ( strcmp(branch->GetName(), "EMCALPreShoRP")==0) {
3699 preshowerbranch = branch ;
3701 emcalPreShoRPfound = kTRUE ;
3705 else if(strcmp(branch->GetName(), "AliEMCALClusterizer")==0){
3707 clusterizerbranch = branch ;
3709 clusterizerfound = kTRUE ;
3719 if ( !emcalTowerRPfound || !emcalPreShoRPfound || !clusterizerfound) {
3723 cout << "WARNING: AliEMCALGetter::ReadTreeR -> Cannot find RecPoints and/or Clusterizer with name "
3725 << fRecPointsTitle << endl ;
3731 if(!TowerRecPoints(fRecPointsTitle) )
3733 PostRecPoints(fRecPointsTitle) ;
3737 towerbranch->SetAddress(TowerRecPointsRef(fRecPointsTitle)) ;
3739 towerbranch->GetEntry(0) ;
3743 preshowerbranch->SetAddress(PreShowerRecPointsRef(fRecPointsTitle)) ;
3745 preshowerbranch->GetEntry(0) ;
3749 if(!Clusterizer(fRecPointsTitle) )
3751 PostClusterizer(fRecPointsTitle) ;
3755 clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
3757 clusterizerbranch->GetEntry(0) ;
3763 // //------------------- TrackSegments ---------------------
3767 // TBranch * tsbranch = 0 ;
3769 // TBranch * tsmakerbranch = 0 ;
3771 // Bool_t emcaltsfound = kFALSE, tsmakerfound = kFALSE ;
3773 // while ( (branch = static_cast<TBranch*>(next())) && (!emcaltsfound || !tsmakerfound) ) {
3775 // if(strcmp(branch->GetTitle(), fTrackSegmentsTitle)==0 ) {
3777 // if ( strcmp(branch->GetName(), "EMCALTS")==0){
3779 // tsbranch = branch ;
3781 // emcaltsfound = kTRUE ;
3785 // else if(strcmp(branch->GetName(), "AliEMCALTrackSegmentMaker")==0) {
3787 // tsmakerbranch = branch ;
3789 // tsmakerfound = kTRUE ;
3799 // if ( !emcaltsfound || !tsmakerfound ) {
3803 // cout << "WARNING: AliEMCALGetter::ReadTreeR -> Cannot find TrackSegments and/or TrackSegmentMaker with name "
3805 // << fTrackSegmentsTitle << endl ;
3809 // // Read and Post the TrackSegments
3811 // if(!TrackSegments(fTrackSegmentsTitle))
3813 // PostTrackSegments(fTrackSegmentsTitle) ;
3815 // tsbranch->SetAddress(TrackSegmentsRef(fTrackSegmentsTitle)) ;
3817 // tsbranch->GetEntry(0) ;
3821 // // Read and Post the TrackSegment Maker
3823 // if(!TrackSegmentMaker(fTrackSegmentsTitle))
3825 // PostTrackSegmentMaker(fTrackSegmentsTitle) ;
3827 // tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
3829 // tsmakerbranch->GetEntry(0) ;
3837 // //------------ RecParticles ----------------------------
3841 // TBranch * rpabranch = 0 ;
3843 // TBranch * pidbranch = 0 ;
3845 // Bool_t emcalrpafound = kFALSE, pidfound = kFALSE ;
3849 // while ( (branch = static_cast<TBranch*>(next())) && (!emcalrpafound || !pidfound) )
3851 // if(strcmp(branch->GetTitle(), fRecParticlesTitle)==0) {
3853 // if ( strcmp(branch->GetName(), "EMCALRP")==0) {
3855 // rpabranch = branch ;
3857 // emcalrpafound = kTRUE ;
3861 // else if (strcmp(branch->GetName(), "AliEMCALPID")==0) {
3863 // pidbranch = branch ;
3865 // pidfound = kTRUE ;
3873 // if ( !emcalrpafound || !pidfound ) {
3877 // cout << "WARNING: AliEMCALGetter::ReadTreeR -> Cannot find RecParticles and/or PID with name "
3879 // << fRecParticlesTitle << endl ;
3883 // // Read and Post the RecParticles
3885 // if(!RecParticles(fRecParticlesTitle))
3887 // PostRecParticles(fRecParticlesTitle) ;
3889 // rpabranch->SetAddress(RecParticlesRef(fRecParticlesTitle)) ;
3891 // rpabranch->GetEntry(0) ;
3893 // // Read and Post the PID
3895 // if(!PID(fRecParticlesTitle))
3897 // PostPID(fRecParticlesTitle) ;
3899 // pidbranch->SetAddress(PIDRef(fRecParticlesTitle)) ;
3901 // pidbranch->GetEntry(0) ;
3907 if(gAlice->TreeR()!=treeR)
3917 //____________________________________________________________________________
3919 Int_t AliEMCALGetter::ReadTreeS(Int_t event)
3923 // Reads the SDigits treeS from all files
3925 // Files, which should be opened are listed in emcalF
3927 // So, first get list of files
3929 TFolder * emcalF = dynamic_cast<TFolder *>(fSDigitsFolder->FindObject("EMCAL")) ;
3933 emcalF = fSDigitsFolder->AddFolder("EMCAL", "SDigits from EMCAL") ;
3935 TCollection * folderslist = emcalF->GetListOfFolders() ;
3939 // Now iterate over the list of files and read TreeS into Whiteboard
3941 TIter next(folderslist) ;
3943 TFolder * folder = 0 ;
3949 while ( (folder = static_cast<TFolder*>(next())) ) {
3951 TString fileName("") ;
3955 fileName = folder->GetTitle() ;
3959 fileName = folder->GetName() ;
3961 fileName.ReplaceAll("_","/") ;
3963 file = static_cast<TFile*>(gROOT->GetFile(fileName));
3967 file = TFile::Open(fileName) ;
3969 // Get SDigits Tree header from file
3971 TString treeName("TreeS") ;
3975 treeS = dynamic_cast<TTree*>(file->Get(treeName.Data()));
3979 if(!treeS){ // TreeS not found in header file