]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCReconstructor.cxx
Adding base class for TPC calibration components
[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"
59697224 35
36ClassImp(AliTPCReconstructor)
37
194b0609 38
39AliTPCRecoParam * AliTPCReconstructor::fgkRecoParam =0; // reconstruction parameters
40Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level
41
42
3464c690 43AliTPCReconstructor::AliTPCReconstructor():
44AliReconstructor(),
45fClusterer(NULL)
46{
194b0609 47 //
48 // default constructor
49 //
7a9e557b 50 //
51 //
5f85753f 52
3464c690 53 AliTPCParam* param = GetTPCParam();
54 if (!param) {
55 AliWarning("Loading default TPC parameters !");
56 param = new AliTPCParamSR;
57 }
58 fClusterer = new AliTPCclustererMI(param);
194b0609 59}
60
3464c690 61//_____________________________________________________________________________
62AliTPCReconstructor::~AliTPCReconstructor()
63{
64 if (fgkRecoParam) delete fgkRecoParam;
65 if (fClusterer) delete fClusterer;
66}
194b0609 67
3464c690 68//_____________________________________________________________________________
69void AliTPCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const {
70 // single event local reconstruction
71 // of TPC data
72 fClusterer->SetInput(digitsTree);
73 fClusterer->SetOutput(clustersTree);
74 fClusterer->Digits2Clusters();
75}
76
59697224 77//_____________________________________________________________________________
3464c690 78void AliTPCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const {
79 // single event local reconstruction
80 // of TPC data starting from raw data
81 TString option = GetOption();
82 if (option.Contains("OldRCUFormat"))
83 fClusterer->SetOldRCUFormat(kTRUE);
84
85 fClusterer->SetOutput(clustersTree);
86 fClusterer->Digits2Clusters(rawReader);
87}
88
89//_____________________________________________________________________________
d76c31f4 90AliTracker* AliTPCReconstructor::CreateTracker() const
59697224 91{
92// create a TPC tracker
93
3464c690 94 AliTPCParam* param = GetTPCParam();
90c7886e 95 if (!param) {
96 AliWarning("Loading default TPC parameters !");
97 param = new AliTPCParamSR;
98 }
4fb6310b 99 param->ReadGeoMatrices();
59697224 100 return new AliTPCtrackerMI(param);
101}
102
103//_____________________________________________________________________________
d76c31f4 104void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/,
af885e0f 105 AliESDEvent* esd) const
59697224 106{
107// make PID
108
7a8614f3 109 Double_t parTPC[] = {47., 0.07, 5.};
59697224 110 AliTPCpidESD tpcPID(parTPC);
111 tpcPID.MakePID(esd);
112}
113
114
115//_____________________________________________________________________________
3464c690 116AliTPCParam* AliTPCReconstructor::GetTPCParam() const
59697224 117{
118// get the TPC parameters
119
3464c690 120 AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters();
3d37b790 121
6d75e4b6 122 return param;
59697224 123}
5f85753f 124
125
126
127
128const AliTPCRecoParam* AliTPCReconstructor::GetRecoParam(){
129 //
130 // Get reconstruction parameters
131 //
132
133 if (!fgkRecoParam) {
134 //
135 // 1. try to get reco parameters from OCDB
136 //
137 fgkRecoParam = AliTPCcalibDB::Instance()->GetRecoParam(0);
138 //Info("","Reconstruction parameters from OCDB used");
139 //
140 // 2. If not initialized take default
141 //
142 if (!fgkRecoParam){
143 fgkRecoParam = AliTPCRecoParam::GetHighFluxParam();
144 //Error("","Default reconstruction parameters used");
145 }
146 }
147
148 return fgkRecoParam;
149}