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 **************************************************************************/
19 29.05.2001 Yuri Kharlov:
20 Everywhere reading the treese TTree->GetEvent(i)
21 is replaced by reading the branches TBranch->GetEntry(0)
24 //_________________________________________________________________________
25 // A singleton. This class should be used in the analysis stage to get
26 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
27 // instead of directly reading them from galice.root file. This container
28 // ensures, that one reads Digits, made of these particular digits, RecPoints,
29 // made of these particular RecPoints, TrackSegments and RecParticles.
30 // This becomes non trivial if there are several identical branches, produced with
31 // different set of parameters.
33 // An example of how to use (see also class AliEMCALAnalyser):
34 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
35 // AliEMCALRecParticle * part = gime->RecParticle(1) ;
37 // please->GetEvent(event) ; // reads new event from galice.root
39 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
40 //*-- Completely redesigned by Dmitri Peressounko March 2001
42 //*-- YS June 2001 : renamed the original AliEMCALIndexToObject and make
43 //*-- systematic usage of TFolders without changing the interface
44 //////////////////////////////////////////////////////////////////////////////
47 // --- ROOT system ---
52 #include "TObjString.h"
54 #include "TParticle.h"
56 // --- Standard library ---
57 #include <Riostream.h>
59 // --- AliRoot header files ---
62 #include "AliConfig.h"
63 #include "AliDataLoader.h"
64 #include "AliEMCALLoader.h"
66 #include "AliEMCALDigitizer.h"
67 #include "AliEMCALSDigitizer.h"
68 #include "AliEMCALClusterizer.h"
69 #include "AliEMCALClusterizerv1.h"
70 #include "AliEMCALTrackSegmentMaker.h"
71 #include "AliEMCALTrackSegmentMakerv1.h"
72 #include "AliEMCALTrackSegment.h"
73 #include "AliEMCALPID.h"
74 #include "AliEMCALPIDv1.h"
75 #include "AliEMCALGeometry.h"
76 //#include "AliEMCALCalibrationDB.h"
78 ClassImp(AliEMCALLoader)
81 const TString AliEMCALLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
82 const TString AliEMCALLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
83 const TString AliEMCALLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
84 const TString AliEMCALLoader::fgkPRERecPointsName("PRERECPOINTS");//Name for TClonesArray
85 const TString AliEMCALLoader::fgkECARecPointsName("ECARECPOINTS");//Name for TClonesArray
86 const TString AliEMCALLoader::fgkHCARecPointsName("HCARECPOINTS");//Name for TClonesArray
87 const TString AliEMCALLoader::fgkTracksName("TRACKS");//Name for TClonesArray
88 const TString AliEMCALLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
90 const TString AliEMCALLoader::fgkPRERecPointsBranchName("EMCALPRERP");//Name for branch with PreShower Reconstructed Points
91 const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
92 const TString AliEMCALLoader::fgkHCARecPointsBranchName("EMCALHCARP");//Name for branch with HCA Reconstructed Points
93 const TString AliEMCALLoader::fgkTrackSegmentsBranchName("EMCALTS");//Name for branch with TrackSegments
94 const TString AliEMCALLoader::fgkRecParticlesBranchName("EMCALRP");//Name for branch with Reconstructed Particles
95 //____________________________________________________________________________
96 AliEMCALLoader::AliEMCALLoader()
99 fRecParticlesLoaded = kFALSE;
101 //____________________________________________________________________________
102 AliEMCALLoader::AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername):
103 AliLoader(detname,eventfoldername)
106 fRecParticlesLoaded = kFALSE;
108 //____________________________________________________________________________
110 AliEMCALLoader::~AliEMCALLoader()
112 //remove and delete arrays
114 Clean(fgkSDigitsName);
115 Clean(fgkDigitsName);
116 Clean(fgkPRERecPointsName);
117 Clean(fgkECARecPointsName);
118 Clean(fgkHCARecPointsName);
119 Clean(fgkTracksName);
120 Clean(fgkRecParticlesName);
122 //____________________________________________________________________________
124 void AliEMCALLoader::CleanFolders()
127 AliLoader::CleanFolders();
129 //____________________________________________________________________________
131 Int_t AliEMCALLoader::SetEvent()
133 //Cleans loaded stuff and and sets Files and Directories
134 // do not post any data to folder/tasks
137 Int_t retval = AliLoader::SetEvent();
140 Error("SetEvent","AliLoader::SetEvent returned error");
145 if (Hits()) Hits()->Clear();
146 if (SDigits()) SDigits()->Clear();
147 if (Digits()) Digits()->Clear();
148 if (PRERecPoints()) PRERecPoints()->Clear();
149 if (ECARecPoints()) ECARecPoints()->Clear();
150 if (HCARecPoints()) HCARecPoints()->Clear();
151 if (TrackSegments()) TrackSegments()->Clear();
152 if (RecParticles()) RecParticles()->Clear();
156 //____________________________________________________________________________
158 Int_t AliEMCALLoader::GetEvent()
160 //Overloads GetEvent method called by AliRunLoader::GetEvent(Int_t) method
161 //to add Rec Particles specific for EMCAL
163 //First call the original method to get whatever from std. setup is needed
166 retval = AliLoader::GetEvent();
169 Error("GetEvent","AliLoader::GetEvent returned error");
173 if (GetHitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadHits();
174 if (GetSDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadSDigits();
175 if (GetDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadDigits();
176 if (GetRecPointsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecPoints();
177 if (GetTracksDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadTracks();
178 if (GetRecParticlesDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecParticles();
181 //Now, check if RecPart were loaded
184 //____________________________________________________________________________
187 //____________________________________________________________________________
188 const AliEMCAL * AliEMCALLoader::EMCAL()
190 // returns the EMCAL object
191 AliEMCAL * emcal = dynamic_cast<AliEMCAL*>(GetModulesFolder()->FindObject(fDetectorName));
194 cout << "WARNING: AliEMCALLoader::EMCAL -> EMCAL module not found in Folders" << endl ;
198 //____________________________________________________________________________
199 const AliEMCALGeometry * AliEMCALLoader::EMCALGeometry()
201 AliEMCALGeometry * rv = 0 ;
203 rv = EMCAL()->GetGeometry();
208 //____________________________________________________________________________
209 Int_t AliEMCALLoader::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 Error("LoadHits","AliLoader::LoadHits returned error");
225 //read the data from tree in folder and send it to folder
231 //____________________________________________________________________________
232 Int_t AliEMCALLoader::LoadSDigits(Option_t* opt)
233 { //---------- SDigits -------------------------
235 //First call the AliLoader's method to send the TreeS to folder
236 res = AliLoader::LoadSDigits(opt);
239 Error("PostSDigits","AliLoader::LoadSDigits returned error");
242 return ReadSDigits();
245 //____________________________________________________________________________
246 Int_t AliEMCALLoader::LoadDigits(Option_t* opt)
249 //First call the AliLoader's method to send the TreeS to folder
250 res = AliLoader::LoadDigits(opt);
253 Error("LoadDigits","AliLoader::LoadDigits returned error");
258 //____________________________________________________________________________
259 Int_t AliEMCALLoader::LoadRecPoints(Option_t* opt)
260 { // -------------- RecPoints -------------------------------------------
262 //First call the AliLoader's method to send the TreeR to folder
263 res = AliLoader::LoadRecPoints(opt);
266 Error("LoadRecPoints","AliLoader::LoadRecPoints returned error");
270 TFolder * emcalFolder = GetDetectorDataFolder();
271 if ( emcalFolder == 0x0 )
273 Error("LoadRecPoints","Can not get detector data folder");
276 return ReadRecPoints();
278 //____________________________________________________________________________
280 Int_t AliEMCALLoader::LoadTracks(Option_t* opt)
282 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
283 if (GetDebug()) Info("LoadTracks","opt = %s",opt);
286 Warning("LoadTracks","Tracks are already loaded");
290 //First call the AliLoader's method to send the TreeS to folder
291 if (GetTracksDataLoader()->GetBaseLoader(0)->IsLoaded() == kFALSE)
292 {//tracks can be loaded by LoadRecPoints
293 res = AliLoader::LoadTracks(opt);
296 Error("LoadTracks","AliLoader::LoadTracks returned error");
303 Error("LoadTracks","Error occured while reading Tracks");
307 fTracksLoaded = kTRUE;
311 //____________________________________________________________________________
312 Int_t AliEMCALLoader::LoadRecParticles(Option_t* opt)
313 { // -------------- RecPoints -------------------------------------------
315 //First call the AliLoader's method to send the TreeS to folder
316 res = AliLoader::LoadRecParticles(opt);
319 Error("LoadRecParticles","AliLoader::LoadRecParticles returned error");
323 TFolder * emcalFolder = GetDetectorDataFolder();
324 if ( emcalFolder == 0x0 )
326 Error("PostDigits","Can not get detector data folder");
329 return ReadRecParticles();
332 //____________________________________________________________________________
334 Int_t AliEMCALLoader::PostHits()
336 Int_t reval = AliLoader::PostHits();
339 Error("PostHits","AliLoader:: returned error");
344 //____________________________________________________________________________
346 Int_t AliEMCALLoader::PostSDigits()
348 Int_t reval = AliLoader::PostSDigits();
351 Error("PostSDigits","AliLoader::PostSDigits returned error");
354 return ReadSDigits();
356 //____________________________________________________________________________
358 Int_t AliEMCALLoader::PostDigits()
360 Int_t reval = AliLoader::PostDigits();
363 Error("PostDigits","AliLoader::PostDigits returned error");
368 //____________________________________________________________________________
370 Int_t AliEMCALLoader::PostRecPoints()
372 Int_t reval = AliLoader::PostRecPoints();
375 Error("PostRecPoints","AliLoader::PostRecPoints returned error");
378 return ReadRecPoints();
381 //____________________________________________________________________________
383 Int_t AliEMCALLoader::PostRecParticles()
385 Int_t reval = AliLoader::PostRecParticles();
388 Error("PostRecParticles","AliLoader::PostRecParticles returned error");
391 return ReadRecParticles();
393 //____________________________________________________________________________
395 Int_t AliEMCALLoader::PostTracks()
397 Int_t reval = AliLoader::PostTracks();
400 Error("PostTracks","AliLoader::PostTracks returned error");
405 //____________________________________________________________________________
409 //____________________________________________________________________________
410 Int_t AliEMCALLoader::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 EMCAL 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 Error("ReadHits"," Cannot read TreeH from folder");
434 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
437 Error("ReadHits"," Cannot find branch EMCAL");
441 if (GetDebug()) Info("ReadHits","Reading Hits");
443 if (hitsbranch->GetEntries() > 1)
445 TClonesArray * tempo = new TClonesArray("AliEMCALHit",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 AliEMCALHit* hit = (AliEMCALHit*)tempo->At(j);
457 new((*hits)[index]) AliEMCALHit( *hit ) ;
465 hitsbranch->SetAddress(hitref);
466 hitsbranch->GetEntry(0) ;
471 //____________________________________________________________________________
472 Int_t AliEMCALLoader::ReadSDigits()
474 // Read the summable digits tree TreeS():
475 // Check if TClones is in folder
476 // if not create and add to folder
477 // connect to tree if available
480 TObject** sdref = SDigitsRef();
484 sdref = SDigitsRef();
487 TTree * treeS = TreeS();
490 //May happen if file is truncated or new in LoadSDigits
491 //Error("ReadSDigits","There is no SDigit Tree");
495 TBranch * branch = treeS->GetBranch(fDetectorName);
497 {//easy, maybe just a new tree
498 //Error("ReadSDigits"," Cannot find branch EMCAL");
502 branch->SetAddress(SDigitsRef());
507 //____________________________________________________________________________
508 Int_t AliEMCALLoader::ReadDigits()
510 // Read the summable digits tree TreeS():
511 // Check if TClones is in folder
512 // if not create and add to folder
513 // connect to tree if available
516 TObject** dref = DigitsRef();
518 {//if there is not array in folder, create it and put it there
523 TTree * treeD = TreeD();
526 //May happen if file is truncated or new in LoadSDigits
527 //Error("ReadDigits","There is no Digit Tree");
531 TBranch * branch = treeD->GetBranch(fDetectorName);
533 {//easy, maybe just a new tree
534 //Error("ReadDigits"," Cannot find branch ",fDetectorName.Data());
538 branch->SetAddress(dref);//connect branch to buffer sitting in folder
539 branch->GetEntry(0);//get first event
543 //____________________________________________________________________________
545 void AliEMCALLoader::UnloadRecParticles()
547 fRecParticlesLoaded = kFALSE;
549 if (fTracksLoaded == kFALSE) UnloadTracks();
551 //____________________________________________________________________________
553 void AliEMCALLoader::UnloadTracks()
555 CleanTracks();//free the memory
556 //in case RecPart are loaded we can not onload tree and close the file
557 if (fRecParticlesLoaded == kFALSE) AliLoader::UnloadTracks();
558 fTracksLoaded = kFALSE;//mark that nobody needs them
560 //____________________________________________________________________________
562 void AliEMCALLoader::Track(Int_t itrack)
564 // Read the first entry of EMCAL branch in hit tree gAlice->TreeH()
569 Error("Track","Can not load hits.");
574 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("EMCAL")) ;
577 cout << "WARNING: AliEMCALLoader::ReadTreeH -> Cannot find branch EMCAL" << endl ;
580 if(!Hits()) PostHits();
582 hitsbranch->SetAddress(HitsRef());
583 hitsbranch->GetEntry(itrack);
586 //____________________________________________________________________________
587 void AliEMCALLoader::ReadTreeQA()
589 // Read the digit tree gAlice->TreeQA()
590 // so far only EMCAL knows about this Tree
592 if(EMCAL()->TreeQA()== 0){
593 cerr << "ERROR: AliEMCALLoader::ReadTreeQA: can not read TreeQA " << endl ;
597 TBranch * qabranch = EMCAL()->TreeQA()->GetBranch("EMCAL");
600 cout << "WARNING: AliEMCALLoader::ReadTreeQA -> Cannot find QA Alarms for EMCAL" << endl ;
604 // if(!Alarms()) PostQA();
606 qabranch->SetAddress(AlarmsRef()) ;
608 qabranch->GetEntry(0) ;
613 //____________________________________________________________________________
614 Int_t AliEMCALLoader::ReadRecPoints()
616 //Creates and posts to folder an array container,
617 //connects branch in tree (if exists), and reads data to array
619 MakeRecPointsArray();
621 TObjArray * pre = 0x0 ;
622 TObjArray * eca = 0x0 ;
623 TObjArray * hca = 0x0 ;
625 TTree * treeR = TreeR();
629 //May happen if file is truncated or new in LoadSDigits
634 TBranch * prebranch = treeR->GetBranch(fgkPRERecPointsBranchName);
636 if (prebranch == 0x0)
638 Error("ReadRecPoints","Can not get branch with PRE Rec. Points named %s",fgkPRERecPointsBranchName.Data());
643 prebranch->SetAddress(&pre) ;
644 prebranch->GetEntry(0) ;
646 TBranch * ecabranch = treeR->GetBranch(fgkECARecPointsBranchName);
647 if (ecabranch == 0x0)
649 Error("ReadRecPoints","Can not get branch with ECA Rec. Points named %s",fgkECARecPointsBranchName.Data());
654 ecabranch->SetAddress(&eca);
655 ecabranch->GetEntry(0) ;
657 TBranch * hcabranch = treeR->GetBranch(fgkHCARecPointsBranchName);
658 if (hcabranch == 0x0)
660 Error("ReadRecPoints","Can not get branch with HCA Rec. Points named %s",fgkHCARecPointsBranchName.Data());
665 hcabranch->SetAddress(&hca);
666 hcabranch->GetEntry(0) ;
670 Int_t maxpre = pre->GetEntries() ;
671 for ( ii= 0 ; ii < maxpre ; ii++ )
672 PRERecPoints()->Add(pre->At(ii)) ;
674 Int_t maxeca = eca->GetEntries() ;
675 for ( ii= 0 ; ii < maxeca ; ii++ )
676 ECARecPoints()->Add(eca->At(ii)) ;
678 Int_t maxhca = hca->GetEntries() ;
679 for ( ii= 0 ; ii < maxhca ; ii++ )
680 HCARecPoints()->Add(hca->At(ii)) ;
685 //____________________________________________________________________________
686 Int_t AliEMCALLoader::ReadTracks()
688 //Creates and posts to folder an array container,
689 //connects branch in tree (if exists), and reads data to arry
691 TObject** trkref = TracksRef();
693 {//Create and post array
694 MakeTrackSegmentsArray();
695 trkref = TracksRef();
698 TTree * treeT = TreeT();
701 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
702 //but tracking was not performed yet for a current event
703 //Error("ReadTracks","There is no Tree with Tracks");
707 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
709 {//easy, maybe just a new tree
710 Error("ReadTracks"," Cannot find branch named %s",fgkTrackSegmentsBranchName.Data());
714 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
715 branch->GetEntry(0);//get first event
719 //____________________________________________________________________________
721 Int_t AliEMCALLoader::ReadRecParticles()
723 //Reads Reconstructed Particles from file
724 //Creates and posts to folder an array container,
725 //connects branch in tree (if exists), and reads data to arry
727 TObject** recpartref = RecParticlesRef();
729 if ( recpartref == 0x0 )
730 {//Create and post array
731 MakeRecParticlesArray();
732 recpartref = RecParticlesRef();
735 TTree * treeP = TreeP();
738 //May happen if file is truncated or new in LoadSDigits,
739 //or the file is in update mode,
740 //but tracking was not performed yet for a current event
741 // Error("ReadRecParticles","There is no Tree with Tracks and Reconstructed Particles");
745 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
747 {//easy, maybe just a new tree
748 Error("ReadRecParticles"," Cannot find branch %s",fgkRecParticlesBranchName.Data());
752 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
753 branch->GetEntry(0);//get first event
759 AliEMCALGeometry* AliEMCALLoader::GetEMCALGeometry()
761 //returns EMCAL geometry from gAlice
762 //static Method used by some classes where it is not convienient to pass eventfoldername
765 AliEMCAL* emcal=dynamic_cast<AliEMCAL*>(gAlice->GetDetector("EMCAL"));
768 return emcal->GetGeometry();
770 /***************************************************************************************/
772 AliEMCALLoader* AliEMCALLoader::GetEMCALLoader(const char* eventfoldername)
774 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
777 cerr<<"Error: <AliEMCALLoader::GetEMCALLoader>: "
778 << "Can not find Run Loader in folder "<<eventfoldername<<endl;
781 return dynamic_cast<AliEMCALLoader*>(rn->GetLoader("EMCALLoader"));
783 /***************************************************************************************/
785 Bool_t AliEMCALLoader::BranchExists(const TString& recName)
787 if (fBranchTitle.IsNull()) return kFALSE;
788 TString dataname, zername ;
790 if(recName == "SDigits") {
792 dataname = GetDetectorName();
793 zername = "AliEMCALSDigitizer" ;
795 else if(recName == "Digits"){
797 dataname = GetDetectorName();
798 zername = "AliEMCALDigitizer" ;
800 else if(recName == "PRERecPoints"){
802 dataname = fgkPRERecPointsBranchName;
803 zername = "AliEMCALClusterizer" ;
805 else if(recName == "ECARecPoints"){
807 dataname = fgkECARecPointsBranchName;
808 zername = "AliEMCALClusterizer" ;
810 else if(recName == "HCARecPoints"){
812 dataname = fgkHCARecPointsBranchName;
813 zername = "AliEMCALClusterizer" ;
815 else if(recName == "TrackSegments"){
817 dataname = fgkTrackSegmentsBranchName;
818 zername = "AliEMCALTrackSegmentMaker";
820 else if(recName == "RecParticles"){
822 dataname = fgkRecParticlesBranchName;
823 zername = "AliEMCALPID";
832 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
834 TBranch * branch = 0 ;
835 TString titleName(fBranchTitle);
838 while ((branch = (static_cast<TBranch*>(next())))) {
839 TString branchName(branch->GetName() ) ;
840 TString branchTitle(branch->GetTitle() ) ;
841 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
842 Warning("BranchExists","branch %s with title %s ",dataname.Data(),fBranchTitle.Data());
845 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
846 Warning("BranchExists","branch AliEMCAL... with title %s ",branch->GetTitle());
854 void AliEMCALLoader::SetBranchTitle(const TString& btitle)
856 if (btitle.CompareTo(fBranchTitle) == 0) return;
857 fBranchTitle = btitle;
860 //____________________________________________________________________________
862 void AliEMCALLoader::CleanHits()
864 AliLoader::CleanHits();
866 TClonesArray* hits = Hits();
867 if (hits) hits->Clear();
869 //____________________________________________________________________________
871 void AliEMCALLoader::CleanSDigits()
873 AliLoader::CleanSDigits();
874 TClonesArray* sdigits = SDigits();
875 if (sdigits) sdigits->Clear();
878 //____________________________________________________________________________
880 void AliEMCALLoader::CleanDigits()
882 AliLoader::CleanDigits();
883 TClonesArray* digits = Digits();
884 if (digits) digits->Clear();
886 //____________________________________________________________________________
888 void AliEMCALLoader::CleanRecPoints()
890 AliLoader::CleanRecPoints();
891 TObjArray* recpoints = PRERecPoints();
892 if (recpoints) recpoints->Clear();
893 recpoints = ECARecPoints();
894 if (recpoints) recpoints->Clear();
895 recpoints = HCARecPoints();
896 if (recpoints) recpoints->Clear();
898 //____________________________________________________________________________
900 void AliEMCALLoader::CleanTracks()
902 //Cleans Tracks stuff
904 AliLoader::CleanTracks();//tree
906 //and clear the array
907 TClonesArray* tracks = TrackSegments();
908 if (tracks) tracks->Clear();
911 //____________________________________________________________________________
913 void AliEMCALLoader::CleanRecParticles()
916 TClonesArray *recpar = RecParticles();
917 if (recpar) recpar->Clear();
921 //____________________________________________________________________________
923 // void AliEMCALLoader::ReadCalibrationDB(const char * database,const char * filename)
926 // if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
929 // TFile * file = gROOT->GetFile(filename) ;
931 // file = TFile::Open(filename);
933 // Error ("ReadCalibrationDB", "Cannot open file %s", filename) ;
938 // fcdb = dynamic_cast<AliEMCALCalibrationDB *>(file->Get("AliEMCALCalibrationDB")) ;
940 // Error ("ReadCalibrationDB", "No database %s in file %s", database, filename) ;
942 //____________________________________________________________________________
944 // AliEMCALSDigitizer* AliEMCALLoader::EMCALSDigitizer()
946 // //return EMCAL SDigitizer
947 // return dynamic_cast<AliEMCALSDigitizer*>(SDigitizer()) ;
950 //____________________________________________________________________________
951 void AliEMCALLoader::MakeHitsArray()
954 TClonesArray* hits = new TClonesArray("AliEMCALHit",1000);
955 hits->SetName(fgkHitsName);
956 GetDetectorDataFolder()->Add(hits);
959 //____________________________________________________________________________
960 void AliEMCALLoader::MakeSDigitsArray()
962 if ( SDigits()) return;
963 TClonesArray* sdigits = new TClonesArray("AliEMCALDigit",1);
964 sdigits->SetName(fgkSDigitsName);
965 GetDetectorDataFolder()->Add(sdigits);
968 //____________________________________________________________________________
969 void AliEMCALLoader::MakeDigitsArray()
971 if ( Digits()) return;
972 TClonesArray* digits = new TClonesArray("AliEMCALDigit",1);
973 digits->SetName(fgkDigitsName);
974 GetDetectorDataFolder()->Add(digits);
978 //____________________________________________________________________________
979 void AliEMCALLoader::MakeRecPointsArray()
981 if ( PRERecPoints() == 0x0) {
983 Info("MakeRecPointsArray","Making array for PRE");
984 TObjArray* pre = new TObjArray(100) ;
985 pre->SetName(fgkPRERecPointsName) ;
986 GetDetectorDataFolder()->Add(pre);
988 if ( ECARecPoints() == 0x0) {
990 Info("MakeRecPointsArray","Making array for ECA");
991 TObjArray* eca = new TObjArray(100) ;
992 eca->SetName(fgkECARecPointsName) ;
993 GetDetectorDataFolder()->Add(eca);
995 if ( HCARecPoints() == 0x0) {
997 Info("MakeRecPointsArray","Making array for HCA");
998 TObjArray* hca = new TObjArray(100) ;
999 hca->SetName(fgkHCARecPointsName) ;
1000 GetDetectorDataFolder()->Add(hca);
1004 //____________________________________________________________________________
1005 void AliEMCALLoader::MakeTrackSegmentsArray()
1007 if ( TrackSegments()) return;
1008 TClonesArray * ts = new TClonesArray("AliEMCALTrackSegment",100) ;
1009 ts->SetName(fgkTracksName);
1010 GetDetectorDataFolder()->Add(ts);
1014 //____________________________________________________________________________
1015 void AliEMCALLoader::MakeRecParticlesArray()
1017 if ( RecParticles()) return;
1018 TClonesArray * rp = new TClonesArray("AliEMCALRecParticle",100) ;
1019 rp->SetName(fgkRecParticlesName);
1020 GetDetectorDataFolder()->Add(rp);