]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALClusterizerv1.cxx
final geometry and cleanup
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerv1.cxx
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 //*-- Author: Yves Schutz (SUBATECH)  & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
19 //  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
20 //                           of new  IO (à la PHOS)
21 //////////////////////////////////////////////////////////////////////////////
22 //  Clusterization class. Performs clusterization (collects neighbouring active cells) and 
23 //  unfolds the clusters having several local maxima.  
24 //  Results are stored in TreeR#, branches EMCALTowerRP (EMC recPoints),
25 //  EMCALPreShoRP (CPV RecPoints) and AliEMCALClusterizer (Clusterizer with all 
26 //  parameters including input digits branch title, thresholds etc.)
27 //  This TTask is normally called from Reconstructioner, but can as well be used in 
28 //  standalone mode.
29 // Use Case:
30 //  root [0] AliEMCALClusterizerv1 * cl = new AliEMCALClusterizerv1("galice.root")  
31 //  Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
32 //               //reads gAlice from header file "..."                      
33 //  root [1] cl->ExecuteTask()  
34 //               //finds RecPoints in all events stored in galice.root
35 //  root [2] cl->SetDigitsBranch("digits2") 
36 //               //sets another title for Digitis (input) branch
37 //  root [3] cl->SetRecPointsBranch("recp2")  
38 //               //sets another title four output branches
39 //  root [4] cl->SetTowerLocalMaxCut(0.03)  
40 //               //set clusterization parameters
41 //  root [5] cl->ExecuteTask("deb all time")  
42 //               //once more finds RecPoints options are 
43 //               // deb - print number of found rec points
44 //               // deb all - print number of found RecPoints and some their characteristics 
45 //               // time - print benchmarking results
46
47 // --- ROOT system ---
48
49 #include "TROOT.h" 
50 #include "TFile.h" 
51 #include "TFolder.h" 
52 #include "TMath.h" 
53 #include "TMinuit.h"
54 #include "TTree.h" 
55 #include "TSystem.h" 
56 #include "TBenchmark.h"
57
58 // --- Standard library ---
59
60
61 // --- AliRoot header files ---
62 #include "AliEMCALGetter.h"
63 #include "AliEMCALClusterizerv1.h"
64 #include "AliEMCALTowerRecPoint.h"
65 #include "AliEMCALDigit.h"
66 #include "AliEMCALDigitizer.h"
67 #include "AliEMCAL.h"
68 #include "AliEMCALGeometry.h"
69
70 ClassImp(AliEMCALClusterizerv1)
71   
72 //____________________________________________________________________________
73   AliEMCALClusterizerv1::AliEMCALClusterizerv1() : AliEMCALClusterizer()
74 {
75   // default ctor (to be used mainly by Streamer)
76   
77   InitParameters() ; 
78   fDefaultInit = kTRUE ; 
79 }
80
81 //____________________________________________________________________________
82 AliEMCALClusterizerv1::AliEMCALClusterizerv1(const TString alirunFileName, const TString eventFolderName)
83 :AliEMCALClusterizer(alirunFileName, eventFolderName)
84 {
85   // ctor with the indication of the file where header Tree and digits Tree are stored
86   
87   InitParameters() ; 
88   Init() ;
89   fDefaultInit = kFALSE ; 
90
91 }
92
93 //____________________________________________________________________________
94   AliEMCALClusterizerv1::~AliEMCALClusterizerv1()
95 {
96   // dtor
97   
98 }
99
100 //____________________________________________________________________________
101 const TString AliEMCALClusterizerv1::BranchName() const 
102
103    return GetName();
104
105 }
106
107 //____________________________________________________________________________
108 Float_t  AliEMCALClusterizerv1::Calibrate(Int_t amp) const
109 {
110   //To be replased later by the method, reading individual parameters from the database 
111   return -fADCpedestalECA + amp * fADCchannelECA ; 
112 }
113
114 //____________________________________________________________________________
115 void AliEMCALClusterizerv1::Exec(Option_t * option)
116 {
117   // Steering method
118
119   if(strstr(option,"tim"))
120     gBenchmark->Start("EMCALClusterizer"); 
121   
122   if(strstr(option,"print"))
123     Print("") ; 
124
125   AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
126
127   Int_t nevents = gime->MaxEvent() ;
128   Int_t ievent ;
129
130   for(ievent = 0; ievent < nevents; ievent++){
131
132     gime->Event(ievent,"D") ;
133
134     GetCalibrationParameters() ;
135
136     fNumberOfECAClusters = 0;
137            
138     MakeClusters() ;
139
140     if(fToUnfold)
141       MakeUnfolding() ;
142
143     WriteRecPoints() ;
144
145     if(strstr(option,"deb"))  
146       PrintRecPoints(option) ;
147
148     //increment the total number of recpoints per run   
149     fRecPointsInRun += gime->ECARecPoints()->GetEntriesFast() ;  
150   }
151   
152   Unload();
153
154   if(strstr(option,"tim")){
155     gBenchmark->Stop("EMCALClusterizer");
156     printf("Exec took %f seconds for Clusterizing %f seconds per event", 
157          gBenchmark->GetCpuTime("EMCALClusterizer"), gBenchmark->GetCpuTime("EMCALClusterizer")/nevents ) ;
158   }
159 }
160
161 //____________________________________________________________________________
162 Bool_t AliEMCALClusterizerv1::FindFit(AliEMCALTowerRecPoint * emcRP, AliEMCALDigit ** maxAt, Float_t * maxAtEnergy,
163                                     Int_t nPar, Float_t * fitparameters) const
164
165   // Calls TMinuit to fit the energy distribution of a cluster with several maxima 
166   // The initial values for fitting procedure are set equal to the positions of local maxima.
167   // Cluster will be fitted as a superposition of nPar/3 electromagnetic showers
168
169   AliEMCALGetter * gime = AliEMCALGetter::Instance() ; 
170   TClonesArray * digits = gime->Digits() ; 
171   
172   gMinuit->mncler();                     // Reset Minuit's list of paramters
173   gMinuit->SetPrintLevel(-1) ;           // No Printout
174   gMinuit->SetFCN(AliEMCALClusterizerv1::UnfoldingChiSquare) ;  
175                                          // To set the address of the minimization function 
176   TList * toMinuit = new TList();
177   toMinuit->AddAt(emcRP,0) ;
178   toMinuit->AddAt(digits,1) ;
179   
180   gMinuit->SetObjectFit(toMinuit) ;         // To tranfer pointer to UnfoldingChiSquare
181
182   // filling initial values for fit parameters
183   AliEMCALDigit * digit ;
184
185   Int_t ierflg  = 0; 
186   Int_t index   = 0 ;
187   Int_t nDigits = (Int_t) nPar / 3 ;
188
189   Int_t iDigit ;
190
191   AliEMCALGeometry * geom = gime->EMCALGeometry() ; 
192
193   for(iDigit = 0; iDigit < nDigits; iDigit++){
194     digit = maxAt[iDigit]; 
195
196     Int_t relid[3] ;
197     Float_t x = 0.;
198     Float_t z = 0.;
199     geom->AbsToRelNumbering(digit->GetId(), relid) ;
200     geom->PosInAlice(relid, x, z) ;
201
202     Float_t energy = maxAtEnergy[iDigit] ;
203
204     gMinuit->mnparm(index, "x",  x, 0.1, 0, 0, ierflg) ;
205     index++ ;   
206     if(ierflg != 0){ 
207       Error("FindFit", "EMCAL Unfolding  Unable to set initial value for fit procedure : x = %f",  x ) ;
208       return kFALSE;
209     }
210     gMinuit->mnparm(index, "z",  z, 0.1, 0, 0, ierflg) ;
211     index++ ;   
212     if(ierflg != 0){
213        Error("FindFit", "EMCAL Unfolding  Unable to set initial value for fit procedure : z = %f", z) ;
214       return kFALSE;
215     }
216     gMinuit->mnparm(index, "Energy",  energy , 0.05*energy, 0., 4.*energy, ierflg) ;
217     index++ ;   
218     if(ierflg != 0){
219      Error("FindFit", "EMCAL Unfolding  Unable to set initial value for fit procedure : energy = %f", energy) ;      
220       return kFALSE;
221     }
222   }
223
224   Double_t p0 = 0.1 ; // "Tolerance" Evaluation stops when EDM = 0.0001*p0 ; The number of function call slightly
225                       //  depends on it. 
226   Double_t p1 = 1.0 ;
227   Double_t p2 = 0.0 ;
228
229   gMinuit->mnexcm("SET STR", &p2, 0, ierflg) ;   // force TMinuit to reduce function calls  
230   gMinuit->mnexcm("SET GRA", &p1, 1, ierflg) ;   // force TMinuit to use my gradient  
231   gMinuit->SetMaxIterations(5);
232   gMinuit->mnexcm("SET NOW", &p2 , 0, ierflg) ;  // No Warnings
233
234   gMinuit->mnexcm("MIGRAD", &p0, 0, ierflg) ;    // minimize 
235
236   if(ierflg == 4){  // Minimum not found   
237     Error("FindFit", "EMCAL Unfolding  Fit not converged, cluster abandoned " ) ;      
238     return kFALSE ;
239   }            
240   for(index = 0; index < nPar; index++){
241     Double_t err ;
242     Double_t val ;
243     gMinuit->GetParameter(index, val, err) ;    // Returns value and error of parameter index
244     fitparameters[index] = val ;
245    }
246
247   delete toMinuit ;
248   return kTRUE;
249
250 }
251
252 //____________________________________________________________________________
253 void AliEMCALClusterizerv1::GetCalibrationParameters() 
254 {
255   // Gets the parameters for the calibration from the digitizer
256   AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
257
258   if ( !gime->Digitizer() ) 
259     gime->LoadDigitizer();
260   AliEMCALDigitizer * dig = gime->Digitizer();  
261
262   fADCchannelECA   = dig->GetECAchannel() ;
263   fADCpedestalECA  = dig->GetECApedestal();
264 }
265
266 //____________________________________________________________________________
267 void AliEMCALClusterizerv1::Init()
268 {
269   // Make all memory allocations which can not be done in default constructor.
270   // Attach the Clusterizer task to the list of EMCAL tasks
271   
272   AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName.Data());
273
274   AliEMCALGeometry * geom = gime->EMCALGeometry() ;
275
276   fNTowers = geom->GetNZ() *  geom->GetNPhi() ;
277   if(!gMinuit) 
278     gMinuit = new TMinuit(100) ;
279
280  if ( !gime->Clusterizer() ) 
281     gime->PostClusterizer(this); 
282 }
283
284 //____________________________________________________________________________
285 void AliEMCALClusterizerv1::InitParameters()
286
287   // Initializes the parameters for the Clusterizer
288   fNumberOfECAClusters = 0;
289   fECAClusteringThreshold   = 0.0045;  // must be adjusted according to the noise leve set by digitizer
290   fECALocMaxCut = 0.03 ;
291   fECAW0     = 4.5 ;
292   fTimeGate = 1.e-8 ; 
293   fToUnfold = kFALSE ;
294   fRecPointsInRun  = 0 ;
295 }
296
297 //____________________________________________________________________________
298 Int_t AliEMCALClusterizerv1::AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const
299 {
300   // Gives the neighbourness of two digits = 0 are not neighbour but continue searching 
301   //                                       = 1 are neighbour
302   //                                       = 2 are not neighbour but do not continue searching
303   // neighbours are defined as digits having at least a common vertex 
304   // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster 
305   //                                      which is compared to a digit (d2)  not yet in a cluster  
306
307    AliEMCALGeometry * geom = AliEMCALGetter::Instance()->EMCALGeometry() ;
308
309   Int_t rv = 0 ; 
310
311   Int_t relid1[3] ; 
312   geom->AbsToRelNumbering(d1->GetId(), relid1) ; 
313
314   Int_t relid2[3] ; 
315   geom->AbsToRelNumbering(d2->GetId(), relid2) ; 
316   
317   if ( (relid1[0] == relid2[0])){ // inside the same EMCAL Arm 
318     Int_t rowdiff = TMath::Abs( relid1[1] - relid2[1] ) ;  
319     Int_t coldiff = TMath::Abs( relid1[2] - relid2[2] ) ;  
320     
321     if (( coldiff <= 1 )  && ( rowdiff <= 1 )){
322       if(TMath::Abs(d1->GetTime() - d2->GetTime() ) < fTimeGate)
323         rv = 1 ; 
324     }
325     else {
326       if((relid2[1] > relid1[1]) && (relid2[2] > relid1[2]+1)) 
327         rv = 2; //  Difference in row numbers is too large to look further 
328     }
329
330   } 
331   else {
332     
333     if(relid1[0] < relid2[0])  
334       rv=0 ;
335   }
336
337   if (gDebug == 2 ) 
338     printf("AreNeighbours: neighbours=%d, id1=%d, relid1=%d,%d,%d \n id2=%d, relid2=%d,%d,%d ", 
339          rv, d1->GetId(), relid1[0], relid1[1], relid1[2],
340          d2->GetId(), relid2[0], relid2[1], relid2[2]) ;   
341   
342   return rv ; 
343 }
344
345 //____________________________________________________________________________
346 void AliEMCALClusterizerv1::Unload() 
347 {
348   // Unloads the Digits and RecPoints
349   AliEMCALGetter * gime = AliEMCALGetter::Instance() ; 
350   gime->EmcalLoader()->UnloadDigits() ; 
351   gime->EmcalLoader()->UnloadRecPoints() ; 
352 }
353  
354 //____________________________________________________________________________
355 void AliEMCALClusterizerv1::WriteRecPoints()
356 {
357
358   // Creates new branches with given title
359   // fills and writes into TreeR.
360
361   AliEMCALGetter *gime = AliEMCALGetter::Instance() ; 
362
363   TObjArray * aECARecPoints = gime->ECARecPoints() ; 
364
365   TClonesArray * digits = gime->Digits() ; 
366   TTree * treeR = gime->TreeR(); ; 
367   
368   Int_t index ;
369
370   //Evaluate position, dispersion and other RecPoint properties for EC section
371   for(index = 0; index < aECARecPoints->GetEntries(); index++)
372     (dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(index)))->EvalAll(fECAW0,digits) ;
373   
374   aECARecPoints->Sort() ;
375
376   for(index = 0; index < aECARecPoints->GetEntries(); index++)
377     (dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(index)))->SetIndexInList(index) ;
378
379   aECARecPoints->Expand(aECARecPoints->GetEntriesFast()) ; 
380   
381   Int_t bufferSize = 32000 ;    
382   Int_t splitlevel = 0 ; 
383
384   //EC section branch
385   TBranch * branchECA = treeR->Branch("EMCALECARP","TObjArray",&aECARecPoints,bufferSize,splitlevel);
386   branchECA->SetTitle(BranchName());
387
388   branchECA->Fill() ;
389
390   gime->WriteRecPoints("OVERWRITE");
391   gime->WriteClusterizer("OVERWRITE");
392 }
393
394 //____________________________________________________________________________
395 void AliEMCALClusterizerv1::MakeClusters()
396 {
397   // Steering method to construct the clusters stored in a list of Reconstructed Points
398   // A cluster is defined as a list of neighbour digits
399     
400   AliEMCALGetter * gime = AliEMCALGetter::Instance() ; 
401
402   AliEMCALGeometry * geom = gime->EMCALGeometry() ; 
403
404   TObjArray * aECARecPoints  = gime->ECARecPoints() ; 
405
406   aECARecPoints->Delete() ;
407
408   TClonesArray * digits = gime->Digits() ; 
409
410   TIter next(digits) ; 
411   AliEMCALDigit * digit ; 
412   Int_t ndigECA=0 ; 
413
414   // count the number of digits in ECA section
415   while ( (digit = dynamic_cast<AliEMCALDigit *>(next())) ) { // scan over the list of digits 
416     if (geom->IsInECA(digit->GetId())) 
417       ndigECA++ ; 
418     else {
419       Error("MakeClusters", "id = %d is a wrong ID!", digit->GetId()) ; 
420       abort() ;
421     }
422   }
423   TClonesArray * digitsC =  dynamic_cast<TClonesArray*>(digits->Clone()) ;
424   // Clusterization starts  
425   
426   TIter nextdigit(digitsC) ; 
427   
428   while ( (digit = dynamic_cast<AliEMCALDigit *>(nextdigit())) ) { // scan over the list of digitsC
429     AliEMCALRecPoint * clu = 0 ; 
430     
431     TArrayI clusterECAdigitslist(50);   
432  
433     Bool_t inECA = kFALSE;
434     if( geom->IsInECA(digit->GetId()) ) {
435        inECA = kTRUE ;
436      }    
437     if (gDebug == 2) { 
438       if (inECA)
439         printf("MakeClusters: id = %d, ene = %f , thre = %f", 
440              digit->GetId(),Calibrate(digit->GetAmp()), fECAClusteringThreshold) ;  
441     }
442     if (inECA && (Calibrate(digit->GetAmp()) > fECAClusteringThreshold  ) ){
443
444     Int_t iDigitInECACluster = 0;
445       // Find the seed
446       if( geom->IsInECA(digit->GetId()) ) {   
447         // start a new Tower RecPoint
448         if(fNumberOfECAClusters >= aECARecPoints->GetSize()) 
449           aECARecPoints->Expand(2*fNumberOfECAClusters+1) ;
450         AliEMCALTowerRecPoint * rp = new  AliEMCALTowerRecPoint("") ; 
451         rp->SetECA() ; 
452         aECARecPoints->AddAt(rp, fNumberOfECAClusters) ;
453         clu = dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(fNumberOfECAClusters)) ; 
454         fNumberOfECAClusters++ ; 
455         clu->AddDigit(*digit, Calibrate(digit->GetAmp())) ; 
456         clusterECAdigitslist[iDigitInECACluster] = digit->GetIndexInList() ;    
457         iDigitInECACluster++ ; 
458         digitsC->Remove(digit) ; 
459         if (gDebug == 2 ) 
460           printf("MakeClusters: OK id = %d, ene = %f , thre = %f ", digit->GetId(),Calibrate(digit->GetAmp()), fECAClusteringThreshold) ;  
461         
462       }    
463       nextdigit.Reset() ;
464       
465       AliEMCALDigit * digitN ; 
466       Int_t index = 0 ;
467
468       // Do the Clustering
469
470       while (index < iDigitInECACluster){ // scan over digits already in cluster 
471         digit =  (AliEMCALDigit*)digits->At(clusterECAdigitslist[index])  ;      
472         index++ ; 
473         while ( (digitN = (AliEMCALDigit *)nextdigit()) ) { // scan over the reduced list of digits 
474           Int_t ineb = AreNeighbours(digit, digitN);       // call (digit,digitN) in THAT oder !!!!! 
475          switch (ineb ) {
476           case 0 :   // not a neighbour
477             break ;
478           case 1 :   // are neighbours 
479             clu->AddDigit(*digitN, Calibrate( digitN->GetAmp()) ) ;
480             clusterECAdigitslist[iDigitInECACluster] = digitN->GetIndexInList() ; 
481             iDigitInECACluster++ ; 
482             digitsC->Remove(digitN) ;
483             break ;
484           case 2 :   // too far from each other
485             goto endofloop1;   
486           } // switch
487           
488         } // while digitN
489         
490       endofloop1: ;
491         nextdigit.Reset() ; 
492       } // loop over ECA cluster
493     } // energy theshold     
494   } // while digit  
495   delete digitsC ;
496 }
497
498 //____________________________________________________________________________
499 void AliEMCALClusterizerv1::MakeUnfolding() const
500 {
501   Fatal("AliEMCALClusterizerv1::MakeUnfolding", "--> Unfolding not implemented") ;
502  
503 }
504
505 //____________________________________________________________________________
506 Double_t  AliEMCALClusterizerv1::ShowerShape(Double_t r)
507
508   // Shape of the shower (see EMCAL TDR)
509   // If you change this function, change also the gradient evaluation in ChiSquare()
510
511   Double_t r4    = r*r*r*r ;
512   Double_t r295  = TMath::Power(r, 2.95) ;
513   Double_t shape = TMath::Exp( -r4 * (1. / (2.32 + 0.26 * r4) + 0.0316 / (1 + 0.0652 * r295) ) ) ;
514   return shape ;
515 }
516
517 //____________________________________________________________________________
518 void  AliEMCALClusterizerv1::UnfoldCluster(AliEMCALTowerRecPoint * /*iniTower*/, 
519                                            Int_t /*nMax*/, 
520                                            AliEMCALDigit ** /*maxAt*/, 
521                                            Float_t * /*maxAtEnergy*/) const
522 {
523   // Performs the unfolding of a cluster with nMax overlapping showers 
524   
525   Fatal("UnfoldCluster", "--> Unfolding not implemented") ;
526
527 }
528
529 //_____________________________________________________________________________
530 void AliEMCALClusterizerv1::UnfoldingChiSquare(Int_t & /*nPar*/, Double_t * /*Grad*/,
531                                                Double_t & /*fret*/,
532                                                Double_t * /*x*/, Int_t /*iflag*/)
533 {
534   // Calculates the Chi square for the cluster unfolding minimization
535   // Number of parameters, Gradient, Chi squared, parameters, what to do
536   
537   ::Fatal("UnfoldingChiSquare","Unfolding not implemented") ;
538 }
539 //____________________________________________________________________________
540 void AliEMCALClusterizerv1::Print(Option_t * /*option*/)const
541 {
542   // Print clusterizer parameters
543
544   TString message("\n") ; 
545   
546   if( strcmp(GetName(), "") !=0 ){
547     
548     // Print parameters
549  
550     TString taskName(GetName()) ;
551     taskName.ReplaceAll(Version(), "") ;
552     
553     printf("--------------- "); 
554     printf(taskName.Data()) ; 
555     printf(" "); 
556     printf(GetTitle()) ; 
557     printf("-----------\n");  
558     printf("Clusterizing digits from the file: "); 
559     printf(taskName.Data());  
560     printf("\n                           Branch: "); 
561     printf(GetName()); 
562     printf("\n                       ECA Local Maximum cut    = %f", fECALocMaxCut); 
563     printf("\n                       ECA Logarothmic weight   = %f", fECAW0); 
564     if(fToUnfold)
565       printf("\nUnfolding on\n");
566     else
567       printf("\nUnfolding off\n");
568     
569     printf("------------------------------------------------------------------"); 
570   }
571   else
572     printf("AliEMCALClusterizerv1 not initialized ") ;
573 }
574
575 //____________________________________________________________________________
576 void AliEMCALClusterizerv1::PrintRecPoints(Option_t * option)
577 {
578   // Prints list of RecPoints produced at the current pass of AliEMCALClusterizer 
579   TObjArray * aECARecPoints = AliEMCALGetter::Instance()->ECARecPoints() ; 
580   printf("PrintRecPoints: Clusterization result:") ; 
581   
582   printf("event # %d\n", gAlice->GetEvNumber() ) ;
583   printf("           Found %d ECA Rec Points\n ", 
584          aECARecPoints->GetEntriesFast()) ; 
585
586   fRecPointsInRun +=  aECARecPoints->GetEntriesFast() ; 
587   
588   if(strstr(option,"all")) {
589     Int_t index =0;
590     printf("\n-----------------------------------------------------------------------\n") ;
591     printf("Clusters in ECAL section\n") ;
592     printf("Index    Ene(GeV) Multi Module     phi     r   theta    X    Y      Z   Dispersion Lambda 1   Lambda 2  # of prim  Primaries list\n") ;      
593     
594     for (index = 0 ; index < aECARecPoints->GetEntries() ; index++) {
595       AliEMCALTowerRecPoint * rp = dynamic_cast<AliEMCALTowerRecPoint * >(aECARecPoints->At(index)) ; 
596       TVector3  globalpos;  
597       rp->GetGlobalPosition(globalpos);
598       TVector3  localpos;  
599       rp->GetLocalPosition(localpos);
600       Float_t lambda[2]; 
601       rp->GetElipsAxis(lambda);
602       Int_t * primaries; 
603       Int_t nprimaries;
604       primaries = rp->GetPrimaries(nprimaries);
605       printf("\n%6d  %8.4f  %3d     %2d     %4.1f    %4.1f %4.1f  %4.1f %4.1f %4.1f    %4.1f   %4f  %4f    %2d     : ", 
606              rp->GetIndexInList(), rp->GetEnergy(), rp->GetMultiplicity(), rp->GetEMCALArm(), 
607              globalpos.X(), globalpos.Y(), globalpos.Z(), localpos.X(), localpos.Y(), localpos.Z(), 
608              rp->GetDispersion(), lambda[0], lambda[1], nprimaries) ; 
609       for (Int_t iprimary=0; iprimary<nprimaries; iprimary++) {
610         printf("%d ", primaries[iprimary] ) ; 
611       } 
612     }
613     printf("\n-----------------------------------------------------------------------\n");
614   }
615 }