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 Revision 1.3 2000/06/30 12:07:49 kowal2
19 Updated from the TPC-PreRelease branch
21 Revision 1.2.4.1 2000/06/09 07:09:29 kowal2
23 Clustering and tracking classes are splitted from the simulation ones
25 Revision 1.2 2000/04/17 09:37:33 kowal2
26 removed obsolete AliTPCDigitsDisplay.C
28 Revision 1.1.4.2 2000/04/10 11:34:02 kowal2
30 Clusters handling in a new data structure
34 ///////////////////////////////////////////////////////////////////////////////
36 // Time Projection Chamber clusters objects //
38 // Origin: Marian Ivanov , GSI Darmstadt
42 ///////////////////////////////////////////////////////////////////////////////
44 #include "AliTPCParam.h"
45 #include "AliSegmentArray.h"
46 #include "AliComplexCluster.h"
47 #include "AliClusters.h"
48 #include "AliClustersArray.h"
49 #include "AliTPCClustersRow.h"
51 #include "AliTPCClustersArray.h"
52 #include "TClonesArray.h"
53 #include "TDirectory.h"
58 //_____________________________________________________________________________
60 ClassImp(AliTPCClustersArray)
62 AliTPCClustersArray::AliTPCClustersArray()
65 SetClass("AliTPCClustersRow");
68 AliTPCClustersArray::~AliTPCClustersArray()
75 AliTPCClustersRow * AliTPCClustersArray::GetRow(Int_t sector,Int_t row)
78 //return clusters ((AliTPCClustersRow *) per given sector and padrow
80 if (fParam==0) return 0;
81 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
82 return (AliTPCClustersRow *)(*this)[index];
85 AliTPCClustersRow * AliTPCClustersArray::CreateRow(Int_t sector, Int_t row)
90 //if row just exist - delete it
91 AliTPCParam * param = (AliTPCParam*)fParam;
92 Int_t index = param->GetIndex(sector,row);
93 AliTPCClustersRow * clusters = (AliTPCClustersRow *)(*this)[index];
94 if (clusters !=0) delete clusters;
96 clusters = (AliTPCClustersRow *) AddSegment(index);
97 if (clusters == 0) return 0;
101 AliTPCClustersRow * AliTPCClustersArray::LoadRow(Int_t sector,Int_t row)
104 //return clusters ((AliTPCClustersRow *) per given sector and padrow
106 if (fParam==0) return 0;
107 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
108 return ( AliTPCClustersRow *) LoadSegment(index);
111 Bool_t AliTPCClustersArray::StoreRow(Int_t sector,Int_t row)
114 //return clusters ((AliTPCClustersRow *) per given sector and padrow
116 if (fParam==0) return 0;
117 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
122 Bool_t AliTPCClustersArray::ClearRow(Int_t sector,Int_t row)
125 //return clusters ((AliTPCDigitsRow *) per given sector and padrow
127 if (fParam==0) return 0;
128 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
135 Bool_t AliTPCClustersArray::Setup(const AliDetectorParam *param)
138 //setup function to adjust array parameters
140 if (param==0) return kFALSE;
141 fParam = (AliDetectorParam *)param;
142 return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal());
145 Bool_t AliTPCClustersArray::Update()
148 //setup function to adjust array parameters
150 if (fParam ==0 ) return kFALSE;
151 if (fTree!=0) return MakeDictionary( ((AliTPCParam*)fParam)->GetNRowsTotal()) ;
152 ((AliTPCParam*)fParam)->Update();
153 return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal());
157 AliSegmentID * AliTPCClustersArray::NewSegment()
160 //create object according class information
161 if (fClusterType==0) {
162 Error("AliTPCCLustersArray", "cluster type isn't adjusted");
165 AliSegmentID *segment=AliSegmentArray::NewSegment();
166 ((AliTPCClustersRow*)segment)->SetClass(fClusterType->GetName());
167 ((AliTPCClustersRow*)segment)->SetArray(100);