]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSReconstructioner.cxx
Reduced output (M.Ivanov)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSReconstructioner.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 **************************************************************************/
15
b2a60966 16/* $Id$ */
17
d15a28e7 18//_________________________________________________________________________
a3dfe79c 19//*--
7acf6008 20//*-- Author: Gines Martinez & Yves Schutz (SUBATECH)
f1aeaf5d 21//*-- Compleetely redesigned by Dmitri Peressounko (SUBATECH & RRC KI) March 2001
7acf6008 22/////////////////////////////////////////////////////////////////////////////////////
9a6ec61a 23// Wrapping class for reconstruction. Allows to produce reconstruction from
24// different steps: from previously produced hits,sdigits, etc. Each new reconstruction
a4e98857 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
21cd0c07 31// TreeR::AliPHOSClusterizer with the same title as the branch containing the RecPoints. // TTree does not support overwriting, therefore one can not produce several
9a6ec61a 32// branches with the same names and titles - use different titles.
33//
a4e98857 34// Use case:
7acf6008 35//
36// root [0] AliPHOSReconstructioner * r = new AliPHOSReconstructioner("galice.root")
37// // Set the header file
38// root [1] r->ExecuteTask()
a4e98857 39// // Make full chain of reconstruction
7acf6008 40//
41// // One can specify the title for each branch
42// root [2] r->SetBranchFileName("RecPoints","RecPoints1") ;
7acf6008 43//
9a6ec61a 44// // One can change parameters of reconstruction algorithms
45// root [3] r->GetClusterizer()->SetEmcLocalMaxCut(0.02)
46//
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
7acf6008 52//
53// // And finally one can call ExecuteTask() with the following options
9a6ec61a 54// root [5] r->ExecuteTask("debug all timing")
85ef0957 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
9a6ec61a 58///////////////////////////////////////////////////////////////////////////////////////////////////
d15a28e7 59
60// --- ROOT system ---
61
d15a28e7 62// --- Standard library ---
364de5c6 63
d15a28e7 64// --- AliRoot header files ---
35293055 65#include "AliESD.h"
66#include "AliESDCaloTrack.h"
d15a28e7 67#include "AliPHOSReconstructioner.h"
7acf6008 68#include "AliPHOSClusterizerv1.h"
7acf6008 69#include "AliPHOSTrackSegmentMakerv1.h"
70#include "AliPHOSPIDv1.h"
35293055 71#include "AliPHOSGetter.h"
e957fea8 72
d15a28e7 73
74ClassImp(AliPHOSReconstructioner)
75
d15a28e7 76//____________________________________________________________________________
7acf6008 77 AliPHOSReconstructioner::AliPHOSReconstructioner():TTask("AliPHOSReconstructioner","")
d15a28e7 78{
b2a60966 79 // ctor
7acf6008 80 fClusterizer = 0 ;
81 fTSMaker = 0 ;
82 fPID = 0 ;
d15a28e7 83
7acf6008 84 fIsInitialized = kFALSE ;
d15a28e7 85
6ad0bfa0 86}
87
6ad0bfa0 88//____________________________________________________________________________
88cb7938 89AliPHOSReconstructioner::AliPHOSReconstructioner(const char* evFoldName,const char * branchName):
90TTask("AliPHOSReconstructioner",evFoldName)
d15a28e7 91{
7acf6008 92 // ctor
88cb7938 93
85ef0957 94 AliPHOSGetter::Instance(evFoldName) ;
7acf6008 95
108bc8df 96 fRecPointBranch=branchName ;
85ef0957 97 Info("ctor", "Creating Clusterizer") ;
98 fClusterizer = new AliPHOSClusterizerv1(evFoldName, GetTitle());
88cb7938 99 Add(fClusterizer);
2131115b 100
108bc8df 101 fTSBranch=branchName ;
85ef0957 102 Info("ctor", "Creating Track Segment Maker") ;
103 fTSMaker = new AliPHOSTrackSegmentMakerv1(evFoldName, GetTitle());
7acf6008 104 Add(fTSMaker) ;
7acf6008 105
108bc8df 106 fRecPartBranch=branchName ;
85ef0957 107 Info("ctor", "Creating PID") ;
108 fPID = new AliPHOSPIDv1(evFoldName, GetTitle());
88cb7938 109 Add(fPID);
7acf6008 110
111 fIsInitialized = kTRUE ;
7acf6008 112}
113//____________________________________________________________________________
35293055 114void AliPHOSReconstructioner::Exec(Option_t *opt)
a4e98857 115{
85ef0957 116 //check, if the names of branches, which should be made coincide with already
7acf6008 117 //existing
e957fea8 118 if (!opt)
119 return ;
7acf6008 120 if(!fIsInitialized)
121 Init() ;
7acf6008 122}
123//____________________________________________________________________________
35293055 124void AliPHOSReconstructioner:: Clusters2Tracks(Int_t ievent, AliESD *event)
125{
126 // Convert PHOS reconstructed particles into ESD object for event# ievent.
127 // ESD object is returned as an argument event
128
129 if(!fIsInitialized) Init() ;
130
131 fClusterizer->SetEventRange(ievent,ievent);
132 fClusterizer->ExecuteTask();
133
134 fTSMaker ->SetEventRange(ievent,ievent);
135 fTSMaker ->ExecuteTask();
136
137 fPID ->SetEventRange(ievent,ievent);
138 fPID ->ExecuteTask();
139
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);
146 }
147
148}
149//____________________________________________________________________________
7acf6008 150 void AliPHOSReconstructioner::Init()
151{
a4e98857 152 // initiliaze Reconstructioner if necessary: we can not do this in default constructor
7acf6008 153
154 if(!fIsInitialized){
85ef0957 155
81b0fcd1 156 fRecPointBranch="Default" ;
88cb7938 157 fClusterizer = new AliPHOSClusterizerv1(GetTitle(),fRecPointBranch.Data());
7acf6008 158 Add(fClusterizer) ;
159
81b0fcd1 160 fTSBranch="Default" ;
88cb7938 161 fTSMaker = new AliPHOSTrackSegmentMakerv1(GetTitle(),fTSBranch.Data());
7acf6008 162 Add(fTSMaker) ;
163
164
88cb7938 165 fRecPartBranch="Default";
166 fPID = new AliPHOSPIDv1(GetTitle(),fRecPartBranch.Data()) ;
7acf6008 167 Add(fPID) ;
168
169 fIsInitialized = kTRUE ;
88cb7938 170
7acf6008 171 }
172}
173//____________________________________________________________________________
174AliPHOSReconstructioner::~AliPHOSReconstructioner()
175{
baef0810 176 // Delete data members if any
7acf6008 177}
baef0810 178
90cceaf6 179void AliPHOSReconstructioner::Print()const {
baef0810 180 // Print reconstructioner data
181
21cd0c07 182 TString message ;
183 message = "-----------------AliPHOSReconstructioner---------------\n" ;
184 message += " Reconstruction of the header file %s\n" ;
185 message += " with the following modules:\n" ;
7acf6008 186
7acf6008 187 if(fClusterizer->IsActive()){
21cd0c07 188 message += " (+) %s to branch %s\n" ;
7acf6008 189 }
190
191 if(fTSMaker->IsActive()){
21cd0c07 192 message += " (+) %s to branch %s\n" ;
7acf6008 193 }
194
7acf6008 195 if(fPID->IsActive()){
21cd0c07 196 message += " (+) %s to branch %s\n" ;
7acf6008 197 }
21cd0c07 198 Info("Print", message.Data(),
88cb7938 199 GetTitle(),
21cd0c07 200 fClusterizer->GetName(), fRecPointBranch.Data(),
201 fTSMaker->GetName(), fTSBranch.Data() ,
202 fPID->GetName(), fRecPartBranch.Data() ) ;
51926850 203}