ROOT logo
#ifndef ALIMUONREALDIGIT_H
#define ALIMUONREALDIGIT_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice                               */

// $Id$

/// \ingroup base
/// \class AliMUONRealDigit
/// \brief Implementation of AliMUONVDigit for real (i.e. not simulated) digits
/// 
// author Laurent Aphecetche

#ifndef ALIMUONVDIGIT_H
#  include "AliMUONVDigit.h"
#endif

class AliMUONRealDigit : public AliMUONVDigit
{
public:
  AliMUONRealDigit();
  AliMUONRealDigit(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t cathode);
  virtual ~AliMUONRealDigit();
  
  /// Return the detection element this digit belongs to
  virtual Int_t DetElemId() const { return AliMUONVDigit::DetElemId(GetUniqueID()); }
  virtual Int_t PadX() const;
  virtual Int_t PadY() const;
  /// Return the cathode this digit belongs to
  virtual Int_t Cathode() const { return AliMUONVDigit::Cathode(GetUniqueID()); }
  
  /// Charge (should be non zero if calibrated)
  virtual Float_t Charge() const { return fCharge; }
  
  /// ADC value (it is the real raw adc value, not pedestal subtracted)
  virtual Int_t ADC() const { return fADC; }
  
  /// Return the manu chip this digit belongs to
  virtual Int_t ManuId() const  { return AliMUONVDigit::ManuId(GetUniqueID()); }
  /// Return the manu channel this digits is connected to
  virtual Int_t ManuChannel() const  { return AliMUONVDigit::ManuChannel(GetUniqueID()); }
  
  /// Whether this digit's charge has saturated the electronics
  virtual Bool_t IsSaturated() const { return TestBit(kSaturated); }
  /// Set the saturation status
  virtual void Saturated(Bool_t saturated=kTRUE) { SetBit(kSaturated,saturated); }
  
  /// We have no idea whether a real digit is noise only or not ;-)
  virtual Bool_t IsNoiseOnly() const { return kFALSE; }
  
  /// Again, this is for simulation only
  virtual Bool_t IsEfficiencyApplied() const { return kFALSE; }
  
  /// Whether this digit is calibrated or not
  virtual Bool_t IsCalibrated() const { return TestBit(kCalibrated); }
  /// Set the calibration status
  virtual void Calibrated(Bool_t value) { SetBit(kCalibrated,value); }
  
  /// Whether this digit has its charge already in fC
  virtual Bool_t IsChargeInFC() const { return TestBit(kChargeInFC); }
  /// Set the charge unit value
  virtual void ChargeInFC(Bool_t value=kTRUE) { SetBit(kChargeInFC,value); }

  /// Whether this digit is part of a cluster or something else
  virtual Bool_t IsUsed() const { return TestBit(kUsed); }
  /// Set the used status
  virtual void Used(Bool_t value) { SetBit(kUsed,value); }
  
  /// The status map (i.e. the status of the neighbours) of this digit
  virtual UInt_t StatusMap() const { return fStatusMap; }
  /// Set the status map value
  virtual void SetStatusMap(UInt_t statusMap) { fStatusMap = statusMap; }
  
  /// Set the ADC value (should be between 0 and 4095)
  virtual void SetADC(Int_t adc) { fADC = adc; }
  virtual void SetPadXY(Int_t padx, Int_t pady);
  /// Set the charge
  virtual void SetCharge(Float_t q) { fCharge=q; }
  
  virtual Bool_t MergeWith(const AliMUONVDigit& other);
  
  /// No, this digit is not a Monte-Carlo one, sorry.
  virtual Bool_t HasMCInformation() const { return kFALSE; }
  
private:
  Float_t fCharge; ///< Charge on pad  
  UInt_t fPadXY; ///< Pad number along x and Y (packed)
  Int_t fADC; ///< Raw ADC value
  UInt_t fStatusMap; ///< Neighbouring pad status (whether ped, gains, hv were ok or not)
  
  /// Various statuses of the digit
  enum EStatusBit 
  {
    kSaturated = BIT(20),  ///< to indicate that manas amplifier has saturated 
    kUsed = BIT(21),       ///< whether the digit is used (e.g. in a cluster)
    kCalibrated = BIT(22),  ///< whether the digit has been calibrated or not 
    kChargeInFC = BIT(23)   ///< whether the digit has a charge in fC or not
  };
  
