]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterStoreV2.cxx
AliMUONRecoParam:
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterStoreV2.cxx
index 13e63ff0cdc1655abd01453d06145e8fbb777c80..9774a3eb51b9df1d6039b70c7fd711a53379f495 100644 (file)
@@ -124,7 +124,7 @@ AliMUONVCluster* AliMUONClusterStoreV2::CreateCluster(Int_t chamberId, Int_t det
 }
 
 //_____________________________________________________________________________
-Bool_t AliMUONClusterStoreV2::Add(const AliMUONVCluster& vCluster)
+AliMUONVCluster* AliMUONClusterStoreV2::Add(const AliMUONVCluster& vCluster)
 {
   /// Add a cluster to this store
   const AliMUONRawClusterV2* cluster = dynamic_cast<const AliMUONRawClusterV2*>(&vCluster);
@@ -132,7 +132,7 @@ Bool_t AliMUONClusterStoreV2::Add(const AliMUONVCluster& vCluster)
   if (!cluster) {
     AliError(Form("Cluster is not of the expected type (%s vs AliMUONRawClusterV2)",
                   vCluster.ClassName()));
-    return kFALSE;
+    return 0x0;
   }
   
   // check chamberId
@@ -143,17 +143,19 @@ Bool_t AliMUONClusterStoreV2::Add(const AliMUONVCluster& vCluster)
   }
   
   // check that there is no cluster with the same Id
-  if (FindObject(cluster->GetUniqueID())) {
-    AliError("cluster store already contains a cluster with the same ID --> add() aborted");
-    return kFALSE;
+  AliMUONVCluster *c = FindObject(cluster->GetUniqueID());
+  if (c) {
+    AliError("cluster store already contains a cluster with the same ID --> add() aborted:");
+    c->Print("FULL");
+    return 0x0;
   }
   
   // add new cluster
-  AliMUONVCluster *c = new((*fClusters)[fClusters->GetLast()+1]) AliMUONRawClusterV2(*cluster);
+  c = new((*fClusters)[fClusters->GetLast()+1]) AliMUONRawClusterV2(*cluster);
   
   if (c) UpdateMap(*c);
   
-  return kTRUE;
+  return c;
 }
 
 //_____________________________________________________________________________