PMD Reconstruction class
[u/mrichter/AliRoot.git] / PMD / AliPMDReconstructor.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 //                                                                           //
18 // class for PMD reconstruction                                              //
19 //                                                                           //
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #include "Riostream.h"
23 #include "AliPMDReconstructor.h"
24 #include "AliRunLoader.h"
25 #include "AliRun.h"
26 #include "AliPMDClusterFinder.h"
27 #include "AliPMDtracker.h"
28 #include "AliESDPmdTrack.h"
29 #include "AliESD.h"
30
31
32 ClassImp(AliPMDReconstructor)
33
34
35 //_____________________________________________________________________________
36 void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader) const
37 {
38 // reconstruct clusters
39
40   AliPMDClusterFinder *pmdClus = new AliPMDClusterFinder(runLoader);
41   pmdClus->Load();
42   for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
43     {
44       pmdClus->Digits2RecPoints(iEvent);
45     }
46   pmdClus->UnLoad();
47   delete pmdClus;
48
49 }
50
51 // ------------------------------------------------------------------------ //
52
53 void AliPMDReconstructor::FillESD(AliRunLoader* runLoader,AliESD* esd) const
54 {
55   AliLoader* loader = runLoader->GetLoader("PMDLoader");
56   if (!loader) {
57     Error("Reconstruct", "PMD loader not found");
58     return;
59   }
60   loader->LoadRecPoints("READ");
61
62   TTree *treeR = loader->TreeR();
63   AliPMDtracker pmdtracker;
64   pmdtracker.LoadClusters(treeR);
65   pmdtracker.Clusters2Tracks(esd);
66   loader->UnloadRecPoints();
67 }