]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDigit.cxx
Updated list of MUON libraries
[u/mrichter/AliRoot.git] / MUON / AliMUONDigit.cxx
index 59aa9f2928fb4c5d5b38ce21bb2fa279d72d1ad9..195e242a1fe1189fbc4a073a78c0d81d231a7243 100644 (file)
@@ -20,7 +20,7 @@
 #include "Riostream.h"
 #include "TString.h"
 
-///
+/// \class AliMUONDigit
 /// A class representing a digit in the MUON spectrometer
 /// either in tracking or trigger chambers.
 ///
 /// with no electronic noise whatsoever) or digits (either real digits or
 /// simulated ones but including electronic noise and de-calibration, to 
 /// closely ressemble real ones).
-///
 
+/// \cond CLASSIMP
 ClassImp(AliMUONDigit)
+/// \endcond
 
 //_____________________________________________________________________________
 AliMUONDigit::AliMUONDigit()
@@ -42,7 +43,7 @@ TObject(),
 fDetElemId(-1),
 fManuId(-1),
 fManuChannel(-1),
-fSignal(0),
+fSignal(0.0),
 fPadX(-1),
 fPadY(-1),
 fCathode(-1),
@@ -51,12 +52,11 @@ fFlags(0),
 fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
-fPhysics(0),
-fHit(0)
+fPhysics(0.0),
+fHit(0),
+fStatusMap(0)
 {
-  //
-  // Default constructor
-  //
+  /// Default constructor
 }
 
 //_____________________________________________________________________________
@@ -65,32 +65,7 @@ AliMUONDigit::AliMUONDigit(const AliMUONDigit& digit)
 fDetElemId(-1),
 fManuId(-1),
 fManuChannel(-1),
-fSignal(0),
-fPadX(-1),
-fPadY(-1),
-fCathode(-1),
-fADC(0),
-fFlags(0),
-fNtracks(0),
-fTcharges(0x0),
-fTracks(0x0),
-fPhysics(0),
-fHit(0)
-{
-  //
-  // copy constructor
-  //
-   (static_cast<const AliMUONDigit&>(digit)).Copy(*this);
-}
-
-
-//_____________________________________________________________________________
-AliMUONDigit::AliMUONDigit(Int_t *digits)
-: TObject(),
-fDetElemId(-1),
-fManuId(-1),
-fManuChannel(-1),
-fSignal(0),
+fSignal(0.0),
 fPadX(-1),
 fPadY(-1),
 fCathode(-1),
@@ -99,91 +74,30 @@ fFlags(0),
 fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
-fPhysics(0),
-fHit(0)
-
+fPhysics(0.0),
+fHit(0),
+fStatusMap(0)
 {
-  //
-  // Creates a MUON digit object to be updated
-  // \deprecated
-  //
-    fPadX        = digits[0];
-    fPadY        = digits[1];
-    fCathode     = digits[2];
-    fSignal      = digits[3];
-    fPhysics     = digits[4];
-    fHit         = digits[5];
-    fDetElemId   = digits[6];
-    fManuId = -1;
-    fManuChannel = -1;
-    fADC=0;
-    fFlags = 0;
-}
+  /// Copy constructor
 
-//_____________________________________________________________________________
-AliMUONDigit::AliMUONDigit(Int_t *tracks, Int_t *charges, Int_t *digits)
-: TObject(),
-fDetElemId(-1),
-fManuId(-1),
-fManuChannel(-1),
-fSignal(0),
-fPadX(-1),
-fPadY(-1),
-fCathode(-1),
-fADC(0),
-fFlags(0),
-fNtracks(0),
-fTcharges(0x0),
-fTracks(0x0),
-fPhysics(0),
-fHit(0)
-{
-  //
-  // Creates a MUON digit object
-  //
-  // \deprecated
-    fPadX        = digits[0];
-    fPadY        = digits[1];
-    fCathode     = digits[2];
-    fSignal      = digits[3];
-    fPhysics     = digits[4];
-    fHit         = digits[5];
-    fDetElemId   = digits[6];
-    fManuId = -1;
-    fManuChannel = -1;
-    fADC=0;
-    
-    // For backward compatibility, which assumed 10 tracks.
-    fNtracks = 10;
-    fTcharges = new Int_t[fNtracks];
-    fTracks = new Int_t[fNtracks];
-    
-    for ( Int_t i=0; i<fNtracks; ++i ) 
-    {
-      fTcharges[i]  = charges[i];
-      fTracks[i]    = tracks[i];
-    }
-    fFlags=0;
+   (static_cast<const AliMUONDigit&>(digit)).Copy(*this);
 }
 
 //_____________________________________________________________________________
 AliMUONDigit::~AliMUONDigit()
 {
-  //
-  // Destructor 
-  //
+  /// Destructor 
+
   delete[] fTcharges;
   delete[] fTracks;
 }
 
 //_____________________________________________________________________________
 void
