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.
24 // The AliEMCALLoader now holds the TClonesArray and TObjArray for reading
25 // Hits, Dgits, SDigits and RecPoints. Filling is managed in the GetEvent()
28 // Creation/writing of files is managed by the relevant parts of the
29 // reconstruction software (AliEMCALDigitiser etx)
31 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
32 //*-- Completely redesigned by Dmitri Peressounko March 2001
34 //*-- YS June 2001 : renamed the original AliEMCALIndexToObject and make
35 //*-- systematic usage of TFolders without changing the interface
37 //*-- Marco van Leeuwen, Jan 2006: complete revision to simplify reading
38 //*-- and fit better in general ALICE scheme
40 //////////////////////////////////////////////////////////////////////////////
43 // --- ROOT system ---
47 // --- Standard library ---
49 // --- AliRoot header files ---
50 #include "AliEMCALLoader.h"
53 ClassImp(AliEMCALLoader)
55 const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
57 //____________________________________________________________________________
58 AliEMCALLoader::AliEMCALLoader()
61 fHits = new TClonesArray("AliEMCALHit");
62 fDigits = new TClonesArray("AliEMCALDigit");
63 fSDigits = new TClonesArray("AliEMCALDigit");
64 fRecPoints = new TObjArray();
67 //____________________________________________________________________________
68 AliEMCALLoader::AliEMCALLoader(const Char_t *detname,const Char_t *eventfoldername):
69 AliLoader(detname,eventfoldername)
72 fHits = new TClonesArray("AliEMCALHit");
73 fDigits = new TClonesArray("AliEMCALDigit");
74 fSDigits = new TClonesArray("AliEMCALDigit");
75 fRecPoints = new TObjArray();
78 //____________________________________________________________________________
79 AliEMCALLoader::~AliEMCALLoader()
81 // Disconnect trees and remove arrays
83 TreeH()->SetBranchAddress(fDetectorName,0);
85 TreeD()->SetBranchAddress(fDetectorName,0);
87 TreeS()->SetBranchAddress(fDetectorName,0);
89 TreeR()->SetBranchAddress(fgkECARecPointsBranchName,0);
96 //____________________________________________________________________________
97 Int_t AliEMCALLoader::GetEvent() {
98 AliLoader::GetEvent(); // First call AliLoader to do all the groundwork
100 AliDebug(1,__PRETTY_FUNCTION__);
101 // Now connect and fill TClonesArray
104 TTree *treeH = TreeH();
106 treeH->SetBranchAddress(fDetectorName,&fHits);
107 if (treeH->GetEntries() > 1)
108 Warning(__PRETTY_FUNCTION__,"multiple arrays in treeH no longer supported");
113 TTree *treeS = TreeS();
115 treeS->SetBranchAddress(fDetectorName,&fSDigits);
120 TTree *treeD = TreeD();
122 treeD->SetBranchAddress(fDetectorName,&fDigits);
127 TTree *treeR = TreeR();
129 treeR->SetBranchAddress(fgkECARecPointsBranchName,&fRecPoints);