]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSTrackSegmentMakerv1.cxx
coding conventions corrections
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrackSegmentMakerv1.cxx
CommitLineData
d15a28e7 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 **************************************************************************/
b2a60966 15/* $Id$ */
d15a28e7 16//_________________________________________________________________________
b2a60966 17// Implementation version 1 of algorithm class to construct PHOS track segments
f035f6ce 18// Track segment for PHOS is list of
19// EMC RecPoint + (possibly) CPV RecPoint + (possibly) PPSD RecPoint
a4e98857 20// To find TrackSegments we do the following:
21// for each EMC RecPoints we look at
fbf811ec 22// CPV/PPSD RecPoints in the radious fRcpv.
a4e98857 23// If there is such a CPV RecPoint,
24// we make "Link" it is just indexes of EMC and CPV/PPSD RecPoint and distance
25// between them in the PHOS plane.
26// Then we sort "Links" and starting from the
27// least "Link" pointing to the unassined EMC and CPV RecPoints assing them to
28// new TrackSegment.
29// If there is no CPV/PPSD RecPoint we make TrackSegment
30// consisting from EMC alone. There is no TrackSegments without EMC RecPoint.
21cd0c07 31//// In principle this class should be called from AliPHOSReconstructioner, but
a4e98857 32// one can use it as well in standalone mode.
33// Use case:
fc12304f 34// root [0] AliPHOSTrackSegmentMakerv1 * t = new AliPHOSTrackSegmentMaker("galice.root", "tracksegmentsname", "recpointsname")
a4e98857 35// Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
fc12304f 36// // reads gAlice from header file "galice.root", uses recpoints stored in the branch names "recpointsname" (default = "Default")
37// // and saves recpoints in branch named "tracksegmentsname" (default = "recpointsname")
a4e98857 38// root [1] t->ExecuteTask()
39// root [2] t->SetMaxEmcPpsdDistance(5)
40// root [3] t->SetTrackSegmentsBranch("max distance 5 cm")
41// root [4] t->ExecuteTask("deb all time")
f035f6ce 42//
fc12304f 43//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH) & Yves Schutz (SUBATECH)
b2a60966 44//
d15a28e7 45
46// --- ROOT system ---
2731cd1e 47#include "TROOT.h"
48#include "TFile.h"
b9791748 49 //#include "TFolder.h"
2731cd1e 50#include "TTree.h"
b9791748 51 //#include "TSystem.h"
2731cd1e 52#include "TBenchmark.h"
d15a28e7 53
21cd0c07 54// --- Standard library ---
d15a28e7 55
56// --- AliRoot header files ---
57
58#include "AliPHOSTrackSegmentMakerv1.h"
b9791748 59 //#include "AliPHOSClusterizerv1.h"
d15a28e7 60#include "AliPHOSTrackSegment.h"
b9791748 61 //#include "AliPHOSCpvRecPoint.h"
d15a28e7 62#include "AliPHOSLink.h"
7b7c1533 63#include "AliPHOSGetter.h"
b9791748 64 //#include "AliPHOS.h"
d15a28e7 65#include "AliRun.h"
66
67ClassImp( AliPHOSTrackSegmentMakerv1)
68
69
70//____________________________________________________________________________
2bd5457f 71 AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1() : AliPHOSTrackSegmentMaker()
d15a28e7 72{
7b7c1533 73 // default ctor (to be used mainly by Streamer)
74
8d0f3f77 75 InitParameters() ;
fc12304f 76
2b60655b 77 fTrackSegmentsInRun = 0 ;
92f521a9 78
79 fDefaultInit = kTRUE ;
d15a28e7 80}
7b7c1533 81
9f616d61 82//____________________________________________________________________________
fbf811ec 83 AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const char * headerFile, const char * name, const Bool_t toSplit) : AliPHOSTrackSegmentMaker(headerFile, name, toSplit)
2731cd1e 84{
85 // ctor
2731cd1e 86
8d0f3f77 87 InitParameters() ;
b9791748 88
2b60655b 89 fTrackSegmentsInRun = 0 ;
90
7b7c1533 91 Init() ;
92f521a9 92
93 fDefaultInit = kFALSE ;
94
2731cd1e 95}
98cbd830 96
2731cd1e 97//____________________________________________________________________________
98 AliPHOSTrackSegmentMakerv1::~AliPHOSTrackSegmentMakerv1()
99{
100 // dtor
92f521a9 101 // fDefaultInit = kTRUE if TrackSegmentMaker created by default ctor (to get just the parameters)
79bb1b62 102
92f521a9 103 if (!fDefaultInit) {
104 delete fLinkUpArray ;
105
79bb1b62 106 fSplitFile = 0 ;
107 }
d15a28e7 108}
9f616d61 109
8d0f3f77 110
fc12304f 111//____________________________________________________________________________
112const TString AliPHOSTrackSegmentMakerv1::BranchName() const
113{
b9791748 114 // retrieves the branch name
fc12304f 115 TString branchName(GetName() ) ;
116 branchName.Remove(branchName.Index(Version())-1) ;
117 return branchName ;
118}
119
d15a28e7 120//____________________________________________________________________________
2731cd1e 121void AliPHOSTrackSegmentMakerv1::FillOneModule()
9f616d61 122{
f035f6ce 123 // Finds first and last indexes between which
124 // clusters from one PHOS module are
fc12304f 125
7b7c1533 126 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
fbf811ec 127 TObjArray * emcRecPoints = gime->EmcRecPoints() ;
128 TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
9688c1dd 129
2731cd1e 130 //First EMC clusters
7b7c1533 131 Int_t totalEmc = emcRecPoints->GetEntriesFast() ;
2731cd1e 132 for(fEmcFirst = fEmcLast; (fEmcLast < totalEmc) &&
29b077b5 133 ((dynamic_cast<AliPHOSRecPoint *>(emcRecPoints->At(fEmcLast)))->GetPHOSMod() == fModule );
2731cd1e 134 fEmcLast ++) ;
135
2731cd1e 136 //Now CPV clusters
7b7c1533 137 Int_t totalCpv = cpvRecPoints->GetEntriesFast() ;
6ad0bfa0 138
2731cd1e 139 for(fCpvFirst = fCpvLast; (fCpvLast < totalCpv) &&
29b077b5 140 ((dynamic_cast<AliPHOSRecPoint *>(cpvRecPoints->At(fCpvLast)))->GetPHOSMod() == fModule );
2731cd1e 141 fCpvLast ++) ;
9688c1dd 142
d15a28e7 143}
7b7c1533 144
d15a28e7 145//____________________________________________________________________________
baef0810 146Float_t AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * emcClu,AliPHOSRecPoint * cpvClu, Bool_t &toofar)const
d15a28e7 147{
b2a60966 148 // Calculates the distance between the EMC RecPoint and the PPSD RecPoint
a4e98857 149 // Clusters are sorted in "rows" and "columns" of width 1 cm
f035f6ce 150
2731cd1e 151 Float_t delta = 1 ; // Width of the rows in sorting of RecPoints (in cm)
152 // if you change this value, change it as well in xxxRecPoint::Compare()
fbf811ec 153 Float_t r = fRcpv ;
d15a28e7 154
155 TVector3 vecEmc ;
2731cd1e 156 TVector3 vecCpv ;
157
158 emcClu->GetLocalPosition(vecEmc) ;
159 cpvClu->GetLocalPosition(vecCpv) ;
160
161 if(emcClu->GetPHOSMod() == cpvClu->GetPHOSMod()){
fbf811ec 162 if(vecCpv.X() <= vecEmc.X() + fRcpv + 2*delta ){
2731cd1e 163
164 vecCpv = vecCpv - vecEmc ;
165 r = vecCpv.Mag() ;
92862013 166 toofar = kFALSE ;
2731cd1e 167
168 } // if xPpsd >= xEmc + ...
169 else
170 toofar = kTRUE ;
d15a28e7 171 }
172 else
92862013 173 toofar = kTRUE ;
7956ec10 174
175 //toofar = kFALSE ;
176
d15a28e7 177
92862013 178 return r ;
d15a28e7 179}
180
7b7c1533 181//____________________________________________________________________________
182void AliPHOSTrackSegmentMakerv1::Init()
183{
184 // Make all memory allocations that are not possible in default constructor
185
186 if ( strcmp(GetTitle(), "") == 0 )
187 SetTitle("galice.root") ;
9688c1dd 188
fbf811ec 189 TString branchname = GetName() ;
190 branchname.Remove(branchname.Index(Version())-1) ;
191 AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(),branchname.Data(), fToSplit ) ;
7b7c1533 192 if ( gime == 0 ) {
21cd0c07 193 Error("Init", "Could not obtain the Getter object !") ;
7b7c1533 194 return ;
195 }
196
fbf811ec 197 fSplitFile = 0 ;
198 if(fToSplit){
199 //First - extract full path if necessary
200 TString fileName(GetTitle()) ;
201 Ssiz_t islash = fileName.Last('/') ;
202 if(islash<fileName.Length())
203 fileName.Remove(islash+1,fileName.Length()) ;
204 else
205 fileName="" ;
206 fileName+="PHOS.RecData." ;
207 if((strcmp(branchname.Data(),"Default")!=0)&&(strcmp(branchname.Data(),"")!=0)){
208 fileName+=branchname ;
209 fileName+="." ;
210 }
211 fileName+="root" ;
212 fSplitFile = static_cast<TFile*>(gROOT->GetFile(fileName.Data()));
213 if(!fSplitFile)
214 fSplitFile = TFile::Open(fileName.Data(),"update") ;
215 }
216
7b7c1533 217 fLinkUpArray = new TClonesArray("AliPHOSLink", 1000);
218
7b7c1533 219
fbf811ec 220 gime->PostTrackSegmentMaker(this) ;
fc12304f 221 gime->PostTrackSegments(BranchName()) ;
7b7c1533 222
223}
224
8d0f3f77 225//____________________________________________________________________________
226void AliPHOSTrackSegmentMakerv1::InitParameters()
227{
b9791748 228 // initializes parameters used for the construction of the tacksegments
fbf811ec 229 fRcpv = 10. ;
8d0f3f77 230 fEmcFirst = 0 ;
231 fEmcLast = 0 ;
232 fCpvFirst = 0 ;
233 fCpvLast = 0 ;
234 fLinkUpArray = 0 ;
235 TString tsmName( GetName()) ;
236 if (tsmName.IsNull() )
237 tsmName = "Default" ;
238 tsmName.Append(":") ;
239 tsmName.Append(Version()) ;
240 SetName(tsmName) ;
241}
242
243
d15a28e7 244//____________________________________________________________________________
baef0810 245void AliPHOSTrackSegmentMakerv1::MakeLinks()const
d15a28e7 246{
f035f6ce 247 // Finds distances (links) between all EMC and PPSD clusters,
fbf811ec 248 // which are not further apart from each other than fRcpv
f035f6ce 249 // and sort them in accordance with this distance
9688c1dd 250
7b7c1533 251 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
fbf811ec 252 TObjArray * emcRecPoints = gime->EmcRecPoints() ;
253 TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
7b7c1533 254
2731cd1e 255 fLinkUpArray->Clear() ;
2731cd1e 256
2731cd1e 257 AliPHOSRecPoint * cpv ;
92862013 258 AliPHOSEmcRecPoint * emcclu ;
28c3a259 259
d15a28e7 260 Int_t iLinkUp = 0 ;
261
28c3a259 262 Int_t iEmcRP;
2731cd1e 263 for(iEmcRP = fEmcFirst; iEmcRP < fEmcLast; iEmcRP++ ) {
29b077b5 264 emcclu = dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(iEmcRP)) ;
2731cd1e 265
9688c1dd 266 Bool_t toofar ;
2731cd1e 267 Int_t iCpv = 0 ;
268 for(iCpv = fCpvFirst; iCpv < fCpvLast;iCpv++ ) {
28c3a259 269
29b077b5 270 cpv = dynamic_cast<AliPHOSRecPoint *>(cpvRecPoints->At(iCpv)) ;
2731cd1e 271 Float_t r = GetDistanceInPHOSPlane(emcclu, cpv, toofar) ;
d15a28e7 272
92862013 273 if(toofar)
d15a28e7 274 break ;
fbf811ec 275 if(r < fRcpv) {
2731cd1e 276 new ((*fLinkUpArray)[iLinkUp++]) AliPHOSLink(r, iEmcRP, iCpv) ;
28c3a259 277 }
d15a28e7 278 }
28c3a259 279 }
d15a28e7 280
9688c1dd 281 fLinkUpArray->Sort() ; //first links with smallest distances
d15a28e7 282}
28c3a259 283
d15a28e7 284//____________________________________________________________________________
2731cd1e 285void AliPHOSTrackSegmentMakerv1::MakePairs()
6ad0bfa0 286{
f035f6ce 287 // Using the previously made list of "links", we found the smallest link - i.e.
a4e98857 288 // link with the least distance between EMC and CPV and pointing to still
f035f6ce 289 // unassigned RecParticles. We assign these RecPoints to TrackSegment and
290 // remove them from the list of "unassigned".
6ad0bfa0 291
7b7c1533 292 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
fbf811ec 293 TObjArray * emcRecPoints = gime->EmcRecPoints() ;
294 TObjArray * cpvRecPoints = gime->CpvRecPoints() ;
fc12304f 295 TClonesArray * trackSegments = gime->TrackSegments(BranchName()) ;
9688c1dd 296
01a599c9 297 //Make arrays to mark clusters already chosen
2731cd1e 298 Int_t * emcExist = 0;
299 if(fEmcLast > fEmcFirst)
300 emcExist = new Int_t[fEmcLast-fEmcFirst] ;
301
302 Int_t index;
303 for(index = 0; index <fEmcLast-fEmcFirst; index ++)
304 emcExist[index] = 1 ;
305
306 Bool_t * cpvExist = 0;
307 if(fCpvLast > fCpvFirst)
308 cpvExist = new Bool_t[fCpvLast-fCpvFirst] ;
309 for(index = 0; index <fCpvLast-fCpvFirst; index ++)
310 cpvExist[index] = kTRUE ;
311
2731cd1e 312
313 // Finds the smallest links and makes pairs of CPV and EMC clusters with smallest distance
2731cd1e 314 TIter nextUp(fLinkUpArray) ;
d15a28e7 315
d15a28e7 316 AliPHOSLink * linkUp ;
9688c1dd 317
2731cd1e 318 AliPHOSRecPoint * nullpointer = 0 ;
9688c1dd 319
29b077b5 320 while ( (linkUp = static_cast<AliPHOSLink *>(nextUp()) ) ){
9688c1dd 321
2731cd1e 322 if(emcExist[linkUp->GetEmc()-fEmcFirst] != -1){ //without ppsd Up yet
d15a28e7 323
2731cd1e 324 if(cpvExist[linkUp->GetPpsd()-fCpvFirst]){ //CPV still exist
7956ec10 325
9688c1dd 326 new ((* trackSegments)[fNTrackSegments])
29b077b5 327 AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(linkUp->GetEmc())) ,
328 dynamic_cast<AliPHOSRecPoint *>(cpvRecPoints->At(linkUp->GetPpsd()))) ;
329 (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
9688c1dd 330 fNTrackSegments++ ;
331
2731cd1e 332 emcExist[linkUp->GetEmc()-fEmcFirst] = -1 ; //Mark emc that Cpv was found
333 //mark CPV recpoint as already used
9688c1dd 334 cpvExist[linkUp->GetPpsd()-fCpvFirst] = kFALSE ;
7956ec10 335 } //if ppsdUp still exist
28c3a259 336 }
337 }
338
2731cd1e 339 //look through emc recPoints left without CPV/PPSD
340 if(emcExist){ //if there is emc rec point
341 Int_t iEmcRP ;
342 for(iEmcRP = 0; iEmcRP < fEmcLast-fEmcFirst ; iEmcRP++ ){
343 if(emcExist[iEmcRP] > 0 ){
9688c1dd 344 new ((*trackSegments)[fNTrackSegments])
29b077b5 345 AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(iEmcRP+fEmcFirst)),
9688c1dd 346 nullpointer) ;
29b077b5 347 (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
2731cd1e 348 fNTrackSegments++;
349 }
d15a28e7 350 }
d15a28e7 351 }
780a31c1 352 delete [] emcExist ;
353 delete [] cpvExist ;
d15a28e7 354}
355
356//____________________________________________________________________________
2731cd1e 357void AliPHOSTrackSegmentMakerv1::Exec(Option_t * option)
d15a28e7 358{
a4e98857 359 // STEERing method
28c3a259 360
7b7c1533 361 if( strcmp(GetName(), "")== 0 )
362 Init() ;
6ad0bfa0 363
2731cd1e 364 if(strstr(option,"tim"))
b3f97575 365 gBenchmark->Start("PHOSTSMaker");
7b7c1533 366
367 if(strstr(option,"print")) {
368 Print("") ;
369 return ;
370 }
d15a28e7 371
9688c1dd 372 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
fbf811ec 373 if(gime->BranchExists("TrackSegments") )
374 return ;
55ea5766 375 const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
fbf811ec 376 Int_t nevents = gime->MaxEvent() ; //(Int_t) gAlice->TreeE()->GetEntries() ;
7b7c1533 377 Int_t ievent ;
378
379 for(ievent = 0; ievent < nevents; ievent++){
01a599c9 380
55ea5766 381 gime->Event(ievent,"R") ;
55ea5766 382 //Make some initializations
383 fNTrackSegments = 0 ;
384 fEmcFirst = 0 ;
385 fEmcLast = 0 ;
386 fCpvFirst = 0 ;
387 fCpvLast = 0 ;
fc12304f 388 gime->TrackSegments(BranchName())->Clear() ;
55ea5766 389
9688c1dd 390 // if(!ReadRecPoints(ievent)) continue; //reads RecPoints for event ievent
391
7b7c1533 392 for(fModule = 1; fModule <= geom->GetNModules() ; fModule++ ){
2731cd1e 393
394 FillOneModule() ;
395
396 MakeLinks() ;
397
398 MakePairs() ;
399
400 }
28c3a259 401
7b7c1533 402 WriteTrackSegments(ievent) ;
403
2731cd1e 404 if(strstr(option,"deb"))
405 PrintTrackSegments(option) ;
94de8339 406
407 //increment the total number of track segments per run
fc12304f 408 fTrackSegmentsInRun += gime->TrackSegments(BranchName())->GetEntriesFast() ;
7b7c1533 409
2731cd1e 410 }
9f616d61 411
2731cd1e 412 if(strstr(option,"tim")){
413 gBenchmark->Stop("PHOSTSMaker");
21cd0c07 414 Info("Exec", "took %f seconds for making TS %f seconds per event",
415 gBenchmark->GetCpuTime("PHOSTSMaker"), gBenchmark->GetCpuTime("PHOSTSMaker")/nevents) ;
2731cd1e 416 }
7b7c1533 417
d15a28e7 418}
7b7c1533 419
d15a28e7 420//____________________________________________________________________________
baef0810 421void AliPHOSTrackSegmentMakerv1::Print(Option_t * option)const
a4e98857 422{
baef0810 423 // Print TrackSegmentMaker parameters
424
21cd0c07 425 TString message("") ;
7b7c1533 426 if( strcmp(GetName(), "") != 0 ) {
21cd0c07 427 message = "\n======== AliPHOSTrackSegmentMakerv1 ========\n" ;
428 message += "Making Track segments\n" ;
429 message += "with parameters:\n" ;
430 message += " Maximal EMC - CPV (PPSD) distance (cm) %f\n" ;
431 message += "============================================\n" ;
432 Info("Print", message.Data(),fRcpv) ;
2731cd1e 433 }
434 else
21cd0c07 435 Info("Print", "AliPHOSTrackSegmentMakerv1 not initialized ") ;
d15a28e7 436}
7b7c1533 437
d15a28e7 438//____________________________________________________________________________
7b7c1533 439void AliPHOSTrackSegmentMakerv1::WriteTrackSegments(Int_t event)
a4e98857 440{
f035f6ce 441 // Writes found TrackSegments to TreeR. Creates branches
442 // "PHOSTS" and "AliPHOSTrackSegmentMaker" with the same title.
443 // In the former branch found TrackSegments are stored, while
444 // in the latter all parameters, with which TS were made.
445 // ROOT does not allow overwriting existing branches, therefore
a4e98857 446 // first we check, if branches with the same title already exist.
f035f6ce 447 // If yes - exits without writing.
2731cd1e 448
7b7c1533 449 AliPHOSGetter *gime = AliPHOSGetter::GetInstance() ;
55ea5766 450
fbf811ec 451 TClonesArray * trackSegments = gime->TrackSegments() ;
55ea5766 452 trackSegments->Expand(trackSegments->GetEntriesFast()) ;
fbf811ec 453 TTree * treeR ;
454
455 if(fToSplit){
456 if(!fSplitFile)
457 return ;
458 fSplitFile->cd() ;
459 char name[10] ;
460 sprintf(name,"%s%d", "TreeR",event) ;
461 treeR = dynamic_cast<TTree*>(fSplitFile->Get(name));
462 }
463 else{
464 treeR = gAlice->TreeR();
465 }
466
467 if(!treeR){
8d0f3f77 468 gAlice->MakeTree("R", fSplitFile);
fbf811ec 469 treeR = gAlice->TreeR() ;
470 }
471
2731cd1e 472 //First TS
473 Int_t bufferSize = 32000 ;
8d0f3f77 474 TBranch * tsBranch = treeR->Branch("PHOSTS",&trackSegments,bufferSize);
fc12304f 475 tsBranch->SetTitle(BranchName());
8d0f3f77 476
2731cd1e 477 //Second -TSMaker
478 Int_t splitlevel = 0 ;
479 AliPHOSTrackSegmentMakerv1 * ts = this ;
8d0f3f77 480 TBranch * tsMakerBranch = treeR->Branch("AliPHOSTrackSegmentMaker","AliPHOSTrackSegmentMakerv1",
2731cd1e 481 &ts,bufferSize,splitlevel);
fc12304f 482 tsMakerBranch->SetTitle(BranchName());
8d0f3f77 483
761e34c0 484 tsBranch->Fill() ;
485 tsMakerBranch->Fill() ;
eec3ac52 486
8d0f3f77 487 treeR->AutoSave() ; //Write(0,kOverwrite) ;
fbf811ec 488 if(gAlice->TreeR()!=treeR)
489 treeR->Delete();
2731cd1e 490}
98cbd830 491
98cbd830 492
2731cd1e 493//____________________________________________________________________________
a4e98857 494void AliPHOSTrackSegmentMakerv1::PrintTrackSegments(Option_t * option)
495{
f035f6ce 496 // option deb - prints # of found TrackSegments
497 // option deb all - prints as well indexed of found RecParticles assigned to the TS
55ea5766 498 TString taskName(GetName()) ;
499 taskName.Remove(taskName.Index(Version())-1) ;
500
501 TClonesArray * trackSegments = AliPHOSGetter::GetInstance()->TrackSegments(taskName) ;
9688c1dd 502
21cd0c07 503 TString message ;
3bf72d32 504 message = "\nevent " ;
505 message += gAlice->GetEvNumber() ;
506 message += "\n Found " ;
507 message += trackSegments->GetEntriesFast() ;
508 message += " TrackSegments\n" ;
21cd0c07 509
2731cd1e 510 if(strstr(option,"all")) { // printing found TS
3bf72d32 511 message += "TrackSegment # EMC RP# CPV RP#\n" ;
2731cd1e 512 Int_t index;
7b7c1533 513 for (index = 0 ; index <trackSegments->GetEntriesFast() ; index++) {
514 AliPHOSTrackSegment * ts = (AliPHOSTrackSegment * )trackSegments->At(index) ;
3bf72d32 515 message += "\n" ;
516 message += ts->GetIndexInList() ;
517 message += " " ;
518 message += ts->GetEmcIndex() ;
519 message += " " ;
520 message += ts->GetCpvIndex() ;
2731cd1e 521 }
d15a28e7 522 }
3bf72d32 523 Info("Print", message.Data() ) ;
2731cd1e 524}