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.16 2006/08/01 12:15:04 cvetan
22 * Adding a constructor from TFolder. Needed by AliReconstruction plugin scheme
24 * Revision 1.15 2005/07/12 20:07:35 hristov
25 * Changes needed to run simulation and reconstrruction in the same AliRoot session
27 * Revision 1.14 2005/05/28 14:19:04 schutz
28 * Compilation warnings fixed by T.P.
32 //_________________________________________________________________________
33 // A singleton. This class should be used in the analysis stage to get
34 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
35 // instead of directly reading them from galice.root file. This container
36 // ensures, that one reads Digits, made of these particular digits, RecPoints,
37 // made of these particular RecPoints, TrackSegments and RecParticles.
38 // This becomes non trivial if there are several identical branches, produced with
39 // different set of parameters.
41 // An example of how to use (see also class AliPHOSAnalyser):
42 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
43 // AliPHOSRecParticle * part = gime->RecParticle(1) ;
45 // please->GetEvent(event) ; // reads new event from galice.root
47 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
48 //*-- Completely redesigned by Dmitri Peressounko March 2001
50 //*-- YS June 2001 : renamed the original AliPHOSIndexToObject and make
51 //*-- systematic usage of TFolders without changing the interface
52 //////////////////////////////////////////////////////////////////////////////
55 // --- ROOT system ---
61 // --- Standard library ---
63 // --- AliRoot header files ---
64 #include "AliObjectLoader.h"
66 #include "AliPHOSLoader.h"
68 #include "AliPHOSHit.h"
69 #include "AliPHOSCalibrationDB.h"
70 #include "AliPHOSGetter.h"
72 ClassImp(AliPHOSLoader)
75 const TString AliPHOSLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
76 const TString AliPHOSLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
77 const TString AliPHOSLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
78 const TString AliPHOSLoader::fgkEmcRecPointsName("EMCRECPOINTS");//Name for TClonesArray
79 const TString AliPHOSLoader::fgkCpvRecPointsName("CPVRECPOINTS");//Name for TClonesArray
80 const TString AliPHOSLoader::fgkTracksName("TRACKS");//Name for TClonesArray
81 const TString AliPHOSLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
83 const TString AliPHOSLoader::fgkEmcRecPointsBranchName("PHOSEmcRP");//Name for branch with EMC Reconstructed Points
84 const TString AliPHOSLoader::fgkCpvRecPointsBranchName("PHOSCpvRP");//Name for branch with CPV Reconstructed Points
85 const TString AliPHOSLoader::fgkTrackSegmentsBranchName("PHOSTS");//Name for branch with TrackSegments
86 const TString AliPHOSLoader::fgkRecParticlesBranchName("PHOSRP");//Name for branch with Reconstructed Particles
87 //____________________________________________________________________________
88 AliPHOSLoader::AliPHOSLoader()
92 //____________________________________________________________________________
93 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,const Char_t *eventfoldername):
94 AliLoader(detname,eventfoldername)
98 //____________________________________________________________________________
99 AliPHOSLoader::AliPHOSLoader(const Char_t *detname,TFolder *topfolder):
100 AliLoader(detname,topfolder)
104 //____________________________________________________________________________
105 AliPHOSLoader::AliPHOSLoader(const AliPHOSLoader & obj):
106 AliLoader(obj),fBranchTitle(obj.GetBranchTitle()),fcdb(obj.CalibrationDB()),
107 fDebug(obj.GetDebug())
111 //____________________________________________________________________________
113 AliPHOSLoader::~AliPHOSLoader()
115 //remove and delete arrays
117 Clean(fgkSDigitsName);
118 Clean(fgkDigitsName);
119 Clean(fgkEmcRecPointsName);
120 Clean(fgkCpvRecPointsName);
121 Clean(fgkTracksName);
122 Clean(fgkRecParticlesName);
124 // set to 0x0 the objgetter in AliGetter ... weird isn it !
125 AliPHOSGetter * gime = AliPHOSGetter::Instance() ; // (AliLoader::GetRunLoader()->GetFileName()).Data()) ;
130 //____________________________________________________________________________
131 void AliPHOSLoader::CleanFolders()
134 AliLoader::CleanFolders();
137 //____________________________________________________________________________
138 Int_t AliPHOSLoader::SetEvent()
140 //Cleans loaded stuff and and sets Files and Directories
141 // do not post any data to folder/tasks
144 Int_t retval = AliLoader::SetEvent();
147 AliError("returned error");
152 if (Hits()) Hits()->Clear();
153 if (SDigits()) SDigits()->Clear();
154 if (Digits()) Digits()->Clear();
155 if (EmcRecPoints()) EmcRecPoints()->Clear();
156 if (CpvRecPoints()) CpvRecPoints()->Clear();
157 if (TrackSegments()) TrackSegments()->Clear();
158 if (RecParticles()) RecParticles()->Clear();
163 //____________________________________________________________________________
164 Int_t AliPHOSLoader::GetEvent()
166 //Overloads GetEvent method called by AliRunLoader::GetEvent(Int_t) method
167 //to add Rec Particles specific for PHOS
169 //First call the original method to get whatever from std. setup is needed
172 retval = AliLoader::GetEvent();
175 AliError("returned error");
179 if (GetHitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadHits();
180 if (GetSDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadSDigits();
181 if (GetDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadDigits();
182 if (GetRecPointsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecPoints();
183 if (GetTracksDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadTracks();
184 if (GetRecParticlesDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecParticles();
187 //Now, check if RecPart were loaded
191 //____________________________________________________________________________
192 const AliPHOS * AliPHOSLoader::PHOS()
194 // returns the PHOS object
195 AliPHOS * phos = dynamic_cast<AliPHOS*>(GetModulesFolder()->FindObject(fDetectorName));
198 cout << "WARNING: AliPHOSLoader::PHOS -> PHOS module not found in Folders" << endl ;
202 //____________________________________________________________________________
203 const AliPHOSGeometry * AliPHOSLoader::PHOSGeometry()
205 // Return PHOS geometry
206 AliPHOSGeometry * rv = 0 ;
208 rv = PHOS()->GetGeometry();
213 //____________________________________________________________________________
214 Int_t AliPHOSLoader::LoadHits(Option_t* opt)
216 //------- Hits ----------------------
217 //Overload (extends) LoadHits implemented in AliLoader
221 //First call the AliLoader's method to send the TreeH to folder
222 res = AliLoader::LoadHits(opt);
226 AliError("returned error");
230 //read the data from tree in folder and send it to folder
236 //____________________________________________________________________________
237 Int_t AliPHOSLoader::LoadSDigits(Option_t* opt)
239 //---------- SDigits -------------------------
241 //First call the AliLoader's method to send the TreeS to folder
242 res = AliLoader::LoadSDigits(opt);
245 AliError("returned error");
248 return ReadSDigits();
251 //____________________________________________________________________________
252 Int_t AliPHOSLoader::LoadDigits(Option_t* opt)
254 //---------- Digits -------------------------
256 //First call the AliLoader's method to send the TreeS to folder
257 res = AliLoader::LoadDigits(opt);
260 AliError("returned error");
265 //____________________________________________________________________________
266 Int_t AliPHOSLoader::LoadRecPoints(Option_t* opt)
268 // -------------- RecPoints -------------------------------------------
270 //First call the AliLoader's method to send the TreeR to folder
271 res = AliLoader::LoadRecPoints(opt);
274 AliError("returned error");
278 TFolder * phosFolder = GetDetectorDataFolder();
279 if ( phosFolder == 0x0 )
281 AliError("Can not get detector data folder");
284 return ReadRecPoints();
286 //____________________________________________________________________________
288 Int_t AliPHOSLoader::LoadTracks(Option_t* opt)
290 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
291 AliDebug(1, Form("opt = %s",opt));
293 res = AliLoader::LoadTracks(opt);
296 AliError("returned error");
302 //____________________________________________________________________________
303 Int_t AliPHOSLoader::LoadRecParticles(Option_t* opt)
305 // -------------- RecPoints -------------------------------------------
307 //First call the AliLoader's method to send the TreeT to folder
308 res = AliLoader::LoadRecParticles(opt);
311 AliError("returned error");
314 return ReadRecParticles();
317 //____________________________________________________________________________
318 //PostHits etc. PostXXX must be const - not to hide virtual functions
319 //from base class AliLoader, but they call non-constant functions ReadXXX
320 //so I have to const_cast this pointer
321 Int_t AliPHOSLoader::PostHits()const
323 // -------------- Hits -------------------------------------------
324 Int_t reval = AliLoader::PostHits();
327 AliError("returned error");
331 return const_cast<AliPHOSLoader *>(this)->ReadHits();
333 //____________________________________________________________________________
335 Int_t AliPHOSLoader::PostSDigits()const
337 // -------------- SDigits -------------------------------------------
338 Int_t reval = AliLoader::PostSDigits();
341 AliError("returned error");
344 return const_cast<AliPHOSLoader *>(this)->ReadSDigits();
346 //____________________________________________________________________________
348 Int_t AliPHOSLoader::PostDigits()const
350 // -------------- Digits -------------------------------------------
351 Int_t reval = AliLoader::PostDigits();
354 AliError("returned error");
357 return const_cast<AliPHOSLoader *>(this)->ReadDigits();
359 //____________________________________________________________________________
361 Int_t AliPHOSLoader::PostRecPoints()const
363 // -------------- RecPoints -------------------------------------------
364 Int_t reval = AliLoader::PostRecPoints();
367 AliError("returned error");
370 return const_cast<AliPHOSLoader *>(this)->ReadRecPoints();
373 //____________________________________________________________________________
375 Int_t AliPHOSLoader::PostRecParticles()const
377 // -------------- RecParticles -------------------------------------------
378 Int_t reval = AliLoader::PostRecParticles();
381 AliError("returned error");
384 return const_cast<AliPHOSLoader *>(this)->ReadRecParticles();
386 //____________________________________________________________________________
388 Int_t AliPHOSLoader::PostTracks()const
390 // -------------- Tracks -------------------------------------------
391 Int_t reval = AliLoader::PostTracks();
394 AliError("returned error");
397 return const_cast<AliPHOSLoader *>(this)->ReadTracks();
399 //____________________________________________________________________________
403 //____________________________________________________________________________
404 Int_t AliPHOSLoader::ReadHits()
406 // If there is no Clones Array in folder creates it and sends to folder
407 // then tries to read
408 // Reads the first entry of PHOS branch in hit tree TreeH()
409 // Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
411 TObject** hitref = HitsRef();
418 TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
420 TTree* treeh = TreeH();
424 AliError("Cannot read TreeH from folder");
428 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
431 AliError("Cannot find branch PHOS");
435 AliDebug(1, "Reading Hits");
437 if (hitsbranch->GetEntries() > 1)
439 TClonesArray * tempo = new TClonesArray("AliPHOSHit",1000);
441 hitsbranch->SetAddress(&tempo);
444 for (i = 0 ; i < hitsbranch->GetEntries(); i++)
446 hitsbranch->GetEntry(i) ;
448 for ( j = 0 ; j < tempo->GetEntries() ; j++)
450 AliPHOSHit* hit = (AliPHOSHit*)tempo->At(j);
451 new((*hits)[index]) AliPHOSHit( *hit ) ;
460 hitsbranch->SetAddress(hitref);
461 hitsbranch->GetEntry(0) ;
466 //____________________________________________________________________________
467 Int_t AliPHOSLoader::ReadSDigits()
469 // Read the summable digits tree TreeS():
470 // Check if TClones is in folder
471 // if not create and add to folder
472 // connect to tree if available
475 TObject** sdref = SDigitsRef();
479 sdref = SDigitsRef();
482 TTree * treeS = TreeS();
485 //May happen if file is truncated or new in LoadSDigits
486 //AliError("There is no SDigit Tree");
490 TBranch * branch = treeS->GetBranch(fDetectorName);
492 {//easy, maybe just a new tree
493 //AliError("Cannot find branch PHOS");
497 branch->SetAddress(SDigitsRef());
502 //____________________________________________________________________________
503 Int_t AliPHOSLoader::ReadDigits()
505 // Read the summable digits tree TreeS():
506 // Check if TClones is in folder
507 // if not create and add to folder
508 // connect to tree if available
511 TObject** dref = DigitsRef();
513 {//if there is not array in folder, create it and put it there
518 TTree * treeD = TreeD();
521 //May happen if file is truncated or new in LoadSDigits
522 //AliError("There is no Digit Tree");
526 TBranch * branch = treeD->GetBranch(fDetectorName);
528 {//easy, maybe just a new tree
529 //AliError("Cannot find branch ",fDetectorName.Data());
533 branch->SetAddress(dref);//connect branch to buffer sitting in folder
534 branch->GetEntry(0);//get first event
539 //____________________________________________________________________________
541 void AliPHOSLoader::Track(Int_t itrack)
543 // Read the first entry of PHOS branch in hit tree gAlice->TreeH()
548 AliError("Can not load hits.");
553 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("PHOS")) ;
556 cout << "WARNING: AliPHOSLoader::ReadTreeH -> Cannot find branch PHOS" << endl ;
559 if(!Hits()) PostHits();
561 hitsbranch->SetAddress(HitsRef());
562 hitsbranch->GetEntry(itrack);
566 //____________________________________________________________________________
567 Int_t AliPHOSLoader::ReadRecPoints()
569 //Creates and posts to folder an array container,
570 //connects branch in tree (if exists), and reads data to array
572 MakeRecPointsArray();
574 TObjArray * cpva = 0x0 ;
575 TObjArray * emca = 0x0 ;
577 TTree * treeR = TreeR();
581 //May happen if file is truncated or new in LoadSDigits
586 TBranch * emcbranch = treeR->GetBranch(fgkEmcRecPointsBranchName);
588 if (emcbranch == 0x0)
590 AliError(Form("Can not get branch with EMC Rec. Points named %s",
591 fgkEmcRecPointsBranchName.Data()));
596 emcbranch->SetAddress(&emca) ;
597 emcbranch->GetEntry(0) ;
599 TBranch * cpvbranch = treeR->GetBranch(fgkCpvRecPointsBranchName);
600 if (cpvbranch == 0x0)
602 AliError(Form("Can not get branch with CPV Rec. Points named %s",
603 fgkCpvRecPointsBranchName.Data()));
608 cpvbranch->SetAddress(&cpva);
609 cpvbranch->GetEntry(0) ;
613 Int_t maxemc = emca->GetEntries() ;
614 for ( ii= 0 ; ii < maxemc ; ii++ )
615 EmcRecPoints()->Add(emca->At(ii)) ;
617 Int_t maxcpv = cpva->GetEntries() ;
618 for ( ii= 0 ; ii < maxcpv ; ii++ )
619 CpvRecPoints()->Add(cpva->At(ii)) ;
624 //____________________________________________________________________________
625 Int_t AliPHOSLoader::ReadTracks()
627 //Creates and posts to folder an array container,
628 //connects branch in tree (if exists), and reads data to arry
630 TObject** trkref = TracksRef();
632 {//Create and post array
633 MakeTrackSegmentsArray();
634 trkref = TracksRef();
637 TTree * treeT = TreeT();
640 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
641 //but tracking was not performed yet for a current event
642 //AliError("There is no Tree with Tracks");
646 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
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 AliPHOSGeometry* AliPHOSLoader::GetPHOSGeometry()
702 //returns PHOS geometry from gAlice
703 //static Method used by some classes where it is not convienient to pass eventfoldername
706 AliPHOS* phos=dynamic_cast<AliPHOS*>(gAlice->GetDetector("PHOS"));
709 return phos->GetGeometry();
711 /***************************************************************************************/
713 AliPHOSLoader* AliPHOSLoader::GetPHOSLoader(const char* eventfoldername)
715 // Return PHOS loader
716 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
718 printf("Can not find Run Loader in folder %s", eventfoldername);
721 return dynamic_cast<AliPHOSLoader*>(rn->GetLoader("PHOSLoader"));
723 /***************************************************************************************/
725 Bool_t AliPHOSLoader::BranchExists(const TString& recName)
727 // Check if a branch named redName exists
728 if (fBranchTitle.IsNull()) return kFALSE;
729 TString dataname, zername ;
731 if(recName == "SDigits")
734 dataname = GetDetectorName();
735 zername = "AliPHOSSDigitizer" ;
738 if(recName == "Digits"){
740 dataname = GetDetectorName();
741 zername = "AliPHOSDigitizer" ;
744 if(recName == "RecPoints"){
746 dataname = fgkEmcRecPointsBranchName;
747 zername = "AliPHOSClusterizer" ;
750 if(recName == "TrackSegments"){
752 dataname = fgkTrackSegmentsBranchName;
753 zername = "AliPHOSTrackSegmentMaker";
756 if(recName == "RecParticles"){
758 dataname = fgkRecParticlesBranchName;
759 zername = "AliPHOSPID";
768 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
770 TBranch * branch = 0 ;
771 TString titleName(fBranchTitle);
774 while ((branch = (static_cast<TBranch*>(next())))) {
775 TString branchName(branch->GetName() ) ;
776 TString branchTitle(branch->GetTitle() ) ;
777 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
778 AliWarning(Form("branch %s with title %s ",
779 dataname.Data(),fBranchTitle.Data()));
782 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
783 AliWarning(Form("branch AliPHOS... with title %s ",
784 branch->GetTitle()));
792 void AliPHOSLoader::SetBranchTitle(const TString& btitle)
795 if (btitle.CompareTo(fBranchTitle) == 0) return;
796 fBranchTitle = btitle;
800 //____________________________________________________________________________
801 //Again, must be const not to hide virtual functions from AliLoader
802 //but there are calls to non-const functions, so I have to const_cast this pointer
803 void AliPHOSLoader::CleanHits()const
806 AliLoader::CleanHits();
808 TClonesArray* hits = const_cast<AliPHOSLoader *>(this)->Hits();
809 if (hits) hits->Clear();
811 //____________________________________________________________________________
813 void AliPHOSLoader::CleanSDigits()const
815 // Clean SDigits array
816 AliLoader::CleanSDigits();
817 TClonesArray* sdigits = const_cast<AliPHOSLoader *>(this)->SDigits();
818 if (sdigits) sdigits->Clear();
821 //____________________________________________________________________________
823 void AliPHOSLoader::CleanDigits()const
825 // Clean Digits array
826 AliLoader::CleanDigits();
827 TClonesArray* digits = const_cast<AliPHOSLoader *>(this)->Digits();
828 if (digits) digits->Clear();
830 //____________________________________________________________________________
832 void AliPHOSLoader::CleanRecPoints()const
834 // Clean RecPoints array
835 AliLoader::CleanRecPoints();
836 TObjArray* recpoints = const_cast<AliPHOSLoader *>(this)->EmcRecPoints();
837 if (recpoints) recpoints->Clear();
838 recpoints = const_cast<AliPHOSLoader *>(this)->CpvRecPoints();
839 if (recpoints) recpoints->Clear();
841 //____________________________________________________________________________
843 void AliPHOSLoader::CleanTracks()const
845 //Cleans Tracks stuff
846 AliLoader::CleanTracks();//tree
848 //and clear the array
849 TClonesArray* tracks = const_cast<AliPHOSLoader *>(this)->TrackSegments();
850 if (tracks) tracks->Clear();
853 //____________________________________________________________________________
855 void AliPHOSLoader::CleanRecParticles()
857 // Clean RecParticles array
858 TClonesArray *recpar = RecParticles();
859 if (recpar) recpar->Clear();
863 //____________________________________________________________________________
865 void AliPHOSLoader::ReadCalibrationDB(const char * database,const char * filename)
867 // Read calibration data base from file
868 if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
871 TFile * file = gROOT->GetFile(filename) ;
873 file = TFile::Open(filename);
875 AliError(Form("Cannot open file %s", filename)) ;
880 fcdb = dynamic_cast<AliPHOSCalibrationDB *>(file->Get("AliPHOSCalibrationDB")) ;
882 AliError(Form("No database %s in file %s", database, filename)) ;
884 //____________________________________________________________________________
886 // AliPHOSSDigitizer* AliPHOSLoader::PHOSSDigitizer()
888 // //return PHOS SDigitizer
889 // return dynamic_cast<AliPHOSSDigitizer*>(SDigitizer()) ;
892 //____________________________________________________________________________
893 void AliPHOSLoader::MakeHitsArray()
895 // Add Hits array to the data folder
897 TClonesArray* hits = new TClonesArray("AliPHOSHit",1000);
898 hits->SetName(fgkHitsName);
899 GetDetectorDataFolder()->Add(hits);
902 //____________________________________________________________________________
903 void AliPHOSLoader::MakeSDigitsArray()
905 // Add SDigits array to the data folder
906 if ( SDigits()) return;
907 TClonesArray* sdigits = new TClonesArray("AliPHOSDigit",1);
908 sdigits->SetName(fgkSDigitsName);
909 GetDetectorDataFolder()->Add(sdigits);
912 //____________________________________________________________________________
913 void AliPHOSLoader::MakeDigitsArray()
915 // Add Digits array to the data folder
916 if ( Digits()) return;
917 TClonesArray* digits = new TClonesArray("AliPHOSDigit",1);
918 digits->SetName(fgkDigitsName);
919 GetDetectorDataFolder()->Add(digits);
923 //____________________________________________________________________________
924 void AliPHOSLoader::MakeRecPointsArray()
926 // Add RecPoints array to the data folder
927 if ( EmcRecPoints() == 0x0)
929 AliDebug(9, "Making array for EMC");
930 TObjArray* emc = new TObjArray(100) ;
931 emc->SetName(fgkEmcRecPointsName) ;
932 GetDetectorDataFolder()->Add(emc);
935 if ( CpvRecPoints() == 0x0)
937 AliDebug(9, "Making array for CPV");
938 TObjArray* cpv = new TObjArray(100) ;
939 cpv->SetName(fgkCpvRecPointsName);
940 GetDetectorDataFolder()->Add(cpv);
944 //____________________________________________________________________________
945 void AliPHOSLoader::MakeTrackSegmentsArray()
947 // Add TrackSegments array to the data folder
948 if ( TrackSegments()) return;
949 TClonesArray * ts = new TClonesArray("AliPHOSTrackSegment",100) ;
950 ts->SetName(fgkTracksName);
951 GetDetectorDataFolder()->Add(ts);
955 //____________________________________________________________________________
956 void AliPHOSLoader::MakeRecParticlesArray()
958 // Add RecParticles array to the data folder
959 if ( RecParticles()) return;
960 TClonesArray * rp = new TClonesArray("AliPHOSRecParticle",100) ;
961 rp->SetName(fgkRecParticlesName);
962 GetDetectorDataFolder()->Add(rp);