]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MFT/AliMFTReconstructor.cxx
MFT Classes modified for integration with the AOD framework
[u/mrichter/AliRoot.git] / MFT / AliMFTReconstructor.cxx
CommitLineData
820b4d9e 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//====================================================================================================================================================
17//
18// Event reconstruction class for the ALICE Muon Forward Tracker
19//
20// Contact author: antonio.uras@cern.ch
21//
22//====================================================================================================================================================
23
24#include "TObjArray.h"
25#include "TTree.h"
26#include "AliMFTSegmentation.h"
27#include "AliMFTClusterFinder.h"
28#include "AliReconstructor.h"
29#include "AliMFTReconstructor.h"
30
31ClassImp(AliMFTReconstructor)
32
33//====================================================================================================================================================
34
35AliMFTReconstructor::AliMFTReconstructor():
36 AliReconstructor(),
37 fDigits(0x0),
38 fNPlanes(0)
39{
40
41 // default constructor
42
43}
44
45//====================================================================================================================================================
46
ffc53def 47AliMFTReconstructor::~AliMFTReconstructor() {
48
820b4d9e 49 // destructor
ffc53def 50
820b4d9e 51 if (fDigits) {
ffc53def 52 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
53 if (fDigits->At(iPlane)) fDigits->At(iPlane)->Delete();
54 }
820b4d9e 55 fDigits->Delete();
56 delete fDigits;
57 fDigits=0;
58 }
ffc53def 59
60}
820b4d9e 61
ffc53def 62//====================================================================================================================================================
63
64void AliMFTReconstructor::Clear(const Option_t* /*opt*/) {
65
66 // Clear arrays
67
68 if (fDigits) {
69 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
70 if (fDigits->At(iPlane)) ((TClonesArray*)fDigits->At(iPlane))->Delete();
71 }
72 fDigits->Delete();
73 delete fDigits;
74 fDigits = NULL;
75 }
76
820b4d9e 77}
78
79//====================================================================================================================================================
80
81void AliMFTReconstructor::Init() {
82
83 AliMFTSegmentation *segmentation = new AliMFTSegmentation("AliMFTGeometry.root");
84 fNPlanes = segmentation->GetNPlanes();
85 delete segmentation;
86
87 fDigits = new TObjArray(fNPlanes);
88 fDigits->SetOwner(kTRUE);
ffc53def 89 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
90 fDigits->AddAt(new TClonesArray("AliMFTDigit"),iPlane);
91 ((TClonesArray*)fDigits->At(iPlane))->SetOwner(kTRUE);
92 }
93
4cc511f4 94 AliInfo(" ************* Using the MFT reconstructor! ************ ");
ffc53def 95
820b4d9e 96 return;
97
98}
99
100//====================================================================================================================================================
101
102void AliMFTReconstructor::ResetDigits() {
103
104 // Reset number of digits and the digits array for the MFT detector.
105
106 if (!fDigits) return;
107 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
108 ResetDigits(iPlane);
109 }
110
111}
112
113//====================================================================================================================================================
114
115void AliMFTReconstructor::ResetDigits(Int_t plane) {
116
117 // Reset number of digits and the digits array for this branch.
118
119 if (fDigits->At(plane)) ((TClonesArray*)fDigits->At(plane))->Clear();
120
121}
122
123//====================================================================================================================================================
124
125void AliMFTReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const {
126
127 AliInfo("Starting Reconstruction for MFT");
128
129 // Clusterization
130
820b4d9e 131 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
132 AliDebug(1, Form("Setting Address for Branch Plane_%02d", iPlane));
133 digitsTree->SetBranchAddress(Form("Plane_%02d",iPlane), &(*fDigits)[iPlane]);
134 }
135
136 digitsTree->GetEntry(0);
137
138 AliDebug(1, "Creating clusterFinder");
139 AliMFTClusterFinder *clusterFinder = new AliMFTClusterFinder();
65273893 140 clusterFinder->ApplyMisalignment(kTRUE); // only in case of MC !!!
820b4d9e 141 clusterFinder->Init("AliMFTGeometry.root");
820b4d9e 142 clusterFinder->MakeClusterBranch(clustersTree);
820b4d9e 143 clusterFinder->SetClusterTreeAddress(clustersTree);
820b4d9e 144 clusterFinder->DigitsToClusters(fDigits);
820b4d9e 145 clustersTree->Fill(); // fill tree for current event
820b4d9e 146 delete clusterFinder;
147
148 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
149 AliDebug(1, Form("fDigits->At(%d)->Clear()",iPlane));
ffc53def 150 ((TClonesArray*)fDigits->At(iPlane))->Delete();
820b4d9e 151 }
152
153}
154
155//====================================================================================================================================================
4cc511f4
AU
156
157AliTracker* AliMFTReconstructor::CreateTracker() const {
158
159 // Create a MFT tracker: global MUON+MFT tracks
160
161 AliMFTTrackerMU *tracker = new AliMFTTrackerMU(); // tracker for muon tracks (MFT + MUON)
162
163 return tracker;
164
165}
166
167//====================================================================================================================================================
168
169AliTracker* AliMFTReconstructor::CreateTrackleter() const {
170
171 AliInfo("Not implemented");
172
173 // Create a MFT tracker: standalone MFT tracks
174
175 // AliMFTTrackerSA *tracker = new AliMFTTrackerSA(); // tracker for MFT tracks
176
177 return NULL;
178
179}
180
181//====================================================================================================================================================
182