  ClassDef(AliMUONRealDigit,2) // Implementation of AliMUONVDigit
};

#endif
 AliMUONRealDigit.h:1
 AliMUONRealDigit.h:2
 AliMUONRealDigit.h:3
 AliMUONRealDigit.h:4
 AliMUONRealDigit.h:5
 AliMUONRealDigit.h:6
 AliMUONRealDigit.h:7
 AliMUONRealDigit.h:8
 AliMUONRealDigit.h:9
 AliMUONRealDigit.h:10
 AliMUONRealDigit.h:11
 AliMUONRealDigit.h:12
 AliMUONRealDigit.h:13
 AliMUONRealDigit.h:14
 AliMUONRealDigit.h:15
 AliMUONRealDigit.h:16
 AliMUONRealDigit.h:17
 AliMUONRealDigit.h:18
 AliMUONRealDigit.h:19
 AliMUONRealDigit.h:20
 AliMUONRealDigit.h:21
 AliMUONRealDigit.h:22
 AliMUONRealDigit.h:23
 AliMUONRealDigit.h:24
 AliMUONRealDigit.h:25
 AliMUONRealDigit.h:26
 AliMUONRealDigit.h:27
 AliMUONRealDigit.h:28
 AliMUONRealDigit.h:29
 AliMUONRealDigit.h:30
 AliMUONRealDigit.h:31
 AliMUONRealDigit.h:32
 AliMUONRealDigit.h:33
 AliMUONRealDigit.h:34
 AliMUONRealDigit.h:35
 AliMUONRealDigit.h:36
 AliMUONRealDigit.h:37
 AliMUONRealDigit.h:38
 AliMUONRealDigit.h:39
 AliMUONRealDigit.h:40
 AliMUONRealDigit.h:41
 AliMUONRealDigit.h:42
 AliMUONRealDigit.h:43
 AliMUONRealDigit.h:44
 AliMUONRealDigit.h:45
 AliMUONRealDigit.h:46
 AliMUONRealDigit.h:47
 AliMUONRealDigit.h:48
 AliMUONRealDigit.h:49
 AliMUONRealDigit.h:50
 AliMUONRealDigit.h:51
 AliMUONRealDigit.h:52
 AliMUONRealDigit.h:53
 AliMUONRealDigit.h:54
 AliMUONRealDigit.h:55
 AliMUONRealDigit.h:56
 AliMUONRealDigit.h:57
 AliMUONRealDigit.h:58
 AliMUONRealDigit.h:59
 AliMUONRealDigit.h:60
 AliMUONRealDigit.h:61
 AliMUONRealDigit.h:62
 AliMUONRealDigit.h:63
 AliMUONRealDigit.h:64
 AliMUONRealDigit.h:65
 AliMUONRealDigit.h:66
 AliMUONRealDigit.h:67
 AliMUONRealDigit.h:68
 AliMUONRealDigit.h:69
 AliMUONRealDigit.h:70
 AliMUONRealDigit.h:71
 AliMUONRealDigit.h:72
 AliMUONRealDigit.h:73
 AliMUONRealDigit.h:74
 AliMUONRealDigit.h:75
 AliMUONRealDigit.h:76
 AliMUONRealDigit.h:77
 AliMUONRealDigit.h:78
 AliMUONRealDigit.h:79
 AliMUONRealDigit.h:80
 AliMUONRealDigit.h:81
 AliMUONRealDigit.h:82
 AliMUONRealDigit.h:83
 AliMUONRealDigit.h:84
 AliMUONRealDigit.h:85
 AliMUONRealDigit.h:86
 AliMUONRealDigit.h:87
 AliMUONRealDigit.h:88
 AliMUONRealDigit.h:89
 AliMUONRealDigit.h:90
 AliMUONRealDigit.h:91
 AliMUONRealDigit.h:92
 AliMUONRealDigit.h:93
 AliMUONRealDigit.h:94
 AliMUONRealDigit.h:95
 AliMUONRealDigit.h:96
 AliMUONRealDigit.h:97
 AliMUONRealDigit.h:98
 AliMUONRealDigit.h:99
 AliMUONRealDigit.h:100
 AliMUONRealDigit.h:101
 AliMUONRealDigit.h:102
 AliMUONRealDigit.h:103
 AliMUONRealDigit.h:104