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 ///////////////////////////////////////////////////////////////////////////////
20 // class for TPC reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliTPCReconstructor.h"
26 #include "AliRunLoader.h"
28 #include "AliRawReader.h"
29 #include "AliTPCclustererMI.h"
30 #include "AliTPCtrackerMI.h"
31 #include "AliTPCpidESD.h"
32 #include "AliTPCParam.h"
33 #include "AliTPCParamSR.h"
34 #include "AliTPCcalibDB.h"
36 ClassImp(AliTPCReconstructor)
39 AliTPCRecoParam * AliTPCReconstructor::fgkRecoParam =0; // reconstruction parameters
40 Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level
43 AliTPCReconstructor::AliTPCReconstructor(): AliReconstructor() {
45 // default constructor
48 AliError("The Reconstruction parameters nonitialized - Used default one");
49 fgkRecoParam = AliTPCRecoParam::GetHighFluxParam();
54 //_____________________________________________________________________________
55 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
57 // reconstruct clusters
59 AliLoader* loader = runLoader->GetLoader("TPCLoader");
61 Error("Reconstruct", "TPC loader not found");
64 loader->LoadRecPoints("recreate");
65 loader->LoadDigits("read");
67 AliTPCParam* param = GetTPCParam(runLoader);
69 AliTPCclustererMI clusterer(param);
70 Int_t nEvents = runLoader->GetNumberOfEvents();
72 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
73 runLoader->GetEvent(iEvent);
75 TTree* treeClusters = loader->TreeR();
77 loader->MakeTree("R");
78 treeClusters = loader->TreeR();
80 TTree* treeDigits = loader->TreeD();
82 Error("Reconstruct", "Can't get digits tree !");
86 clusterer.SetInput(treeDigits);
87 clusterer.SetOutput(treeClusters);
88 clusterer.Digits2Clusters();
90 loader->WriteRecPoints("OVERWRITE");
93 loader->UnloadRecPoints();
94 loader->UnloadDigits();
97 //_____________________________________________________________________________
98 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader,
99 AliRawReader* rawReader) const
101 // reconstruct clusters from raw data
103 AliLoader* loader = runLoader->GetLoader("TPCLoader");
105 Error("Reconstruct", "TPC loader not found");
108 loader->LoadRecPoints("recreate");
110 AliTPCParam* param = GetTPCParam(runLoader);
112 AliWarning("Loading default TPC parameters !");
113 param = new AliTPCParamSR;
115 AliTPCclustererMI clusterer(param);
117 TString option = GetOption();
118 // if (option.Contains("PedestalSubtraction"))
119 // clusterer.SetPedSubtraction(kTRUE);
120 if (option.Contains("OldRCUFormat"))
121 clusterer.SetOldRCUFormat(kTRUE);
124 while (rawReader->NextEvent()) {
125 runLoader->GetEvent(iEvent++);
127 TTree* treeClusters = loader->TreeR();
129 loader->MakeTree("R");
130 treeClusters = loader->TreeR();
133 clusterer.SetOutput(treeClusters);
134 clusterer.Digits2Clusters(rawReader);
136 loader->WriteRecPoints("OVERWRITE");
139 loader->UnloadRecPoints();
142 //_____________________________________________________________________________
143 AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const
145 // create a TPC tracker
147 AliTPCParam* param = GetTPCParam(runLoader);
149 AliWarning("Loading default TPC parameters !");
150 param = new AliTPCParamSR;
152 param->ReadGeoMatrices();
153 return new AliTPCtrackerMI(param);
156 //_____________________________________________________________________________
157 void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/,
162 Double_t parTPC[] = {47., 0.10, 10.};
163 AliTPCpidESD tpcPID(parTPC);
168 //_____________________________________________________________________________
169 AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* /*runLoader*/) const
171 // get the TPC parameters
173 // TDirectory* saveDir = gDirectory;
174 //runLoader->CdGAFile();
176 AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters();
178 // AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60");
179 // if (!param) Error("GetTPCParam", "no TPC parameters found");