1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //_________________________________________________________________________
20 //*-- Author: Gines Martinez & Yves Schutz (SUBATECH)
21 //*-- Compleetely redesigned by Dmitri Peressounko (SUBATECH & RRC KI) March 2001
22 /////////////////////////////////////////////////////////////////////////////////////
23 // Wrapping class for reconstruction. Allows to produce reconstruction from
24 // different steps: from previously produced hits,sdigits, etc. Each new reconstruction
25 // flow (e.g. digits, made from them RecPoints, subsequently made TrackSegments,
26 // subsequently made RecParticles) are distinguished by the title of created branches. One can
27 // use this title as a comment, see use case below.
28 // Thanks to getters, one can set
29 // parameters to reconstruction briks. The full set of parameters is saved in the
30 // corresponding branch: e.g. parameters of clusterizer are stored in branch
31 // TreeR::AliPHOSClusterizer with the same title as the branch containing the RecPoints. // TTree does not support overwriting, therefore one can not produce several
32 // branches with the same names and titles - use different titles.
36 // root [0] AliPHOSReconstructioner * r = new AliPHOSReconstructioner("galice.root")
37 // // Set the header file
38 // root [1] r->ExecuteTask()
39 // // Make full chain of reconstruction
41 // // One can specify the title for each branch
42 // root [2] r->SetBranchFileName("RecPoints","RecPoints1") ;
44 // // One can change parameters of reconstruction algorithms
45 // root [3] r->GetClusterizer()->SetEmcLocalMaxCut(0.02)
47 // // One can specify the starting point of the reconstruction and title of all
48 // // branches produced in this pass
49 // root [4] r->StartFrom("AliPHOSClusterizer","Local max cut 0.02")
50 // // means that will use already generated Digits and produce only RecPoints,
51 // // TS and RecParticles
53 // // And finally one can call ExecuteTask() with the following options
54 // root [5] r->ExecuteTask("debug all timing")
55 // // deb - prints the numbers of RecPoints, TrackSegments, RecParticles
56 // // deb all - prints in addition list of RecPoints, TrackSegments, RecParticles
57 // // timing - prints benchmarking results
58 ///////////////////////////////////////////////////////////////////////////////////////////////////
60 // --- ROOT system ---
62 // --- Standard library ---
64 // --- AliRoot header files ---
66 #include "AliESDCaloTrack.h"
67 #include "AliPHOSReconstructioner.h"
68 #include "AliPHOSClusterizerv1.h"
69 #include "AliPHOSTrackSegmentMakerv1.h"
70 #include "AliPHOSPIDv1.h"
71 #include "AliPHOSGetter.h"
74 ClassImp(AliPHOSReconstructioner)
76 //____________________________________________________________________________
77 AliPHOSReconstructioner::AliPHOSReconstructioner():TTask("AliPHOSReconstructioner","")
84 fIsInitialized = kFALSE ;
88 //____________________________________________________________________________
89 AliPHOSReconstructioner::AliPHOSReconstructioner(const char* evFoldName,const char * branchName):
90 TTask("AliPHOSReconstructioner",evFoldName)
94 AliPHOSGetter::Instance(evFoldName) ;
96 fRecPointBranch=branchName ;
97 Info("ctor", "Creating Clusterizer") ;
98 fClusterizer = new AliPHOSClusterizerv1(evFoldName, GetTitle());
101 fTSBranch=branchName ;
102 Info("ctor", "Creating Track Segment Maker") ;
103 fTSMaker = new AliPHOSTrackSegmentMakerv1(evFoldName, GetTitle());
106 fRecPartBranch=branchName ;
107 Info("ctor", "Creating PID") ;
108 fPID = new AliPHOSPIDv1(evFoldName, GetTitle());
111 fIsInitialized = kTRUE ;
113 //____________________________________________________________________________
114 void AliPHOSReconstructioner::Exec(Option_t *opt)
116 //check, if the names of branches, which should be made coincide with already
123 //____________________________________________________________________________
124 void AliPHOSReconstructioner:: Clusters2Tracks(Int_t ievent, AliESD *event)
126 // Convert PHOS reconstructed particles into ESD object for event# ievent.
127 // ESD object is returned as an argument event
129 if(!fIsInitialized) Init() ;
131 fClusterizer->SetEventRange(ievent,ievent);
132 fClusterizer->ExecuteTask();
134 fTSMaker ->SetEventRange(ievent,ievent);
135 fTSMaker ->ExecuteTask();
137 fPID ->SetEventRange(ievent,ievent);
138 fPID ->ExecuteTask();
140 AliPHOSGetter *gime = AliPHOSGetter::Instance();
141 TClonesArray *recParticles = gime->RecParticles();
142 Int_t nOfRecParticles = recParticles->GetEntries();
143 for (Int_t recpart=0; recpart<nOfRecParticles; recpart++) {
144 AliESDCaloTrack *ct = new AliESDCaloTrack((AliPHOSRecParticle*)recParticles->At(recpart));
145 event->AddCaloTrack(ct);
149 //____________________________________________________________________________
150 void AliPHOSReconstructioner::Init()
152 // initiliaze Reconstructioner if necessary: we can not do this in default constructor
156 fRecPointBranch="Default" ;
157 fClusterizer = new AliPHOSClusterizerv1(GetTitle(),fRecPointBranch.Data());
160 fTSBranch="Default" ;
161 fTSMaker = new AliPHOSTrackSegmentMakerv1(GetTitle(),fTSBranch.Data());
165 fRecPartBranch="Default";
166 fPID = new AliPHOSPIDv1(GetTitle(),fRecPartBranch.Data()) ;
169 fIsInitialized = kTRUE ;
173 //____________________________________________________________________________
174 AliPHOSReconstructioner::~AliPHOSReconstructioner()
176 // Delete data members if any
179 void AliPHOSReconstructioner::Print()const {
180 // Print reconstructioner data
183 message = "-----------------AliPHOSReconstructioner---------------\n" ;
184 message += " Reconstruction of the header file %s\n" ;
185 message += " with the following modules:\n" ;
187 if(fClusterizer->IsActive()){
188 message += " (+) %s to branch %s\n" ;
191 if(fTSMaker->IsActive()){
192 message += " (+) %s to branch %s\n" ;
195 if(fPID->IsActive()){
196 message += " (+) %s to branch %s\n" ;
198 Info("Print", message.Data(),
200 fClusterizer->GetName(), fRecPointBranch.Data(),
201 fTSMaker->GetName(), fTSBranch.Data() ,
202 fPID->GetName(), fRecPartBranch.Data() ) ;