]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCClustersRow.cxx
First version of ACORDE QA reference data. Up tp now, we use the modules activity...
[u/mrichter/AliRoot.git] / TPC / AliTPCClustersRow.cxx
index f44e6f9a7ec1a4bf12c2fca464cd80768ea3cfe9..f26175987dc336c459232fc50718d7e02c73f5a3 100644 (file)
@@ -12,6 +12,8 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 //                                                                           //
 //                                                                          //
 ///////////////////////////////////////////////////////////////////////////////
-#include "AliTPC.h"
-#include "AliCluster.h"
+#include "AliTPCcluster.h"
+#include <TClass.h>
 #include "AliClusters.h"
 #include "AliTPCClustersRow.h"
-#include "TDirectory.h"
+#include <TDirectory.h>
+#include <TClonesArray.h>
 
 
 const Int_t kDefSize = 1;  //defalut size
@@ -46,9 +49,24 @@ AliTPCClustersRow::AliTPCClustersRow()
 }
 
 //_____________________________________________________________________________
-//AliTPCClustersRow::AliTPCClustersRow(Int_t size) 
-//{    
-//  fNclusters=0;
-//  fClusters = new TClonesArray("AliTPCcluster",size);
-//}
+TObject *AliTPCClustersRow::InsertCluster(const TObject *c) 
+{    
+  //
+  // Add a simulated cluster copy to the list
+  //
+  if (fClass==0) {
+    Error("AliClusters", "class type not specified");
+    return 0;
+  }
+  if(!fClusters) fClusters=new TClonesArray(fClass->GetName(),1000);
+  TClonesArray &lclusters = *fClusters;
+  return new(lclusters[fNclusters++]) AliTPCcluster(*((AliTPCcluster*)c));
+}
+//__________________________________________________________________________
+
+
+TObject *AliTPCClustersRow::Append(){
+ //create new object return pointer to this object
+ return fClusters->operator[](fClusters->GetEntriesFast());
+}