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"
34 ClassImp(AliTPCReconstructor)
36 Double_t AliTPCReconstructor::fgCtgRange = 1.05;
38 //_____________________________________________________________________________
39 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader) const
41 // reconstruct clusters
43 AliLoader* loader = runLoader->GetLoader("TPCLoader");
45 Error("Reconstruct", "TPC loader not found");
48 loader->LoadRecPoints("recreate");
49 loader->LoadDigits("read");
51 AliTPCParam* param = GetTPCParam(runLoader);
53 AliTPCclustererMI clusterer(param);
54 Int_t nEvents = runLoader->GetNumberOfEvents();
56 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
57 runLoader->GetEvent(iEvent);
59 TTree* treeClusters = loader->TreeR();
61 loader->MakeTree("R");
62 treeClusters = loader->TreeR();
64 TTree* treeDigits = loader->TreeD();
66 Error("Reconstruct", "Can't get digits tree !");
70 clusterer.SetInput(treeDigits);
71 clusterer.SetOutput(treeClusters);
72 clusterer.Digits2Clusters();
74 loader->WriteRecPoints("OVERWRITE");
77 loader->UnloadRecPoints();
78 loader->UnloadDigits();
81 //_____________________________________________________________________________
82 void AliTPCReconstructor::Reconstruct(AliRunLoader* runLoader,
83 AliRawReader* rawReader) const
85 // reconstruct clusters from raw data
87 AliLoader* loader = runLoader->GetLoader("TPCLoader");
89 Error("Reconstruct", "TPC loader not found");
92 loader->LoadRecPoints("recreate");
94 AliTPCParam* param = GetTPCParam(runLoader);
96 AliTPCclustererMI clusterer(param);
99 while (rawReader->NextEvent()) {
100 runLoader->GetEvent(iEvent++);
102 TTree* treeClusters = loader->TreeR();
104 loader->MakeTree("R");
105 treeClusters = loader->TreeR();
108 clusterer.SetOutput(treeClusters);
109 clusterer.Digits2Clusters(rawReader);
111 loader->WriteRecPoints("OVERWRITE");
114 loader->UnloadRecPoints();
117 //_____________________________________________________________________________
118 AliTracker* AliTPCReconstructor::CreateTracker(AliRunLoader* runLoader) const
120 // create a TPC tracker
122 AliTPCParam* param = GetTPCParam(runLoader);
123 if (!param) return NULL;
124 return new AliTPCtrackerMI(param);
127 //_____________________________________________________________________________
128 void AliTPCReconstructor::FillESD(AliRunLoader* /*runLoader*/,
133 Double_t parTPC[] = {47., 0.10, 10.};
134 AliTPCpidESD tpcPID(parTPC);
139 //_____________________________________________________________________________
140 AliTPCParam* AliTPCReconstructor::GetTPCParam(AliRunLoader* runLoader) const
142 // get the TPC parameters
144 TDirectory* saveDir = gDirectory;
145 runLoader->CdGAFile();
147 AliTPCParam* param = (AliTPCParam*) gDirectory->Get("75x40_100x60_150x60");
148 if (!param) Error("GetTPCParam", "no TPC parameters found");