]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALReconstructioner.cxx
Last version
[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 ---
6ddf6724 69
70// --- AliRoot header files ---
71#include "AliRun.h"
72#include "AliEMCALReconstructioner.h"
73#include "AliEMCALClusterizerv1.h"
74#include "AliEMCALDigitizer.h"
75#include "AliEMCALSDigitizer.h"
76//#include "AliEMCALTrackSegmentMakerv1.h"
77//#include "AliEMCALPIDv1.h"
78//#include "AliEMCALFastRecParticle.h"
79//#include "AliEMCALCpvRecPoint.h"
80
81ClassImp(AliEMCALReconstructioner)
82
83//____________________________________________________________________________
84 AliEMCALReconstructioner::AliEMCALReconstructioner():TTask("AliEMCALReconstructioner","")
85{
86 // ctor
87 fToSplit = kFALSE ;
88 fDigitizer = 0 ;
89 fClusterizer = 0 ;
90 //fTSMaker = 0 ;
91 //fPID = 0 ;
92 fSDigitizer = 0 ;
93 fHeaderFileName = "galice.root" ;
94
95 fIsInitialized = kFALSE ;
96
97}
98
99//____________________________________________________________________________
100AliEMCALReconstructioner::AliEMCALReconstructioner(const char* headerFile,const char * branchName,Bool_t toSplit):
101TTask("AliEMCALReconstructioner","")
102{
103 // ctor
104
105 fHeaderFileName = headerFile ;
106 fToSplit = toSplit ;
107 fSDigitsBranch= branchName;
108 fSDigitizer = new AliEMCALSDigitizer(fHeaderFileName.Data(),fSDigitsBranch.Data(),toSplit) ;
109 Add(fSDigitizer) ;
110
111 fDigitsBranch=branchName ;
112 fDigitizer = new AliEMCALDigitizer(fHeaderFileName.Data(),fDigitsBranch.Data(),toSplit) ;
113 Add(fDigitizer) ;
114
115
116 fRecPointBranch=branchName ;
117 fClusterizer = new AliEMCALClusterizerv1(fHeaderFileName.Data(),fRecPointBranch.Data(),toSplit) ;
118 Add(fClusterizer) ;
119
120
121// fTSBranch=branchName ;
122// fTSMaker = new AliEMCALTrackSegmentMakerv1(fHeaderFileName.Data(),fTSBranch.Data(),toSplit) ;
123// Add(fTSMaker) ;
124
125
126// fRecPartBranch=branchName ;
127// fPID = new AliEMCALPIDv1(fHeaderFileName.Data(),fRecPartBranch.Data(),toSplit) ;
128// Add(fPID) ;
129
130 fIsInitialized = kTRUE ;
131
132}
133//____________________________________________________________________________
134void AliEMCALReconstructioner::Exec(Option_t *option)
135{
136 //chesk, if the names of branches, which should be made conicide with already
137 //existing
138 if(!fIsInitialized)
139 Init() ;
140}
141
142//____________________________________________________________________________
143 void AliEMCALReconstructioner::Init()
144{
145 // initiliaze Reconstructioner if necessary: we can not do this in default constructor
146
147 if(!fIsInitialized){
148 // Initialisation
149
150 fSDigitsBranch="Default" ;
151 fSDigitizer = new AliEMCALSDigitizer(fHeaderFileName.Data(),fSDigitsBranch.Data(),fToSplit) ;
152 Add(fSDigitizer) ;
153
154 fDigitsBranch="Default" ;
155 fDigitizer = new AliEMCALDigitizer(fHeaderFileName.Data(),fDigitsBranch.Data(),fToSplit) ;
156 Add(fDigitizer) ;
157
158 fRecPointBranch="Default" ;
159 fClusterizer = new AliEMCALClusterizerv1(fHeaderFileName.Data(),fRecPointBranch.Data(),fToSplit) ;
160 Add(fClusterizer) ;
161
162// fTSBranch="Default" ;
163// fTSMaker = new AliEMCALTrackSegmentMakerv1(fHeaderFileName.Data(),fTSBranch.Data(),fToSplit) ;
164// Add(fTSMaker) ;
165
166
167// fRecPartBranch="Default" ;
168// fPID = new AliEMCALPIDv1(fHeaderFileName.Data(),fRecPartBranch.Data(),fToSplit) ;
169// Add(fPID) ;
170
171 fIsInitialized = kTRUE ;
172 }
173}
174//____________________________________________________________________________
175AliEMCALReconstructioner::~AliEMCALReconstructioner()
176{
177 // Delete data members if any
178
179}
180
181//____________________________________________________________________________
182
183void AliEMCALReconstructioner::Print(Option_t * option)const {
184 // Print reconstructioner data
185
9859bfc0 186 TString message("\n") ;
187
188 message += " Reconstruction of the header file " ;
189 message += fHeaderFileName.Data() ;
190 message += "\n with the following modules:\n" ;
6ddf6724 191
192 if(fSDigitizer->IsActive()){
9859bfc0 193 message += " (+) " ;
194 message += fSDigitizer->GetName() ;
195 message +=" to branch : " ;
196 message += fSDigitsBranch.Data() ;
6ddf6724 197 }
198 if(fDigitizer->IsActive()){
9859bfc0 199 message += "\n (+) " ;
200 message += fDigitizer->GetName() ;
201 message += " to branch : " ;
202 message += fDigitsBranch.Data() ;
6ddf6724 203 }
204
205 if(fClusterizer->IsActive()){
9859bfc0 206 message += "\n (+) " ;
207 message += fClusterizer->GetName() ;
208 message += " to branch : " ;
209 message += fRecPointBranch.Data() ;
6ddf6724 210 }
9859bfc0 211 Info("Print", message.Data() ) ;
6ddf6724 212}