]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFReconstructor.cxx
Use ESD objects from a tree (T.Kuhr)
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.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 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 // class for TOF reconstruction                                              //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24
25 #include "AliTOFReconstructor.h"
26 #include "AliRunLoader.h"
27 #include "AliRun.h"
28 #include "AliTOF.h"
29 #include "AliTOFtracker.h"
30
31
32 ClassImp(AliTOFReconstructor)
33
34
35 //_____________________________________________________________________________
36 void AliTOFReconstructor::Reconstruct(AliRunLoader* /*runLoader*/) const
37 {
38 // nothing to be done
39
40 }
41
42 //_____________________________________________________________________________
43 AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* runLoader) const
44 {
45 // create a TOF tracker
46
47   AliTOFGeometry* geom = GetTOFGeometry(runLoader);
48   if (!geom) return NULL;
49   Double_t parPID[] = {130., 5.};
50   return new AliTOFtracker(geom, parPID);
51 }
52
53 //_____________________________________________________________________________
54 void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/, 
55                                   AliESD* /*esd*/) const
56 {
57 // nothing to be done
58
59 }
60
61
62 //_____________________________________________________________________________
63 AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const
64 {
65 // get the TOF parameters
66
67   if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
68   if (!runLoader->GetAliRun()) {
69     Error("GetTOFGeometry", "couldn't get AliRun object");
70     return NULL;
71   }
72   AliTOF* tof = (AliTOF*) runLoader->GetAliRun()->GetDetector("TOF");
73   if (!tof) {
74     Error("GetTOFGeometry", "couldn't get TOF detector");
75     return NULL;
76   }
77   if (!tof->GetGeometry()) {
78     Error("GetTOFGeometry", "no TOF geometry available");
79     return NULL;
80   }
81   return tof->GetGeometry();
82 }