]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug fix in Charge() which returned half the charge for single-cathode clusters (spott...
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2007 17:20:36 +0000 (17:20 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2007 17:20:36 +0000 (17:20 +0000)
MUON/AliMUONCluster.cxx

index 4df1d8cd695655d3a1c102306e3625affdd4c37a..d8e22c74461b08deda5b56423f0106720362d8b3 100644 (file)
@@ -368,7 +368,21 @@ Float_t
 AliMUONCluster::Charge() const
 {
   /// Return the average charge over both cathodes
-  return (Charge(0)+Charge(1))/2.0;
+  
+  if ( Multiplicity(0) && Multiplicity(1) )
+  {
+    return (Charge(0)+Charge(1))/2.0;
+  }
+  else if ( Multiplicity(0) ) 
+  {
+    return Charge(0);
+  }
+  else if ( Multiplicity(1) ) 
+  {
+    return Charge(1);
+  }
+  AliError("Should not be here ?!");
+  return -1.0;
 }
 
 //_____________________________________________________________________________