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 ---
45 // --- Standard library ---
47 // --- AliRoot header files ---
49 #include "AliEMCALLoader.h"
51 #include "AliEMCALHit.h"
53 ClassImp(AliEMCALLoader)
56 const TString AliEMCALLoader::fgkHitsName("HITS");//Name for TClonesArray with hits from one event
57 const TString AliEMCALLoader::fgkSDigitsName("SDIGITS");//Name for TClonesArray
58 const TString AliEMCALLoader::fgkDigitsName("DIGITS");//Name for TClonesArray
59 const TString AliEMCALLoader::fgkPRERecPointsName("PRERECPOINTS");//Name for TClonesArray
60 const TString AliEMCALLoader::fgkECARecPointsName("ECARECPOINTS");//Name for TClonesArray
61 const TString AliEMCALLoader::fgkHCARecPointsName("HCARECPOINTS");//Name for TClonesArray
62 const TString AliEMCALLoader::fgkTracksName("TRACKS");//Name for TClonesArray
63 const TString AliEMCALLoader::fgkRecParticlesName("RECPARTICLES");//Name for TClonesArray
65 const TString AliEMCALLoader::fgkPRERecPointsBranchName("EMCALPRERP");//Name for branch with PreShower Reconstructed Points
66 const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
67 const TString AliEMCALLoader::fgkHCARecPointsBranchName("EMCALHCARP");//Name for branch with HCA Reconstructed Points
68 const TString AliEMCALLoader::fgkTrackSegmentsBranchName("EMCALTS");//Name for branch with TrackSegments
69 const TString AliEMCALLoader::fgkRecParticlesBranchName("EMCALRP");//Name for branch with Reconstructed Particles
71 //____________________________________________________________________________
72 AliEMCALLoader::AliEMCALLoader()
75 fRecParticlesLoaded = kFALSE;
78 //____________________________________________________________________________
79 AliEMCALLoader::AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername):
80 AliLoader(detname,eventfoldername)
83 fRecParticlesLoaded = kFALSE;
86 //____________________________________________________________________________
87 AliEMCALLoader::~AliEMCALLoader()
89 //remove and delete arrays
91 Clean(fgkSDigitsName);
93 Clean(fgkPRERecPointsName);
94 Clean(fgkECARecPointsName);
95 Clean(fgkHCARecPointsName);
97 Clean(fgkRecParticlesName);
100 //____________________________________________________________________________
101 void AliEMCALLoader::CleanFolders()
104 AliLoader::CleanFolders();
107 //____________________________________________________________________________
108 Int_t AliEMCALLoader::SetEvent()
110 //Cleans loaded stuff and and sets Files and Directories
111 // do not post any data to folder/tasks
114 Int_t retval = AliLoader::SetEvent();
117 Error("SetEvent","AliLoader::SetEvent returned error");
122 if (Hits()) Hits()->Clear();
123 if (SDigits()) SDigits()->Clear();
124 if (Digits()) Digits()->Clear();
125 if (PRERecPoints()) PRERecPoints()->Clear();
126 if (ECARecPoints()) ECARecPoints()->Clear();
127 if (HCARecPoints()) HCARecPoints()->Clear();
128 if (TrackSegments()) TrackSegments()->Clear();
129 if (RecParticles()) RecParticles()->Clear();
134 //____________________________________________________________________________
135 Int_t AliEMCALLoader::GetEvent()
137 //Overloads GetEvent method called by AliRunLoader::GetEvent(Int_t) method
138 //to add Rec Particles specific for EMCAL
140 //First call the original method to get whatever from std. setup is needed
143 retval = AliLoader::GetEvent();
146 Error("GetEvent","AliLoader::GetEvent returned error");
150 if (GetHitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadHits();
151 if (GetSDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadSDigits();
152 if (GetDigitsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadDigits();
153 if (GetRecPointsDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecPoints();
154 if (GetTracksDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadTracks();
155 if (GetRecParticlesDataLoader()->GetBaseDataLoader()->IsLoaded()) ReadRecParticles();
158 //Now, check if RecPart were loaded
162 //____________________________________________________________________________
163 const AliEMCAL * AliEMCALLoader::EMCAL()
165 // returns the EMCAL object
166 AliEMCAL * emcal = dynamic_cast<AliEMCAL*>(GetModulesFolder()->FindObject(fDetectorName));
169 cout << "WARNING: AliEMCALLoader::EMCAL -> EMCAL module not found in Folders" << endl ;
173 //____________________________________________________________________________
174 const AliEMCALGeometry * AliEMCALLoader::EMCALGeometry()
176 // Gets the EMCAL Geometry object
177 AliEMCALGeometry * rv = 0 ;
179 rv = EMCAL()->GetGeometry();
183 //____________________________________________________________________________
184 Int_t AliEMCALLoader::LoadHits(Option_t* opt)
186 //------- Hits ----------------------
187 //Overload (extends) LoadHits implemented in AliLoader
191 //First call the AliLoader's method to send the TreeH to folder
192 res = AliLoader::LoadHits(opt);
196 Error("LoadHits","AliLoader::LoadHits returned error");
200 //read the data from tree in folder and send it to folder
205 //____________________________________________________________________________
206 Int_t AliEMCALLoader::LoadSDigits(Option_t* opt)
208 // Loads the SDigits array in the folder structure
210 //First call the AliLoader's method to send the TreeS to folder
211 res = AliLoader::LoadSDigits(opt);
214 Error("PostSDigits","AliLoader::LoadSDigits returned error");
217 return ReadSDigits();
221 //____________________________________________________________________________
222 Int_t AliEMCALLoader::LoadDigits(Option_t* opt)
224 // Loads the Digits array in the folder structure
227 //First call the AliLoader's method to send the TreeS to folder
228 res = AliLoader::LoadDigits(opt);
231 Error("LoadDigits","AliLoader::LoadDigits returned error");
237 //____________________________________________________________________________
238 Int_t AliEMCALLoader::LoadRecPoints(Option_t* opt)
240 // Loads the RecPoints array in the folder structure
242 //First call the AliLoader's method to send the TreeR to folder
243 res = AliLoader::LoadRecPoints(opt);
246 Error("LoadRecPoints","AliLoader::LoadRecPoints returned error");
250 TFolder * emcalFolder = GetDetectorDataFolder();
251 if ( emcalFolder == 0x0 )
253 Error("LoadRecPoints","Can not get detector data folder");
256 return ReadRecPoints();
259 //____________________________________________________________________________
260 Int_t AliEMCALLoader::LoadTracks(Option_t* opt)
262 //Loads Tracks: Open File, Reads Tree and posts, Read Data and Posts
264 Info("LoadTracks","opt = %s",opt);
267 Warning("LoadTracks","Tracks are already loaded");
271 //First call the AliLoader's method to send the TreeS to folder
272 if (GetTracksDataLoader()->GetBaseLoader(0)->IsLoaded() == kFALSE)
273 {//tracks can be loaded by LoadRecPoints
274 res = AliLoader::LoadTracks(opt);
277 Error("LoadTracks","AliLoader::LoadTracks returned error");
284 Error("LoadTracks","Error occured while reading Tracks");
288 fTracksLoaded = kTRUE;
292 //____________________________________________________________________________
293 Int_t AliEMCALLoader::LoadRecParticles(Option_t* opt)
295 // Loads the RecParticles array in the folder structure
297 //First call the AliLoader's method to send the TreeS to folder
298 res = AliLoader::LoadRecParticles(opt);
301 Error("LoadRecParticles","AliLoader::LoadRecParticles returned error");
305 TFolder * emcalFolder = GetDetectorDataFolder();
306 if ( emcalFolder == 0x0 )
308 Error("PostDigits","Can not get detector data folder");
311 return ReadRecParticles();
314 //____________________________________________________________________________
315 Int_t AliEMCALLoader::PostHits()
317 Int_t reval = AliLoader::PostHits();
320 Error("PostHits","AliLoader:: returned error");
326 //____________________________________________________________________________
327 Int_t AliEMCALLoader::PostSDigits()
329 // Posts the SDigits array to the folder structure
330 Int_t reval = AliLoader::PostSDigits();
333 Error("PostSDigits","AliLoader::PostSDigits returned error");
336 return ReadSDigits();
339 //____________________________________________________________________________
340 Int_t AliEMCALLoader::PostDigits()
342 // Posts the Digits array to the folder structure
343 Int_t reval = AliLoader::PostDigits();
346 Error("PostDigits","AliLoader::PostDigits returned error");
352 //____________________________________________________________________________
353 Int_t AliEMCALLoader::PostRecPoints()
355 // Posts the RecPoints array to the folder structure
356 Int_t reval = AliLoader::PostRecPoints();
359 Error("PostRecPoints","AliLoader::PostRecPoints returned error");
362 return ReadRecPoints();
365 //____________________________________________________________________________
366 Int_t AliEMCALLoader::PostRecParticles()
368 // Posts the RecParticles array to the folder structure
370 Int_t reval = AliLoader::PostRecParticles();
373 Error("PostRecParticles","AliLoader::PostRecParticles returned error");
376 return ReadRecParticles();
379 //____________________________________________________________________________
380 Int_t AliEMCALLoader::PostTracks()
382 // Posts the Tracks array to the folder structure
383 Int_t reval = AliLoader::PostTracks();
386 Error("PostTracks","AliLoader::PostTracks returned error");
392 //____________________________________________________________________________
393 Int_t AliEMCALLoader::ReadHits()
395 // If there is no Clones Array in folder creates it and sends to folder
396 // then tries to read
397 // Reads the first entry of EMCAL branch in hit tree TreeH()
398 // Reads data from TreeH and stores it in TClonesArray that sits in DetectorDataFolder
400 TObject** hitref = HitsRef();
407 TClonesArray* hits = dynamic_cast<TClonesArray*>(*hitref);
409 TTree* treeh = TreeH();
413 Error("ReadHits"," Cannot read TreeH from folder");
417 TBranch * hitsbranch = treeh->GetBranch(fDetectorName);
420 Error("ReadHits"," Cannot find branch EMCAL");
425 Info("ReadHits","Reading Hits");
427 if (hitsbranch->GetEntries() > 1)
429 TClonesArray * tempo = new TClonesArray("AliEMCALHit",1000);
431 hitsbranch->SetAddress(&tempo);
434 for (i = 0 ; i < hitsbranch->GetEntries(); i++)
436 hitsbranch->GetEntry(i) ;
438 for ( j = 0 ; j < tempo->GetEntries() ; j++)
440 AliEMCALHit* hit = (AliEMCALHit*)tempo->At(j);
441 new((*hits)[index]) AliEMCALHit( *hit ) ;
449 hitsbranch->SetAddress(hitref);
450 hitsbranch->GetEntry(0) ;
456 //____________________________________________________________________________
457 Int_t AliEMCALLoader::ReadSDigits()
459 // Read the summable digits tree TreeS():
460 // Check if TClones is in folder
461 // if not create and add to folder
462 // connect to tree if available
465 TObject** sdref = SDigitsRef();
469 sdref = SDigitsRef();
472 TTree * treeS = TreeS();
475 //May happen if file is truncated or new in LoadSDigits
476 //Error("ReadSDigits","There is no SDigit Tree");
480 TBranch * branch = treeS->GetBranch(fDetectorName);
482 {//easy, maybe just a new tree
483 //Error("ReadSDigits"," Cannot find branch EMCAL");
487 branch->SetAddress(SDigitsRef());
492 //____________________________________________________________________________
493 Int_t AliEMCALLoader::ReadDigits()
495 // Read the summable digits tree TreeS():
496 // Check if TClones is in folder
497 // if not create and add to folder
498 // connect to tree if available
501 TObject** dref = DigitsRef();
503 {//if there is not array in folder, create it and put it there
508 TTree * treeD = TreeD();
511 //May happen if file is truncated or new in LoadSDigits
512 //Error("ReadDigits","There is no Digit Tree");
516 TBranch * branch = treeD->GetBranch(fDetectorName);
518 {//easy, maybe just a new tree
519 //Error("ReadDigits"," Cannot find branch ",fDetectorName.Data());
523 branch->SetAddress(dref);//connect branch to buffer sitting in folder
524 branch->GetEntry(0);//get first event
529 //____________________________________________________________________________
530 void AliEMCALLoader::UnloadRecParticles()
532 // Unloads the RecParticles array fromthe folder structure
533 fRecParticlesLoaded = kFALSE;
535 if (fTracksLoaded == kFALSE) UnloadTracks();
538 //____________________________________________________________________________
539 void AliEMCALLoader::UnloadTracks()
541 // Unloads the Tracks array fromthe folder structure
542 CleanTracks();//free the memory
543 //in case RecPart are loaded we can not onload tree and close the file
544 if (fRecParticlesLoaded == kFALSE) AliLoader::UnloadTracks();
545 fTracksLoaded = kFALSE;//mark that nobody needs them
548 //____________________________________________________________________________
549 void AliEMCALLoader::Track(Int_t itrack)
551 // Read the first entry of EMCAL branch in hit tree gAlice->TreeH()
556 Error("Track","Can not load hits.");
561 TBranch * hitsbranch = dynamic_cast<TBranch*>(TreeH()->GetListOfBranches()->FindObject("EMCAL")) ;
564 cout << "WARNING: AliEMCALLoader::ReadTreeH -> Cannot find branch EMCAL" << endl ;
567 if(!Hits()) PostHits();
569 hitsbranch->SetAddress(HitsRef());
570 hitsbranch->GetEntry(itrack);
574 //____________________________________________________________________________
575 void AliEMCALLoader::ReadTreeQA()
577 // Read the digit tree gAlice->TreeQA()
578 // so far only EMCAL knows about this Tree
580 if(EMCAL()->TreeQA()== 0){
581 cerr << "ERROR: AliEMCALLoader::ReadTreeQA: can not read TreeQA " << endl ;
585 TBranch * qabranch = EMCAL()->TreeQA()->GetBranch("EMCAL");
588 cout << "WARNING: AliEMCALLoader::ReadTreeQA -> Cannot find QA Alarms for EMCAL" << endl ;
592 // if(!Alarms()) PostQA();
594 qabranch->SetAddress(AlarmsRef()) ;
596 qabranch->GetEntry(0) ;
600 //____________________________________________________________________________
601 Int_t AliEMCALLoader::ReadRecPoints()
603 //Creates and posts to folder an array container,
604 //connects branch in tree (if exists), and reads data to array
606 MakeRecPointsArray();
608 TObjArray * pre = 0x0 ;
609 TObjArray * eca = 0x0 ;
610 TObjArray * hca = 0x0 ;
612 TTree * treeR = TreeR();
616 //May happen if file is truncated or new in LoadSDigits
621 TBranch * prebranch = treeR->GetBranch(fgkPRERecPointsBranchName);
623 if (prebranch == 0x0)
625 Error("ReadRecPoints","Can not get branch with PRE Rec. Points named %s",fgkPRERecPointsBranchName.Data());
630 prebranch->SetAddress(&pre) ;
631 prebranch->GetEntry(0) ;
633 TBranch * ecabranch = treeR->GetBranch(fgkECARecPointsBranchName);
634 if (ecabranch == 0x0)
636 Error("ReadRecPoints","Can not get branch with ECA Rec. Points named %s",fgkECARecPointsBranchName.Data());
641 ecabranch->SetAddress(&eca);
642 ecabranch->GetEntry(0) ;
644 TBranch * hcabranch = treeR->GetBranch(fgkHCARecPointsBranchName);
645 if (hcabranch == 0x0)
647 Error("ReadRecPoints","Can not get branch with HCA Rec. Points named %s",fgkHCARecPointsBranchName.Data());
652 hcabranch->SetAddress(&hca);
653 hcabranch->GetEntry(0) ;
657 Int_t maxpre = pre->GetEntries() ;
658 for ( ii= 0 ; ii < maxpre ; ii++ )
659 PRERecPoints()->Add(pre->At(ii)) ;
661 Int_t maxeca = eca->GetEntries() ;
662 for ( ii= 0 ; ii < maxeca ; ii++ )
663 ECARecPoints()->Add(eca->At(ii)) ;
665 Int_t maxhca = hca->GetEntries() ;
666 for ( ii= 0 ; ii < maxhca ; ii++ )
667 HCARecPoints()->Add(hca->At(ii)) ;
672 //____________________________________________________________________________
673 Int_t AliEMCALLoader::ReadTracks()
675 //Creates and posts to folder an array container,
676 //connects branch in tree (if exists), and reads data to arry
678 TObject** trkref = TracksRef();
680 {//Create and post array
681 MakeTrackSegmentsArray();
682 trkref = TracksRef();
685 TTree * treeT = TreeT();
688 //May happen if file is truncated or new in LoadSDigits, or the file is in update mode,
689 //but tracking was not performed yet for a current event
690 //Error("ReadTracks","There is no Tree with Tracks");
694 TBranch * branch = treeT->GetBranch(fgkTrackSegmentsBranchName);
696 {//easy, maybe just a new tree
697 Error("ReadTracks"," Cannot find branch named %s",fgkTrackSegmentsBranchName.Data());
701 branch->SetAddress(trkref);//connect branch to buffer sitting in folder
702 branch->GetEntry(0);//get first event
707 //____________________________________________________________________________
708 Int_t AliEMCALLoader::ReadRecParticles()
710 //Reads Reconstructed Particles from file
711 //Creates and posts to folder an array container,
712 //connects branch in tree (if exists), and reads data to arry
714 TObject** recpartref = RecParticlesRef();
716 if ( recpartref == 0x0 )
717 {//Create and post array
718 MakeRecParticlesArray();
719 recpartref = RecParticlesRef();
722 TTree * treeP = TreeP();
725 //May happen if file is truncated or new in LoadSDigits,
726 //or the file is in update mode,
727 //but tracking was not performed yet for a current event
728 // Error("ReadRecParticles","There is no Tree with Tracks and Reconstructed Particles");
732 TBranch * branch = treeP->GetBranch(fgkRecParticlesBranchName);
734 {//easy, maybe just a new tree
735 Error("ReadRecParticles"," Cannot find branch %s",fgkRecParticlesBranchName.Data());
739 branch->SetAddress(recpartref);//connect branch to buffer sitting in folder
740 branch->GetEntry(0);//get first event
745 //____________________________________________________________________________
746 AliEMCALGeometry* AliEMCALLoader::GetEMCALGeometry()
748 //returns EMCAL geometry from gAlice
749 //static Method used by some classes where it is not convienient to pass eventfoldername
752 AliEMCAL* emcal=dynamic_cast<AliEMCAL*>(gAlice->GetDetector("EMCAL"));
755 return emcal->GetGeometry();
758 //____________________________________________________________________________
759 AliEMCALLoader* AliEMCALLoader::GetEMCALLoader(const char* eventfoldername)
761 // Get an instance of the EMCALLoader object
762 AliRunLoader* rn = AliRunLoader::GetRunLoader(eventfoldername);
765 cerr<<"Error: <AliEMCALLoader::GetEMCALLoader>: "
766 << "Can not find Run Loader in folder "<<eventfoldername<<endl;
769 return dynamic_cast<AliEMCALLoader*>(rn->GetLoader("EMCALLoader"));
772 //____________________________________________________________________________
773 Bool_t AliEMCALLoader::BranchExists(const TString& recName)
775 if (fBranchTitle.IsNull()) return kFALSE;
776 TString dataname, zername ;
778 if(recName == "SDigits") {
780 dataname = GetDetectorName();
781 zername = "AliEMCALSDigitizer" ;
783 else if(recName == "Digits"){
785 dataname = GetDetectorName();
786 zername = "AliEMCALDigitizer" ;
788 else if(recName == "PRERecPoints"){
790 dataname = fgkPRERecPointsBranchName;
791 zername = "AliEMCALClusterizer" ;
793 else if(recName == "ECARecPoints"){
795 dataname = fgkECARecPointsBranchName;
796 zername = "AliEMCALClusterizer" ;
798 else if(recName == "HCARecPoints"){
800 dataname = fgkHCARecPointsBranchName;
801 zername = "AliEMCALClusterizer" ;
803 else if(recName == "TrackSegments"){
805 dataname = fgkTrackSegmentsBranchName;
806 zername = "AliEMCALTrackSegmentMaker";
808 else if(recName == "RecParticles"){
810 dataname = fgkRecParticlesBranchName;
811 zername = "AliEMCALPID";
819 TObjArray * lob = static_cast<TObjArray*>(tree->GetListOfBranches()) ;
821 TBranch * branch = 0 ;
822 TString titleName(fBranchTitle);
825 while ((branch = (static_cast<TBranch*>(next())))) {
826 TString branchName(branch->GetName() ) ;
827 TString branchTitle(branch->GetTitle() ) ;
828 if ( branchName.BeginsWith(dataname) && branchTitle.BeginsWith(fBranchTitle) ){
829 Warning("BranchExists","branch %s with title %s ",dataname.Data(),fBranchTitle.Data());
832 if ( branchName.BeginsWith(zername) && branchTitle.BeginsWith(titleName) ){
833 Warning("BranchExists","branch AliEMCAL... with title %s ",branch->GetTitle());
841 //____________________________________________________________________________
842 void AliEMCALLoader::SetBranchTitle(const TString& btitle)
844 // Gives a name to a branch in the folder structure
845 if (btitle.CompareTo(fBranchTitle) == 0) return;
846 fBranchTitle = btitle;
850 //____________________________________________________________________________
851 void AliEMCALLoader::CleanHits()
853 AliLoader::CleanHits();
855 TClonesArray* hits = Hits();
856 if (hits) hits->Clear();
859 //____________________________________________________________________________
860 void AliEMCALLoader::CleanSDigits()
862 // Cleans the SDigits array in the folder structure
863 AliLoader::CleanSDigits();
864 TClonesArray* sdigits = SDigits();
865 if (sdigits) sdigits->Clear();
868 //____________________________________________________________________________
870 void AliEMCALLoader::CleanDigits()
872 // Cleans the Digits array in the folder structure
873 AliLoader::CleanDigits();
874 TClonesArray* digits = Digits();
875 if (digits) digits->Clear();
878 //____________________________________________________________________________
879 void AliEMCALLoader::CleanRecPoints()
881 // Cleans the RecPoints array in the folder structure
882 AliLoader::CleanRecPoints();
883 TObjArray* recpoints = PRERecPoints();
886 recpoints = ECARecPoints();
889 recpoints = HCARecPoints();
894 //____________________________________________________________________________
895 void AliEMCALLoader::CleanTracks()
897 // Cleans the Tracks array in the folder structure
898 AliLoader::CleanTracks();//tree
899 //and clear the array
900 TClonesArray* tracks = TrackSegments();
905 //____________________________________________________________________________
906 void AliEMCALLoader::CleanRecParticles()
908 // Cleans the RecParticles array in the folder structure
909 TClonesArray *recpar = RecParticles();
914 //____________________________________________________________________________
915 // void AliEMCALLoader::ReadCalibrationDB(const char * database,const char * filename)
918 // if(fcdb && (strcmp(database,fcdb->GetTitle())==0))
921 // TFile * file = gROOT->GetFile(filename) ;
923 // file = TFile::Open(filename);
925 // Error ("ReadCalibrationDB", "Cannot open file %s", filename) ;
930 // fcdb = dynamic_cast<AliEMCALCalibrationDB *>(file->Get("AliEMCALCalibrationDB")) ;
932 // Error ("ReadCalibrationDB", "No database %s in file %s", database, filename) ;
934 //____________________________________________________________________________
936 // AliEMCALSDigitizer* AliEMCALLoader::EMCALSDigitizer()
938 // //return EMCAL SDigitizer
939 // return dynamic_cast<AliEMCALSDigitizer*>(SDigitizer()) ;
942 //____________________________________________________________________________
943 void AliEMCALLoader::MakeHitsArray()
945 // Create the array for Hits
947 TClonesArray* hits = new TClonesArray("AliEMCALHit",1000);
948 hits->SetName(fgkHitsName);
949 GetDetectorDataFolder()->Add(hits);
952 //____________________________________________________________________________
953 void AliEMCALLoader::MakeSDigitsArray()
955 // Create the array for SDigits
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 // Create the array for Digits
966 if ( Digits()) return;
967 TClonesArray* digits = new TClonesArray("AliEMCALDigit",1);
968 digits->SetName(fgkDigitsName);
969 GetDetectorDataFolder()->Add(digits);
973 //____________________________________________________________________________
974 void AliEMCALLoader::MakeRecPointsArray()
976 // Create the array for RecPoints
977 if ( PRERecPoints() == 0x0) {
979 Info("MakeRecPointsArray","Making array for PRE");
980 TObjArray* pre = new TObjArray(100) ;
981 pre->SetName(fgkPRERecPointsName) ;
982 GetDetectorDataFolder()->Add(pre);
984 if ( ECARecPoints() == 0x0) {
986 Info("MakeRecPointsArray","Making array for ECA");
987 TObjArray* eca = new TObjArray(100) ;
988 eca->SetName(fgkECARecPointsName) ;
989 GetDetectorDataFolder()->Add(eca);
991 if ( HCARecPoints() == 0x0) {
993 Info("MakeRecPointsArray","Making array for HCA");
994 TObjArray* hca = new TObjArray(100) ;
995 hca->SetName(fgkHCARecPointsName) ;
996 GetDetectorDataFolder()->Add(hca);
1000 //____________________________________________________________________________
1001 void AliEMCALLoader::MakeTrackSegmentsArray()
1003 // Create the array for TrackSegments
1004 if ( TrackSegments())
1006 TClonesArray * ts = new TClonesArray("AliEMCALTrackSegment",100) ;
1007 ts->SetName(fgkTracksName);
1008 GetDetectorDataFolder()->Add(ts);
1011 //____________________________________________________________________________
1012 void AliEMCALLoader::MakeRecParticlesArray()
1014 // Create the array for RecParticles
1015 if ( RecParticles()) return;
1016 TClonesArray * rp = new TClonesArray("AliEMCALRecParticle",100) ;
1017 rp->SetName(fgkRecParticlesName);
1018 GetDetectorDataFolder()->Add(rp);