1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //--------------------------------------------------------------------
19 // Options for the TPC Reconstruction in rec.C
21 // 4 options can be set to change the input for TPC reconstruction
22 // which overwrites the usage of fUseHLTClusters of the AliTPCRecoParam
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
29 // -> The current default is useHLTorRAW
30 //--------------------------------------------------------------------
32 ///////////////////////////////////////////////////////////////////////////////
34 // class for TPC reconstruction //
36 ///////////////////////////////////////////////////////////////////////////////
39 #include "AliTPCReconstructor.h"
40 #include "AliRunLoader.h"
42 #include "AliRawReader.h"
43 #include "AliTPCclustererMI.h"
44 #include "AliTPCtrackerMI.h"
45 //#include "AliTPCpidESD.h"
46 #include "AliTPCParam.h"
47 #include "AliTPCParamSR.h"
48 #include "AliTPCcalibDB.h"
49 #include "AliTracker.h"
52 ClassImp(AliTPCReconstructor)
55 Int_t AliTPCReconstructor::fgStreamLevel = 1; // stream (debug) level
56 AliTPCAltroEmulator * AliTPCReconstructor::fAltroEmulator=0; // ALTRO emulator
58 AliTPCReconstructor::AliTPCReconstructor():
63 // default constructor
67 AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
68 const AliMagF * field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
69 calib->SetExBField(field);
70 AliTPCParam* param = GetTPCParam();
72 AliWarning("Loading default TPC parameters !");
73 param = new AliTPCParamSR;
75 fClusterer = new AliTPCclustererMI(param);
78 AliTPCReconstructor::AliTPCReconstructor(const AliTPCReconstructor& /*rec*/):
83 // Dummy copu constructor
87 AliTPCReconstructor& AliTPCReconstructor::operator=(const AliTPCReconstructor&){
94 //_____________________________________________________________________________
95 AliTPCReconstructor::~AliTPCReconstructor()
97 if (fClusterer) delete fClusterer;
100 //_____________________________________________________________________________
101 void AliTPCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const {
102 // single event local reconstruction
104 fClusterer->SetInput(digitsTree);
105 fClusterer->SetOutput(clustersTree);
106 fClusterer->Digits2Clusters();
109 //_____________________________________________________________________________
110 void AliTPCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const {
111 // single event local reconstruction
112 // of TPC data starting from raw data
114 fClusterer->SetOutput(clustersTree);
115 fClusterer->Digits2Clusters(rawReader);
118 //_____________________________________________________________________________
119 AliTracker* AliTPCReconstructor::CreateTracker() const
121 // create a TPC tracker
123 AliTPCParam* param = GetTPCParam();
125 AliWarning("Loading default TPC parameters !");
126 param = new AliTPCParamSR;
128 param->ReadGeoMatrices();
130 AliTPCtrackerMI* tracker = new AliTPCtrackerMI(param);
132 ParseOptions(tracker);
137 //_____________________________________________________________________________
138 void AliTPCReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/,
139 AliESDEvent* /*esd*/) const
142 /* Now done in AliESDpid
143 Double_t parTPC[] = {50., 0.07, 5.}; // MIP nnormalized to channel 50 -MI
144 AliTPCpidESD tpcPID(parTPC);
150 //_____________________________________________________________________________
151 AliTPCParam* AliTPCReconstructor::GetTPCParam() const
153 // get the TPC parameters
155 AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters();
161 //_____________________________________________________________________________
162 void AliTPCReconstructor::ParseOptions( AliTPCtrackerMI* tracker ) const
164 // parse options from rec.C and set in clusterer and tracker
166 TString option = GetOption();
168 Int_t useHLTClusters = 3;
170 if (option.Contains("use")) {
172 AliInfo(Form("Overide TPC RecoParam with option %s",option.Data()));
174 if (!option.CompareTo("useRAW"))
176 if (!option.CompareTo("useRAWorHLT"))
178 if (!option.CompareTo("useHLT"))
180 if (!option.CompareTo("useHLTorRAW"))
184 const AliTPCRecoParam* param = GetRecoParam();
185 useHLTClusters = param->GetUseHLTClusters();
188 AliInfo(Form("Usage of HLT clusters in TPC reconstruction : %d", useHLTClusters));
190 fClusterer->SetUseHLTClusters(useHLTClusters);
191 tracker->SetUseHLTClusters(useHLTClusters);