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);
105 while (rawReader->NextEvent()) {
106 runLoader->GetEvent(iEvent++);
108 TTree* treeClusters = loader->TreeR();
110 loader->MakeTree("R");
111 treeClusters = loader->TreeR();
114 clusterer.SetOutput(treeClusters);
115 clusterer.Digits2Clusters(rawReader);
117 loader->WriteRecPoints("OVERWRITE");
120 loader->UnloadRecPoints();
123 //_____________________________________________________________________________
124 AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const
126 // create a TPC tracker
128 AliTPCParam* param = GetTPCParam(runLoader);
130 AliWarning("Loading default TPC parameters !");
131 param = new AliTPCParamSR;
133 param->ReadGeoMatrices();
134 return new AliTPCtrackerMI(param);
137 //_____________________________________________________________________________
138 void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/,
143 Double_t parTPC[] = {47., 0.10, 10.};
144 AliTPCpidESD tpcPID(parTPC);
149 //_____________________________________________________________________________
150 AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* runLoader) const
152 // get the TPC parameters
154 TDirectory* saveDir = gDirectory;
155 runLoader->CdGAFile();
157 AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60");
158 if (!param) Error("GetTPCParam", "no TPC parameters found");