-AliMUONDigit::AddTrack(Int_t trackNumber, Int_t trackCharge)
+AliMUONDigit::AddTrack(Int_t trackNumber, Float_t trackCharge)
 {
-  //
-  // Add 1 track information to the track list we keep.
-  // The implementation below is dumb, you've been warned !
-  //
+  /// Add 1 track information to the track list we keep.
+  /// The implementation below is dumb, you've been warned !
   
   // First check if track is already there, in which
   // case we simply increment its charge.
@@ -199,7 +113,7 @@ AliMUONDigit::AddTrack(Int_t trackNumber, Int_t trackCharge)
   // Nope. It's a brand new track. Make a new array to get space
   // for it, copy the old array into new one, and add the track.
   Int_t* newTracks = new Int_t[fNtracks+1];
-  Int_t* newTcharges = new Int_t[fNtracks+1];
+  Float_t* newTcharges = new Float_t[fNtracks+1];
   
   for ( Int_t i = 0; i < fNtracks; ++i )
   {
@@ -223,9 +137,8 @@ AliMUONDigit::AddTrack(Int_t trackNumber, Int_t trackCharge)
 void 
 AliMUONDigit::Clear(Option_t*)
 {
-  //
-  // Reset this digit, in particular the internal arrays are deleted.
-  //
+  /// Reset this digit, in particular the internal arrays are deleted.
+
   delete[] fTracks;
   delete[] fTcharges;
   fTracks=0x0;
@@ -236,10 +149,8 @@ AliMUONDigit::Clear(Option_t*)
 //_____________________________________________________________________________
 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...
-  //
+  /// 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);
   
@@ -283,9 +194,8 @@ Int_t AliMUONDigit::Compare(const TObject *obj) const
 void 
 AliMUONDigit::Copy(TObject& obj) const
 {
-  //
-  // Copy this line to line.
-  //
+  /// Copy this line to line.
+
   TObject::Copy(obj);
   AliMUONDigit& digit = static_cast<AliMUONDigit&>(obj);
   
@@ -307,7 +217,7 @@ AliMUONDigit::Copy(TObject& obj) const
   
   if ( fNtracks )
   {
-    digit.fTcharges = new Int_t[fNtracks];
+    digit.fTcharges = new Float_t[fNtracks];
     digit.fTracks = new Int_t[fNtracks];
   }
   
@@ -319,13 +229,15 @@ AliMUONDigit::Copy(TObject& obj) const
   
   digit.fPhysics = fPhysics;
   digit.fHit = fHit;
+  digit.fStatusMap = fStatusMap;
 }
 
 //_____________________________________________________________________________
 Bool_t
 AliMUONDigit::IsNoiseOnly() const
 {
-  // Whether this (simulated only) digit is only due to noise.
+  /// Whether this (simulated only) digit is only due to noise.
+
   return (fFlags & fgkNoiseOnlyMask );
 }
 
@@ -333,17 +245,42 @@ AliMUONDigit::IsNoiseOnly() const
 Bool_t
 AliMUONDigit::IsSaturated() const
 {
-  // Whether this digit is saturated or not.
+  /// Whether this digit is saturated or not.
+
   return (fFlags & fgkSaturatedMask );
 }
 
+//_____________________________________________________________________________
+Bool_t
+AliMUONDigit::IsEfficiencyApplied() const
+{
+  /// Whether this digit had efficiency applied or not
+  
+  return (fFlags & fgkEfficiencyMask );
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDigit::EfficiencyApplied(Bool_t value)
+{
+  /// Set the EfficiencyApplied status of this digit.
+  
+  if ( value )
+  {
+    fFlags |= fgkEfficiencyMask;
+  }
+  else
+  {
+    fFlags ^= fgkEfficiencyMask;
+  }
+}
+
 //_____________________________________________________________________________
 void
 AliMUONDigit::NoiseOnly(Bool_t value)
 {
-  //
-  // Set the NoiseOnly status of this digit.
-  //
+  /// Set the NoiseOnly status of this digit.
+
   if ( value )
   {
     fFlags |= fgkNoiseOnlyMask;
@@ -358,9 +295,8 @@ AliMUONDigit::NoiseOnly(Bool_t value)
 AliMUONDigit& 
 AliMUONDigit::operator=(const AliMUONDigit& digit)
 {
-  //
-  // Assignement operator.
-  //
+  /// Assignement operator.
+
   AliMUONDigit a(digit);
   a.Copy(*this);
   return *this;
@@ -370,9 +306,8 @@ AliMUONDigit::operator=(const AliMUONDigit& digit)
 void
 AliMUONDigit::PatchTracks(Int_t mask)
 {
-  //
-  // Add mask to each track number.
-  //
+  /// Add mask to each track number.
+
   for ( Int_t i = 0; i < Ntracks(); ++i )
   {
     fTracks[i] += mask;
@@ -383,18 +318,14 @@ AliMUONDigit::PatchTracks(Int_t mask)
 void
 AliMUONDigit::Print(Option_t* opt) const
 {
-  //
-  // Dump to screen.
-  // If opt=="tracks", info on tracks are printed too.
-  //
-  cout << "DetEle " << setw(5) << DetElemId()
-  << " Cath " << setw(2) << Cathode()
-  << " (Ix,Iy)=(" << setw(3) << PadX() << "," << setw(3) << PadY()
-  << ") "
-  << " (Manu,Channel)=(" << setw(4) << ManuId() 
-  << "," << setw(3) << ManuChannel() << ")"
-  << " Signal=" << setw(6) << Signal()
-  << " Physics=" << setw(4) << Physics();
+  /// Dump to screen.
+  /// If opt=="tracks", info on tracks are printed too.
+
+  cout << Form("<AliMUONDigit>: DE %4d Cath %d (Ix,Iy)=(%3d,%3d) (Manu,Channel)=(%4d,%2d)"
+               ", Signal=%7.2f Physics=%7.2f",
+               DetElemId(),Cathode(),PadX(),PadY(),ManuId(),ManuChannel(),Signal(),
+               Physics());
+  
   if ( IsSaturated() ) 
   {
     cout << "(S)";
@@ -406,6 +337,9 @@ AliMUONDigit::Print(Option_t* opt) const
   cout << " ADC=" << setw(4) << ADC();
   cout << " Flags=0x" << setw(4) << hex << setfill('0') << fFlags << dec
     << setfill(' ');
+  cout << " StatusMap=0x" << setw(4) << hex << setfill('0') << StatusMap() << dec
+    << setfill(' ');
+
   TString options(opt);
   options.ToLower();
   if ( options.Contains("tracks") )
@@ -433,9 +367,8 @@ AliMUONDigit::Print(Option_t* opt) const
 void
 AliMUONDigit::Saturated(Bool_t value)
 {
-  //
-  // Set the saturation status of this digit.
-  //
+  /// Set the saturation status of this digit.
+
   if ( value )
   {
     fFlags |= fgkSaturatedMask;
@@ -450,6 +383,8 @@ AliMUONDigit::Saturated(Bool_t value)
 void
 AliMUONDigit::SetElectronics(Int_t manuId, Int_t manuChannel)
 {
+  /// Set manuIs and manuChannel
+
   //
   //FIXME: should we check that the values are ok here ??
   //
@@ -461,9 +396,8 @@ AliMUONDigit::SetElectronics(Int_t manuId, Int_t manuChannel)
 Int_t
 AliMUONDigit::Track(Int_t i) const
 {
-  //
-  // Return the i-th track number (if i is >=0 and < Ntracks()) or -1.
-  //
+  /// Return the i-th track number (if i is >=0 and < Ntracks()) or -1.
+
   if ( i >= 0 && i < fNtracks ) 
   {
     return fTracks[i];
@@ -473,12 +407,11 @@ AliMUONDigit::Track(Int_t i) const
 }
 
 //_____________________________________________________________________________
-Int_t
+Float_t
 AliMUONDigit::TrackCharge(Int_t i) const
 {
-  //
-  // Return the i-th track charge (if i is >=0 and < Ntracjs()) or -1.
-  //
+  /// Return the i-th track charge (if i is >=0 and < Ntracjs()) or -1.
+
   if ( i >= 0 && i < fNtracks ) 
   {
     return fTcharges[i];