]>
Commit | Line | Data |
---|---|---|
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 | **************************************************************************/ | |
7d855b04 | 15 | |
88cb7938 | 16 | /* $Id$ */ |
cc80f89e | 17 | |
7d855b04 | 18 | /// \class AliTPCClustersRow |
19 | /// \brief Time Projection Chamber AliTPCClusterRow objects | |
20 | /// | |
21 | /// - clusters for given segment of TPC | |
22 | /// | |
23 | /// \author Marian Ivanov , GSI Darmstadt | |
24 | ||
73042f01 | 25 | #include <TClass.h> |
cc80f89e | 26 | #include "AliClusters.h" |
f1e55ab6 | 27 | #include "AliTPCclusterMI.h" |
cc80f89e | 28 | #include "AliTPCClustersRow.h" |
c3c63118 | 29 | #include <TDirectory.h> |
30 | #include <TClonesArray.h> | |
cc80f89e | 31 | |
32 | ||
7d855b04 | 33 | const Int_t kDefSize = 1; ///< defalut size |
cc80f89e | 34 | |
35 | ||
7d855b04 | 36 | /// \cond CLASSIMP |
37 | ClassImp(AliTPCClustersRow) | |
38 | /// \endcond | |
cc80f89e | 39 | |
40 | ||
41 | //***************************************************************************** | |
42 | // | |
43 | //_____________________________________________________________________________ | |
7d855b04 | 44 | AliTPCClustersRow::AliTPCClustersRow() |
45 | { | |
cc80f89e | 46 | // |
47 | //default constructor | |
48 | fNclusters=0; | |
49 | } | |
50 | ||
e7de6656 | 51 | //____________________________________________________________________________ |
52 | AliTPCClustersRow::AliTPCClustersRow(const char *classname) : AliClusters(classname) | |
53 | { | |
7d855b04 | 54 | /// special constructor |
55 | ||
e7de6656 | 56 | fNclusters=0; |
57 | } | |
58 | ||
cc80f89e | 59 | //_____________________________________________________________________________ |
7d855b04 | 60 | TObject *AliTPCClustersRow::InsertCluster(const TObject *c) |
61 | { | |
62 | /// Add a simulated cluster copy to the list | |
63 | ||
73042f01 | 64 | if (fClass==0) { |
65 | Error("AliClusters", "class type not specified"); | |
66 | return 0; | |
67 | } | |
68 | if(!fClusters) fClusters=new TClonesArray(fClass->GetName(),1000); | |
69 | TClonesArray &lclusters = *fClusters; | |
f1e55ab6 | 70 | return new(lclusters[fNclusters++]) AliTPCclusterMI(*((AliTPCclusterMI*)c)); |
73042f01 | 71 | } |
7665dff6 | 72 | //__________________________________________________________________________ |
73042f01 | 73 | |
cc80f89e | 74 | |
7665dff6 | 75 | TObject *AliTPCClustersRow::Append(){ |
7d855b04 | 76 | /// create new object return pointer to this object |
77 | ||
7665dff6 | 78 | return fClusters->operator[](fClusters->GetEntriesFast()); |
79 | } | |
80 |