]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDigit.cxx
added proper handling of EMCAL calibration events
[u/mrichter/AliRoot.git] / MUON / AliMUONDigit.cxx
index d3e7f53c602719aacb08290f11268648b459465e..56907450e1980c7c99e2f7cb21eef1c4a15cec8d 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "AliMUONDigit.h"
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONDigit
 /// A class representing a digit (with MC information if possible)
 /// in the MUON spectrometer either in tracking or trigger chambers.
@@ -27,6 +28,7 @@
 /// This class is used to represent either sdigits (purely simulated digit, 
 /// with no electronic noise whatsoever) or digits (simulated ones but 
 /// including electronic noise and de-calibration, to closely ressemble real ones).
+//-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
 ClassImp(AliMUONDigit)
@@ -49,6 +51,7 @@ fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
 fHit(0),
+fTime(0),
 fStatusMap(0)
 {
   /// Default constructor
@@ -72,6 +75,7 @@ fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
 fHit(0),
+fTime(0),
 fStatusMap(0)
 {
   /// Normal constructor
@@ -94,6 +98,7 @@ fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
 fHit(0),
+fTime(0),
 fStatusMap(0)
 {
   /// Copy constructor
@@ -164,50 +169,6 @@ AliMUONDigit::Clear(Option_t*)
   fNtracks=0;
 }
 
-//_____________________________________________________________________________
-Int_t AliMUONDigit::Compare(const TObject *obj) const
-{
-  /// The order defined below is first by DE, then Signal, then 
-  /// manuId, and then manuChannel, i.e. it should be a total ordering...
-
-  const AliMUONDigit* d = static_cast<const AliMUONDigit*>(obj);
-  
-  if ( DetElemId() > d->DetElemId() ) 
-  {
-    return 1;
-  }
-  else if ( DetElemId() < d->DetElemId() )
-  {
-    return -1;
-  }
-  else
-  {
-    if ( Charge() > d->Charge() )
-    {
-      return 1;
-    }
-    else if ( Charge() < d->Charge() )
-    {
-      return -1;
-    }
-    else
-    {
-      if ( ManuId() < d->ManuId() )
-      {
-        return 1;
-      }
-      else if ( ManuId() > d->ManuId() )
-      {
-        return -1;
-      }
-      else
-      {
-        return ( ManuChannel() < d->ManuChannel() ) ? 1 : -1;
-      }
-    }
-  }
-}
-
 //______________________________________________________________________________
 void 
 AliMUONDigit::Copy(TObject& obj) const
@@ -246,6 +207,7 @@ AliMUONDigit::Copy(TObject& obj) const
   }
   
   digit.fHit = fHit;
+  digit.fTime = fTime;
   digit.fStatusMap = fStatusMap;
 }
 
@@ -277,6 +239,24 @@ AliMUONDigit::IsCalibrated() const
   return (fFlags & fgkCalibratedMask );
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONDigit::IsConverted() const
+{
+  /// Whether this digit is converted or not
+  
+  return (fFlags & fgkConverted);
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONDigit::IsChargeInFC() const
+{
+  /// Whether this digit is converted or not
+  
+  return (fFlags & fgkChargeInFC);
+}
+
 
 //_____________________________________________________________________________
 Bool_t
@@ -308,7 +288,7 @@ AliMUONDigit::Used(Bool_t value)
   }
   else
   {
-    fFlags ^= fgkUsedMask;
+    fFlags &= ~fgkUsedMask;
   }
 }
 
@@ -324,7 +304,7 @@ AliMUONDigit::Calibrated(Bool_t value)
   }
   else
   {
-    fFlags ^= fgkCalibratedMask;
+    fFlags &= ~fgkCalibratedMask;
   }
 }
 
@@ -340,7 +320,7 @@ AliMUONDigit::EfficiencyApplied(Bool_t value)
   }
   else
   {
-    fFlags ^= fgkEfficiencyMask;
+    fFlags &= ~fgkEfficiencyMask;
   }
 }
 
@@ -379,7 +359,7 @@ AliMUONDigit::NoiseOnly(Bool_t value)
   }
   else
   {
-    fFlags ^= fgkNoiseOnlyMask;
+    fFlags &= ~fgkNoiseOnlyMask;
   }
 }
 
@@ -389,8 +369,10 @@ AliMUONDigit::operator=(const AliMUONDigit& digit)
 {
   /// Assignement operator.
 
-  AliMUONDigit a(digit);
-  a.Copy(*this);
+  if ( this != &digit ) 
+  {
+    digit.Copy(*this);
+  }
   return *this;
 }
 
@@ -418,7 +400,39 @@ AliMUONDigit::Saturated(Bool_t value)
   }
   else
   {
-    fFlags ^= fgkSaturatedMask;
+    fFlags &= ~fgkSaturatedMask;
+  }
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDigit::Converted(Bool_t value)
+{
+  /// Set the convertion status of this digit.
+  
+  if ( value )
+  {
+    fFlags |= fgkConverted;
+  }
+  else
+  {
+    fFlags &= ~fgkConverted;
+  }
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDigit::ChargeInFC(Bool_t value)
+{
+  /// Set the convertion status of this digit.
+  
+  if ( value )
+  {
+    fFlags |= fgkChargeInFC;
+  }
+  else
+  {
+    fFlags &= ~fgkChargeInFC;
   }
 }