]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCReconstructor.cxx
Added switch in recoparam for HLTPreSeeding
[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
1598ba75 18//--------------------------------------------------------------------
19// Options for the TPC Reconstruction in rec.C
20//
21// 4 options can be set to change the input for TPC reconstruction
22// which overwrites the usage of fUseHLTClusters of the AliTPCRecoParam
23//
24// 1) useRAW - use RAW, if not present -> do nothing
25// 2) useRAWorHLT - use RAW, if not present -> use HLT clusters
26// 3) useHLT - use HLT clusters, if not present -> do nothing
27// 4) useHLTorRAW - use HLT clusters, if not present -> use RAW
28//
29// -> The current default is useHLTorRAW
30//--------------------------------------------------------------------
31
59697224 32///////////////////////////////////////////////////////////////////////////////
33// //
34// class for TPC reconstruction //
35// //
36///////////////////////////////////////////////////////////////////////////////
37
38
39#include "AliTPCReconstructor.h"
40#include "AliRunLoader.h"
41#include "AliRun.h"
38e6e547 42#include "AliRawReader.h"
59697224 43#include "AliTPCclustererMI.h"
44#include "AliTPCtrackerMI.h"
10d100d4 45//#include "AliTPCpidESD.h"
4fb6310b 46#include "AliTPCParam.h"
90c7886e 47#include "AliTPCParamSR.h"
3d37b790 48#include "AliTPCcalibDB.h"
7bab76cf 49#include "AliTracker.h"
50#include "AliMagF.h"
59697224 51
52ClassImp(AliTPCReconstructor)
53
194b0609 54
7f7ed03b 55Int_t AliTPCReconstructor::fgStreamLevel = 1; // stream (debug) level
e2a1f213 56AliTPCAltroEmulator * AliTPCReconstructor::fAltroEmulator=0; // ALTRO emulator
194b0609 57
3464c690 58AliTPCReconstructor::AliTPCReconstructor():
59AliReconstructor(),
60fClusterer(NULL)
61{
194b0609 62 //
63 // default constructor
64 //
7a9e557b 65 //
66 //
7bab76cf 67 AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
745b6db9 68 const AliMagF * field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
0a997b33 69 calib->SetExBField(field);
3464c690 70 AliTPCParam* param = GetTPCParam();
71 if (!param) {
72 AliWarning("Loading default TPC parameters !");
73 param = new AliTPCParamSR;
74 }
75 fClusterer = new AliTPCclustererMI(param);
194b0609 76}
77
0ffd2ae1 78AliTPCReconstructor::AliTPCReconstructor(const AliTPCReconstructor& /*rec*/):
79AliReconstructor(),
80fClusterer(NULL)
81{
82 //
83 // Dummy copu constructor
84 //
85}
86
87AliTPCReconstructor& AliTPCReconstructor::operator=(const AliTPCReconstructor&){
88 //
89 // dummy operator
90 //
91 return *this;
92}
93
3464c690 94//_____________________________________________________________________________
95AliTPCReconstructor::~AliTPCReconstructor()
96{
3464c690 97 if (fClusterer) delete fClusterer;
98}
194b0609 99
3464c690 100//_____________________________________________________________________________
101void AliTPCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const {
102 // single event local reconstruction
103 // of TPC data
104 fClusterer->SetInput(digitsTree);
105 fClusterer->SetOutput(clustersTree);
106 fClusterer->Digits2Clusters();
107}
108
59697224 109//_____________________________________________________________________________
3464c690 110void AliTPCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const {
111 // single event local reconstruction
112 // of TPC data starting from raw data
3464c690 113
114 fClusterer->SetOutput(clustersTree);
115 fClusterer->Digits2Clusters(rawReader);
116}
117
118//_____________________________________________________________________________
d76c31f4 119AliTracker* AliTPCReconstructor::CreateTracker() const
59697224 120{
121// create a TPC tracker
122
3464c690 123 AliTPCParam* param = GetTPCParam();
90c7886e 124 if (!param) {
125 AliWarning("Loading default TPC parameters !");
126 param = new AliTPCParamSR;
127 }
4fb6310b 128 param->ReadGeoMatrices();
1598ba75 129
130 AliTPCtrackerMI* tracker = new AliTPCtrackerMI(param);
131
132 ParseOptions(tracker);
133
134 return tracker;
59697224 135}
136
137//_____________________________________________________________________________
d76c31f4 138void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/,
937a076a 139 AliESDEvent* /*esd*/) const
59697224 140{
141// make PID
10d100d4 142/* Now done in AliESDpid
83afd539 143 Double_t parTPC[] = {50., 0.07, 5.}; // MIP nnormalized to channel 50 -MI
59697224 144 AliTPCpidESD tpcPID(parTPC);
145 tpcPID.MakePID(esd);
10d100d4 146*/
59697224 147}
148
149
150//_____________________________________________________________________________
3464c690 151AliTPCParam* AliTPCReconstructor::GetTPCParam() const
59697224 152{
153// get the TPC parameters
154
3464c690 155 AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters();
3d37b790 156
6d75e4b6 157 return param;
59697224 158}
1598ba75 159
160
161//_____________________________________________________________________________
162void AliTPCReconstructor::ParseOptions( AliTPCtrackerMI* tracker ) const
163{
164// parse options from rec.C and set in clusterer and tracker
165
166 TString option = GetOption();
167
168 Int_t useHLTClusters = 3;
169
170 if (option.Contains("use")) {
171
172 AliInfo(Form("Overide TPC RecoParam with option %s",option.Data()));
173
174 if (!option.CompareTo("useRAW"))
175 useHLTClusters = 1;
176 if (!option.CompareTo("useRAWorHLT"))
177 useHLTClusters = 2;
178 if (!option.CompareTo("useHLT"))
179 useHLTClusters = 3;
180 if (!option.CompareTo("useHLTorRAW"))
181 useHLTClusters = 4;
182 }
183 else {
184 const AliTPCRecoParam* param = GetRecoParam();
185 useHLTClusters = param->GetUseHLTClusters();
186 }
187
188 AliInfo(Form("Usage of HLT clusters in TPC reconstruction : %d", useHLTClusters));
189
190 fClusterer->SetUseHLTClusters(useHLTClusters);
191 tracker->SetUseHLTClusters(useHLTClusters);
192
193 return;
194}