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"
34 ClassImp(AliTPCReconstructor)
36 Double_t AliTPCReconstructor::fgCtgRange = 1.05;
37 Double_t AliTPCReconstructor::fgMaxSnpTracker = 0.95; // max tangent in tracker - correspond to 3
38 Double_t AliTPCReconstructor::fgMaxSnpTrack = 0.999; // tangent
39 Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level
40 //_____________________________________________________________________________
41 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
43 // reconstruct clusters
45 AliLoader* loader = runLoader->GetLoader("TPCLoader");
47 Error("Reconstruct", "TPC loader not found");
50 loader->LoadRecPoints("recreate");
51 loader->LoadDigits("read");
53 AliTPCParam* param = GetTPCParam(runLoader);
55 AliTPCclustererMI clusterer(param);
56 Int_t nEvents = runLoader->GetNumberOfEvents();
58 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
59 runLoader->GetEvent(iEvent);
61 TTree* treeClusters = loader->TreeR();
63 loader->MakeTree("R");
64 treeClusters = loader->TreeR();
66 TTree* treeDigits = loader->TreeD();
68 Error("Reconstruct", "Can't get digits tree !");
72 clusterer.SetInput(treeDigits);
73 clusterer.SetOutput(treeClusters);
74 clusterer.Digits2Clusters();
76 loader->WriteRecPoints("OVERWRITE");
79 loader->UnloadRecPoints();
80 loader->UnloadDigits();
83 //_____________________________________________________________________________
84 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader,
85 AliRawReader* rawReader) const
87 // reconstruct clusters from raw data
89 AliLoader* loader = runLoader->GetLoader("TPCLoader");
91 Error("Reconstruct", "TPC loader not found");
94 loader->LoadRecPoints("recreate");
96 AliTPCParam* param = GetTPCParam(runLoader);
98 AliTPCclustererMI clusterer(param);
101 while (rawReader->NextEvent()) {
102 runLoader->GetEvent(iEvent++);
104 TTree* treeClusters = loader->TreeR();
106 loader->MakeTree("R");
107 treeClusters = loader->TreeR();
110 clusterer.SetOutput(treeClusters);
111 clusterer.Digits2Clusters(rawReader);
113 loader->WriteRecPoints("OVERWRITE");
116 loader->UnloadRecPoints();
119 //_____________________________________________________________________________
120 AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const
122 // create a TPC tracker
124 AliTPCParam* param = GetTPCParam(runLoader);
125 if (!param) return NULL;
126 param->ReadGeoMatrices();
127 return new AliTPCtrackerMI(param);
130 //_____________________________________________________________________________
131 void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/,
136 Double_t parTPC[] = {47., 0.10, 10.};
137 AliTPCpidESD tpcPID(parTPC);
142 //_____________________________________________________________________________
143 AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* runLoader) const
145 // get the TPC parameters
147 TDirectory* saveDir = gDirectory;
148 runLoader->CdGAFile();
150 AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60");
151 if (!param) Error("GetTPCParam", "no TPC parameters found");