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