]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALReconstructor.cxx
coding violations fix (changed naming, added comments, made methods const)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALReconstructor.cxx
CommitLineData
f6019cda 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18//_________________________________________________________________________
fa42b1f3 19//--
20//-- Yves Schutz (SUBATECH)
f6019cda 21// Reconstruction class. Redesigned from the old AliReconstructionner class and
22// derived from STEER/AliReconstructor.
23//
85c25c2e 24//-- Aleksei Pavlinov : added staf for EMCAL jet trigger 9Apr 25, 2008)
25// : fgDigitsArr should read just once at event
26
f6019cda 27// --- ROOT system ---
85c25c2e 28#include <TList.h>
29#include <TClonesArray.h>
60d8ad94 30#include <TH2.h>
0c5b726e 31#include "TGeoManager.h"
32#include "TGeoMatrix.h"
f6019cda 33
34// --- Standard library ---
35
36// --- AliRoot header files ---
f6019cda 37#include "AliEMCALReconstructor.h"
5dee926e 38
aaa3cb7c 39#include "AliCodeTimer.h"
af885e0f 40#include "AliESDEvent.h"
89ffc0b0 41#include "AliESDCaloCluster.h"
0e7c6655 42#include "AliESDCaloCells.h"
6a0cf740 43#include "AliESDtrack.h"
5dee926e 44#include "AliEMCALLoader.h"
98e9578e 45#include "AliEMCALRawUtils.h"
0e7c6655 46#include "AliEMCALDigit.h"
f6019cda 47#include "AliEMCALClusterizerv1.h"
5dee926e 48#include "AliEMCALRecPoint.h"
dc293ae9 49#include "AliEMCALPID.h"
0964c2e9 50#include "AliEMCALTrigger.h"
1d59832c 51#include "AliRawReader.h"
fa42b1f3 52#include "AliCDBEntry.h"
53#include "AliCDBManager.h"
65bdc82f 54#include "AliEMCALGeometry.h"
ac8ae9fe 55#include "AliEMCAL.h"
85c25c2e 56#include "AliEMCALHistoUtilities.h"
57#include "AliESDVZERO.h"
0c5b726e 58#include "AliCDBManager.h"
72c58de0 59#include "AliRunLoader.h"
60#include "AliRun.h"
1d59832c 61
85c25c2e 62ClassImp(AliEMCALReconstructor)
f6019cda 63
ba6de5ea 64const AliEMCALRecParam* AliEMCALReconstructor::fgkRecParam = 0; // EMCAL rec. parameters
65bdc82f 65AliEMCALRawUtils* AliEMCALReconstructor::fgRawUtils = 0; // EMCAL raw utilities class
9517d886 66AliEMCALClusterizer* AliEMCALReconstructor::fgClusterizer = 0; // EMCAL clusterizer class
85c25c2e 67TClonesArray* AliEMCALReconstructor::fgDigitsArr = 0; // shoud read just once at event
f6019cda 68//____________________________________________________________________________
18a21c7c 69AliEMCALReconstructor::AliEMCALReconstructor()
0c5b726e 70 : fDebug(kFALSE), fList(0), fGeom(0),fCalibData(0)
f6019cda 71{
72 // ctor
65bdc82f 73
74 fgRawUtils = new AliEMCALRawUtils;
72c58de0 75
76 //To make sure we match with the geometry in a simulation file,
77 //let's try to get it first. If not, take the default geometry
33c3c91a 78 AliRunLoader *rl = AliRunLoader::Instance();
72c58de0 79 if (rl->GetAliRun() && rl->GetAliRun()->GetDetector("EMCAL")) {
80 fGeom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
81 } else {
82 AliInfo(Form("Using default geometry in reconstruction"));
937d0661 83 fGeom = AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaultGeometryName());
65bdc82f 84 }
0e7c6655 85
0c5b726e 86 //Get calibration parameters
87 if(!fCalibData)
88 {
89 AliCDBEntry *entry = (AliCDBEntry*)
90 AliCDBManager::Instance()->Get("EMCAL/Calib/Data");
91 if (entry) fCalibData = (AliEMCALCalibData*) entry->GetObject();
92 }
93
94 if(!fCalibData)
95 AliFatal("Calibration parameters not found in CDB!");
96
97 //Init the clusterizer with geometry and calibration pointers, avoid doing it twice.
98 fgClusterizer = new AliEMCALClusterizerv1(fGeom, fCalibData);
99
72c58de0 100 if(!fGeom) AliFatal(Form("Could not get geometry!"));
101
f6019cda 102}
103
f6019cda 104//____________________________________________________________________________
105AliEMCALReconstructor::~AliEMCALReconstructor()
106{
107 // dtor
65bdc82f 108 delete fGeom;
aaa3cb7c 109 AliCodeTimer::Instance()->Print();
f6019cda 110}
111
85c25c2e 112//____________________________________________________________________________
113void AliEMCALReconstructor::Init()
114{
115 // Trigger hists - Oct 24, 2007
116 fList = AliEMCALHistoUtilities::GetTriggersListOfHists(kTRUE);
117}
118
f6019cda 119//____________________________________________________________________________
c47157cd 120void AliEMCALReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const
f6019cda 121{
122 // method called by AliReconstruction;
123 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
124 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
125 // the global tracking.
c47157cd 126 // Works on the current event.
fa42b1f3 127
1a429a6b 128 AliCodeTimerAuto("",0)
aaa3cb7c 129
85c25c2e 130 ReadDigitsArrayFromTree(digitsTree);
0832a2bf 131 fgClusterizer->InitParameters();
4601e3a7 132 fgClusterizer->SetOutput(clustersTree);
0c5b726e 133
85c25c2e 134 if(fgDigitsArr && fgDigitsArr->GetEntries()) {
135
9517d886 136 fgClusterizer->SetInput(digitsTree);
9517d886 137
85c25c2e 138 if(Debug())
9517d886 139 fgClusterizer->Digits2Clusters("deb all") ;
85c25c2e 140 else
9517d886 141 fgClusterizer->Digits2Clusters("");
142
143 fgClusterizer->Clear();
85c25c2e 144
145 }
9517d886 146
f6019cda 147}
148
a68156e6 149//____________________________________________________________________________
c47157cd 150void AliEMCALReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
98e9578e 151
a68156e6 152{
c47157cd 153 // Conversion from raw data to
154 // EMCAL digits.
155 // Works on a single-event basis
85c60a8e 156
98e9578e 157 rawReader->Reset() ;
98e9578e 158
3e5fa09c 159 TClonesArray *digitsArr = new TClonesArray("AliEMCALDigit",200);
c47157cd 160 Int_t bufsize = 32000;
161 digitsTree->Branch("EMCAL", &digitsArr, bufsize);
98e9578e 162
65bdc82f 163 //must be done here because, in constructor, option is not yet known
164 fgRawUtils->SetOption(GetOption());
b4133f05 165
0832a2bf 166 fgRawUtils->SetRawFormatHighLowGainFactor(GetRecParam()->GetHighLowGainFactor());
167 fgRawUtils->SetRawFormatOrder(GetRecParam()->GetOrderParameter());
168 fgRawUtils->SetRawFormatTau(GetRecParam()->GetTau());
169 fgRawUtils->SetNoiseThreshold(GetRecParam()->GetNoiseThreshold());
170 fgRawUtils->SetNPedSamples(GetRecParam()->GetNPedSamples());
b4133f05 171
65bdc82f 172 fgRawUtils->Raw2Digits(rawReader,digitsArr);
c615db53 173
174 digitsTree->Fill();
175 digitsArr->Delete();
176 delete digitsArr;
177
a68156e6 178}
179
85c25c2e 180
f6019cda 181//____________________________________________________________________________
0e7c6655 182void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
c47157cd 183 AliESDEvent* esd) const
f6019cda 184{
98e9578e 185 // Called by AliReconstruct after Reconstruct() and global tracking and vertexing
85c25c2e 186 // and V0
c47157cd 187 // Works on the current event
85c25c2e 188 // printf(" ## AliEMCALReconstructor::FillESD() is started ### \n ");
189 //return;
92da3372 190
6a0cf740 191 //######################################################
0964c2e9 192 //#########Calculate trigger and set trigger info###########
6a0cf740 193 //######################################################
85c25c2e 194
195 AliEMCALTrigger tr;
196 // tr.SetPatchSize(1); // create 4x4 patches
197 tr.SetSimulation(kFALSE); // Reconstruction mode
198 tr.SetDigitsList(fgDigitsArr);
199 // Get VZERO total multiplicity for jet trigger simulation
200 // The simulation of jey trigger will be incorrect if no VZERO data
201 // at ESD
202 AliESDVZERO* vZero = esd->GetVZEROData();
203 if(vZero) {
204 tr.SetVZER0Multiplicity(vZero->GetMTotV0A() + vZero->GetMTotV0C());
205 }
206 //
0964c2e9 207 tr.Trigger();
85c25c2e 208
0964c2e9 209 Float_t maxAmp2x2 = tr.Get2x2MaxAmplitude();
210 Float_t maxAmpnxn = tr.GetnxnMaxAmplitude();
211 Float_t ampOutOfPatch2x2 = tr.Get2x2AmpOutOfPatch() ;
212 Float_t ampOutOfPatchnxn = tr.GetnxnAmpOutOfPatch() ;
213
0964c2e9 214 Int_t iSM2x2 = tr.Get2x2SuperModule();
215 Int_t iSMnxn = tr.GetnxnSuperModule();
85c25c2e 216 Int_t iModulePhi2x2 = tr.Get2x2ModulePhi();
217 Int_t iModulePhinxn = tr.GetnxnModulePhi();
218 Int_t iModuleEta2x2 = tr.Get2x2ModuleEta();
219 Int_t iModuleEtanxn = tr.GetnxnModuleEta();
0964c2e9 220
85c25c2e 221 AliDebug(2, Form("Trigger 2x2 max amp %f, out amp %f, SM %d, iphi %d ieta %d", maxAmp2x2, ampOutOfPatch2x2, iSM2x2,iModulePhi2x2, iModuleEta2x2));
222 AliDebug(2, Form("Trigger 4x4 max amp %f , out amp %f, SM %d, iphi %d, ieta %d", maxAmpnxn, ampOutOfPatchnxn, iSMnxn,iModulePhinxn, iModuleEtanxn));
0964c2e9 223
224 TVector3 pos2x2(-1,-1,-1);
225 TVector3 posnxn(-1,-1,-1);
226
85c25c2e 227 Int_t iAbsId2x2 = fGeom->GetAbsCellIdFromCellIndexes( iSM2x2, iModulePhi2x2, iModuleEta2x2) ; // should be changed to Module
228 Int_t iAbsIdnxn = fGeom->GetAbsCellIdFromCellIndexes( iSMnxn, iModulePhinxn, iModuleEtanxn) ;
65bdc82f 229 fGeom->GetGlobal(iAbsId2x2, pos2x2);
230 fGeom->GetGlobal(iAbsIdnxn, posnxn);
85c25c2e 231 //printf(" iAbsId2x2 %i iAbsIdnxn %i \n", iAbsId2x2, iAbsIdnxn);
0964c2e9 232
233 TArrayF triggerPosition(6);
234 triggerPosition[0] = pos2x2(0) ;
235 triggerPosition[1] = pos2x2(1) ;
236 triggerPosition[2] = pos2x2(2) ;
237 triggerPosition[3] = posnxn(0) ;
238 triggerPosition[4] = posnxn(1) ;
85c25c2e 239 triggerPosition[5] = posnxn(2) ;
240 //printf(" triggerPosition ");
241 //for(int i=0; i<6; i++) printf(" %i %f : ", i, triggerPosition[i]);
0964c2e9 242
243 TArrayF triggerAmplitudes(4);
244 triggerAmplitudes[0] = maxAmp2x2 ;
245 triggerAmplitudes[1] = ampOutOfPatch2x2 ;
246 triggerAmplitudes[2] = maxAmpnxn ;
247 triggerAmplitudes[3] = ampOutOfPatchnxn ;
85c25c2e 248 //printf("\n triggerAmplitudes ");
249 //for(int i=0; i<4; i++) printf(" %i %f : ", i, triggerAmplitudes[i]);
250 //printf("\n");
85d4cbde 251 //tr.Print("");
60d8ad94 252 //
253 // Trigger jet staff
254 //
255 if(tr.GetNJetThreshold()>0) {
256 // Jet phi/eta
257 Int_t n0 = triggerPosition.GetSize();
258 const TH2F *hpatch = tr.GetJetMatrixE();
259 triggerPosition.Set(n0 + 2);
260 for(Int_t i=0; i<2; i++) triggerPosition[n0+i] = hpatch->GetMean(i+1);
261 // Add jet ampitudes
262 n0 = triggerAmplitudes.GetSize();
263 triggerAmplitudes.Set(n0 + tr.GetNJetThreshold());
264 Double_t *ampJet = tr.GetL1JetThresholds();
265 for(Int_t i=0; i<tr.GetNJetThreshold(); i++){
266 triggerAmplitudes[n0 + i] = Float_t(ampJet[i]);
267 }
268 }
0964c2e9 269 esd->AddEMCALTriggerPosition(triggerPosition);
270 esd->AddEMCALTriggerAmplitudes(triggerAmplitudes);
85c25c2e 271 // Fill trigger hists
272 AliEMCALHistoUtilities::FillTriggersListOfHists(fList,&triggerPosition,&triggerAmplitudes);
aaa3cb7c 273
0e7c6655 274 //########################################
275 //##############Fill CaloCells###############
276 //########################################
aaa3cb7c 277
0e7c6655 278 TClonesArray *digits = new TClonesArray("AliEMCALDigit",1000);
279 TBranch *branchdig = digitsTree->GetBranch("EMCAL");
280 if (!branchdig) {
0c5b726e 281 AliError("can't get the branch with the EMCAL digits !");
0e7c6655 282 return;
283 }
284 branchdig->SetAddress(&digits);
285 digitsTree->GetEvent(0);
286 Int_t nDigits = digits->GetEntries(), idignew = 0 ;
287 AliDebug(1,Form("%d digits",nDigits));
288
289 AliESDCaloCells &emcCells = *(esd->GetEMCALCells());
290 emcCells.CreateContainer(nDigits);
291 emcCells.SetType(AliESDCaloCells::kEMCALCell);
0c5b726e 292 Float_t energy = 0;
0e7c6655 293 for (Int_t idig = 0 ; idig < nDigits ; idig++) {
294 const AliEMCALDigit * dig = (const AliEMCALDigit*)digits->At(idig);
295 if(dig->GetAmp() > 0 ){
0c5b726e 296 energy = (static_cast<AliEMCALClusterizerv1*> (fgClusterizer))->Calibrate(dig->GetAmp(),dig->GetId());
297 emcCells.SetCell(idignew,dig->GetId(),energy, dig->GetTime());
0e7c6655 298 idignew++;
299 }
300 }
301 emcCells.SetNumberOfCells(idignew);
302 emcCells.Sort();
303
304 //------------------------------------------------------------
305 //-----------------CLUSTERS-----------------------------
306 //------------------------------------------------------------
307 TObjArray *clusters = new TObjArray(100);
308 TBranch *branch = clustersTree->GetBranch("EMCALECARP");
309 branch->SetAddress(&clusters);
310 clustersTree->GetEvent(0);
311
312 Int_t nClusters = clusters->GetEntries(), nClustersNew=0;
313 AliDebug(1,Form("%d clusters",nClusters));
314 esd->SetFirstEMCALCluster(esd->GetNumberOfCaloClusters()); // Put after Phos clusters
315
85c25c2e 316
6a0cf740 317 //######################################################
318 //#######################TRACK MATCHING###############
319 //######################################################
320 //Fill list of integers, each one is index of track to which the cluster belongs.
321
322 // step 1 - initialize array of matched track indexes
323 Int_t *matchedTrack = new Int_t[nClusters];
324 for (Int_t iclus = 0; iclus < nClusters; iclus++)
325 matchedTrack[iclus] = -1; // neg. index --> no matched track
326
327 // step 2, change the flag for all matched clusters found in tracks
328 Int_t iemcalMatch = -1;
329 Int_t endtpc = esd->GetNumberOfTracks();
330 for (Int_t itrack = 0; itrack < endtpc; itrack++) {
331 AliESDtrack * track = esd->GetTrack(itrack) ; // retrieve track
332 iemcalMatch = track->GetEMCALcluster();
65f4a419 333 if(iemcalMatch >= 0) matchedTrack[iemcalMatch] = itrack;
6a0cf740 334 }
85c25c2e 335
6a0cf740 336 //########################################
85c25c2e 337 //##############Fill CaloClusters#############
6a0cf740 338 //########################################
35397e76 339 esd->SetNumberOfEMCALClusters(nClusters);
5dee926e 340 for (Int_t iClust = 0 ; iClust < nClusters ; iClust++) {
c47157cd 341 const AliEMCALRecPoint * clust = (const AliEMCALRecPoint*)clusters->At(iClust);
8ada0ffe 342 //if(clust->GetClusterType()== AliESDCaloCluster::kEMCALClusterv1) nRP++; else nPC++;
85c60a8e 343 if (Debug()) clust->Print();
a7a5421e 344 // Get information from EMCAL reconstruction points
85c60a8e 345 Float_t xyz[3];
5dee926e 346 TVector3 gpos;
347 clust->GetGlobalPosition(gpos);
35397e76 348 for (Int_t ixyz=0; ixyz<3; ixyz++)
5dee926e 349 xyz[ixyz] = gpos[ixyz];
85c25c2e 350 Float_t elipAxis[2];
351 clust->GetElipsAxis(elipAxis);
35397e76 352 //Create digits lists
353 Int_t cellMult = clust->GetMultiplicity();
354 //TArrayS digiList(digitMult);
355 Float_t *amplFloat = clust->GetEnergiesList();
356 Int_t *digitInts = clust->GetAbsId();
357 TArrayS absIdList(cellMult);
eb972628 358 TArrayD fracList(cellMult);
35397e76 359
360 Int_t newCellMult = 0;
361 for (Int_t iCell=0; iCell<cellMult; iCell++) {
362 if (amplFloat[iCell] > 0) {
363 absIdList[newCellMult] = (UShort_t)(digitInts[iCell]);
eb972628 364 //Uncomment when unfolding is done
365 //if(emcCells.GetCellAmplitude(digitInts[iCell])>0)
366 //fracList[newCellMult] = amplFloat[iCell]/(emcCells.GetCellAmplitude(digitInts[iCell])*calibration);//get cell calibration value
367 //else
368 fracList[newCellMult] = 0;
35397e76 369 newCellMult++;
92da3372 370 }
92da3372 371 }
85c25c2e 372
eb972628 373 absIdList.Set(newCellMult);
374 fracList.Set(newCellMult);
375
35397e76 376 if(newCellMult > 0) { // accept cluster if it has some digit
377 nClustersNew++;
65721814 378 //Primaries
7592dfc4 379 Int_t parentMult = 0;
fa42b1f3 380 Int_t *parentList = clust->GetParents(parentMult);
a7a5421e 381 // fills the ESDCaloCluster
35397e76 382 AliESDCaloCluster * ec = new AliESDCaloCluster() ;
383 ec->SetClusterType(AliESDCaloCluster::kEMCALClusterv1);
7592dfc4 384 ec->SetPosition(xyz);
385 ec->SetE(clust->GetEnergy());
35397e76 386 ec->SetNCells(newCellMult);
387 //Change type of list from short to ushort
388 UShort_t *newAbsIdList = new UShort_t[newCellMult];
eb972628 389 Double_t *newFracList = new Double_t[newCellMult];
35397e76 390 for(Int_t i = 0; i < newCellMult ; i++) {
391 newAbsIdList[i]=absIdList[i];
eb972628 392 newFracList[i]=fracList[i];
35397e76 393 }
394 ec->SetCellsAbsId(newAbsIdList);
eb972628 395 ec->SetCellsAmplitudeFraction(newFracList);
35397e76 396 ec->SetClusterDisp(clust->GetDispersion());
397 ec->SetClusterChi2(-1); //not yet implemented
398 ec->SetM02(elipAxis[0]*elipAxis[0]) ;
399 ec->SetM20(elipAxis[1]*elipAxis[1]) ;
78902954 400 ec->SetTOF(clust->GetTime()) ; //time-of-fligh
225cd96d 401 ec->SetNExMax(clust->GetNExMax()); //number of local maxima
35397e76 402 TArrayI arrayTrackMatched(1);// Only one track, temporal solution.
403 arrayTrackMatched[0]= matchedTrack[iClust];
404 ec->AddTracksMatched(arrayTrackMatched);
405
406 TArrayI arrayParents(parentMult,parentList);
407 ec->AddLabels(arrayParents);
408
6a0cf740 409 // add the cluster to the esd object
eb972628 410 esd->AddCaloCluster(ec);
a7a5421e 411 delete ec;
85d4cbde 412 delete [] newAbsIdList ;
eb972628 413 delete [] newFracList ;
35397e76 414 }
415 } // cycle on clusters
85c25c2e 416
35397e76 417 delete [] matchedTrack;
85c25c2e 418
35397e76 419 esd->SetNumberOfEMCALClusters(nClustersNew);
420 //if(nClustersNew != nClusters)
421 //printf(" ##### nClusters %i -> new %i ##### \n", nClusters, nClustersNew );
85c25c2e 422
35397e76 423 //Fill ESDCaloCluster with PID weights
85c25c2e 424 AliEMCALPID *pid = new AliEMCALPID;
425 //pid->SetPrintInfo(kTRUE);
426 pid->SetReconstructor(kTRUE);
427 pid->RunPID(esd);
85c25c2e 428 delete pid;
eb972628 429
35397e76 430 delete digits;
85c25c2e 431 delete clusters;
eb972628 432
35397e76 433 // printf(" ## AliEMCALReconstructor::FillESD() is ended : ncl %i -> %i ### \n ",nClusters, nClustersNew);
0c5b726e 434
435 //Store EMCAL misalignment matrixes
436 FillMisalMatrixes(esd) ;
437
438}
439
440//==================================================================================
441void AliEMCALReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
442 //Store EMCAL matrixes in ESD Header
443
444 //Check, if matrixes was already stored
445 for(Int_t sm = 0 ; sm < 12; sm++){
446 if(esd->GetEMCALMatrix(sm)!=0)
447 return ;
448 }
449
450 //Create and store matrixes
451 if(!gGeoManager){
452 AliError("Can not store misal. matrixes: no gGeoManager! \n") ;
453 return ;
454 }
455 //Note, that owner of copied marixes will be header
456 char path[255] ;
457 TGeoHMatrix * m ;
458 for(Int_t sm = 0; sm < 12; sm++){
459 sprintf(path,"/ALIC_1/XEN1_1/SMOD_%d",sm+1) ; //In Geometry modules numbered 1,2,.,5
460 if(sm >= 10) sprintf(path,"/ALIC_1/XEN1_1/SM10_%d",sm-10+1) ;
461
462 if (gGeoManager->cd(path)){
463 m = gGeoManager->GetCurrentMatrix() ;
464 esd->SetEMCALMatrix(new TGeoHMatrix(*m),sm) ;
465 }
466 else{
467 esd->SetEMCALMatrix(NULL,sm) ;
468 }
469 }
470
f6019cda 471}
dc293ae9 472
0c5b726e 473
474
9517d886 475//__________________________________________________________________________
85c25c2e 476void AliEMCALReconstructor::ReadDigitsArrayFromTree(TTree *digitsTree) const
477{
478 // See AliEMCALClusterizer::SetInput(TTree *digitsTree);
479 if(fgDigitsArr) {
480 // Clear previous digits
481 fgDigitsArr->Delete();
482 delete fgDigitsArr;
483 }
484 // Read the digits from the input tree
485 TBranch *branch = digitsTree->GetBranch("EMCAL");
486 if (!branch) {
487 AliError("can't get the branch with the EMCAL digits !");
488 return;
489 }
490 fgDigitsArr = new TClonesArray("AliEMCALDigit",100);
491 branch->SetAddress(&fgDigitsArr);
492 branch->GetEntry(0);
493}
98e9578e 494