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 //_________________________________________________________________________
19 // A singleton. This class should be used in the analysis stage to get
20 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
21 // instead of directly reading them from galice.root file. This container
22 // ensures, that one reads Digits, made of these particular digits, RecPoints,
23 // made of these particular RecPoints, TrackSegments and RecParticles.
24 // This becomes non trivial if there are several identical branches, produced with
25 // different set of parameters.
27 // An example of how to use (see also class AliEMCALAnalyser):
28 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
29 // AliEMCALRecParticle * part = gime->RecParticle(1) ;
31 // please->GetEvent(event) ; // reads new event from galice.root
33 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
34 //*-- Completely redesigned by Dmitri Peressounko March 2001
36 //*-- YS June 2001 : renamed the original AliEMCALIndexToObject and make
37 //*-- systematic usage of TFolders without changing the interface
38 //////////////////////////////////////////////////////////////////////////////
41 // --- ROOT system ---
46 #include "TObjString.h"
48 #include "TParticle.h"
50 // --- Standard library ---
51 #include <Riostream.h>
53 // --- AliRoot header files ---
56 #include "AliConfig.h"
57 #include "AliDataLoader.h"
58 #include "AliEMCALLoader.h"
60 #include "AliEMCALDigitizer.h"
61 #include "AliEMCALSDigitizer.h"
62 #include "AliEMCALClusterizer.h"
63 #include "AliEMCALClusterizerv1.h"
64 #include "AliEMCALTrackSegmentMaker.h"
65 #include "AliEMCALTrackSegmentMakerv1.h"
66 #include "AliEMCALTrackSegment.h"
67 #include "AliEMCALPID.h"
68 #include "AliEMCALPIDv1.h"
69 #include "AliEMCALGeometry.h"
70 //#include "AliEMCALCalibrationDB.h"
72 ClassImp(AliEMCALLoader)
75 const TString AliEMCALLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
76 const TString AliEMCALLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
77 const TString AliEMCALLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
78 const TString AliEMCALLoader::fgkPRERecPointsName("PRERECPOINTS");//Name for TClonesArray
79 const TString AliEMCALLoader::fgkECARecPointsName("ECARECPOINTS");//Name for TClonesArray
80 const TString AliEMCALLoader::fgkHCARecPointsName("HCARECPOINTS");//Name for TClonesArray
81 const TString AliEMCALLoader::fgkTracksName("TRACKS");//Name for TClonesArray
82 const TString AliEMCALLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
84 const TString AliEMCALLoader::fgkPRERecPointsBranchName("EMCALPRERP");//Name for branch with PreShower Reconstructed Points
85 const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
86 const TString AliEMCALLoader::fgkHCARecPointsBranchName("EMCALHCARP");//Name for branch with HCA Reconstructed Points
87 const TString AliEMCALLoader::fgkTrackSegmentsBranchName("EMCALTS");//Name for branch with TrackSegments
88 const TString AliEMCALLoader::fgkRecParticlesBranchName("EMCALRP");//Name for branch with Reconstructed Particles
89 //____________________________________________________________________________
90 AliEMCALLoader::AliEMCALLoader()
93 fRecParticlesLoaded = kFALSE;
95 //____________________________________________________________________________
96 AliEMCALLoader::AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername):
97 AliLoader(detname,eventfoldername)
100 fRecParticlesLoaded = kFALSE;
102 //____________________________________________________________________________
104 AliEMCALLoader::~AliEMCALLoader()
106 //remove and delete arrays
108 Clean(fgkSDigitsName);
109 Clean(fgkDigitsName);
110 Clean(fgkPRERecPointsName);
111 Clean(fgkECARecPointsName);
112 Clean(fgkHCARecPointsName);
113 Clean(fgkTracksName);
114 Clean(fgkRecParticlesName);
116 //____________________________________________________________________________
118 void AliEMCALLoader::CleanFolders()
121 AliLoader::CleanFolders();
123 //____________________________________________________________________________
125 Int_t AliEMCALLoader::SetEvent()
127 //Cleans loaded stuff and and sets Files and Directories
128 // do not post any data to folder/tasks
131 Int_t retval = AliLoader::SetEvent();
134 Error("SetEvent","AliLoader::SetEvent returned error");
139 if (Hits()) Hits()->Clear();
140 if (SDigits()) SDigits()->Clear();
141 if (Digits()) Digits()->Clear();
142 if (PRERecPoints()) PRERecPoints()->Clear();
143 if (ECARecPoints()) ECARecPoints()->Clear();
144 if (HCARecPoints()) HCARecPoints()->Clear();
145 if (TrackSegments()) TrackSegments()->Clear();
146 if (RecParticles()) RecParticles()->Clear();
150 //____________________________________________________________________________
152 Int_t AliEMCALLoader::GetEvent()
154 //Overloads GetEvent method called by AliRunLoader::GetEvent(Int_t) method
155 //to add Rec Particles specific for EMCAL
157 //First call the original method to get whatever from std. setup is needed
160 retval = AliLoader::GetEvent();
163 Error("GetEvent","AliLoader::GetEvent returned error");
167 if (GetHitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadHits();
168 if (GetSDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadSDigits();
169 if (GetDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadDigits();
170 if (GetRecPointsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecPoints();
171 if (GetTracksDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadTracks();
172 if (GetRecParticlesDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecParticles();
175 //Now, check if RecPart were loaded
178 //____________________________________________________________________________
181 //____________________________________________________________________________
182 const AliEMCAL * AliEMCALLoader::EMCAL()
184 // returns the EMCAL object
185 AliEMCAL * emcal = dynamic_cast<AliEMCAL*>(GetModulesFolder()->FindObject(fDetectorName));
188 cout << "WARNING: AliEMCALLoader::EMCAL -> EMCAL module not found in Folders" << endl ;
192 //____________________________________________________________________________
193 const AliEMCALGeometry * AliEMCALLoader::EMCALGeometry()
195 AliEMCALGeometry * rv = 0 ;
197 rv = EMCAL()->GetGeometry();
202 //____________________________________________________________________________
203 Int_t AliEMCALLoader::LoadHits(Option_t* opt)
205 //------- Hits ----------------------
206 //Overload (extends) LoadHits implemented in AliLoader
210 //First call the AliLoader's method to send the TreeH to folder
211 res = AliLoader::LoadHits(opt);
215 Error("LoadHits","AliLoader::LoadHits returned error");
219 //read the data from tree in folder and send it to folder
225 //____________________________________________________________________________
226 Int_t AliEMCALLoader::LoadSDigits(Option_t* opt)
227 { //---------- SDigits -------------------------
229 //First call the AliLoader's method to send the TreeS to folder
230 res = AliLoader::LoadSDigits(opt);
233 Error("PostSDigits","AliLoader::LoadSDigits returned error");
236 return ReadSDigits();
239 //____________________________________________________________________________
240 Int_t AliEMCALLoader::LoadDigits(Option_t* opt)
243 //First call the AliLoader's method to send the TreeS to folder
244 res = AliLoader::LoadDigits(opt);
247 Error("LoadDigits","AliLoader::LoadDigits returned error");
252 //____________________________________________________________________________
253 Int_t AliEMCALLoader::LoadRecPoints(Option_t* opt)
254 { // -------------- RecPoints -------------------------------------------
256 //First call the AliLoader's method to send the TreeR to folder
257 res = AliLoader::LoadRecPoints(opt);
260 Error("LoadRecPoints","AliLoader::LoadRecPoints returned error");
264 TFolder * emcalFolder = GetDetectorDataFolder();
265 if ( emcalFolder == 0x0 )
267 Error("LoadRecPoints","Can not get detector data folder");
270 return ReadRecPoints();
272 //____________________________________________________________________________
274 Int_t AliEMCALLoader::LoadTracks(Option_t* opt)
276 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
277 if (GetDebug()) Info("LoadTracks","opt = %s",opt);
280 Warning("LoadTracks","Tracks are already loaded");
284 //First call the AliLoader's method to send the TreeS to folder
285 if (GetTracksDataLoader()->GetBaseLoader(0)->IsLoaded() == kFALSE)
286 {//tracks can be loaded by LoadRecPoints
287 res = AliLoader::LoadTracks(opt);
290 Error("LoadTracks","AliLoader::LoadTracks returned error");
297 Error("LoadTracks","Error occured while reading Tracks");
301 fTracksLoaded = kTRUE;
305 //____________________________________________________________________________
306 Int_t AliEMCALLoader::LoadRecParticles(Option_t* opt)
307 { // -------------- RecPoints -------------------------------------------
309 //First call the AliLoader's method to send the TreeS to folder
310 res = AliLoader::LoadRecParticles(opt);
313 Error("LoadRecParticles","AliLoader::LoadRecParticles returned error");
317 TFolder * emcalFolder = GetDetectorDataFolder();
318 if ( emcalFolder == 0x0 )
320 Error("PostDigits","Can not get detector data folder");
323 return ReadRecParticles();
326 //____________________________________________________________________________
328 Int_t AliEMCALLoader::PostHits()
330 Int_t reval = AliLoader::PostHits();
333 Error("PostHits","AliLoader:: returned error");
338 //____________________________________________________________________________
340 Int_t AliEMCALLoader::PostSDigits()
342 Int_t reval = AliLoader::PostSDigits();
345 Error("PostSDigits","AliLoader::PostSDigits returned error");
348 return ReadSDigits();
350 //____________________________________________________________________________
352 Int_t AliEMCALLoader::PostDigits()
354 Int_t reval = AliLoader::PostDigits();
357 Error("PostDigits","AliLoader::PostDigits returned error");
362 //____________________________________________________________________________
364 Int_t AliEMCALLoader::PostRecPoints()
366 Int_t reval = AliLoader::PostRecPoints();
369 Error("PostRecPoints","AliLoader::PostRecPoints returned error");
372 return ReadRecPoints();
375 //____________________________________________________________________________
377 Int_t AliEMCALLoader::PostRecParticles()
379 Int_t reval = AliLoader::PostRecParticles();
382 Error("PostRecParticles","AliLoader::PostRecParticles returned error");
385 return ReadRecParticles();
387 //____________________________________________________________________________
389 Int_t AliEMCALLoader::PostTracks()
391 Int_t reval = AliLoader::PostTracks();
394 Error("PostTracks","AliLoader::PostTracks returned error");
399 //____________________________________________________________________________
403 //____________________________________________________________________________
404 Int_t AliEMCALLoader::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 EMCAL 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 Error("ReadHits"," Cannot read TreeH from folder");
428 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
431 Error("ReadHits"," Cannot find branch EMCAL");
435 if (GetDebug()) Info("ReadHits","Reading Hits");
437 if (hitsbranch->GetEntries() > 1)
439 TClonesArray * tempo = new TClonesArray("AliEMCALHit",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 AliEMCALHit* hit = (AliEMCALHit*)tempo->At(j);
451 new((*hits)[index]) AliEMCALHit( *hit ) ;
459 hitsbranch->SetAddress(hitref);
460 hitsbranch->GetEntry(0) ;
465 //____________________________________________________________________________
466 Int_t AliEMCALLoader::ReadSDigits()
468 // Read the summable digits tree TreeS():
469 // Check if TClones is in folder
470 // if not create and add to folder
471 // connect to tree if available
474 TObject** sdref = SDigitsRef();
478 sdref = SDigitsRef();
481 TTree * treeS = TreeS();
484 //May happen if file is truncated or new in LoadSDigits
485 //Error("ReadSDigits","There is no SDigit Tree");
489 TBranch * branch = treeS->GetBranch(fDetectorName);
491 {//easy, maybe just a new tree
492 //Error("ReadSDigits"," Cannot find branch EMCAL");
496 branch->SetAddress(SDigitsRef());
501 //____________________________________________________________________________
502 Int_t AliEMCALLoader::ReadDigits()
504 // Read the summable digits tree TreeS():
505 // Check if TClones is in folder
506 // if not create and add to folder
507 // connect to tree if available
510 TObject** dref = DigitsRef();
512 {//if there is not array in folder, create it and put it there
517 TTree * treeD = TreeD();
520 //May happen if file is truncated or new in LoadSDigits
521 //Error("ReadDigits","There is no Digit Tree");
525 TBranch * branch = treeD->GetBranch(fDetectorName);
527 {//easy, maybe just a new tree
528 //Error("ReadDigits"," Cannot find branch ",fDetectorName.Data());
532 branch->SetAddress(dref);//connect branch to buffer sitting in folder
533 branch->GetEntry(0);//get first event
537 //____________________________________________________________________________
539 void AliEMCALLoader::UnloadRecParticles()
541 fRecParticlesLoaded = kFALSE;
543 if (fTracksLoaded == kFALSE) UnloadTracks();
545 //____________________________________________________________________________
547 void AliEMCALLoader::UnloadTracks()
549 CleanTracks();//free the memory
550 //in case RecPart are loaded we can not onload tree and close the file
551 if (fRecParticlesLoaded == kFALSE) AliLoader::UnloadTracks();
552 fTracksLoaded = kFALSE;//mark that nobody needs them
554 //____________________________________________________________________________
556 void AliEMCALLoader::Track(Int_t itrack)
558 // Read the first entry of EMCAL branch in hit tree gAlice->TreeH()
563 Error("Track","Can not load hits.");
568 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("EMCAL")) ;
571 cout << "WARNING: AliEMCALLoader::ReadTreeH -> Cannot find branch EMCAL" << endl ;
574 if(!Hits()) PostHits();
576 hitsbranch->SetAddress(HitsRef());
577 hitsbranch->GetEntry(itrack);
580 //____________________________________________________________________________
581 void AliEMCALLoader::ReadTreeQA()
583 // Read the digit tree gAlice->TreeQA()
584 // so far only EMCAL knows about this Tree
586 if(EMCAL()->TreeQA()== 0){
587 cerr << "ERROR: AliEMCALLoader::ReadTreeQA: can not read TreeQA " << endl ;
591 TBranch * qabranch = EMCAL()->TreeQA()->GetBranch("EMCAL");
594 cout << "WARNING: AliEMCALLoader::ReadTreeQA -> Cannot find QA Alarms for EMCAL" << endl ;
598 // if(!Alarms()) PostQA();
600 qabranch->SetAddress(AlarmsRef()) ;
602 qabranch->GetEntry(0) ;
607 //____________________________________________________________________________
608 Int_t AliEMCALLoader::ReadRecPoints()
610 //Creates and posts to folder an array container,
611 //connects branch in tree (if exists), and reads data to array
613 MakeRecPointsArray();
615 TObjArray * pre = 0x0 ;
616 TObjArray * eca = 0x0 ;
617 TObjArray * hca = 0x0 ;
619 TTree * treeR = TreeR();
623 //May happen if file is truncated or new in LoadSDigits
628 TBranch * prebranch = treeR->GetBranch(fgkPRERecPointsBranchName);
630 if (prebranch == 0x0)
632 Error("ReadRecPoints","Can not get branch with PRE Rec. Points named %s",fgkPRERecPointsBranchName.Data());
637 prebranch->SetAddress(&pre) ;
638 prebranch->GetEntry(0) ;
640 TBranch * ecabranch = treeR->GetBranch(fgkECARecPointsBranchName);
641 if (ecabranch == 0x0)
643 Error("ReadRecPoints","Can not get branch with ECA Rec. Points named %s",fgkECARecPointsBranchName.Data());
648 ecabranch->SetAddress(&eca);
649 ecabranch->GetEntry(0) ;
651 TBranch * hcabranch = treeR->GetBranch(fgkHCARecPointsBranchName);
652 if (hcabranch == 0x0)
654 Error("ReadRecPoints","Can not get branch with HCA Rec. Points named %s",fgkHCARecPointsBranchName.Data());
659 hcabranch->SetAddress(&hca);
660 hcabranch->GetEntry(0) ;
664 Int_t maxpre = pre->GetEntries() ;
665 for ( ii= 0 ; ii < maxpre ; ii++ )
666 PRERecPoints()->Add(pre->At(ii)) ;
668 Int_t maxeca = eca->GetEntries() ;
669 for ( ii= 0 ; ii < maxeca ; ii++ )
670 ECARecPoints()->Add(eca->At(ii)) ;
672 Int_t maxhca = hca->GetEntries() ;
673 for ( ii= 0 ; ii < maxhca ; ii++ )
674 HCARecPoints()->Add(hca->At(ii)) ;
679 //____________________________________________________________________________
680 Int_t AliEMCALLoader::ReadTracks()
682 //Creates and posts to folder an array container,
683 //connects branch in tree (if exists), and reads data to arry
685 TObject** trkref = TracksRef();
687 {//Create and post array
688 MakeTrackSegmentsArray();
689 trkref = TracksRef();
692 TTree * treeT = TreeT();
695 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
696 //but tracking was not performed yet for a current event
697 //Error("ReadTracks","There is no Tree with Tracks");
701 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
703 {//easy, maybe just a new tree
704 Error("ReadTracks"," Cannot find branch named %s",fgkTrackSegmentsBranchName.Data());
708 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
709 branch->GetEntry(0);//get first event
713 //____________________________________________________________________________
715 Int_t AliEMCALLoader::ReadRecParticles()
717 //Reads Reconstructed Particles from file
718 //Creates and posts to folder an array container,
719 //connects branch in tree (if exists), and reads data to arry
721 TObject** recpartref = RecParticlesRef();
723 if ( recpartref == 0x0 )
724 {//Create and post array
725 MakeRecParticlesArray();
726 recpartref = RecParticlesRef();
729 TTree * treeP = TreeP();
732 //May happen if file is truncated or new in LoadSDigits,
733 //or the file is in update mode,
734 //but tracking was not performed yet for a current event
735 // Error("ReadRecParticles","There is no Tree with Tracks and Reconstructed Particles");
739 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
741 {//easy, maybe just a new tree
742 Error("ReadRecParticles"," Cannot find branch %s",fgkRecParticlesBranchName.Data());
746 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
747 branch->GetEntry(0);//get first event
753 AliEMCALGeometry* AliEMCALLoader::GetEMCALGeometry()
755 //returns EMCAL geometry from gAlice
756 //static Method used by some classes where it is not convienient to pass eventfoldername
759 AliEMCAL* emcal=dynamic_cast<AliEMCAL*>(gAlice->GetDetector("EMCAL"));
762 return emcal->GetGeometry();
764 /***************************************************************************************/
766 AliEMCALLoader* AliEMCALLoader::GetEMCALLoader(const char* eventfoldername)
768 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
771 cerr<<"Error: <AliEMCALLoader::GetEMCALLoader>: "
772 << "Can not find Run Loader in folder "<<eventfoldername<<endl;
775 return dynamic_cast<AliEMCALLoader*>(rn->GetLoader("EMCALLoader"));
777 /***************************************************************************************/
779 Bool_t AliEMCALLoader::BranchExists(const TString& recName)
781 if (fBranchTitle.IsNull()) return kFALSE;
782 TString dataname, zername ;
784 if(recName == "SDigits") {
786 dataname = GetDetectorName();
787 zername = "AliEMCALSDigitizer" ;
789 else if(recName == "Digits"){
791 dataname = GetDetectorName();
792 zername = "AliEMCALDigitizer" ;
794 else if(recName == "PRERecPoints"){
796 dataname = fgkPRERecPointsBranchName;
797 zername = "AliEMCALClusterizer" ;
799 else if(recName == "ECARecPoints"){
801 dataname = fgkECARecPointsBranchName;
802 zername = "AliEMCALClusterizer" ;
804 else if(recName == "HCARecPoints"){
806 dataname = fgkHCARecPointsBranchName;
807 zername = "AliEMCALClusterizer" ;
809 else if(recName == "TrackSegments"){
811 dataname = fgkTrackSegmentsBranchName;
812 zername = "AliEMCALTrackSegmentMaker";
814 else if(recName == "RecParticles"){
816 dataname = fgkRecParticlesBranchName;
817 zername = "AliEMCALPID";
826 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
828 TBranch * branch = 0 ;
829 TString titleName(fBranchTitle);
832 while ((branch = (static_cast<TBranch*>(next())))) {
833 TString branchName(branch->GetName() ) ;
834 TString branchTitle(branch->GetTitle() ) ;
835 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
836 Warning("BranchExists","branch %s with title %s ",dataname.Data(),fBranchTitle.Data());
839 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
840 Warning("BranchExists","branch AliEMCAL... with title %s ",branch->GetTitle());
848 void AliEMCALLoader::SetBranchTitle(const TString& btitle)
850 if (btitle.CompareTo(fBranchTitle) == 0) return;
851 fBranchTitle = btitle;
854 //____________________________________________________________________________
856 void AliEMCALLoader::CleanHits()
858 AliLoader::CleanHits();
860 TClonesArray* hits = Hits();
861 if (hits) hits->Clear();
863 //____________________________________________________________________________
865 void AliEMCALLoader::CleanSDigits()
867 AliLoader::CleanSDigits();
868 TClonesArray* sdigits = SDigits();
869 if (sdigits) sdigits->Clear();
872 //____________________________________________________________________________
874 void AliEMCALLoader::CleanDigits()
876 AliLoader::CleanDigits();
877 TClonesArray* digits = Digits();
878 if (digits) digits->Clear();
880 //____________________________________________________________________________
882 void AliEMCALLoader::CleanRecPoints()
884 AliLoader::CleanRecPoints();
885 TObjArray* recpoints = PRERecPoints();
886 if (recpoints) recpoints->Clear();
887 recpoints = ECARecPoints();
888 if (recpoints) recpoints->Clear();
889 recpoints = HCARecPoints();
890 if (recpoints) recpoints->Clear();
892 //____________________________________________________________________________
894 void AliEMCALLoader::CleanTracks()
896 //Cleans Tracks stuff
898 AliLoader::CleanTracks();//tree
900 //and clear the array
901 TClonesArray* tracks = TrackSegments();
902 if (tracks) tracks->Clear();
905 //____________________________________________________________________________
907 void AliEMCALLoader::CleanRecParticles()
910 TClonesArray *recpar = RecParticles();
911 if (recpar) recpar->Clear();
915 //____________________________________________________________________________
917 // void AliEMCALLoader::ReadCalibrationDB(const char * database,const char * filename)
920 // if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
923 // TFile * file = gROOT->GetFile(filename) ;
925 // file = TFile::Open(filename);
927 // Error ("ReadCalibrationDB", "Cannot open file %s", filename) ;
932 // fcdb = dynamic_cast<AliEMCALCalibrationDB *>(file->Get("AliEMCALCalibrationDB")) ;
934 // Error ("ReadCalibrationDB", "No database %s in file %s", database, filename) ;
936 //____________________________________________________________________________
938 // AliEMCALSDigitizer* AliEMCALLoader::EMCALSDigitizer()
940 // //return EMCAL SDigitizer
941 // return dynamic_cast<AliEMCALSDigitizer*>(SDigitizer()) ;
944 //____________________________________________________________________________
945 void AliEMCALLoader::MakeHitsArray()
948 TClonesArray* hits = new TClonesArray("AliEMCALHit",1000);
949 hits->SetName(fgkHitsName);
950 GetDetectorDataFolder()->Add(hits);
953 //____________________________________________________________________________
954 void AliEMCALLoader::MakeSDigitsArray()
956 if ( SDigits()) return;
957 TClonesArray* sdigits = new TClonesArray("AliEMCALDigit",1);
958 sdigits->SetName(fgkSDigitsName);
959 GetDetectorDataFolder()->Add(sdigits);
962 //____________________________________________________________________________
963 void AliEMCALLoader::MakeDigitsArray()
965 if ( Digits()) return;
966 TClonesArray* digits = new TClonesArray("AliEMCALDigit",1);
967 digits->SetName(fgkDigitsName);
968 GetDetectorDataFolder()->Add(digits);
972 //____________________________________________________________________________
973 void AliEMCALLoader::MakeRecPointsArray()
975 if ( PRERecPoints() == 0x0) {
977 Info("MakeRecPointsArray","Making array for PRE");
978 TObjArray* pre = new TObjArray(100) ;
979 pre->SetName(fgkPRERecPointsName) ;
980 GetDetectorDataFolder()->Add(pre);
982 if ( ECARecPoints() == 0x0) {
984 Info("MakeRecPointsArray","Making array for ECA");
985 TObjArray* eca = new TObjArray(100) ;
986 eca->SetName(fgkECARecPointsName) ;
987 GetDetectorDataFolder()->Add(eca);
989 if ( HCARecPoints() == 0x0) {
991 Info("MakeRecPointsArray","Making array for HCA");
992 TObjArray* hca = new TObjArray(100) ;
993 hca->SetName(fgkHCARecPointsName) ;
994 GetDetectorDataFolder()->Add(hca);
998 //____________________________________________________________________________
999 void AliEMCALLoader::MakeTrackSegmentsArray()
1001 if ( TrackSegments()) return;
1002 TClonesArray * ts = new TClonesArray("AliEMCALTrackSegment",100) ;
1003 ts->SetName(fgkTracksName);
1004 GetDetectorDataFolder()->Add(ts);
1008 //____________________________________________________________________________
1009 void AliEMCALLoader::MakeRecParticlesArray()
1011 if ( RecParticles()) return;
1012 TClonesArray * rp = new TClonesArray("AliEMCALRecParticle",100) ;
1013 rp->SetName(fgkRecParticlesName);
1014 GetDetectorDataFolder()->Add(rp);