+//_____________________________________________________________________________
+AliMUONDigit&
+AliMUONDigit::operator=(const AliMUONDigit& digit)
+{
+ //
+ // Assignement operator.
+ //
+ AliMUONDigit a(digit);
+ a.Copy(*this);
+ return *this;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDigit::PatchTracks(Int_t mask)
+{
+ //
+ // Add mask to each track number.
+ //
+ for ( Int_t i = 0; i < Ntracks(); ++i )
+ {
+ fTracks[i] += 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();
+ if ( IsSaturated() )
+ {
+ cout << "(S)";
+ }
+ else
+ {
+ cout << " ";
+ }
+ cout << " ADC=" << setw(4) << ADC();
+ cout << " Flags=0x" << setw(4) << hex << setfill('0') << fFlags << dec
+ << setfill(' ');
+ TString options(opt);
+ options.ToLower();
+ if ( options.Contains("tracks") )
+ {
+ cout << " Hit " << setw(3) << Hit();
+ Int_t ntracks = Ntracks();
+ if (ntracks)
+ {
+ cout << " Tracks : " << setw(2) << ntracks;
+ for ( Int_t i = 0; i < ntracks; ++i )
+ {
+ cout << " Track(" << i << ")=" << setw(3) << Track(i)
+ << " Charge(" << i << ")=" << setw(5) << TrackCharge(i);
+ }
+ }
+ else
+ {
+ cout << " no track info.";
+ }
+ }
+ cout << endl;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDigit::Saturated(Bool_t value)
+{
+ //
+ // Set the saturation status of this digit.
+ //
+ if ( value )
+ {
+ fFlags |= fgkSaturatedMask;
+ }
+ else
+ {
+ fFlags ^= fgkSaturatedMask;
+ }
+}
+
+//_____________________________________________________________________________
+void
+AliMUONDigit::SetElectronics(Int_t manuId, Int_t manuChannel)
+{
+ //
+ //FIXME: should we check that the values are ok here ??
+ //
+ fManuId=manuId;
+ fManuChannel=manuChannel;
+}
+
+//_____________________________________________________________________________
+Int_t
+AliMUONDigit::Track(Int_t i) const
+{
+ //
+ // Return the i-th track number (if i is >=0 and < Ntracks()) or -1.
+ //
+ if ( i >= 0 && i < fNtracks )
+ {
+ return fTracks[i];
+ }
+
+ return -1;
+}
+
+//_____________________________________________________________________________
+Int_t
+AliMUONDigit::TrackCharge(Int_t i) const
+{
+ //
+ // Return the i-th track charge (if i is >=0 and < Ntracjs()) or -1.
+ //
+ if ( i >= 0 && i < fNtracks )
+ {
+ return fTcharges[i];
+ }