]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALReconstructioner.cxx
fCalcMass not copied in ctor. with TParticle parameter
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALReconstructioner.cxx
CommitLineData
6ddf6724 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//_________________________________________________________________________
19//*--
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::AliEMCALClusterizer with the same title as the branch containing the RecPoints.
32// TTree does not support overwriting, therefore one can not produce several
33// branches with the same names and titles - use different titles.
34//
35// Use case:
36//
37// root [0] AliEMCALReconstructioner * r = new AliEMCALReconstructioner("galice.root")
38// // Set the header file
39// root [1] r->ExecuteTask()
40// // Make full chain of reconstruction
41//
42// // One can specify the title for each branch
43// root [2] r->SetBranchFileName("RecPoints","RecPoints1") ;
44//
45// // One can change parameters of reconstruction algorithms
46// root [3] r->GetClusterizer()->SetEmcLocalMaxCut(0.02)
47//
48// // One can specify the starting point of the reconstruction and title of all
49// // branches produced in this pass
50// root [4] r->StartFrom("AliEMCALClusterizer","Local max cut 0.02")
51// // means that will use already generated Digits and produce only RecPoints,
52// // TS and RecParticles
53//
54// // And finally one can call ExecuteTask() with the following options
55// root [5] r->ExecuteTask("debug all timing")
56// // deb - prints the numbers of produced SDigits, Digits etc.
57// // deb all - prints in addition list of made SDigits, digits etc.
58// // timing - prints benchmarking results
59///////////////////////////////////////////////////////////////////////////////////////////////////
60
61// --- ROOT system ---
62
63#include "TClonesArray.h"
64#include "TROOT.h"
65#include "TTree.h"
66#include "TFile.h"
67
68// --- Standard library ---
70479d0e 69#include <Riostream.h>
6ddf6724 70
71// --- AliRoot header files ---
72#include "AliRun.h"
73#include "AliEMCALReconstructioner.h"
74#include "AliEMCALClusterizerv1.h"
75#include "AliEMCALDigitizer.h"
76#include "AliEMCALSDigitizer.h"
77//#include "AliEMCALTrackSegmentMakerv1.h"
78//#include "AliEMCALPIDv1.h"
79//#include "AliEMCALFastRecParticle.h"
80//#include "AliEMCALCpvRecPoint.h"
81
82ClassImp(AliEMCALReconstructioner)
83
84//____________________________________________________________________________
85 AliEMCALReconstructioner::AliEMCALReconstructioner():TTask("AliEMCALReconstructioner","")
86{
87 // ctor
88 fToSplit = kFALSE ;
89 fDigitizer = 0 ;
90 fClusterizer = 0 ;
91 //fTSMaker = 0 ;
92 //fPID = 0 ;
93 fSDigitizer = 0 ;
94 fHeaderFileName = "galice.root" ;
95
96 fIsInitialized = kFALSE ;
97
98}
99
100//____________________________________________________________________________
101AliEMCALReconstructioner::AliEMCALReconstructioner(const char* headerFile,const char * branchName,Bool_t toSplit):
102TTask("AliEMCALReconstructioner","")
103{
104 // ctor
105
106 fHeaderFileName = headerFile ;
107 fToSplit = toSplit ;
108 fSDigitsBranch= branchName;
109 fSDigitizer = new AliEMCALSDigitizer(fHeaderFileName.Data(),fSDigitsBranch.Data(),toSplit) ;
110 Add(fSDigitizer) ;
111
112 fDigitsBranch=branchName ;
113 fDigitizer = new AliEMCALDigitizer(fHeaderFileName.Data(),fDigitsBranch.Data(),toSplit) ;
114 Add(fDigitizer) ;
115
116
117 fRecPointBranch=branchName ;
118 fClusterizer = new AliEMCALClusterizerv1(fHeaderFileName.Data(),fRecPointBranch.Data(),toSplit) ;
119 Add(fClusterizer) ;
120
121
122// fTSBranch=branchName ;
123// fTSMaker = new AliEMCALTrackSegmentMakerv1(fHeaderFileName.Data(),fTSBranch.Data(),toSplit) ;
124// Add(fTSMaker) ;
125
126
127// fRecPartBranch=branchName ;
128// fPID = new AliEMCALPIDv1(fHeaderFileName.Data(),fRecPartBranch.Data(),toSplit) ;
129// Add(fPID) ;
130
131 fIsInitialized = kTRUE ;
132
133}
134//____________________________________________________________________________
135void AliEMCALReconstructioner::Exec(Option_t *option)
136{
137 //chesk, if the names of branches, which should be made conicide with already
138 //existing
139 if(!fIsInitialized)
140 Init() ;
141}
142
143//____________________________________________________________________________
144 void AliEMCALReconstructioner::Init()
145{
146 // initiliaze Reconstructioner if necessary: we can not do this in default constructor
147
148 if(!fIsInitialized){
149 // Initialisation
150
151 fSDigitsBranch="Default" ;
152 fSDigitizer = new AliEMCALSDigitizer(fHeaderFileName.Data(),fSDigitsBranch.Data(),fToSplit) ;
153 Add(fSDigitizer) ;
154
155 fDigitsBranch="Default" ;
156 fDigitizer = new AliEMCALDigitizer(fHeaderFileName.Data(),fDigitsBranch.Data(),fToSplit) ;
157 Add(fDigitizer) ;
158
159 fRecPointBranch="Default" ;
160 fClusterizer = new AliEMCALClusterizerv1(fHeaderFileName.Data(),fRecPointBranch.Data(),fToSplit) ;
161 Add(fClusterizer) ;
162
163// fTSBranch="Default" ;
164// fTSMaker = new AliEMCALTrackSegmentMakerv1(fHeaderFileName.Data(),fTSBranch.Data(),fToSplit) ;
165// Add(fTSMaker) ;
166
167
168// fRecPartBranch="Default" ;
169// fPID = new AliEMCALPIDv1(fHeaderFileName.Data(),fRecPartBranch.Data(),fToSplit) ;
170// Add(fPID) ;
171
172 fIsInitialized = kTRUE ;
173 }
174}
175//____________________________________________________________________________
176AliEMCALReconstructioner::~AliEMCALReconstructioner()
177{
178 // Delete data members if any
179
180}
181
182//____________________________________________________________________________
183
184void AliEMCALReconstructioner::Print(Option_t * option)const {
185 // Print reconstructioner data
186
187 cout << "-----------------AliEMCALReconstructioner---------------" << endl ;
188 cout << " Reconstruction of the header file " <<fHeaderFileName.Data() << endl ;
189 cout << " with the following modules: " << endl ;
190
191 if(fSDigitizer->IsActive()){
192 cout << " (+) " << fSDigitizer->GetName() << " to branch : " << fSDigitsBranch.Data() << endl ;
193 cout << endl ;
194 }
195 if(fDigitizer->IsActive()){
196 cout << " (+) " << fDigitizer->GetName() << " to branch : " << fDigitsBranch.Data() << endl ;
197 cout << endl ;
198 }
199
200 if(fClusterizer->IsActive()){
201 cout << " (+) " <<fClusterizer->GetName() << " to branch : " <<fRecPointBranch.Data() << endl ;
202 cout << endl ;
203 }
204
205// if(fTSMaker->IsActive()){
206// cout << " (+) " << fTSMaker->GetName() << " to branch : " << fTSBranch.Data() << endl ;
207// cout << endl ;
208// }
209
210
211// if(fPID->IsActive()){
212// cout << " (+) " << fPID->GetName() << " to branch : " <<fRecPartBranch.Data() << endl ;
213// cout << endl ;
214// }
215
216
217}