]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALReconstructor.cxx
update from Per Thomas - new classes for NeuralNet and FastFit + code warning fixes
[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()
40164976 70 : fDebug(kFALSE), fList(0), fGeom(0),fCalibData(0),fPedestalData(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
40164976 97 //Get calibration parameters
98 if(!fPedestalData)
99 {
100 AliCDBEntry *entry = (AliCDBEntry*)
101 AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
102 if (entry) fPedestalData = (AliCaloCalibPedestal*) entry->GetObject();
103 }
104
105 if(!fPedestalData)
106 AliFatal("Dead map not found in CDB!");
107
108
0c5b726e 109 //Init the clusterizer with geometry and calibration pointers, avoid doing it twice.
40164976 110 fgClusterizer = new AliEMCALClusterizerv1(fGeom, fCalibData,fPedestalData);
0c5b726e 111
72c58de0 112 if(!fGeom) AliFatal(Form("Could not get geometry!"));
113
f6019cda 114}
115
f6019cda 116//____________________________________________________________________________
117AliEMCALReconstructor::~AliEMCALReconstructor()
118{
119 // dtor
65bdc82f 120 delete fGeom;
5e3106bc 121 delete fgRawUtils;
122 delete fgClusterizer;
123
aaa3cb7c 124 AliCodeTimer::Instance()->Print();
f6019cda 125}
126
85c25c2e 127//____________________________________________________________________________
128void AliEMCALReconstructor::Init()
129{
130 // Trigger hists - Oct 24, 2007
131 fList = AliEMCALHistoUtilities::GetTriggersListOfHists(kTRUE);
132}
133
f6019cda 134//____________________________________________________________________________
c47157cd 135void AliEMCALReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const
f6019cda 136{
137 // method called by AliReconstruction;
138 // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
139 // segment maker needs access to the AliESD object to retrieve the tracks reconstructed by
140 // the global tracking.
c47157cd 141 // Works on the current event.
fa42b1f3 142
1a429a6b 143 AliCodeTimerAuto("",0)
aaa3cb7c 144
85c25c2e 145 ReadDigitsArrayFromTree(digitsTree);
0832a2bf 146 fgClusterizer->InitParameters();
4601e3a7 147 fgClusterizer->SetOutput(clustersTree);
0c5b726e 148
85c25c2e 149 if(fgDigitsArr && fgDigitsArr->GetEntries()) {
150
9517d886 151 fgClusterizer->SetInput(digitsTree);
9517d886 152
85c25c2e 153 if(Debug())
9517d886 154 fgClusterizer->Digits2Clusters("deb all") ;
85c25c2e 155 else
9517d886 156 fgClusterizer->Digits2Clusters("");
157
158 fgClusterizer->Clear();
85c25c2e 159
160 }
9517d886 161
f6019cda 162}
163
a68156e6 164//____________________________________________________________________________
c47157cd 165void AliEMCALReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
98e9578e 166
a68156e6 167{
c47157cd 168 // Conversion from raw data to
169 // EMCAL digits.
170 // Works on a single-event basis
85c60a8e 171
98e9578e 172 rawReader->Reset() ;
98e9578e 173
3e5fa09c 174 TClonesArray *digitsArr = new TClonesArray("AliEMCALDigit",200);
c47157cd 175 Int_t bufsize = 32000;
176 digitsTree->Branch("EMCAL", &digitsArr, bufsize);
98e9578e 177
65bdc82f 178 //must be done here because, in constructor, option is not yet known
179 fgRawUtils->SetOption(GetOption());
b4133f05 180
0832a2bf 181 fgRawUtils->SetRawFormatHighLowGainFactor(GetRecParam()->GetHighLowGainFactor());
182 fgRawUtils->SetRawFormatOrder(GetRecParam()->GetOrderParameter());
183 fgRawUtils->SetRawFormatTau(GetRecParam()->GetTau());
184 fgRawUtils->SetNoiseThreshold(GetRecParam()->GetNoiseThreshold());
185 fgRawUtils->SetNPedSamples(GetRecParam()->GetNPedSamples());
9f467289 186 fgRawUtils->SetRemoveBadChannels(GetRecParam()->GetRemoveBadChannels());
187 fgRawUtils->SetFittingAlgorithm(GetRecParam()->GetFittingAlgorithm());
b4133f05 188
5e3106bc 189 fgRawUtils->Raw2Digits(rawReader,digitsArr,fPedestalData);
c615db53 190
191 digitsTree->Fill();
89d338a6 192 digitsArr->Delete();
193 delete digitsArr;
c615db53 194
a68156e6 195}
196
85c25c2e 197
f6019cda 198//____________________________________________________________________________
0e7c6655 199void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
c47157cd 200 AliESDEvent* esd) const
f6019cda 201{
98e9578e 202 // Called by AliReconstruct after Reconstruct() and global tracking and vertexing
85c25c2e 203 // and V0
c47157cd 204 // Works on the current event
85c25c2e 205 // printf(" ## AliEMCALReconstructor::FillESD() is started ### \n ");
206 //return;
92da3372 207
6a0cf740 208 //######################################################
0964c2e9 209 //#########Calculate trigger and set trigger info###########
6a0cf740 210 //######################################################
85c25c2e 211
212 AliEMCALTrigger tr;
213 // tr.SetPatchSize(1); // create 4x4 patches
214 tr.SetSimulation(kFALSE); // Reconstruction mode
215 tr.SetDigitsList(fgDigitsArr);
216 // Get VZERO total multiplicity for jet trigger simulation
217 // The simulation of jey trigger will be incorrect if no VZERO data
218 // at ESD
219 AliESDVZERO* vZero = esd->GetVZEROData();
220 if(vZero) {
221 tr.SetVZER0Multiplicity(vZero->GetMTotV0A() + vZero->GetMTotV0C());
222 }
223 //
0964c2e9 224 tr.Trigger();
85c25c2e 225
0964c2e9 226 Float_t maxAmp2x2 = tr.Get2x2MaxAmplitude();
227 Float_t maxAmpnxn = tr.GetnxnMaxAmplitude();
228 Float_t ampOutOfPatch2x2 = tr.Get2x2AmpOutOfPatch() ;
229 Float_t ampOutOfPatchnxn = tr.GetnxnAmpOutOfPatch() ;
230
0964c2e9 231 Int_t iSM2x2 = tr.Get2x2SuperModule();
232 Int_t iSMnxn = tr.GetnxnSuperModule();
85c25c2e 233 Int_t iModulePhi2x2 = tr.Get2x2ModulePhi();
234 Int_t iModulePhinxn = tr.GetnxnModulePhi();
235 Int_t iModuleEta2x2 = tr.Get2x2ModuleEta();
236 Int_t iModuleEtanxn = tr.GetnxnModuleEta();
0964c2e9 237
85c25c2e 238 AliDebug(2, Form("Trigger 2x2 max amp %f, out amp %f, SM %d, iphi %d ieta %d", maxAmp2x2, ampOutOfPatch2x2, iSM2x2,iModulePhi2x2, iModuleEta2x2));
239 AliDebug(2, Form("Trigger 4x4 max amp %f , out amp %f, SM %d, iphi %d, ieta %d", maxAmpnxn, ampOutOfPatchnxn, iSMnxn,iModulePhinxn, iModuleEtanxn));
0964c2e9 240
241 TVector3 pos2x2(-1,-1,-1);
242 TVector3 posnxn(-1,-1,-1);
243
85c25c2e 244 Int_t iAbsId2x2 = fGeom->GetAbsCellIdFromCellIndexes( iSM2x2, iModulePhi2x2, iModuleEta2x2) ; // should be changed to Module
245 Int_t iAbsIdnxn = fGeom->GetAbsCellIdFromCellIndexes( iSMnxn, iModulePhinxn, iModuleEtanxn) ;
65bdc82f 246 fGeom->GetGlobal(iAbsId2x2, pos2x2);
247 fGeom->GetGlobal(iAbsIdnxn, posnxn);
85c25c2e 248 //printf(" iAbsId2x2 %i iAbsIdnxn %i \n", iAbsId2x2, iAbsIdnxn);
0964c2e9 249
250 TArrayF triggerPosition(6);
251 triggerPosition[0] = pos2x2(0) ;
252 triggerPosition[1] = pos2x2(1) ;
253 triggerPosition[2] = pos2x2(2) ;
254 triggerPosition[3] = posnxn(0) ;
255 triggerPosition[4] = posnxn(1) ;
85c25c2e 256 triggerPosition[5] = posnxn(2) ;
257 //printf(" triggerPosition ");
258 //for(int i=0; i<6; i++) printf(" %i %f : ", i, triggerPosition[i]);
0964c2e9 259
260 TArrayF triggerAmplitudes(4);
261 triggerAmplitudes[0] = maxAmp2x2 ;
262 triggerAmplitudes[1] = ampOutOfPatch2x2 ;
263 triggerAmplitudes[2] = maxAmpnxn ;
264 triggerAmplitudes[3] = ampOutOfPatchnxn ;
85c25c2e 265 //printf("\n triggerAmplitudes ");
266 //for(int i=0; i<4; i++) printf(" %i %f : ", i, triggerAmplitudes[i]);
267 //printf("\n");
85d4cbde 268 //tr.Print("");
60d8ad94 269 //
270 // Trigger jet staff
271 //
272 if(tr.GetNJetThreshold()>0) {
273 // Jet phi/eta
274 Int_t n0 = triggerPosition.GetSize();
275 const TH2F *hpatch = tr.GetJetMatrixE();
276 triggerPosition.Set(n0 + 2);
277 for(Int_t i=0; i<2; i++) triggerPosition[n0+i] = hpatch->GetMean(i+1);
278 // Add jet ampitudes
279 n0 = triggerAmplitudes.GetSize();
280 triggerAmplitudes.Set(n0 + tr.GetNJetThreshold());
281 Double_t *ampJet = tr.GetL1JetThresholds();
282 for(Int_t i=0; i<tr.GetNJetThreshold(); i++){
283 triggerAmplitudes[n0 + i] = Float_t(ampJet[i]);
284 }
285 }
0964c2e9 286 esd->AddEMCALTriggerPosition(triggerPosition);
287 esd->AddEMCALTriggerAmplitudes(triggerAmplitudes);
85c25c2e 288 // Fill trigger hists
289 AliEMCALHistoUtilities::FillTriggersListOfHists(fList,&triggerPosition,&triggerAmplitudes);
aaa3cb7c 290
0e7c6655 291 //########################################
292 //##############Fill CaloCells###############
293 //########################################
aaa3cb7c 294
0e7c6655 295 TClonesArray *digits = new TClonesArray("AliEMCALDigit",1000);
296 TBranch *branchdig = digitsTree->GetBranch("EMCAL");
297 if (!branchdig) {
0c5b726e 298 AliError("can't get the branch with the EMCAL digits !");
0e7c6655 299 return;
300 }
301 branchdig->SetAddress(&digits);
302 digitsTree->GetEvent(0);
303 Int_t nDigits = digits->GetEntries(), idignew = 0 ;
304 AliDebug(1,Form("%d digits",nDigits));
305
306 AliESDCaloCells &emcCells = *(esd->GetEMCALCells());
307 emcCells.CreateContainer(nDigits);
308 emcCells.SetType(AliESDCaloCells::kEMCALCell);
0c5b726e 309 Float_t energy = 0;
0e7c6655 310 for (Int_t idig = 0 ; idig < nDigits ; idig++) {
311 const AliEMCALDigit * dig = (const AliEMCALDigit*)digits->At(idig);
312 if(dig->GetAmp() > 0 ){
0c5b726e 313 energy = (static_cast<AliEMCALClusterizerv1*> (fgClusterizer))->Calibrate(dig->GetAmp(),dig->GetId());
40164976 314 if(energy > 0){ //Digits tagged as bad (dead, hot, not alive) are set to 0 in calibrate, remove them
315 emcCells.SetCell(idignew,dig->GetId(),energy, dig->GetTime());
316 idignew++;
317 }
0e7c6655 318 }
319 }
320 emcCells.SetNumberOfCells(idignew);
321 emcCells.Sort();
322
323 //------------------------------------------------------------
324 //-----------------CLUSTERS-----------------------------
325 //------------------------------------------------------------
326 TObjArray *clusters = new TObjArray(100);
327 TBranch *branch = clustersTree->GetBranch("EMCALECARP");
328 branch->SetAddress(&clusters);
329 clustersTree->GetEvent(0);
330
331 Int_t nClusters = clusters->GetEntries(), nClustersNew=0;
332 AliDebug(1,Form("%d clusters",nClusters));
333 esd->SetFirstEMCALCluster(esd->GetNumberOfCaloClusters()); // Put after Phos clusters
334
85c25c2e 335
6a0cf740 336 //######################################################
337 //#######################TRACK MATCHING###############
338 //######################################################
339 //Fill list of integers, each one is index of track to which the cluster belongs.
340
341 // step 1 - initialize array of matched track indexes
342 Int_t *matchedTrack = new Int_t[nClusters];
343 for (Int_t iclus = 0; iclus < nClusters; iclus++)
344 matchedTrack[iclus] = -1; // neg. index --> no matched track
345
346 // step 2, change the flag for all matched clusters found in tracks
347 Int_t iemcalMatch = -1;
348 Int_t endtpc = esd->GetNumberOfTracks();
349 for (Int_t itrack = 0; itrack < endtpc; itrack++) {
350 AliESDtrack * track = esd->GetTrack(itrack) ; // retrieve track
351 iemcalMatch = track->GetEMCALcluster();
65f4a419 352 if(iemcalMatch >= 0) matchedTrack[iemcalMatch] = itrack;
6a0cf740 353 }
85c25c2e 354
6a0cf740 355 //########################################
85c25c2e 356 //##############Fill CaloClusters#############
6a0cf740 357 //########################################
35397e76 358 esd->SetNumberOfEMCALClusters(nClusters);
5dee926e 359 for (Int_t iClust = 0 ; iClust < nClusters ; iClust++) {
c47157cd 360 const AliEMCALRecPoint * clust = (const AliEMCALRecPoint*)clusters->At(iClust);
8ada0ffe 361 //if(clust->GetClusterType()== AliESDCaloCluster::kEMCALClusterv1) nRP++; else nPC++;
85c60a8e 362 if (Debug()) clust->Print();
a7a5421e 363 // Get information from EMCAL reconstruction points
85c60a8e 364 Float_t xyz[3];
5dee926e 365 TVector3 gpos;
366 clust->GetGlobalPosition(gpos);
35397e76 367 for (Int_t ixyz=0; ixyz<3; ixyz++)
5dee926e 368 xyz[ixyz] = gpos[ixyz];
85c25c2e 369 Float_t elipAxis[2];
370 clust->GetElipsAxis(elipAxis);
35397e76 371 //Create digits lists
372 Int_t cellMult = clust->GetMultiplicity();
373 //TArrayS digiList(digitMult);
374 Float_t *amplFloat = clust->GetEnergiesList();
375 Int_t *digitInts = clust->GetAbsId();
376 TArrayS absIdList(cellMult);
eb972628 377 TArrayD fracList(cellMult);
35397e76 378
379 Int_t newCellMult = 0;
380 for (Int_t iCell=0; iCell<cellMult; iCell++) {
381 if (amplFloat[iCell] > 0) {
382 absIdList[newCellMult] = (UShort_t)(digitInts[iCell]);
eb972628 383 //Uncomment when unfolding is done
384 //if(emcCells.GetCellAmplitude(digitInts[iCell])>0)
385 //fracList[newCellMult] = amplFloat[iCell]/(emcCells.GetCellAmplitude(digitInts[iCell])*calibration);//get cell calibration value
386 //else
387 fracList[newCellMult] = 0;
35397e76 388 newCellMult++;
92da3372 389 }
92da3372 390 }
85c25c2e 391
eb972628 392 absIdList.Set(newCellMult);
393 fracList.Set(newCellMult);
394
35397e76 395 if(newCellMult > 0) { // accept cluster if it has some digit
396 nClustersNew++;
65721814 397 //Primaries
7592dfc4 398 Int_t parentMult = 0;
fa42b1f3 399 Int_t *parentList = clust->GetParents(parentMult);
a7a5421e 400 // fills the ESDCaloCluster
35397e76 401 AliESDCaloCluster * ec = new AliESDCaloCluster() ;
402 ec->SetClusterType(AliESDCaloCluster::kEMCALClusterv1);
7592dfc4 403 ec->SetPosition(xyz);
404 ec->SetE(clust->GetEnergy());
40164976 405
406 //Distance to the nearest bad crystal
407 ec->SetDistanceToBadChannel(clust->GetDistanceToBadTower());
408
35397e76 409 ec->SetNCells(newCellMult);
410 //Change type of list from short to ushort
411 UShort_t *newAbsIdList = new UShort_t[newCellMult];
eb972628 412 Double_t *newFracList = new Double_t[newCellMult];
35397e76 413 for(Int_t i = 0; i < newCellMult ; i++) {
414 newAbsIdList[i]=absIdList[i];
eb972628 415 newFracList[i]=fracList[i];
35397e76 416 }
417 ec->SetCellsAbsId(newAbsIdList);
eb972628 418 ec->SetCellsAmplitudeFraction(newFracList);
35397e76 419 ec->SetClusterDisp(clust->GetDispersion());
420 ec->SetClusterChi2(-1); //not yet implemented
421 ec->SetM02(elipAxis[0]*elipAxis[0]) ;
422 ec->SetM20(elipAxis[1]*elipAxis[1]) ;
78902954 423 ec->SetTOF(clust->GetTime()) ; //time-of-fligh
225cd96d 424 ec->SetNExMax(clust->GetNExMax()); //number of local maxima
35397e76 425 TArrayI arrayTrackMatched(1);// Only one track, temporal solution.
426 arrayTrackMatched[0]= matchedTrack[iClust];
427 ec->AddTracksMatched(arrayTrackMatched);
428
429 TArrayI arrayParents(parentMult,parentList);
430 ec->AddLabels(arrayParents);
431
6a0cf740 432 // add the cluster to the esd object
eb972628 433 esd->AddCaloCluster(ec);
a7a5421e 434 delete ec;
85d4cbde 435 delete [] newAbsIdList ;
eb972628 436 delete [] newFracList ;
35397e76 437 }
438 } // cycle on clusters
85c25c2e 439
35397e76 440 delete [] matchedTrack;
85c25c2e 441
35397e76 442 esd->SetNumberOfEMCALClusters(nClustersNew);
443 //if(nClustersNew != nClusters)
444 //printf(" ##### nClusters %i -> new %i ##### \n", nClusters, nClustersNew );
85c25c2e 445
35397e76 446 //Fill ESDCaloCluster with PID weights
85c25c2e 447 AliEMCALPID *pid = new AliEMCALPID;
448 //pid->SetPrintInfo(kTRUE);
449 pid->SetReconstructor(kTRUE);
450 pid->RunPID(esd);
85c25c2e 451 delete pid;
eb972628 452
89d338a6 453 delete digits;
85c25c2e 454 delete clusters;
eb972628 455
35397e76 456 // printf(" ## AliEMCALReconstructor::FillESD() is ended : ncl %i -> %i ### \n ",nClusters, nClustersNew);
0c5b726e 457
458 //Store EMCAL misalignment matrixes
459 FillMisalMatrixes(esd) ;
460
461}
462
463//==================================================================================
464void AliEMCALReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
465 //Store EMCAL matrixes in ESD Header
466
467 //Check, if matrixes was already stored
468 for(Int_t sm = 0 ; sm < 12; sm++){
469 if(esd->GetEMCALMatrix(sm)!=0)
470 return ;
471 }
472
473 //Create and store matrixes
474 if(!gGeoManager){
475 AliError("Can not store misal. matrixes: no gGeoManager! \n") ;
476 return ;
477 }
478 //Note, that owner of copied marixes will be header
479 char path[255] ;
5e3106bc 480 TGeoHMatrix * m = 0x0;
0c5b726e 481 for(Int_t sm = 0; sm < 12; sm++){
482 sprintf(path,"/ALIC_1/XEN1_1/SMOD_%d",sm+1) ; //In Geometry modules numbered 1,2,.,5
483 if(sm >= 10) sprintf(path,"/ALIC_1/XEN1_1/SM10_%d",sm-10+1) ;
484
9ddc5deb 485 if (gGeoManager->CheckPath(path)){
0c5b726e 486 m = gGeoManager->GetCurrentMatrix() ;
487 esd->SetEMCALMatrix(new TGeoHMatrix(*m),sm) ;
488 }
489 else{
490 esd->SetEMCALMatrix(NULL,sm) ;
491 }
492 }
f6019cda 493}
dc293ae9 494
0c5b726e 495
496
9517d886 497//__________________________________________________________________________
85c25c2e 498void AliEMCALReconstructor::ReadDigitsArrayFromTree(TTree *digitsTree) const
499{
500 // See AliEMCALClusterizer::SetInput(TTree *digitsTree);
501 if(fgDigitsArr) {
502 // Clear previous digits
503 fgDigitsArr->Delete();
504 delete fgDigitsArr;
505 }
506 // Read the digits from the input tree
507 TBranch *branch = digitsTree->GetBranch("EMCAL");
508 if (!branch) {
509 AliError("can't get the branch with the EMCAL digits !");
510 return;
511 }
512 fgDigitsArr = new TClonesArray("AliEMCALDigit",100);
513 branch->SetAddress(&fgDigitsArr);
514 branch->GetEntry(0);
515}
98e9578e 516