]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTracker.cxx
6f192fb6680c5c64f55b691c1b53a49729ec95c5
[u/mrichter/AliRoot.git] / MUON / AliMUONTracker.cxx
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 #include "AliMUONTracker.h"
18 #include "AliMUONTrackReconstructorK.h"
19 #include "AliMUONTrackReconstructor.h"
20 #include "AliMUONData.h"
21 #include "AliLog.h"
22
23 //_____________________________________________________________________________
24 AliMUONTracker::AliMUONTracker()
25   : AliTracker(),
26     fTriggerCircuit(0x0),
27     fMUONData(0x0),
28     fTrackReco(0x0)
29 {
30   /// constructor
31
32 }
33 //_____________________________________________________________________________
34 AliMUONTracker::~AliMUONTracker()
35 {
36   /// dtr
37   delete fTrackReco;
38 }
39
40 //_____________________________________________________________________________
41 void AliMUONTracker::SetOption(Option_t* option)
42 {
43   /// set reconstructor class
44
45   if (!fMUONData)
46     AliError("MUONData not defined");
47
48   if (!fTriggerCircuit)
49     AliError("TriggerCircuit not defined");
50
51   if (strstr(option,"Original")) 
52     fTrackReco = new AliMUONTrackReconstructor(fMUONData);
53   else if (strstr(option,"Combi")) 
54     fTrackReco = new AliMUONTrackReconstructorK(fMUONData,"Combi");
55   else 
56     fTrackReco = new AliMUONTrackReconstructorK(fMUONData,"Kalman");
57
58   fTrackReco->SetTriggerCircuit(fTriggerCircuit);
59
60 }
61
62 //_____________________________________________________________________________
63 Int_t AliMUONTracker::Clusters2Tracks(AliESD* /*esd*/)
64 {
65
66   /// clusters2Tracks method
67   /// in general tracking framework
68    
69   // open TClonesArray for reading
70   fMUONData->SetTreeAddress("TC,RC");
71
72   // open for writing
73   // trigger branch
74   fMUONData->MakeBranch("RL"); //trigger track
75   fMUONData->SetTreeAddress("RL");
76   fTrackReco->EventReconstructTrigger();
77   fMUONData->Fill("RL");
78
79   // tracking branch
80   fMUONData->MakeBranch("RT"); //track
81   fMUONData->SetTreeAddress("RT");
82   fTrackReco->EventReconstruct();
83   fMUONData->Fill("RT");
84
85   fMUONData->ResetRecTracks();
86   fMUONData->ResetRecTriggerTracks();
87
88  
89   return kTRUE;
90 }