The operator[] is replaced by At() or AddAt() in case of TObjArray.
[u/mrichter/AliRoot.git] / TPC / AliTPCClustersRow.cxx
CommitLineData
cc80f89e 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16///////////////////////////////////////////////////////////////////////////////
17// //
18// Time Projection Chamber AliTPCClusterRow objects
19// - clusters for given segment of TPC //
20//
21// Origin: Marian Ivanov , GSI Darmstadt
22// //
23// //
24///////////////////////////////////////////////////////////////////////////////
73042f01 25#include "AliTPCcluster.h"
26#include <TClass.h>
cc80f89e 27#include "AliClusters.h"
28#include "AliTPCClustersRow.h"
c3c63118 29#include <TDirectory.h>
30#include <TClonesArray.h>
cc80f89e 31
32
33const Int_t kDefSize = 1; //defalut size
34
35
36ClassImp(AliTPCClustersRow)
37
38
39//*****************************************************************************
40//
41//_____________________________________________________________________________
42AliTPCClustersRow::AliTPCClustersRow()
43{
44 //
45 //default constructor
46 fNclusters=0;
47}
48
49//_____________________________________________________________________________
73042f01 50TObject *AliTPCClustersRow::InsertCluster(const TObject *c)
51{
52 //
53 // Add a simulated cluster copy to the list
54 //
55 if (fClass==0) {
56 Error("AliClusters", "class type not specified");
57 return 0;
58 }
59 if(!fClusters) fClusters=new TClonesArray(fClass->GetName(),1000);
60 TClonesArray &lclusters = *fClusters;
61 return new(lclusters[fNclusters++]) AliTPCcluster(*((AliTPCcluster*)c));
62}
63
cc80f89e 64