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 const AliPHOSGeometry * AliPHOSLoader::PHOSGeometry()
214 // Return PHOS geometry
215 AliPHOSGeometry * rv = 0 ;
217 rv = PHOS()->GetGeometry();
222 //____________________________________________________________________________
223 Int_t AliPHOSLoader::LoadHits(Option_t* opt)
225 //------- Hits ----------------------
226 //Overload (extends) LoadHits implemented in AliLoader
230 //First call the AliLoader's method to send the TreeH to folder
231 res = AliLoader::LoadHits(opt);
235 AliError("returned error");
239 //read the data from tree in folder and send it to folder
245 //____________________________________________________________________________
246 Int_t AliPHOSLoader::LoadSDigits(Option_t* opt)
248 //---------- SDigits -------------------------
250 //First call the AliLoader's method to send the TreeS to folder
251 res = AliLoader::LoadSDigits(opt);
254 AliError("returned error");
257 return ReadSDigits();
260 //____________________________________________________________________________
261 Int_t AliPHOSLoader::LoadDigits(Option_t* opt)
263 //---------- Digits -------------------------
265 //First call the AliLoader's method to send the TreeS to folder
266 res = AliLoader::LoadDigits(opt);
269 AliError("returned error");
274 //____________________________________________________________________________
275 Int_t AliPHOSLoader::LoadRecPoints(Option_t* opt)
277 // -------------- RecPoints -------------------------------------------
279 //First call the AliLoader's method to send the TreeR to folder
280 res = AliLoader::LoadRecPoints(opt);
283 AliError("returned error");
287 TFolder * phosFolder = GetDetectorDataFolder();
288 if ( phosFolder == 0x0 )
290 AliError("Can not get detector data folder");
293 return ReadRecPoints();
295 //____________________________________________________________________________
297 Int_t AliPHOSLoader::LoadTracks(Option_t* opt)
299 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
300 AliDebug(1, Form("opt = %s",opt));
302 res = AliLoader::LoadTracks(opt);
305 AliError("returned error");
311 //____________________________________________________________________________
312 Int_t AliPHOSLoader::LoadRecParticles(Option_t* opt)
314 // -------------- RecPoints -------------------------------------------
316 //First call the AliLoader's method to send the TreeT to folder
317 res = AliLoader::LoadRecParticles(opt);
320 AliError("returned error");
323 return ReadRecParticles();
326 //____________________________________________________________________________
327 //PostHits etc. PostXXX must be const - not to hide virtual functions
328 //from base class AliLoader, but they call non-constant functions ReadXXX
329 //so I have to const_cast this pointer
330 Int_t AliPHOSLoader::PostHits()const
332 // -------------- Hits -------------------------------------------
333 Int_t reval = AliLoader::PostHits();
336 AliError("returned error");
340 return const_cast<AliPHOSLoader *>(this)->ReadHits();
342 //____________________________________________________________________________
344 Int_t AliPHOSLoader::PostSDigits()const
346 // -------------- SDigits -------------------------------------------
347 Int_t reval = AliLoader::PostSDigits();
350 AliError("returned error");
353 return const_cast<AliPHOSLoader *>(this)->ReadSDigits();
355 //____________________________________________________________________________
357 Int_t AliPHOSLoader::PostDigits()const
359 // -------------- Digits -------------------------------------------
360 Int_t reval = AliLoader::PostDigits();
363 AliError("returned error");
366 return const_cast<AliPHOSLoader *>(this)->ReadDigits();
368 //____________________________________________________________________________
370 Int_t AliPHOSLoader::PostRecPoints()const
372 // -------------- RecPoints -------------------------------------------
373 Int_t reval = AliLoader::PostRecPoints();
376 AliError("returned error");
379 return const_cast<AliPHOSLoader *>(this)->ReadRecPoints();
382 //____________________________________________________________________________
384 Int_t AliPHOSLoader::PostRecParticles()const
386 // -------------- RecParticles -------------------------------------------
387 Int_t reval = AliLoader::PostRecParticles();
390 AliError("returned error");
393 return const_cast<AliPHOSLoader *>(this)->ReadRecParticles();
395 //____________________________________________________________________________
397 Int_t AliPHOSLoader::PostTracks()const
399 // -------------- Tracks -------------------------------------------
400 Int_t reval = AliLoader::PostTracks();
403 AliError("returned error");
406 return const_cast<AliPHOSLoader *>(this)->ReadTracks();
408 //____________________________________________________________________________
412 //____________________________________________________________________________
413 Int_t AliPHOSLoader::ReadHits()
415 // If there is no Clones Array in folder creates it and sends to folder
416 // then tries to read
417 // Reads the first entry of PHOS branch in hit tree TreeH()
418 // Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
420 TObject** hitref = HitsRef();
427 TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
429 TTree* treeh = TreeH();
433 AliError("Cannot read TreeH from folder");
437 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
440 AliError("Cannot find branch PHOS");
444 AliDebug(1, "Reading Hits");
446 if (hitsbranch->GetEntries() > 1)
448 TClonesArray * tempo = new TClonesArray("AliPHOSHit",1000);
450 hitsbranch->SetAddress(&tempo);
453 for (i = 0 ; i < hitsbranch->GetEntries(); i++)
455 hitsbranch->GetEntry(i) ;
457 for ( j = 0 ; j < tempo->GetEntries() ; j++)
459 AliPHOSHit* hit = (AliPHOSHit*)tempo->At(j);
460 new((*hits)[index]) AliPHOSHit( *hit ) ;
469 hitsbranch->SetAddress(hitref);
470 hitsbranch->GetEntry(0) ;
475 //____________________________________________________________________________
476 Int_t AliPHOSLoader::ReadSDigits()
478 // Read the summable digits tree TreeS():
479 // Check if TClones is in folder
480 // if not create and add to folder
481 // connect to tree if available
484 TObject** sdref = SDigitsRef();
488 sdref = SDigitsRef();
491 TTree * treeS = TreeS();
494 //May happen if file is truncated or new in LoadSDigits
495 //AliError("There is no SDigit Tree");
499 TBranch * branch = treeS->GetBranch(fDetectorName);
501 {//easy, maybe just a new tree
502 //AliError("Cannot find branch PHOS");
506 branch->SetAddress(SDigitsRef());
511 //____________________________________________________________________________
512 Int_t AliPHOSLoader::ReadDigits()
514 // Read the summable digits tree TreeS():
515 // Check if TClones is in folder
516 // if not create and add to folder
517 // connect to tree if available
520 TObject** dref = DigitsRef();
522 {//if there is not array in folder, create it and put it there
527 TTree * treeD = TreeD();
530 //May happen if file is truncated or new in LoadSDigits
531 //AliError("There is no Digit Tree");
535 TBranch * branch = treeD->GetBranch(fDetectorName);
537 {//easy, maybe just a new tree
538 //AliError("Cannot find branch ",fDetectorName.Data());
542 branch->SetAddress(dref);//connect branch to buffer sitting in folder
543 branch->GetEntry(0);//get first event
548 //____________________________________________________________________________
550 void AliPHOSLoader::Track(Int_t itrack)
552 // Read the first entry of PHOS branch in hit tree gAlice->TreeH()
557 AliError("Can not load hits.");
562 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("PHOS")) ;
565 cout << "WARNING: AliPHOSLoader::ReadTreeH -> Cannot find branch PHOS" << endl ;
568 if(!Hits()) PostHits();
570 hitsbranch->SetAddress(HitsRef());
571 hitsbranch->GetEntry(itrack);
575 //____________________________________________________________________________
576 Int_t AliPHOSLoader::ReadRecPoints()
578 //Creates and posts to folder an array container,
579 //connects branch in tree (if exists), and reads data to array
581 MakeRecPointsArray();
583 TObjArray * cpva = 0x0 ;
584 TObjArray * emca = 0x0 ;
586 TTree * treeR = TreeR();
590 //May happen if file is truncated or new in LoadSDigits
595 TBranch * emcbranch = treeR->GetBranch(fgkEmcRecPointsBranchName);
597 if (emcbranch == 0x0)
599 AliError(Form("Can not get branch with EMC Rec. Points named %s",
600 fgkEmcRecPointsBranchName.Data()));
605 emcbranch->SetAddress(&emca) ;
606 emcbranch->GetEntry(0) ;
608 TBranch * cpvbranch = treeR->GetBranch(fgkCpvRecPointsBranchName);
609 if (cpvbranch == 0x0)
611 AliError(Form("Can not get branch with CPV Rec. Points named %s",
612 fgkCpvRecPointsBranchName.Data()));
617 cpvbranch->SetAddress(&cpva);
618 cpvbranch->GetEntry(0) ;
622 Int_t maxemc = emca->GetEntries() ;
623 for ( ii= 0 ; ii < maxemc ; ii++ )
624 EmcRecPoints()->Add(emca->At(ii)) ;
626 Int_t maxcpv = cpva->GetEntries() ;
627 for ( ii= 0 ; ii < maxcpv ; ii++ )
628 CpvRecPoints()->Add(cpva->At(ii)) ;
633 //____________________________________________________________________________
634 Int_t AliPHOSLoader::ReadTracks()
636 //Creates and posts to folder an array container,
637 //connects branch in tree (if exists), and reads data to arry
639 TObject** trkref = TracksRef();
641 {//Create and post array
642 MakeTrackSegmentsArray();
643 trkref = TracksRef();
646 TTree * treeT = TreeT();
649 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
650 //but tracking was not performed yet for a current event
651 //AliError("There is no Tree with Tracks");
655 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
656 // AliInfo(Form("Branch named %s is opened: 0x%z",
657 // fgkTrackSegmentsBranchName.Data(),branch));
659 {//easy, maybe just a new tree
660 AliError(Form("Cannot find branch named %s",
661 fgkTrackSegmentsBranchName.Data()));
665 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
666 branch->GetEntry(0);//get first event
670 //____________________________________________________________________________
672 Int_t AliPHOSLoader::ReadRecParticles()
674 //Reads Reconstructed Particles from file
675 //Creates and posts to folder an array container,
676 //connects branch in tree (if exists), and reads data to arry
678 TObject** recpartref = RecParticlesRef();
680 if ( recpartref == 0x0 )
681 {//Create and post array
682 MakeRecParticlesArray();
683 recpartref = RecParticlesRef();
686 TTree * treeP = TreeP();
689 //May happen if file is truncated or new in LoadSDigits,
690 //or the file is in update mode,
691 //but tracking was not performed yet for a current event
692 // AliError("There is no Tree with Tracks and Reconstructed Particles");
696 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
698 {//easy, maybe just a new tree
699 AliError(Form("Cannot find branch %s",
700 fgkRecParticlesBranchName.Data()));
704 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
705 branch->GetEntry(0);//get first event
711 AliPHOSGeometry* AliPHOSLoader::GetPHOSGeometry()
713 //returns PHOS geometry from gAlice
714 //static Method used by some classes where it is not convienient to pass eventfoldername
717 AliPHOS* phos=dynamic_cast<AliPHOS*>(gAlice->GetDetector("PHOS"));
720 return phos->GetGeometry();
722 /***************************************************************************************/
724 AliPHOSLoader* AliPHOSLoader::GetPHOSLoader(const char* eventfoldername)
726 // Return PHOS loader
727 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
729 printf("Can not find Run Loader in folder %s", eventfoldername);
732 return dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
734 /***************************************************************************************/
736 Bool_t AliPHOSLoader::BranchExists(const TString& recName)
738 // Check if a branch named redName exists
739 if (fBranchTitle.IsNull()) return kFALSE;
740 TString dataname, zername ;
742 if(recName == "SDigits")
745 dataname = GetDetectorName();
746 zername = "AliPHOSSDigitizer" ;
749 if(recName == "Digits"){
751 dataname = GetDetectorName();
752 zername = "AliPHOSDigitizer" ;
755 if(recName == "RecPoints"){
757 dataname = fgkEmcRecPointsBranchName;
758 zername = "AliPHOSClusterizer" ;
761 if(recName == "TrackSegments"){
763 dataname = fgkTrackSegmentsBranchName;
764 zername = "AliPHOSTrackSegmentMaker";
767 if(recName == "RecParticles"){
769 dataname = fgkRecParticlesBranchName;
770 zername = "AliPHOSPID";
779 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
781 TBranch * branch = 0 ;
782 TString titleName(fBranchTitle);
785 while ((branch = (static_cast<TBranch*>(next())))) {
786 TString branchName(branch->GetName() ) ;
787 TString branchTitle(branch->GetTitle() ) ;
788 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
789 AliWarning(Form("branch %s with title %s ",
790 dataname.Data(),fBranchTitle.Data()));
793 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
794 AliWarning(Form("branch AliPHOS... with title %s ",
795 branch->GetTitle()));
803 void AliPHOSLoader::SetBranchTitle(const TString& btitle)
806 if (btitle.CompareTo(fBranchTitle) == 0) return;
807 fBranchTitle = btitle;
811 //____________________________________________________________________________
812 //Again, must be const not to hide virtual functions from AliLoader
813 //but there are calls to non-const functions, so I have to const_cast this pointer
814 void AliPHOSLoader::CleanHits()const
817 AliLoader::CleanHits();
819 TClonesArray* hits = const_cast<AliPHOSLoader *>(this)->Hits();
820 if (hits) hits->Clear();
822 //____________________________________________________________________________
824 void AliPHOSLoader::CleanSDigits()const
826 // Clean SDigits array
827 AliLoader::CleanSDigits();
828 TClonesArray* sdigits = const_cast<AliPHOSLoader *>(this)->SDigits();
829 if (sdigits) sdigits->Clear();
832 //____________________________________________________________________________
834 void AliPHOSLoader::CleanDigits()const
836 // Clean Digits array
837 AliLoader::CleanDigits();
838 TClonesArray* digits = const_cast<AliPHOSLoader *>(this)->Digits();
839 if (digits) digits->Clear();
841 //____________________________________________________________________________
843 void AliPHOSLoader::CleanRecPoints()const
845 // Clean RecPoints array
846 AliLoader::CleanRecPoints();
847 TObjArray* recpoints = const_cast<AliPHOSLoader *>(this)->EmcRecPoints();
848 if (recpoints) recpoints->Clear();
849 recpoints = const_cast<AliPHOSLoader *>(this)->CpvRecPoints();
850 if (recpoints) recpoints->Clear();
852 //____________________________________________________________________________
854 void AliPHOSLoader::CleanTracks()const
856 //Cleans Tracks stuff
857 AliLoader::CleanTracks();//tree
859 //and clear the array
860 TClonesArray* tracks = const_cast<AliPHOSLoader *>(this)->TrackSegments();
861 if (tracks) tracks->Clear();
864 //____________________________________________________________________________
866 void AliPHOSLoader::CleanRecParticles()
868 // Clean RecParticles array
869 TClonesArray *recpar = RecParticles();
870 if (recpar) recpar->Clear();
874 //____________________________________________________________________________
876 void AliPHOSLoader::ReadCalibrationDB(const char * database,const char * filename)
878 // Read calibration data base from file
879 if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
882 TFile * file = gROOT->GetFile(filename) ;
884 file = TFile::Open(filename);
886 AliError(Form("Cannot open file %s", filename)) ;
891 fcdb = dynamic_cast<AliPHOSCalibrationDB *>(file->Get("AliPHOSCalibrationDB")) ;
893 AliError(Form("No database %s in file %s", database, filename)) ;
895 //____________________________________________________________________________
897 // AliPHOSSDigitizer* AliPHOSLoader::PHOSSDigitizer()
899 // //return PHOS SDigitizer
900 // return dynamic_cast<AliPHOSSDigitizer*>(SDigitizer()) ;
903 //____________________________________________________________________________
904 void AliPHOSLoader::MakeHitsArray()
906 // Add Hits array to the data folder
908 TClonesArray* hits = new TClonesArray("AliPHOSHit",1000);
909 hits->SetName(fgkHitsName);
910 GetDetectorDataFolder()->Add(hits);
913 //____________________________________________________________________________
914 void AliPHOSLoader::MakeSDigitsArray()
916 // Add SDigits array to the data folder
917 if ( SDigits()) return;
918 TClonesArray* sdigits = new TClonesArray("AliPHOSDigit",1);
919 sdigits->SetName(fgkSDigitsName);
920 GetDetectorDataFolder()->Add(sdigits);
923 //____________________________________________________________________________
924 void AliPHOSLoader::MakeDigitsArray()
926 // Add Digits array to the data folder
927 if ( Digits()) return;
928 TClonesArray* digits = new TClonesArray("AliPHOSDigit",1);
929 digits->SetName(fgkDigitsName);
930 GetDetectorDataFolder()->Add(digits);
934 //____________________________________________________________________________
935 void AliPHOSLoader::MakeRecPointsArray()
937 // Add RecPoints array to the data folder
938 if ( EmcRecPoints() == 0x0)
940 AliDebug(9, "Making array for EMC");
941 TObjArray* emc = new TObjArray(100) ;
942 emc->SetName(fgkEmcRecPointsName) ;
943 GetDetectorDataFolder()->Add(emc);
946 if ( CpvRecPoints() == 0x0)
948 AliDebug(9, "Making array for CPV");
949 TObjArray* cpv = new TObjArray(100) ;
950 cpv->SetName(fgkCpvRecPointsName);
951 GetDetectorDataFolder()->Add(cpv);
955 //____________________________________________________________________________
956 void AliPHOSLoader::MakeTrackSegmentsArray()
958 // Add TrackSegments array to the data folder
959 if ( TrackSegments()) return;
960 TClonesArray * ts = new TClonesArray("AliPHOSTrackSegment",100) ;
961 ts->SetName(fgkTracksName);
962 GetDetectorDataFolder()->Add(ts);
966 //____________________________________________________________________________
967 void AliPHOSLoader::MakeRecParticlesArray()
969 // Add RecParticles array to the data folder
970 if ( RecParticles()) return;
971 TClonesArray * rp = new TClonesArray("AliPHOSRecParticle",100) ;
972 rp->SetName(fgkRecParticlesName);
973 GetDetectorDataFolder()->Add(rp);