Eff C++ Warning removal
[u/mrichter/AliRoot.git] / TPC / AliTPCReconstructor.cxx
CommitLineData
59697224 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 TPC reconstruction //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24
25#include "AliTPCReconstructor.h"
26#include "AliRunLoader.h"
27#include "AliRun.h"
38e6e547 28#include "AliRawReader.h"
59697224 29#include "AliTPCclustererMI.h"
30#include "AliTPCtrackerMI.h"
31#include "AliTPCpidESD.h"
4fb6310b 32#include "AliTPCParam.h"
90c7886e 33#include "AliTPCParamSR.h"
3d37b790 34#include "AliTPCcalibDB.h"
7bab76cf 35#include "AliTracker.h"
36#include "AliMagF.h"
59697224 37
38ClassImp(AliTPCReconstructor)
39
194b0609 40
194b0609 41Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level
42
43
3464c690 44AliTPCReconstructor::AliTPCReconstructor():
45AliReconstructor(),
46fClusterer(NULL)
47{
194b0609 48 //
49 // default constructor
50 //
7a9e557b 51 //
52 //
7bab76cf 53 AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
54 const AliMagF * field = AliTracker::GetFieldMap();
55 if (field) { // Set correctly the magnetic field in the ExB calculation
56 calib->SetExBField(field->SolenoidField());
57 }
3464c690 58 AliTPCParam* param = GetTPCParam();
59 if (!param) {
60 AliWarning("Loading default TPC parameters !");
61 param = new AliTPCParamSR;
62 }
63 fClusterer = new AliTPCclustererMI(param);
194b0609 64}
65
3464c690 66//_____________________________________________________________________________
67AliTPCReconstructor::~AliTPCReconstructor()
68{
3464c690 69 if (fClusterer) delete fClusterer;
70}
194b0609 71
59697224 72//_____________________________________________________________________________
3464c690 73void AliTPCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const {
74 // single event local reconstruction
75 // of TPC data
76 fClusterer->SetInput(digitsTree);
77 fClusterer->SetOutput(clustersTree);
78 fClusterer->Digits2Clusters();
79}
80
81//_____________________________________________________________________________
3464c690 82void AliTPCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const {
83 // single event local reconstruction
84 // of TPC data starting from raw data
3464c690 85
86 fClusterer->SetOutput(clustersTree);
87 fClusterer->Digits2Clusters(rawReader);
88}
89
90//_____________________________________________________________________________
d76c31f4 91AliTracker* AliTPCReconstructor::CreateTracker() const
59697224 92{
93// create a TPC tracker
94
3464c690 95 AliTPCParam* param = GetTPCParam();
90c7886e 96 if (!param) {
97 AliWarning("Loading default TPC parameters !");
98 param = new AliTPCParamSR;
99 }
4fb6310b 100 param->ReadGeoMatrices();
59697224 101 return new AliTPCtrackerMI(param);
102}
103
104//_____________________________________________________________________________
d76c31f4 105void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/,
af885e0f 106 AliESDEvent* esd) const
59697224 107{
108// make PID
109
7a8614f3 110 Double_t parTPC[] = {47., 0.07, 5.};
59697224 111 AliTPCpidESD tpcPID(parTPC);
112 tpcPID.MakePID(esd);
113}
114
115
116//_____________________________________________________________________________
3464c690 117AliTPCParam* AliTPCReconstructor::GetTPCParam() const
59697224 118{
119// get the TPC parameters
120
3464c690 121 AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters();
3d37b790 122
6d75e4b6 123 return param;
59697224 124}