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.17 2006/08/25 16:00:53 kharlov
22 * Compliance with Effective C++AliPHOSHit.cxx
24 * Revision 1.16 2006/08/01 12:15:04 cvetan
25 * Adding a constructor from TFolder. Needed by AliReconstruction plugin scheme
27 * Revision 1.15 2005/07/12 20:07:35 hristov
28 * Changes needed to run simulation and reconstrruction in the same AliRoot session
30 * Revision 1.14 2005/05/28 14:19:04 schutz
31 * Compilation warnings fixed by T.P.
35 //_________________________________________________________________________
36 // A singleton. This class should be used in the analysis stage to get
37 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
38 // instead of directly reading them from galice.root file. This container
39 // ensures, that one reads Digits, made of these particular digits, RecPoints,
40 // made of these particular RecPoints, TrackSegments and RecParticles.
41 // This becomes non trivial if there are several identical branches, produced with
42 // different set of parameters.
44 // An example of how to use (see also class AliPHOSAnalyser):
45 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
46 // AliPHOSRecParticle * part = gime->RecParticle(1) ;
48 // please->GetEvent(event) ; // reads new event from galice.root
50 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
51 //*-- Completely redesigned by Dmitri Peressounko March 2001
53 //*-- YS June 2001 : renamed the original AliPHOSIndexToObject and make
54 //*-- systematic usage of TFolders without changing the interface
55 //////////////////////////////////////////////////////////////////////////////
58 // --- ROOT system ---
64 // --- Standard library ---
66 // --- AliRoot header files ---
67 #include "AliObjectLoader.h"
69 #include "AliPHOSLoader.h"
71 #include "AliPHOSHit.h"
72 #include "AliPHOSCalibrationDB.h"
73 #include "AliPHOSGetter.h"
75 ClassImp(AliPHOSLoader)
78 const TString AliPHOSLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
79 const TString AliPHOSLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
80 const TString AliPHOSLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
81 const TString AliPHOSLoader::fgkEmcRecPointsName("EMCRECPOINTS");//Name for TClonesArray
82 const TString AliPHOSLoader::fgkCpvRecPointsName("CPVRECPOINTS");//Name for TClonesArray
83 const TString AliPHOSLoader::fgkTracksName("TRACKS");//Name for TClonesArray
84 const TString AliPHOSLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
86 const TString AliPHOSLoader::fgkEmcRecPointsBranchName("PHOSEmcRP");//Name for branch with EMC Reconstructed Points
87 const TString AliPHOSLoader::fgkCpvRecPointsBranchName("PHOSCpvRP");//Name for branch with CPV Reconstructed Points
88 const TString AliPHOSLoader::fgkTrackSegmentsBranchName("PHOSTS");//Name for branch with TrackSegments
89 const TString AliPHOSLoader::fgkRecParticlesBranchName("PHOSRP");//Name for branch with Reconstructed Particles
90 //____________________________________________________________________________
91 AliPHOSLoader::AliPHOSLoader() : fBranchTitle(), fcdb(0), fDebug(0)
95 //____________________________________________________________________________
96 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,const Char_t *eventfoldername) :
97 AliLoader(detname, eventfoldername),
98 fBranchTitle(), fcdb(0), fDebug(0)
102 //____________________________________________________________________________
103 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,TFolder *topfolder):
104 AliLoader(detname,topfolder),
105 fBranchTitle(), fcdb(0), fDebug(0)
110 //____________________________________________________________________________
111 AliPHOSLoader::AliPHOSLoader(const AliPHOSLoader & obj):
112 AliLoader(obj),fBranchTitle(obj.GetBranchTitle()),fcdb(obj.CalibrationDB()),
113 fDebug(obj.GetDebug())
117 //____________________________________________________________________________
119 AliPHOSLoader::~AliPHOSLoader()
121 //remove and delete arrays
123 Clean(fgkSDigitsName);
124 Clean(fgkDigitsName);
125 Clean(fgkEmcRecPointsName);
126 Clean(fgkCpvRecPointsName);
127 Clean(fgkTracksName);
128 Clean(fgkRecParticlesName);
130 // set to 0x0 the objgetter in AliGetter ... weird isn it !
131 AliPHOSGetter * gime = AliPHOSGetter::Instance() ; // (AliLoader::GetRunLoader()->GetFileName()).Data()) ;
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 const AliPHOSGeometry * AliPHOSLoader::PHOSGeometry()
211 // Return PHOS geometry
212 AliPHOSGeometry * rv = 0 ;
214 rv = PHOS()->GetGeometry();
219 //____________________________________________________________________________
220 Int_t AliPHOSLoader::LoadHits(Option_t* opt)
222 //------- Hits ----------------------
223 //Overload (extends) LoadHits implemented in AliLoader
227 //First call the AliLoader's method to send the TreeH to folder
228 res = AliLoader::LoadHits(opt);
232 AliError("returned error");
236 //read the data from tree in folder and send it to folder
242 //____________________________________________________________________________
243 Int_t AliPHOSLoader::LoadSDigits(Option_t* opt)
245 //---------- SDigits -------------------------
247 //First call the AliLoader's method to send the TreeS to folder
248 res = AliLoader::LoadSDigits(opt);
251 AliError("returned error");
254 return ReadSDigits();
257 //____________________________________________________________________________
258 Int_t AliPHOSLoader::LoadDigits(Option_t* opt)
260 //---------- Digits -------------------------
262 //First call the AliLoader's method to send the TreeS to folder
263 res = AliLoader::LoadDigits(opt);
266 AliError("returned error");
271 //____________________________________________________________________________
272 Int_t AliPHOSLoader::LoadRecPoints(Option_t* opt)
274 // -------------- RecPoints -------------------------------------------
276 //First call the AliLoader's method to send the TreeR to folder
277 res = AliLoader::LoadRecPoints(opt);
280 AliError("returned error");
284 TFolder * phosFolder = GetDetectorDataFolder();
285 if ( phosFolder == 0x0 )
287 AliError("Can not get detector data folder");
290 return ReadRecPoints();
292 //____________________________________________________________________________
294 Int_t AliPHOSLoader::LoadTracks(Option_t* opt)
296 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
297 AliDebug(1, Form("opt = %s",opt));
299 res = AliLoader::LoadTracks(opt);
302 AliError("returned error");
308 //____________________________________________________________________________
309 Int_t AliPHOSLoader::LoadRecParticles(Option_t* opt)
311 // -------------- RecPoints -------------------------------------------
313 //First call the AliLoader's method to send the TreeT to folder
314 res = AliLoader::LoadRecParticles(opt);
317 AliError("returned error");
320 return ReadRecParticles();
323 //____________________________________________________________________________
324 //PostHits etc. PostXXX must be const - not to hide virtual functions
325 //from base class AliLoader, but they call non-constant functions ReadXXX
326 //so I have to const_cast this pointer
327 Int_t AliPHOSLoader::PostHits()const
329 // -------------- Hits -------------------------------------------
330 Int_t reval = AliLoader::PostHits();
333 AliError("returned error");
337 return const_cast<AliPHOSLoader *>(this)->ReadHits();
339 //____________________________________________________________________________
341 Int_t AliPHOSLoader::PostSDigits()const
343 // -------------- SDigits -------------------------------------------
344 Int_t reval = AliLoader::PostSDigits();
347 AliError("returned error");
350 return const_cast<AliPHOSLoader *>(this)->ReadSDigits();
352 //____________________________________________________________________________
354 Int_t AliPHOSLoader::PostDigits()const
356 // -------------- Digits -------------------------------------------
357 Int_t reval = AliLoader::PostDigits();
360 AliError("returned error");
363 return const_cast<AliPHOSLoader *>(this)->ReadDigits();
365 //____________________________________________________________________________
367 Int_t AliPHOSLoader::PostRecPoints()const
369 // -------------- RecPoints -------------------------------------------
370 Int_t reval = AliLoader::PostRecPoints();
373 AliError("returned error");
376 return const_cast<AliPHOSLoader *>(this)->ReadRecPoints();
379 //____________________________________________________________________________
381 Int_t AliPHOSLoader::PostRecParticles()const
383 // -------------- RecParticles -------------------------------------------
384 Int_t reval = AliLoader::PostRecParticles();
387 AliError("returned error");
390 return const_cast<AliPHOSLoader *>(this)->ReadRecParticles();
392 //____________________________________________________________________________
394 Int_t AliPHOSLoader::PostTracks()const
396 // -------------- Tracks -------------------------------------------
397 Int_t reval = AliLoader::PostTracks();
400 AliError("returned error");
403 return const_cast<AliPHOSLoader *>(this)->ReadTracks();
405 //____________________________________________________________________________
409 //____________________________________________________________________________
410 Int_t AliPHOSLoader::ReadHits()
412 // If there is no Clones Array in folder creates it and sends to folder
413 // then tries to read
414 // Reads the first entry of PHOS branch in hit tree TreeH()
415 // Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
417 TObject** hitref = HitsRef();
424 TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
426 TTree* treeh = TreeH();
430 AliError("Cannot read TreeH from folder");
434 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
437 AliError("Cannot find branch PHOS");
441 AliDebug(1, "Reading Hits");
443 if (hitsbranch->GetEntries() > 1)
445 TClonesArray * tempo = new TClonesArray("AliPHOSHit",1000);
447 hitsbranch->SetAddress(&tempo);
450 for (i = 0 ; i < hitsbranch->GetEntries(); i++)
452 hitsbranch->GetEntry(i) ;
454 for ( j = 0 ; j < tempo->GetEntries() ; j++)
456 AliPHOSHit* hit = (AliPHOSHit*)tempo->At(j);
457 new((*hits)[index]) AliPHOSHit( *hit ) ;
466 hitsbranch->SetAddress(hitref);
467 hitsbranch->GetEntry(0) ;
472 //____________________________________________________________________________
473 Int_t AliPHOSLoader::ReadSDigits()
475 // Read the summable digits tree TreeS():
476 // Check if TClones is in folder
477 // if not create and add to folder
478 // connect to tree if available
481 TObject** sdref = SDigitsRef();
485 sdref = SDigitsRef();
488 TTree * treeS = TreeS();
491 //May happen if file is truncated or new in LoadSDigits
492 //AliError("There is no SDigit Tree");
496 TBranch * branch = treeS->GetBranch(fDetectorName);
498 {//easy, maybe just a new tree
499 //AliError("Cannot find branch PHOS");
503 branch->SetAddress(SDigitsRef());
508 //____________________________________________________________________________
509 Int_t AliPHOSLoader::ReadDigits()
511 // Read the summable digits tree TreeS():
512 // Check if TClones is in folder
513 // if not create and add to folder
514 // connect to tree if available
517 TObject** dref = DigitsRef();
519 {//if there is not array in folder, create it and put it there
524 TTree * treeD = TreeD();
527 //May happen if file is truncated or new in LoadSDigits
528 //AliError("There is no Digit Tree");
532 TBranch * branch = treeD->GetBranch(fDetectorName);
534 {//easy, maybe just a new tree
535 //AliError("Cannot find branch ",fDetectorName.Data());
539 branch->SetAddress(dref);//connect branch to buffer sitting in folder
540 branch->GetEntry(0);//get first event
545 //____________________________________________________________________________
547 void AliPHOSLoader::Track(Int_t itrack)
549 // Read the first entry of PHOS branch in hit tree gAlice->TreeH()
554 AliError("Can not load hits.");
559 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("PHOS")) ;
562 cout << "WARNING: AliPHOSLoader::ReadTreeH -> Cannot find branch PHOS" << endl ;
565 if(!Hits()) PostHits();
567 hitsbranch->SetAddress(HitsRef());
568 hitsbranch->GetEntry(itrack);
572 //____________________________________________________________________________
573 Int_t AliPHOSLoader::ReadRecPoints()
575 //Creates and posts to folder an array container,
576 //connects branch in tree (if exists), and reads data to array
578 MakeRecPointsArray();
580 TObjArray * cpva = 0x0 ;
581 TObjArray * emca = 0x0 ;
583 TTree * treeR = TreeR();
587 //May happen if file is truncated or new in LoadSDigits
592 TBranch * emcbranch = treeR->GetBranch(fgkEmcRecPointsBranchName);
594 if (emcbranch == 0x0)
596 AliError(Form("Can not get branch with EMC Rec. Points named %s",
597 fgkEmcRecPointsBranchName.Data()));
602 emcbranch->SetAddress(&emca) ;
603 emcbranch->GetEntry(0) ;
605 TBranch * cpvbranch = treeR->GetBranch(fgkCpvRecPointsBranchName);
606 if (cpvbranch == 0x0)
608 AliError(Form("Can not get branch with CPV Rec. Points named %s",
609 fgkCpvRecPointsBranchName.Data()));
614 cpvbranch->SetAddress(&cpva);
615 cpvbranch->GetEntry(0) ;
619 Int_t maxemc = emca->GetEntries() ;
620 for ( ii= 0 ; ii < maxemc ; ii++ )
621 EmcRecPoints()->Add(emca->At(ii)) ;
623 Int_t maxcpv = cpva->GetEntries() ;
624 for ( ii= 0 ; ii < maxcpv ; ii++ )
625 CpvRecPoints()->Add(cpva->At(ii)) ;
630 //____________________________________________________________________________
631 Int_t AliPHOSLoader::ReadTracks()
633 //Creates and posts to folder an array container,
634 //connects branch in tree (if exists), and reads data to arry
636 TObject** trkref = TracksRef();
638 {//Create and post array
639 MakeTrackSegmentsArray();
640 trkref = TracksRef();
643 TTree * treeT = TreeT();
646 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
647 //but tracking was not performed yet for a current event
648 //AliError("There is no Tree with Tracks");
652 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
654 {//easy, maybe just a new tree
655 AliError(Form("Cannot find branch named %s",
656 fgkTrackSegmentsBranchName.Data()));
660 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
661 branch->GetEntry(0);//get first event
665 //____________________________________________________________________________
667 Int_t AliPHOSLoader::ReadRecParticles()
669 //Reads Reconstructed Particles from file
670 //Creates and posts to folder an array container,
671 //connects branch in tree (if exists), and reads data to arry
673 TObject** recpartref = RecParticlesRef();
675 if ( recpartref == 0x0 )
676 {//Create and post array
677 MakeRecParticlesArray();
678 recpartref = RecParticlesRef();
681 TTree * treeP = TreeP();
684 //May happen if file is truncated or new in LoadSDigits,
685 //or the file is in update mode,
686 //but tracking was not performed yet for a current event
687 // AliError("There is no Tree with Tracks and Reconstructed Particles");
691 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
693 {//easy, maybe just a new tree
694 AliError(Form("Cannot find branch %s",
695 fgkRecParticlesBranchName.Data()));
699 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
700 branch->GetEntry(0);//get first event
706 AliPHOSGeometry* AliPHOSLoader::GetPHOSGeometry()
708 //returns PHOS geometry from gAlice
709 //static Method used by some classes where it is not convienient to pass eventfoldername
712 AliPHOS* phos=dynamic_cast<AliPHOS*>(gAlice->GetDetector("PHOS"));
715 return phos->GetGeometry();
717 /***************************************************************************************/
719 AliPHOSLoader* AliPHOSLoader::GetPHOSLoader(const char* eventfoldername)
721 // Return PHOS loader
722 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
724 printf("Can not find Run Loader in folder %s", eventfoldername);
727 return dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
729 /***************************************************************************************/
731 Bool_t AliPHOSLoader::BranchExists(const TString& recName)
733 // Check if a branch named redName exists
734 if (fBranchTitle.IsNull()) return kFALSE;
735 TString dataname, zername ;
737 if(recName == "SDigits")
740 dataname = GetDetectorName();
741 zername = "AliPHOSSDigitizer" ;
744 if(recName == "Digits"){
746 dataname = GetDetectorName();
747 zername = "AliPHOSDigitizer" ;
750 if(recName == "RecPoints"){
752 dataname = fgkEmcRecPointsBranchName;
753 zername = "AliPHOSClusterizer" ;
756 if(recName == "TrackSegments"){
758 dataname = fgkTrackSegmentsBranchName;
759 zername = "AliPHOSTrackSegmentMaker";
762 if(recName == "RecParticles"){
764 dataname = fgkRecParticlesBranchName;
765 zername = "AliPHOSPID";
774 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
776 TBranch * branch = 0 ;
777 TString titleName(fBranchTitle);
780 while ((branch = (static_cast<TBranch*>(next())))) {
781 TString branchName(branch->GetName() ) ;
782 TString branchTitle(branch->GetTitle() ) ;
783 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
784 AliWarning(Form("branch %s with title %s ",
785 dataname.Data(),fBranchTitle.Data()));
788 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
789 AliWarning(Form("branch AliPHOS... with title %s ",
790 branch->GetTitle()));
798 void AliPHOSLoader::SetBranchTitle(const TString& btitle)
801 if (btitle.CompareTo(fBranchTitle) == 0) return;
802 fBranchTitle = btitle;
806 //____________________________________________________________________________
807 //Again, must be const not to hide virtual functions from AliLoader
808 //but there are calls to non-const functions, so I have to const_cast this pointer
809 void AliPHOSLoader::CleanHits()const
812 AliLoader::CleanHits();
814 TClonesArray* hits = const_cast<AliPHOSLoader *>(this)->Hits();
815 if (hits) hits->Clear();
817 //____________________________________________________________________________
819 void AliPHOSLoader::CleanSDigits()const
821 // Clean SDigits array
822 AliLoader::CleanSDigits();
823 TClonesArray* sdigits = const_cast<AliPHOSLoader *>(this)->SDigits();
824 if (sdigits) sdigits->Clear();
827 //____________________________________________________________________________
829 void AliPHOSLoader::CleanDigits()const
831 // Clean Digits array
832 AliLoader::CleanDigits();
833 TClonesArray* digits = const_cast<AliPHOSLoader *>(this)->Digits();
834 if (digits) digits->Clear();
836 //____________________________________________________________________________
838 void AliPHOSLoader::CleanRecPoints()const
840 // Clean RecPoints array
841 AliLoader::CleanRecPoints();
842 TObjArray* recpoints = const_cast<AliPHOSLoader *>(this)->EmcRecPoints();
843 if (recpoints) recpoints->Clear();
844 recpoints = const_cast<AliPHOSLoader *>(this)->CpvRecPoints();
845 if (recpoints) recpoints->Clear();
847 //____________________________________________________________________________
849 void AliPHOSLoader::CleanTracks()const
851 //Cleans Tracks stuff
852 AliLoader::CleanTracks();//tree
854 //and clear the array
855 TClonesArray* tracks = const_cast<AliPHOSLoader *>(this)->TrackSegments();
856 if (tracks) tracks->Clear();
859 //____________________________________________________________________________
861 void AliPHOSLoader::CleanRecParticles()
863 // Clean RecParticles array
864 TClonesArray *recpar = RecParticles();
865 if (recpar) recpar->Clear();
869 //____________________________________________________________________________
871 void AliPHOSLoader::ReadCalibrationDB(const char * database,const char * filename)
873 // Read calibration data base from file
874 if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
877 TFile * file = gROOT->GetFile(filename) ;
879 file = TFile::Open(filename);
881 AliError(Form("Cannot open file %s", filename)) ;
886 fcdb = dynamic_cast<AliPHOSCalibrationDB *>(file->Get("AliPHOSCalibrationDB")) ;
888 AliError(Form("No database %s in file %s", database, filename)) ;
890 //____________________________________________________________________________
892 // AliPHOSSDigitizer* AliPHOSLoader::PHOSSDigitizer()
894 // //return PHOS SDigitizer
895 // return dynamic_cast<AliPHOSSDigitizer*>(SDigitizer()) ;
898 //____________________________________________________________________________
899 void AliPHOSLoader::MakeHitsArray()
901 // Add Hits array to the data folder
903 TClonesArray* hits = new TClonesArray("AliPHOSHit",1000);
904 hits->SetName(fgkHitsName);
905 GetDetectorDataFolder()->Add(hits);
908 //____________________________________________________________________________
909 void AliPHOSLoader::MakeSDigitsArray()
911 // Add SDigits array to the data folder
912 if ( SDigits()) return;
913 TClonesArray* sdigits = new TClonesArray("AliPHOSDigit",1);
914 sdigits->SetName(fgkSDigitsName);
915 GetDetectorDataFolder()->Add(sdigits);
918 //____________________________________________________________________________
919 void AliPHOSLoader::MakeDigitsArray()
921 // Add Digits array to the data folder
922 if ( Digits()) return;
923 TClonesArray* digits = new TClonesArray("AliPHOSDigit",1);
924 digits->SetName(fgkDigitsName);
925 GetDetectorDataFolder()->Add(digits);
929 //____________________________________________________________________________
930 void AliPHOSLoader::MakeRecPointsArray()
932 // Add RecPoints array to the data folder
933 if ( EmcRecPoints() == 0x0)
935 AliDebug(9, "Making array for EMC");
936 TObjArray* emc = new TObjArray(100) ;
937 emc->SetName(fgkEmcRecPointsName) ;
938 GetDetectorDataFolder()->Add(emc);
941 if ( CpvRecPoints() == 0x0)
943 AliDebug(9, "Making array for CPV");
944 TObjArray* cpv = new TObjArray(100) ;
945 cpv->SetName(fgkCpvRecPointsName);
946 GetDetectorDataFolder()->Add(cpv);
950 //____________________________________________________________________________
951 void AliPHOSLoader::MakeTrackSegmentsArray()
953 // Add TrackSegments array to the data folder
954 if ( TrackSegments()) return;
955 TClonesArray * ts = new TClonesArray("AliPHOSTrackSegment",100) ;
956 ts->SetName(fgkTracksName);
957 GetDetectorDataFolder()->Add(ts);
961 //____________________________________________________________________________
962 void AliPHOSLoader::MakeRecParticlesArray()
964 // Add RecParticles array to the data folder
965 if ( RecParticles()) return;
966 TClonesArray * rp = new TClonesArray("AliPHOSRecParticle",100) ;
967 rp->SetName(fgkRecParticlesName);
968 GetDetectorDataFolder()->Add(rp);