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