Default value of fgChargeCorrelSt12 set to 1 to avoid division by zero
[u/mrichter/AliRoot.git] / PMD / AliPMDReconstructor.cxx
CommitLineData
05f4fa74 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"
01b56f5c 28#include "AliRawReader.h"
05f4fa74 29#include "AliESDPmdTrack.h"
30#include "AliESD.h"
31
05f4fa74 32ClassImp(AliPMDReconstructor)
33
34
35//_____________________________________________________________________________
36void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader) const
37{
01b56f5c 38// reconstruct clusters from digits file
05f4fa74 39
40 AliPMDClusterFinder *pmdClus = new AliPMDClusterFinder(runLoader);
41 pmdClus->Load();
9cd1c5d4 42 // pmdClus->SetDebug(1);
05f4fa74 43 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++)
44 {
45 pmdClus->Digits2RecPoints(iEvent);
46 }
47 pmdClus->UnLoad();
48 delete pmdClus;
49
50}
01b56f5c 51//_____________________________________________________________________________
52void AliPMDReconstructor::Reconstruct(AliRunLoader* runLoader,
53 AliRawReader *rawReader) const
54{
55// reconstruct clusters from Raw Data
56
57 AliPMDClusterFinder pmdClus(runLoader);
58 pmdClus.LoadClusters();
59
60 Int_t iEvent = 0;
61 while (rawReader->NextEvent()) {
9cd1c5d4 62 // pmdClus.SetDebug(1);
01b56f5c 63 pmdClus.Digits2RecPoints(iEvent,rawReader);
64
65 iEvent++;
66 }
67 pmdClus.UnLoadClusters();
68
69}
05f4fa74 70
71// ------------------------------------------------------------------------ //
72
73void AliPMDReconstructor::FillESD(AliRunLoader* runLoader,AliESD* esd) const
74{
75 AliLoader* loader = runLoader->GetLoader("PMDLoader");
76 if (!loader) {
77 Error("Reconstruct", "PMD loader not found");
78 return;
79 }
80 loader->LoadRecPoints("READ");
81
82 TTree *treeR = loader->TreeR();
83 AliPMDtracker pmdtracker;
84 pmdtracker.LoadClusters(treeR);
85 pmdtracker.Clusters2Tracks(esd);
86 loader->UnloadRecPoints();
87}