1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 /* History of cvs commits:
21 * Revision 1.18 2006/08/28 10:01:56 kharlov
22 * Effective C++ warnings fixed (Timur Pocheptsov)
24 * Revision 1.17 2006/08/25 16:00:53 kharlov
25 * Compliance with Effective C++AliPHOSHit.cxx
27 * Revision 1.16 2006/08/01 12:15:04 cvetan
28 * Adding a constructor from TFolder. Needed by AliReconstruction plugin scheme
30 * Revision 1.15 2005/07/12 20:07:35 hristov
31 * Changes needed to run simulation and reconstrruction in the same AliRoot session
33 * Revision 1.14 2005/05/28 14:19:04 schutz
34 * Compilation warnings fixed by T.P.
38 //_________________________________________________________________________
39 // A singleton. This class should be used in the analysis stage to get
40 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
41 // instead of directly reading them from galice.root file. This container
42 // ensures, that one reads Digits, made of these particular digits, RecPoints,
43 // made of these particular RecPoints, TrackSegments and RecParticles.
44 // This becomes non trivial if there are several identical branches, produced with
45 // different set of parameters.
47 // An example of how to use (see also class AliPHOSAnalyser):
48 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
49 // AliPHOSRecParticle * part = gime->RecParticle(1) ;
51 // please->GetEvent(event) ; // reads new event from galice.root
53 //-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
54 //-- Completely redesigned by Dmitri Peressounko March 2001
56 //-- YS June 2001 : renamed the original AliPHOSIndexToObject and make
57 //-- systematic usage of TFolders without changing the interface
58 //////////////////////////////////////////////////////////////////////////////
61 // --- ROOT system ---
67 // --- Standard library ---
69 // --- AliRoot header files ---
70 #include "AliObjectLoader.h"
72 #include "AliPHOSLoader.h"
74 #include "AliPHOSHit.h"
75 #include "AliPHOSCalibrationDB.h"
76 #include "AliPHOSGetter.h"
78 ClassImp(AliPHOSLoader)
81 const TString AliPHOSLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
82 const TString AliPHOSLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
83 const TString AliPHOSLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
84 const TString AliPHOSLoader::fgkEmcRecPointsName("EMCRECPOINTS");//Name for TClonesArray
85 const TString AliPHOSLoader::fgkCpvRecPointsName("CPVRECPOINTS");//Name for TClonesArray
86 const TString AliPHOSLoader::fgkTracksName("TRACKS");//Name for TClonesArray
87 const TString AliPHOSLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
89 const TString AliPHOSLoader::fgkEmcRecPointsBranchName("PHOSEmcRP");//Name for branch with EMC Reconstructed Points
90 const TString AliPHOSLoader::fgkCpvRecPointsBranchName("PHOSCpvRP");//Name for branch with CPV Reconstructed Points
91 const TString AliPHOSLoader::fgkTrackSegmentsBranchName("PHOSTS");//Name for branch with TrackSegments
92 const TString AliPHOSLoader::fgkRecParticlesBranchName("PHOSRP");//Name for branch with Reconstructed Particles
93 //____________________________________________________________________________
94 AliPHOSLoader::AliPHOSLoader() : fBranchTitle(), fcdb(0), fDebug(0)
98 //____________________________________________________________________________
99 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,const Char_t *eventfoldername) :
100 AliLoader(detname, eventfoldername),
101 fBranchTitle(), fcdb(0), fDebug(0)
105 //____________________________________________________________________________
106 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,TFolder *topfolder):
107 AliLoader(detname,topfolder),
108 fBranchTitle(), fcdb(0), fDebug(0)
113 //____________________________________________________________________________
114 AliPHOSLoader::AliPHOSLoader(const AliPHOSLoader & obj):
115 AliLoader(obj),fBranchTitle(obj.GetBranchTitle()),fcdb(obj.CalibrationDB()),
116 fDebug(obj.GetDebug())
120 //____________________________________________________________________________
122 AliPHOSLoader::~AliPHOSLoader()
124 //remove and delete arrays
126 Clean(fgkSDigitsName);
127 Clean(fgkDigitsName);
128 Clean(fgkEmcRecPointsName);
129 Clean(fgkCpvRecPointsName);
130 Clean(fgkTracksName);
131 Clean(fgkRecParticlesName);
133 // // set to 0x0 the objgetter in AliGetter ... weird isn it !
134 // AliPHOSGetter * gime = AliPHOSGetter::Instance() ; // (AliLoader::GetRunLoader()->GetFileName()).Data()) ;
139 //____________________________________________________________________________
140 void AliPHOSLoader::CleanFolders()
143 AliLoader::CleanFolders();
146 //____________________________________________________________________________
147 Int_t AliPHOSLoader::SetEvent()
149 //Cleans loaded stuff and and sets Files and Directories
150 // do not post any data to folder/tasks
153 Int_t retval = AliLoader::SetEvent();
156 AliError("returned error");
161 if (Hits()) Hits()->Clear();
162 if (SDigits()) SDigits()->Clear();
163 if (Digits()) Digits()->Clear();
164 if (EmcRecPoints()) EmcRecPoints()->Clear();
165 if (CpvRecPoints()) CpvRecPoints()->Clear();
166 if (TrackSegments()) TrackSegments()->Clear();
167 if (RecParticles()) RecParticles()->Clear();
172 //____________________________________________________________________________
173 Int_t AliPHOSLoader::GetEvent()
175 //Overloads GetEvent method called by AliRunLoader::GetEvent(Int_t) method
176 //to add Rec Particles specific for PHOS
178 //First call the original method to get whatever from std. setup is needed
181 retval = AliLoader::GetEvent();
184 AliError("returned error");
188 if (GetHitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadHits();
189 if (GetSDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadSDigits();
190 if (GetDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadDigits();
191 if (GetRecPointsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecPoints();
192 if (GetTracksDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadTracks();
193 if (GetRecParticlesDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecParticles();
196 //Now, check if RecPart were loaded
200 //____________________________________________________________________________
201 const AliPHOS * AliPHOSLoader::PHOS()
203 // returns the PHOS object
204 AliPHOS * phos = dynamic_cast<AliPHOS*>(GetModulesFolder()->FindObject(fDetectorName));
207 cout << "WARNING: AliPHOSLoader::PHOS -> PHOS module not found in Folders" << endl ;
211 //____________________________________________________________________________
212 Int_t AliPHOSLoader::LoadHits(Option_t* opt)
214 //------- Hits ----------------------
215 //Overload (extends) LoadHits implemented in AliLoader
219 //First call the AliLoader's method to send the TreeH to folder
220 res = AliLoader::LoadHits(opt);
224 AliError("returned error");
228 //read the data from tree in folder and send it to folder
234 //____________________________________________________________________________
235 Int_t AliPHOSLoader::LoadSDigits(Option_t* opt)
237 //---------- SDigits -------------------------
239 //First call the AliLoader's method to send the TreeS to folder
240 res = AliLoader::LoadSDigits(opt);
243 AliError("returned error");
246 return ReadSDigits();
249 //____________________________________________________________________________
250 Int_t AliPHOSLoader::LoadDigits(Option_t* opt)
252 //---------- Digits -------------------------
254 //First call the AliLoader's method to send the TreeS to folder
255 res = AliLoader::LoadDigits(opt);
258 AliError("returned error");
263 //____________________________________________________________________________
264 Int_t AliPHOSLoader::LoadRecPoints(Option_t* opt)
266 // -------------- RecPoints -------------------------------------------
268 //First call the AliLoader's method to send the TreeR to folder
269 res = AliLoader::LoadRecPoints(opt);
272 AliError("returned error");
276 TFolder * phosFolder = GetDetectorDataFolder();
277 if ( phosFolder == 0x0 )
279 AliError("Can not get detector data folder");
282 return ReadRecPoints();
284 //____________________________________________________________________________
286 Int_t AliPHOSLoader::LoadTracks(Option_t* opt)
288 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
289 AliDebug(1, Form("opt = %s",opt));
291 res = AliLoader::LoadTracks(opt);
294 AliError("returned error");
300 //____________________________________________________________________________
301 Int_t AliPHOSLoader::LoadRecParticles(Option_t* opt)
303 // -------------- RecPoints -------------------------------------------
305 //First call the AliLoader's method to send the TreeT to folder
306 res = AliLoader::LoadRecParticles(opt);
309 AliError("returned error");
312 return ReadRecParticles();
315 //____________________________________________________________________________
316 //PostHits etc. PostXXX must be const - not to hide virtual functions
317 //from base class AliLoader, but they call non-constant functions ReadXXX
318 //so I have to const_cast this pointer
319 Int_t AliPHOSLoader::PostHits()const
321 // -------------- Hits -------------------------------------------
322 Int_t reval = AliLoader::PostHits();
325 AliError("returned error");
329 return const_cast<AliPHOSLoader *>(this)->ReadHits();
331 //____________________________________________________________________________
333 Int_t AliPHOSLoader::PostSDigits()const
335 // -------------- SDigits -------------------------------------------
336 Int_t reval = AliLoader::PostSDigits();
339 AliError("returned error");
342 return const_cast<AliPHOSLoader *>(this)->ReadSDigits();
344 //____________________________________________________________________________
346 Int_t AliPHOSLoader::PostDigits()const
348 // -------------- Digits -------------------------------------------
349 Int_t reval = AliLoader::PostDigits();
352 AliError("returned error");
355 return const_cast<AliPHOSLoader *>(this)->ReadDigits();
357 //____________________________________________________________________________
359 Int_t AliPHOSLoader::PostRecPoints()const
361 // -------------- RecPoints -------------------------------------------
362 Int_t reval = AliLoader::PostRecPoints();
365 AliError("returned error");
368 return const_cast<AliPHOSLoader *>(this)->ReadRecPoints();
371 //____________________________________________________________________________
373 Int_t AliPHOSLoader::PostRecParticles()const
375 // -------------- RecParticles -------------------------------------------
376 Int_t reval = AliLoader::PostRecParticles();
379 AliError("returned error");
382 return const_cast<AliPHOSLoader *>(this)->ReadRecParticles();
384 //____________________________________________________________________________
386 Int_t AliPHOSLoader::PostTracks()const
388 // -------------- Tracks -------------------------------------------
389 Int_t reval = AliLoader::PostTracks();
392 AliError("returned error");
395 return const_cast<AliPHOSLoader *>(this)->ReadTracks();
397 //____________________________________________________________________________
401 //____________________________________________________________________________
402 Int_t AliPHOSLoader::ReadHits()
404 // If there is no Clones Array in folder creates it and sends to folder
405 // then tries to read
406 // Reads the first entry of PHOS branch in hit tree TreeH()
407 // Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
409 TObject** hitref = HitsRef();
416 TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
418 TTree* treeh = TreeH();
422 AliError("Cannot read TreeH from folder");
426 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
429 AliError("Cannot find branch PHOS");
433 AliDebug(1, "Reading Hits");
435 if (hitsbranch->GetEntries() > 1)
437 TClonesArray * tempo = new TClonesArray("AliPHOSHit",1000);
439 hitsbranch->SetAddress(&tempo);
442 for (i = 0 ; i < hitsbranch->GetEntries(); i++)
444 hitsbranch->GetEntry(i) ;
446 for ( j = 0 ; j < tempo->GetEntries() ; j++)
448 AliPHOSHit* hit = (AliPHOSHit*)tempo->At(j);
449 new((*hits)[index]) AliPHOSHit( *hit ) ;
458 hitsbranch->SetAddress(hitref);
459 hitsbranch->GetEntry(0) ;
464 //____________________________________________________________________________
465 Int_t AliPHOSLoader::ReadSDigits()
467 // Read the summable digits tree TreeS():
468 // Check if TClones is in folder
469 // if not create and add to folder
470 // connect to tree if available
473 TObject** sdref = SDigitsRef();
477 sdref = SDigitsRef();
480 TTree * treeS = TreeS();
483 //May happen if file is truncated or new in LoadSDigits
484 //AliError("There is no SDigit Tree");
488 TBranch * branch = treeS->GetBranch(fDetectorName);
490 {//easy, maybe just a new tree
491 //AliError("Cannot find branch PHOS");
495 branch->SetAddress(SDigitsRef());
500 //____________________________________________________________________________
501 Int_t AliPHOSLoader::ReadDigits()
503 // Read the summable digits tree TreeS():
504 // Check if TClones is in folder
505 // if not create and add to folder
506 // connect to tree if available
509 TObject** dref = DigitsRef();
511 {//if there is not array in folder, create it and put it there
516 TTree * treeD = TreeD();
519 //May happen if file is truncated or new in LoadSDigits
520 //AliError("There is no Digit Tree");
524 TBranch * branch = treeD->GetBranch(fDetectorName);
526 {//easy, maybe just a new tree
527 //AliError("Cannot find branch ",fDetectorName.Data());
531 branch->SetAddress(dref);//connect branch to buffer sitting in folder
532 branch->GetEntry(0);//get first event
537 //____________________________________________________________________________
539 void AliPHOSLoader::Track(Int_t itrack)
541 // Read the first entry of PHOS branch in hit tree gAlice->TreeH()
546 AliError("Can not load hits.");
551 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("PHOS")) ;
554 cout << "WARNING: AliPHOSLoader::ReadTreeH -> Cannot find branch PHOS" << endl ;
557 if(!Hits()) PostHits();
559 hitsbranch->SetAddress(HitsRef());
560 hitsbranch->GetEntry(itrack);
564 //____________________________________________________________________________
565 Int_t AliPHOSLoader::ReadRecPoints()
567 //Creates and posts to folder an array container,
568 //connects branch in tree (if exists), and reads data to array
570 MakeRecPointsArray();
572 TObjArray * cpva = 0x0 ;
573 TObjArray * emca = 0x0 ;
575 TTree * treeR = TreeR();
579 //May happen if file is truncated or new in LoadSDigits
584 TBranch * emcbranch = treeR->GetBranch(fgkEmcRecPointsBranchName);
586 if (emcbranch == 0x0)
588 AliError(Form("Can not get branch with EMC Rec. Points named %s",
589 fgkEmcRecPointsBranchName.Data()));
594 emcbranch->SetAddress(&emca) ;
595 emcbranch->GetEntry(0) ;
597 TBranch * cpvbranch = treeR->GetBranch(fgkCpvRecPointsBranchName);
598 if (cpvbranch == 0x0)
600 AliError(Form("Can not get branch with CPV Rec. Points named %s",
601 fgkCpvRecPointsBranchName.Data()));
606 cpvbranch->SetAddress(&cpva);
607 cpvbranch->GetEntry(0) ;
611 Int_t maxemc = emca->GetEntries() ;
612 for ( ii= 0 ; ii < maxemc ; ii++ )
613 EmcRecPoints()->Add(emca->At(ii)) ;
615 Int_t maxcpv = cpva->GetEntries() ;
616 for ( ii= 0 ; ii < maxcpv ; ii++ )
617 CpvRecPoints()->Add(cpva->At(ii)) ;
622 //____________________________________________________________________________
623 Int_t AliPHOSLoader::ReadTracks()
625 //Creates and posts to folder an array container,
626 //connects branch in tree (if exists), and reads data to arry
628 TObject** trkref = TracksRef();
630 {//Create and post array
631 MakeTrackSegmentsArray();
632 trkref = TracksRef();
635 TTree * treeT = TreeT();
638 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
639 //but tracking was not performed yet for a current event
640 //AliError("There is no Tree with Tracks");
644 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
645 // AliInfo(Form("Branch named %s is opened: 0x%z",
646 // fgkTrackSegmentsBranchName.Data(),branch));
648 {//easy, maybe just a new tree
649 AliError(Form("Cannot find branch named %s",
650 fgkTrackSegmentsBranchName.Data()));
654 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
655 branch->GetEntry(0);//get first event
659 //____________________________________________________________________________
661 Int_t AliPHOSLoader::ReadRecParticles()
663 //Reads Reconstructed Particles from file
664 //Creates and posts to folder an array container,
665 //connects branch in tree (if exists), and reads data to arry
667 TObject** recpartref = RecParticlesRef();
669 if ( recpartref == 0x0 )
670 {//Create and post array
671 MakeRecParticlesArray();
672 recpartref = RecParticlesRef();
675 TTree * treeP = TreeP();
678 //May happen if file is truncated or new in LoadSDigits,
679 //or the file is in update mode,
680 //but tracking was not performed yet for a current event
681 // AliError("There is no Tree with Tracks and Reconstructed Particles");
685 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
687 {//easy, maybe just a new tree
688 AliError(Form("Cannot find branch %s",
689 fgkRecParticlesBranchName.Data()));
693 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
694 branch->GetEntry(0);//get first event
700 /***************************************************************************************/
702 AliPHOSLoader* AliPHOSLoader::GetPHOSLoader(const char* eventfoldername)
704 // Return PHOS loader
705 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
707 printf("Can not find Run Loader in folder %s", eventfoldername);
710 return dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
712 /***************************************************************************************/
714 Bool_t AliPHOSLoader::BranchExists(const TString& recName)
716 // Check if a branch named redName exists
717 if (fBranchTitle.IsNull()) return kFALSE;
718 TString dataname, zername ;
720 if(recName == "SDigits")
723 dataname = GetDetectorName();
724 zername = "AliPHOSSDigitizer" ;
727 if(recName == "Digits"){
729 dataname = GetDetectorName();
730 zername = "AliPHOSDigitizer" ;
733 if(recName == "RecPoints"){
735 dataname = fgkEmcRecPointsBranchName;
736 zername = "AliPHOSClusterizer" ;
739 if(recName == "TrackSegments"){
741 dataname = fgkTrackSegmentsBranchName;
742 zername = "AliPHOSTrackSegmentMaker";
745 if(recName == "RecParticles"){
747 dataname = fgkRecParticlesBranchName;
748 zername = "AliPHOSPID";
757 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
759 TBranch * branch = 0 ;
760 TString titleName(fBranchTitle);
763 while ((branch = (static_cast<TBranch*>(next())))) {
764 TString branchName(branch->GetName() ) ;
765 TString branchTitle(branch->GetTitle() ) ;
766 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
767 AliWarning(Form("branch %s with title %s ",
768 dataname.Data(),fBranchTitle.Data()));
771 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
772 AliWarning(Form("branch AliPHOS... with title %s ",
773 branch->GetTitle()));
781 void AliPHOSLoader::SetBranchTitle(const TString& btitle)
784 if (btitle.CompareTo(fBranchTitle) == 0) return;
785 fBranchTitle = btitle;
789 //____________________________________________________________________________
790 //Again, must be const not to hide virtual functions from AliLoader
791 //but there are calls to non-const functions, so I have to const_cast this pointer
792 void AliPHOSLoader::CleanHits()const
795 AliLoader::CleanHits();
797 TClonesArray* hits = const_cast<AliPHOSLoader *>(this)->Hits();
798 if (hits) hits->Clear();
800 //____________________________________________________________________________
802 void AliPHOSLoader::CleanSDigits()const
804 // Clean SDigits array
805 AliLoader::CleanSDigits();
806 TClonesArray* sdigits = const_cast<AliPHOSLoader *>(this)->SDigits();
807 if (sdigits) sdigits->Clear();
810 //____________________________________________________________________________
812 void AliPHOSLoader::CleanDigits()const
814 // Clean Digits array
815 AliLoader::CleanDigits();
816 TClonesArray* digits = const_cast<AliPHOSLoader *>(this)->Digits();
817 if (digits) digits->Clear();
819 //____________________________________________________________________________
821 void AliPHOSLoader::CleanRecPoints()const
823 // Clean RecPoints array
824 AliLoader::CleanRecPoints();
825 TObjArray* recpoints = const_cast<AliPHOSLoader *>(this)->EmcRecPoints();
826 if (recpoints) recpoints->Clear();
827 recpoints = const_cast<AliPHOSLoader *>(this)->CpvRecPoints();
828 if (recpoints) recpoints->Clear();
830 //____________________________________________________________________________
832 void AliPHOSLoader::CleanTracks()const
834 //Cleans Tracks stuff
835 AliLoader::CleanTracks();//tree
837 //and clear the array
838 TClonesArray* tracks = const_cast<AliPHOSLoader *>(this)->TrackSegments();
839 if (tracks) tracks->Clear();
842 //____________________________________________________________________________
844 void AliPHOSLoader::CleanRecParticles()
846 // Clean RecParticles array
847 TClonesArray *recpar = RecParticles();
848 if (recpar) recpar->Clear();
852 //____________________________________________________________________________
854 void AliPHOSLoader::ReadCalibrationDB(const char * database,const char * filename)
856 // Read calibration data base from file
857 if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
860 TFile * file = gROOT->GetFile(filename) ;
862 file = TFile::Open(filename);
864 AliError(Form("Cannot open file %s", filename)) ;
869 fcdb = dynamic_cast<AliPHOSCalibrationDB *>(file->Get("AliPHOSCalibrationDB")) ;
871 AliError(Form("No database %s in file %s", database, filename)) ;
873 //____________________________________________________________________________
875 // AliPHOSSDigitizer* AliPHOSLoader::PHOSSDigitizer()
877 // //return PHOS SDigitizer
878 // return dynamic_cast<AliPHOSSDigitizer*>(SDigitizer()) ;
881 //____________________________________________________________________________
882 void AliPHOSLoader::MakeHitsArray()
884 // Add Hits array to the data folder
886 TClonesArray* hits = new TClonesArray("AliPHOSHit",1000);
887 hits->SetName(fgkHitsName);
888 GetDetectorDataFolder()->Add(hits);
891 //____________________________________________________________________________
892 void AliPHOSLoader::MakeSDigitsArray()
894 // Add SDigits array to the data folder
895 if ( SDigits()) return;
896 TClonesArray* sdigits = new TClonesArray("AliPHOSDigit",1);
897 sdigits->SetName(fgkSDigitsName);
898 GetDetectorDataFolder()->Add(sdigits);
901 //____________________________________________________________________________
902 void AliPHOSLoader::MakeDigitsArray()
904 // Add Digits array to the data folder
905 if ( Digits()) return;
906 TClonesArray* digits = new TClonesArray("AliPHOSDigit",1);
907 digits->SetName(fgkDigitsName);
908 GetDetectorDataFolder()->Add(digits);
912 //____________________________________________________________________________
913 void AliPHOSLoader::MakeRecPointsArray()
915 // Add RecPoints array to the data folder
916 if ( EmcRecPoints() == 0x0)
918 AliDebug(9, "Making array for EMC");
919 TObjArray* emc = new TObjArray(100) ;
920 emc->SetName(fgkEmcRecPointsName) ;
921 GetDetectorDataFolder()->Add(emc);
924 if ( CpvRecPoints() == 0x0)
926 AliDebug(9, "Making array for CPV");
927 TObjArray* cpv = new TObjArray(100) ;
928 cpv->SetName(fgkCpvRecPointsName);
929 GetDetectorDataFolder()->Add(cpv);
933 //____________________________________________________________________________
934 void AliPHOSLoader::MakeTrackSegmentsArray()
936 // Add TrackSegments array to the data folder
937 if ( TrackSegments()) return;
938 TClonesArray * ts = new TClonesArray("AliPHOSTrackSegment",100) ;
939 ts->SetName(fgkTracksName);
940 GetDetectorDataFolder()->Add(ts);
944 //____________________________________________________________________________
945 void AliPHOSLoader::MakeRecParticlesArray()
947 // Add RecParticles array to the data folder
948 if ( RecParticles()) return;
949 TClonesArray * rp = new TClonesArray("AliPHOSRecParticle",100) ;
950 rp->SetName(fgkRecParticlesName);
951 GetDetectorDataFolder()->Add(rp);