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"
77 ClassImp(AliPHOSLoader)
80 const TString AliPHOSLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
81 const TString AliPHOSLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
82 const TString AliPHOSLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
83 const TString AliPHOSLoader::fgkEmcRecPointsName("EMCRECPOINTS");//Name for TClonesArray
84 const TString AliPHOSLoader::fgkCpvRecPointsName("CPVRECPOINTS");//Name for TClonesArray
85 const TString AliPHOSLoader::fgkTracksName("TRACKS");//Name for TClonesArray
86 const TString AliPHOSLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
88 const TString AliPHOSLoader::fgkEmcRecPointsBranchName("PHOSEmcRP");//Name for branch with EMC Reconstructed Points
89 const TString AliPHOSLoader::fgkCpvRecPointsBranchName("PHOSCpvRP");//Name for branch with CPV Reconstructed Points
90 const TString AliPHOSLoader::fgkTrackSegmentsBranchName("PHOSTS");//Name for branch with TrackSegments
91 const TString AliPHOSLoader::fgkRecParticlesBranchName("PHOSRP");//Name for branch with Reconstructed Particles
92 //____________________________________________________________________________
93 AliPHOSLoader::AliPHOSLoader() : fBranchTitle(), fcdb(0), fDebug(0), fTmpHits(0x0)
96 fTmpHits = new TClonesArray("AliPHOSHit",1000);
98 //____________________________________________________________________________
99 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,const Char_t *eventfoldername) :
100 AliLoader(detname, eventfoldername),
101 fBranchTitle(), fcdb(0), fDebug(0), fTmpHits(0x0)
105 //____________________________________________________________________________
106 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,TFolder *topfolder):
107 AliLoader(detname,topfolder),
108 fBranchTitle(), fcdb(0), fDebug(0), fTmpHits(0x0)
112 fTmpHits = new TClonesArray("AliPHOSHit",1000);
114 //____________________________________________________________________________
115 AliPHOSLoader::AliPHOSLoader(const AliPHOSLoader & obj):
116 AliLoader(obj),fBranchTitle(obj.GetBranchTitle()),fcdb(obj.CalibrationDB()),
117 fDebug(obj.GetDebug()),fTmpHits(obj.fTmpHits)
121 //____________________________________________________________________________
123 AliPHOSLoader::~AliPHOSLoader()
125 //remove and delete arrays
127 Clean(fgkSDigitsName);
128 Clean(fgkDigitsName);
129 Clean(fgkEmcRecPointsName);
130 Clean(fgkCpvRecPointsName);
131 Clean(fgkTracksName);
132 Clean(fgkRecParticlesName);
136 //____________________________________________________________________________
137 void AliPHOSLoader::CleanFolders()
140 AliLoader::CleanFolders();
143 //____________________________________________________________________________
144 Int_t AliPHOSLoader::SetEvent()
146 //Cleans loaded stuff and and sets Files and Directories
147 // do not post any data to folder/tasks
150 Int_t retval = AliLoader::SetEvent();
153 AliError("returned error");
158 if (Hits()) Hits()->Clear();
159 if (SDigits()) SDigits()->Clear();
160 if (Digits()) Digits()->Clear();
161 if (EmcRecPoints()) EmcRecPoints()->Clear();
162 if (CpvRecPoints()) CpvRecPoints()->Clear();
163 if (TrackSegments()) TrackSegments()->Clear();
164 if (RecParticles()) RecParticles()->Clear();
169 //____________________________________________________________________________
170 Int_t AliPHOSLoader::GetEvent()
172 //Overloads GetEvent method called by AliRunLoader::GetEvent(Int_t) method
173 //to add Rec Particles specific for PHOS
175 //First call the original method to get whatever from std. setup is needed
178 retval = AliLoader::GetEvent();
181 AliError("returned error");
185 if (GetHitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadHits();
186 if (GetSDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadSDigits();
187 if (GetDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadDigits();
188 if (GetRecPointsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecPoints();
189 if (GetTracksDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadTracks();
190 if (GetRecParticlesDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecParticles();
193 //Now, check if RecPart were loaded
197 // //____________________________________________________________________________
198 // const AliPHOS * AliPHOSLoader::PHOS()
200 // // returns the PHOS object
201 // AliPHOS * phos = dynamic_cast<AliPHOS*>(GetModulesFolder()->FindObject(fDetectorName));
204 // cout << "WARNING: AliPHOSLoader::PHOS -> PHOS module not found in Folders" << endl ;
208 //____________________________________________________________________________
209 Int_t AliPHOSLoader::LoadHits(Option_t* opt)
211 //------- Hits ----------------------
212 //Overload (extends) LoadHits implemented in AliLoader
216 //First call the AliLoader's method to send the TreeH to folder
217 res = AliLoader::LoadHits(opt);
221 AliError("returned error");
225 //read the data from tree in folder and send it to folder
231 //____________________________________________________________________________
232 Int_t AliPHOSLoader::LoadSDigits(Option_t* opt)
234 //---------- SDigits -------------------------
236 //First call the AliLoader's method to send the TreeS to folder
237 res = AliLoader::LoadSDigits(opt);
240 AliError("returned error");
243 return ReadSDigits();
246 //____________________________________________________________________________
247 Int_t AliPHOSLoader::LoadDigits(Option_t* opt)
249 //---------- Digits -------------------------
251 //First call the AliLoader's method to send the TreeS to folder
252 res = AliLoader::LoadDigits(opt);
255 AliError("returned error");
260 //____________________________________________________________________________
261 Int_t AliPHOSLoader::LoadRecPoints(Option_t* opt)
263 // -------------- RecPoints -------------------------------------------
265 //First call the AliLoader's method to send the TreeR to folder
266 res = AliLoader::LoadRecPoints(opt);
269 AliError("returned error");
273 TFolder * phosFolder = GetDetectorDataFolder();
274 if ( phosFolder == 0x0 )
276 AliError("Can not get detector data folder");
279 return ReadRecPoints();
281 //____________________________________________________________________________
283 Int_t AliPHOSLoader::LoadTracks(Option_t* opt)
285 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
286 AliDebug(1, Form("opt = %s",opt));
288 res = AliLoader::LoadTracks(opt);
291 AliError("returned error");
297 //____________________________________________________________________________
298 Int_t AliPHOSLoader::LoadRecParticles(Option_t* opt)
300 // -------------- RecPoints -------------------------------------------
302 //First call the AliLoader's method to send the TreeT to folder
303 res = AliLoader::LoadRecParticles(opt);
306 AliError("returned error");
309 return ReadRecParticles();
312 //____________________________________________________________________________
313 //PostHits etc. PostXXX must be const - not to hide virtual functions
314 //from base class AliLoader, but they call non-constant functions ReadXXX
315 //so I have to const_cast this pointer
316 Int_t AliPHOSLoader::PostHits()const
318 // -------------- Hits -------------------------------------------
319 Int_t reval = AliLoader::PostHits();
322 AliError("returned error");
326 return const_cast<AliPHOSLoader *>(this)->ReadHits();
328 //____________________________________________________________________________
330 Int_t AliPHOSLoader::PostSDigits()const
332 // -------------- SDigits -------------------------------------------
333 Int_t reval = AliLoader::PostSDigits();
336 AliError("returned error");
339 return const_cast<AliPHOSLoader *>(this)->ReadSDigits();
341 //____________________________________________________________________________
343 Int_t AliPHOSLoader::PostDigits()const
345 // -------------- Digits -------------------------------------------
346 Int_t reval = AliLoader::PostDigits();
349 AliError("returned error");
352 return const_cast<AliPHOSLoader *>(this)->ReadDigits();
354 //____________________________________________________________________________
356 Int_t AliPHOSLoader::PostRecPoints()const
358 // -------------- RecPoints -------------------------------------------
359 Int_t reval = AliLoader::PostRecPoints();
362 AliError("returned error");
365 return const_cast<AliPHOSLoader *>(this)->ReadRecPoints();
368 //____________________________________________________________________________
370 Int_t AliPHOSLoader::PostRecParticles()const
372 // -------------- RecParticles -------------------------------------------
373 Int_t reval = AliLoader::PostRecParticles();
376 AliError("returned error");
379 return const_cast<AliPHOSLoader *>(this)->ReadRecParticles();
381 //____________________________________________________________________________
383 Int_t AliPHOSLoader::PostTracks()const
385 // -------------- Tracks -------------------------------------------
386 Int_t reval = AliLoader::PostTracks();
389 AliError("returned error");
392 return const_cast<AliPHOSLoader *>(this)->ReadTracks();
394 //____________________________________________________________________________
398 //____________________________________________________________________________
399 Int_t AliPHOSLoader::ReadHits()
401 // If there is no Clones Array in folder creates it and sends to folder
402 // then tries to read
403 // Reads the first entry of PHOS branch in hit tree TreeH()
404 // Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
406 TObject** hitref = HitsRef();
412 TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
414 TTree* treeh = TreeH();
417 AliError("Cannot read TreeH from folder");
421 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
422 if (hitsbranch == 0) {
423 AliError("Cannot find branch PHOS");
427 AliDebug(1, "Reading Hits");
429 if (hitsbranch->GetEntries() > 1) {
431 hitsbranch->SetAddress(&fTmpHits);
433 for (Int_t i = 0 ; i < hitsbranch->GetEntries(); i++) {
434 hitsbranch->GetEntry(i) ;
435 for (Int_t j = 0 ; j < fTmpHits->GetEntriesFast() ; j++) {
436 AliPHOSHit* hit = (AliPHOSHit*)fTmpHits->At(j);
437 new((*hits)[index]) AliPHOSHit( *hit ) ;
444 hitsbranch->SetAddress(hitref);
445 hitsbranch->GetEntry(0) ;
450 //____________________________________________________________________________
451 Int_t AliPHOSLoader::ReadSDigits()
453 // Read the summable digits tree TreeS():
454 // Check if TClones is in folder
455 // if not create and add to folder
456 // connect to tree if available
459 TObject** sdref = SDigitsRef();
463 sdref = SDigitsRef();
466 TTree * treeS = TreeS();
469 //May happen if file is truncated or new in LoadSDigits
470 //AliError("There is no SDigit Tree");
474 TBranch * branch = treeS->GetBranch(fDetectorName);
476 {//easy, maybe just a new tree
477 //AliError("Cannot find branch PHOS");
481 branch->SetAddress(SDigitsRef());
486 //____________________________________________________________________________
487 Int_t AliPHOSLoader::ReadDigits()
489 // Read the summable digits tree TreeS():
490 // Check if TClones is in folder
491 // if not create and add to folder
492 // connect to tree if available
495 TObject** dref = DigitsRef();
497 {//if there is not array in folder, create it and put it there
502 TTree * treeD = TreeD();
505 //May happen if file is truncated or new in LoadSDigits
506 //AliError("There is no Digit Tree");
510 TBranch * branch = treeD->GetBranch(fDetectorName);
512 {//easy, maybe just a new tree
513 //AliError("Cannot find branch ",fDetectorName.Data());
517 branch->SetAddress(dref);//connect branch to buffer sitting in folder
518 branch->GetEntry(0);//get first event
523 //____________________________________________________________________________
525 void AliPHOSLoader::Track(Int_t itrack)
527 // Read the first entry of PHOS branch in hit tree gAlice->TreeH()
532 AliError("Can not load hits.");
537 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("PHOS")) ;
540 cout << "WARNING: AliPHOSLoader::ReadTreeH -> Cannot find branch PHOS" << endl ;
543 if(!Hits()) PostHits();
545 hitsbranch->SetAddress(HitsRef());
546 hitsbranch->GetEntry(itrack);
550 //____________________________________________________________________________
551 Int_t AliPHOSLoader::ReadRecPoints()
553 //Creates and posts to folder an array container,
554 //connects branch in tree (if exists), and reads data to array
556 MakeRecPointsArray();
558 TObjArray * cpva = 0x0 ;
559 TObjArray * emca = 0x0 ;
561 TTree * treeR = TreeR();
565 //May happen if file is truncated or new in LoadSDigits
570 TBranch * emcbranch = treeR->GetBranch(fgkEmcRecPointsBranchName);
572 if (emcbranch == 0x0)
574 AliError(Form("Can not get branch with EMC Rec. Points named %s",
575 fgkEmcRecPointsBranchName.Data()));
580 emcbranch->SetAddress(&emca) ;
581 emcbranch->GetEntry(0) ;
583 TBranch * cpvbranch = treeR->GetBranch(fgkCpvRecPointsBranchName);
584 if (cpvbranch == 0x0)
586 AliError(Form("Can not get branch with CPV Rec. Points named %s",
587 fgkCpvRecPointsBranchName.Data()));
592 cpvbranch->SetAddress(&cpva);
593 cpvbranch->GetEntry(0) ;
597 Int_t maxemc = emca->GetEntries() ;
598 for ( ii= 0 ; ii < maxemc ; ii++ )
599 EmcRecPoints()->Add(emca->At(ii)) ;
601 Int_t maxcpv = cpva->GetEntries() ;
602 for ( ii= 0 ; ii < maxcpv ; ii++ )
603 CpvRecPoints()->Add(cpva->At(ii)) ;
608 //____________________________________________________________________________
609 Int_t AliPHOSLoader::ReadTracks()
611 //Creates and posts to folder an array container,
612 //connects branch in tree (if exists), and reads data to arry
614 TObject** trkref = TracksRef();
616 {//Create and post array
617 MakeTrackSegmentsArray();
618 trkref = TracksRef();
621 TTree * treeT = TreeT();
624 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
625 //but tracking was not performed yet for a current event
626 //AliError("There is no Tree with Tracks");
630 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
631 // AliInfo(Form("Branch named %s is opened: 0x%z",
632 // fgkTrackSegmentsBranchName.Data(),branch));
634 {//easy, maybe just a new tree
635 AliError(Form("Cannot find branch named %s",
636 fgkTrackSegmentsBranchName.Data()));
640 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
641 branch->GetEntry(0);//get first event
645 //____________________________________________________________________________
647 Int_t AliPHOSLoader::ReadRecParticles()
649 //Reads Reconstructed Particles from file
650 //Creates and posts to folder an array container,
651 //connects branch in tree (if exists), and reads data to arry
653 TObject** recpartref = RecParticlesRef();
655 if ( recpartref == 0x0 )
656 {//Create and post array
657 MakeRecParticlesArray();
658 recpartref = RecParticlesRef();
661 TTree * treeP = TreeP();
664 //May happen if file is truncated or new in LoadSDigits,
665 //or the file is in update mode,
666 //but tracking was not performed yet for a current event
667 // AliError("There is no Tree with Tracks and Reconstructed Particles");
671 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
673 {//easy, maybe just a new tree
674 AliError(Form("Cannot find branch %s",
675 fgkRecParticlesBranchName.Data()));
679 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
680 branch->GetEntry(0);//get first event
686 /***************************************************************************************/
688 AliPHOSLoader* AliPHOSLoader::GetPHOSLoader(const char* eventfoldername)
690 // Return PHOS loader
691 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
693 printf("Can not find Run Loader in folder %s", eventfoldername);
696 return dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
698 /***************************************************************************************/
700 Bool_t AliPHOSLoader::BranchExists(const TString& recName)
702 // Check if a branch named redName exists
703 if (fBranchTitle.IsNull()) return kFALSE;
704 TString dataname, zername ;
706 if(recName == "SDigits")
709 dataname = GetDetectorName();
710 zername = "AliPHOSSDigitizer" ;
713 if(recName == "Digits"){
715 dataname = GetDetectorName();
716 zername = "AliPHOSDigitizer" ;
719 if(recName == "RecPoints"){
721 dataname = fgkEmcRecPointsBranchName;
722 zername = "AliPHOSClusterizer" ;
725 if(recName == "TrackSegments"){
727 dataname = fgkTrackSegmentsBranchName;
728 zername = "AliPHOSTrackSegmentMaker";
731 if(recName == "RecParticles"){
733 dataname = fgkRecParticlesBranchName;
734 zername = "AliPHOSPID";
743 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
745 TBranch * branch = 0 ;
746 TString titleName(fBranchTitle);
749 while ((branch = (static_cast<TBranch*>(next())))) {
750 TString branchName(branch->GetName() ) ;
751 TString branchTitle(branch->GetTitle() ) ;
752 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
753 AliWarning(Form("branch %s with title %s ",
754 dataname.Data(),fBranchTitle.Data()));
757 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
758 AliWarning(Form("branch AliPHOS... with title %s ",
759 branch->GetTitle()));
767 void AliPHOSLoader::SetBranchTitle(const TString& btitle)
770 if (btitle.CompareTo(fBranchTitle) == 0) return;
771 fBranchTitle = btitle;
775 //____________________________________________________________________________
776 //Again, must be const not to hide virtual functions from AliLoader
777 //but there are calls to non-const functions, so I have to const_cast this pointer
778 void AliPHOSLoader::CleanHits()const
781 AliLoader::CleanHits();
783 TClonesArray* hits = const_cast<AliPHOSLoader *>(this)->Hits();
784 if (hits) hits->Clear();
786 //____________________________________________________________________________
788 void AliPHOSLoader::CleanSDigits()const
790 // Clean SDigits array
791 AliLoader::CleanSDigits();
792 TClonesArray* sdigits = const_cast<AliPHOSLoader *>(this)->SDigits();
793 if (sdigits) sdigits->Clear();
796 //____________________________________________________________________________
798 void AliPHOSLoader::CleanDigits()const
800 // Clean Digits array
801 AliLoader::CleanDigits();
802 TClonesArray* digits = const_cast<AliPHOSLoader *>(this)->Digits();
803 if (digits) digits->Clear();
805 //____________________________________________________________________________
807 void AliPHOSLoader::CleanRecPoints()const
809 // Clean RecPoints array
810 AliLoader::CleanRecPoints();
811 TObjArray* recpoints = const_cast<AliPHOSLoader *>(this)->EmcRecPoints();
812 if (recpoints) recpoints->Clear();
813 recpoints = const_cast<AliPHOSLoader *>(this)->CpvRecPoints();
814 if (recpoints) recpoints->Clear();
816 //____________________________________________________________________________
818 void AliPHOSLoader::CleanTracks()const
820 //Cleans Tracks stuff
821 AliLoader::CleanTracks();//tree
823 //and clear the array
824 TClonesArray* tracks = const_cast<AliPHOSLoader *>(this)->TrackSegments();
825 if (tracks) tracks->Clear();
828 //____________________________________________________________________________
830 void AliPHOSLoader::CleanRecParticles()
832 // Clean RecParticles array
833 TClonesArray *recpar = RecParticles();
834 if (recpar) recpar->Clear();
838 //____________________________________________________________________________
840 void AliPHOSLoader::ReadCalibrationDB(const char * database,const char * filename)
842 // Read calibration data base from file
843 if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
846 TFile * file = gROOT->GetFile(filename) ;
848 file = TFile::Open(filename);
850 AliError(Form("Cannot open file %s", filename)) ;
855 fcdb = dynamic_cast<AliPHOSCalibrationDB *>(file->Get("AliPHOSCalibrationDB")) ;
857 AliError(Form("No database %s in file %s", database, filename)) ;
859 //____________________________________________________________________________
861 // AliPHOSSDigitizer* AliPHOSLoader::PHOSSDigitizer()
863 // //return PHOS SDigitizer
864 // return dynamic_cast<AliPHOSSDigitizer*>(SDigitizer()) ;
867 //____________________________________________________________________________
868 void AliPHOSLoader::MakeHitsArray()
870 // Add Hits array to the data folder
872 TClonesArray* hits = new TClonesArray("AliPHOSHit",1000);
873 hits->SetName(fgkHitsName);
874 GetDetectorDataFolder()->Add(hits);
877 //____________________________________________________________________________
878 void AliPHOSLoader::MakeSDigitsArray()
880 // Add SDigits array to the data folder
881 if ( SDigits()) return;
882 TClonesArray* sdigits = new TClonesArray("AliPHOSDigit",1);
883 sdigits->SetName(fgkSDigitsName);
884 GetDetectorDataFolder()->Add(sdigits);
887 //____________________________________________________________________________
888 void AliPHOSLoader::MakeDigitsArray()
890 // Add Digits array to the data folder
891 if ( Digits()) return;
892 TClonesArray* digits = new TClonesArray("AliPHOSDigit",1);
893 digits->SetName(fgkDigitsName);
894 GetDetectorDataFolder()->Add(digits);
898 //____________________________________________________________________________
899 void AliPHOSLoader::MakeRecPointsArray()
901 // Add RecPoints array to the data folder
902 if ( EmcRecPoints() == 0x0)
904 AliDebug(9, "Making array for EMC");
905 TObjArray* emc = new TObjArray(100) ;
906 emc->SetName(fgkEmcRecPointsName) ;
907 GetDetectorDataFolder()->Add(emc);
910 if ( CpvRecPoints() == 0x0)
912 AliDebug(9, "Making array for CPV");
913 TObjArray* cpv = new TObjArray(100) ;
914 cpv->SetName(fgkCpvRecPointsName);
915 GetDetectorDataFolder()->Add(cpv);
919 //____________________________________________________________________________
920 void AliPHOSLoader::MakeTrackSegmentsArray()
922 // Add TrackSegments array to the data folder
923 if ( TrackSegments()) return;
924 TClonesArray * ts = new TClonesArray("AliPHOSTrackSegment",100) ;
925 ts->SetName(fgkTracksName);
926 GetDetectorDataFolder()->Add(ts);
930 //____________________________________________________________________________
931 void AliPHOSLoader::MakeRecParticlesArray()
933 // Add RecParticles array to the data folder
934 if ( RecParticles()) return;
935 TClonesArray * rp = new TClonesArray("AliPHOSRecParticle",100) ;
936 rp->SetName(fgkRecParticlesName);
937 GetDetectorDataFolder()->Add(rp);