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 **************************************************************************/
16 //====================================================================================================================================================
18 // Event reconstruction class for the ALICE Muon Forward Tracker
20 // Contact author: antonio.uras@cern.ch
22 //====================================================================================================================================================
24 #include "TObjArray.h"
26 #include "AliMFTSegmentation.h"
27 #include "AliMFTClusterFinder.h"
28 #include "AliReconstructor.h"
29 #include "AliMFTReconstructor.h"
31 ClassImp(AliMFTReconstructor)
33 //====================================================================================================================================================
35 AliMFTReconstructor::AliMFTReconstructor():
41 // default constructor
45 //====================================================================================================================================================
47 AliMFTReconstructor::~AliMFTReconstructor() {
52 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
53 if (fDigits->At(iPlane)) fDigits->At(iPlane)->Delete();
62 //====================================================================================================================================================
64 void AliMFTReconstructor::Clear(const Option_t* /*opt*/) {
69 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
70 if (fDigits->At(iPlane)) ((TClonesArray*)fDigits->At(iPlane))->Delete();
79 //====================================================================================================================================================
81 void AliMFTReconstructor::Init() {
83 AliMFTSegmentation *segmentation = new AliMFTSegmentation("AliMFTGeometry.root");
84 fNPlanes = segmentation->GetNPlanes();
87 fDigits = new TObjArray(fNPlanes);
88 fDigits->SetOwner(kTRUE);
89 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
90 fDigits->AddAt(new TClonesArray("AliMFTDigit"),iPlane);
91 ((TClonesArray*)fDigits->At(iPlane))->SetOwner(kTRUE);
94 AliInfo(" ************* Using the MFT reconstructor! ************ ");
100 //====================================================================================================================================================
102 void AliMFTReconstructor::ResetDigits() {
104 // Reset number of digits and the digits array for the MFT detector.
106 if (!fDigits) return;
107 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
113 //====================================================================================================================================================
115 void AliMFTReconstructor::ResetDigits(Int_t plane) {
117 // Reset number of digits and the digits array for this branch.
119 if (fDigits->At(plane)) ((TClonesArray*)fDigits->At(plane))->Clear();
123 //====================================================================================================================================================
125 void AliMFTReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const {
127 AliInfo("Starting Reconstruction for MFT");
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]);
136 digitsTree->GetEntry(0);
138 AliDebug(1, "Creating clusterFinder");
139 AliMFTClusterFinder *clusterFinder = new AliMFTClusterFinder();
140 clusterFinder->ApplyMisalignment(kTRUE); // only in case of MC !!!
141 clusterFinder->Init("AliMFTGeometry.root");
142 clusterFinder->MakeClusterBranch(clustersTree);
143 clusterFinder->SetClusterTreeAddress(clustersTree);
144 clusterFinder->DigitsToClusters(fDigits);
145 clustersTree->Fill(); // fill tree for current event
146 delete clusterFinder;
148 for (Int_t iPlane=0; iPlane<fNPlanes; iPlane++) {
149 AliDebug(1, Form("fDigits->At(%d)->Clear()",iPlane));
150 ((TClonesArray*)fDigits->At(iPlane))->Delete();
155 //====================================================================================================================================================
157 AliTracker* AliMFTReconstructor::CreateTracker() const {
159 // Create a MFT tracker: global MUON+MFT tracks
161 AliMFTTrackerMU *tracker = new AliMFTTrackerMU(); // tracker for muon tracks (MFT + MUON)
167 //====================================================================================================================================================
169 AliTracker* AliMFTReconstructor::CreateTrackleter() const {
171 AliInfo("Not implemented");
173 // Create a MFT tracker: standalone MFT tracks
175 // AliMFTTrackerSA *tracker = new AliMFTTrackerSA(); // tracker for MFT tracks
181 //====================================================================================================================================================