]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterStoreV2.cxx
Adding -lssl
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterStoreV2.cxx
index aa0b9f31fb03372835dcc36849d8a3c0357a0154..8d06032b5c76110ce7409827f48ce4b0afa64754 100644 (file)
 ClassImp(AliMUONClusterStoreV2)
 /// \endcond
 
+//_____________________________________________________________________________
+AliMUONClusterStoreV2::AliMUONClusterStoreV2(TRootIOCtor* /*dummy*/)
+: AliMUONVClusterStore(), 
+fClusters(0x0),
+fMap(0x0),
+fMapped(kFALSE)
+{
+  /// Dummy IO ctor that does not allocate memory
+}
+
 //_____________________________________________________________________________
 AliMUONClusterStoreV2::AliMUONClusterStoreV2() 
 : AliMUONVClusterStore(), 
@@ -69,10 +79,13 @@ AliMUONClusterStoreV2::AliMUONClusterStoreV2(const AliMUONClusterStoreV2& store)
 AliMUONClusterStoreV2& AliMUONClusterStoreV2::operator=(const AliMUONClusterStoreV2& store)
 {
   /// Assignment operator
-  fClusters = new TClonesArray(*(store.fClusters));
-  fMap = 0x0;
-  fMapped = kFALSE;
-  if (store.fMapped) ReMap();
+  if ( this != &store )
+  {
+    fClusters = new TClonesArray(*(store.fClusters));
+    fMap = 0x0;
+    fMapped = kFALSE;
+    if (store.fMapped) ReMap();
+  }
   return *this;
 }
 
@@ -88,10 +101,17 @@ AliMUONClusterStoreV2::~AliMUONClusterStoreV2()
 void AliMUONClusterStoreV2::Clear(Option_t*)
 {
   /// Clear the internal cluster array AND the index
-  fClusters->Clear("C");
-  if (fMap) {
-    fMap->Clear("C");
-    fMapped = kFALSE;
+  if ( fClusters ) 
+  {
+    fClusters->Clear("C");
+    if (fMap) {
+      Int_t nChamber = AliMpConstants::NofTrackingChambers();
+      for (Int_t chamber=0; chamber<nChamber; chamber++) {
+        AliMpExMap *map = static_cast<AliMpExMap *>(fMap->UncheckedAt(chamber));
+        map->Clear("C");
+      }
+      fMapped = kFALSE;
+    }
   }
 }
 
@@ -145,7 +165,7 @@ AliMUONVCluster* AliMUONClusterStoreV2::Add(const AliMUONVCluster& vCluster)
   // check that there is no cluster with the same Id
   AliMUONVCluster *c = FindObject(cluster->GetUniqueID());
   if (c) {
-    AliError("cluster store already contains a cluster with the same ID --> add() aborted:");
+    AliError("cluster store already contains a cluster with the same ID --> add() exited:");
     c->Print("FULL");
     return 0x0;
   }
@@ -172,7 +192,7 @@ AliMUONVCluster* AliMUONClusterStoreV2::Add(Int_t chamberId, Int_t detElemId, In
   // check that there is no cluster with the same Id
   AliMUONVCluster *c = FindObject(AliMUONVCluster::BuildUniqueID(chamberId, detElemId, clusterIndex));
   if (c) {
-    AliError("cluster store already contains a cluster with the same ID --> add() aborted:");
+    AliError("cluster store already contains a cluster with the same ID --> add() exited:");
     c->Print("FULL");
     return 0x0;
   }
@@ -219,13 +239,13 @@ void AliMUONClusterStoreV2::ReMap()
     // Create one map per chamber
     AliMpExMap *map;
     for (Int_t chamber=0; chamber<nChamber; chamber++) {
-      map = new((*fMap)[chamber]) AliMpExMap(kTRUE);
+      map = new((*fMap)[chamber]) AliMpExMap;
       map->SetOwner(kFALSE);
     }
   }
   else {
     for (Int_t chamber=0; chamber<nChamber; chamber++) {
-      AliMpExMap *map = static_cast<AliMpExMap *>(fMap->At(chamber));
+      AliMpExMap *map = static_cast<AliMpExMap *>(fMap->UncheckedAt(chamber));
       map->Clear("C");
     }
   }