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"
35 ClassImp(AliTPCReconstructor)
37 Double_t AliTPCReconstructor::fgCtgRange = 1.05;
38 Double_t AliTPCReconstructor::fgMaxSnpTracker = 0.95; // max tangent in tracker - correspond to 3
39 Double_t AliTPCReconstructor::fgMaxSnpTrack = 0.999; // tangent
40 Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level
41 //_____________________________________________________________________________
42 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
44 // reconstruct clusters
46 AliLoader* loader = runLoader->GetLoader("TPCLoader");
48 Error("Reconstruct", "TPC loader not found");
51 loader->LoadRecPoints("recreate");
52 loader->LoadDigits("read");
54 AliTPCParam* param = GetTPCParam(runLoader);
56 AliTPCclustererMI clusterer(param);
57 Int_t nEvents = runLoader->GetNumberOfEvents();
59 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
60 runLoader->GetEvent(iEvent);
62 TTree* treeClusters = loader->TreeR();
64 loader->MakeTree("R");
65 treeClusters = loader->TreeR();
67 TTree* treeDigits = loader->TreeD();
69 Error("Reconstruct", "Can't get digits tree !");
73 clusterer.SetInput(treeDigits);
74 clusterer.SetOutput(treeClusters);
75 clusterer.Digits2Clusters();
77 loader->WriteRecPoints("OVERWRITE");
80 loader->UnloadRecPoints();
81 loader->UnloadDigits();
84 //_____________________________________________________________________________
85 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader,
86 AliRawReader* rawReader) const
88 // reconstruct clusters from raw data
90 AliLoader* loader = runLoader->GetLoader("TPCLoader");
92 Error("Reconstruct", "TPC loader not found");
95 loader->LoadRecPoints("recreate");
97 AliTPCParam* param = GetTPCParam(runLoader);
99 AliWarning("Loading default TPC parameters !");
100 param = new AliTPCParamSR;
102 AliTPCclustererMI clusterer(param);
104 TString option = GetOption();
105 if (option.Contains("PedestalSubtraction"))
106 clusterer.SetPedSubtraction(kTRUE);
107 if (option.Contains("OldRCUFormat"))
108 clusterer.SetOldRCUFormat(kTRUE);
111 while (rawReader->NextEvent()) {
112 runLoader->GetEvent(iEvent++);
114 TTree* treeClusters = loader->TreeR();
116 loader->MakeTree("R");
117 treeClusters = loader->TreeR();
120 clusterer.SetOutput(treeClusters);
121 clusterer.Digits2Clusters(rawReader);
123 loader->WriteRecPoints("OVERWRITE");
126 loader->UnloadRecPoints();
129 //_____________________________________________________________________________
130 AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const
132 // create a TPC tracker
134 AliTPCParam* param = GetTPCParam(runLoader);
136 AliWarning("Loading default TPC parameters !");
137 param = new AliTPCParamSR;
139 param->ReadGeoMatrices();
140 return new AliTPCtrackerMI(param);
143 //_____________________________________________________________________________
144 void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/,
149 Double_t parTPC[] = {47., 0.10, 10.};
150 AliTPCpidESD tpcPID(parTPC);
155 //_____________________________________________________________________________
156 AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* runLoader) const
158 // get the TPC parameters
160 TDirectory* saveDir = gDirectory;
161 runLoader->CdGAFile();
163 AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60");
164 if (!param) Error("GetTPCParam", "no TPC parameters found");