]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Change charges from Int_t to Float_t as they should be (Laurent)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Oct 2006 15:59:43 +0000 (15:59 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Oct 2006 15:59:43 +0000 (15:59 +0000)
MUON/AliMUONDigit.cxx
MUON/AliMUONDigit.h

index 5bb8f12d8b113ba672556c118876912391596314..9ea8372d573c94720974f4b0fe4ef49f5f5897cc 100644 (file)
@@ -43,7 +43,7 @@ TObject(),
 fDetElemId(-1),
 fManuId(-1),
 fManuChannel(-1),
-fSignal(0),
+fSignal(0.0),
 fPadX(-1),
 fPadY(-1),
 fCathode(-1),
@@ -52,7 +52,7 @@ fFlags(0),
 fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
-fPhysics(0),
+fPhysics(0.0),
 fHit(0)
 {
   /// Default constructor
@@ -64,7 +64,7 @@ AliMUONDigit::AliMUONDigit(const AliMUONDigit& digit)
 fDetElemId(-1),
 fManuId(-1),
 fManuChannel(-1),
-fSignal(0),
+fSignal(0.0),
 fPadX(-1),
 fPadY(-1),
 fCathode(-1),
@@ -73,7 +73,7 @@ fFlags(0),
 fNtracks(0),
 fTcharges(0x0),
 fTracks(0x0),
-fPhysics(0),
+fPhysics(0.0),
 fHit(0)
 {
   /// Copy constructor
@@ -81,87 +81,6 @@ fHit(0)
    (static_cast<const AliMUONDigit&>(digit)).Copy(*this);
 }
 
-
-//_____________________________________________________________________________
-AliMUONDigit::AliMUONDigit(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 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;
-}
-
-//_____________________________________________________________________________
-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;
-}
-
 //_____________________________________________________________________________
 AliMUONDigit::~AliMUONDigit()
 {
@@ -173,7 +92,7 @@ AliMUONDigit::~AliMUONDigit()
 
 //_____________________________________________________________________________
 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 !
@@ -192,7 +111,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 )
   {
@@ -296,7 +215,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];
   }
   
@@ -374,14 +293,11 @@ AliMUONDigit::Print(Option_t* opt) const
   /// Dump to screen.
   /// If opt=="tracks", info on tracks are printed too.
 
-  cout << "<AliMUONDigit>: 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();
+  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)";
@@ -458,7 +374,7 @@ 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.
index 685abe2d6be7548d415eaddbd8e5c3585ec53f99..a3ba843e6b6d97ff6c5e4f4b9a1fd534a75373f3 100644 (file)
@@ -17,32 +17,28 @@ class AliMUONDigit : public TObject
  public:
     AliMUONDigit();
     AliMUONDigit(const AliMUONDigit& rhs);
-    // deprecated
-    AliMUONDigit(Int_t *digits);
-    // deprecated
-    AliMUONDigit(Int_t *tracks, Int_t *charges, Int_t *digits);
     virtual ~AliMUONDigit();
 
     AliMUONDigit& operator=(const AliMUONDigit& rhs);
     
     virtual Bool_t IsSortable() const {return kTRUE;}        ///< Return true if sortable
-    virtual int Compare(const TObject *obj) const;
+    virtual Int_t Compare(const TObject *obj) const;
 
     virtual Int_t DetElemId()const     {return fDetElemId;}  ///< Return detection element ID  
     virtual Int_t PadX() const         {return fPadX;}       ///< Return pad number along x
     virtual Int_t PadY() const         {return fPadY;}       ///< Return pad number along y
     virtual Int_t Cathode() const      {return fCathode;}    ///< Return cathode number
     
-    virtual Int_t Signal() const       {return fSignal;}     ///< Return signal amplitude
+    virtual Float_t Signal() const       {return fSignal;}     ///< Return signal amplitude
     
-    virtual Int_t Physics() const      {return fPhysics;}    ///< Return MC physics contribution to signal
+    virtual Float_t Physics() const      {return fPhysics;}    ///< Return MC physics contribution to signal
     
     virtual Int_t Hit() const          {return fHit;}        ///< Return MC hit number
     
     virtual Int_t Ntracks() const { return fNtracks; }       ///< Return MC tracks making to this digit
-    virtual void AddTrack(Int_t trackNumber, Int_t trackCharge);
+    virtual void AddTrack(Int_t trackNumber, Float_t trackCharge);
     virtual Int_t Track(Int_t i) const;
-    virtual Int_t TrackCharge(Int_t i) const;
+    virtual Float_t TrackCharge(Int_t i) const;
     
     virtual Int_t ADC() const { return fADC; }                 ///< Return ADC value
     virtual Int_t ManuId() const { return fManuId; }           ///< Return Id of the MANU chip
@@ -57,12 +53,12 @@ class AliMUONDigit : public TObject
     virtual void SetDetElemId(Int_t id)    {fDetElemId = id;}  ///< Set detection element ID
     virtual void SetPadX(Int_t pad)        {fPadX = pad;}      ///< Set pad number along x
     virtual void SetPadY(Int_t pad)        {fPadY = pad;}      ///< Set pad number along y
-    virtual void SetSignal(Int_t q)        {fSignal = q;}      ///< Set signal amplitude
-    virtual void AddSignal(Int_t q)        {fSignal += q;}     ///< Add signal amplitude
-    virtual void AddPhysicsSignal(Int_t q) {fPhysics += q;}    ///< Add MC physics contribution to signal
+    virtual void SetSignal(Float_t q)        {fSignal = q;}      ///< Set signal amplitude
+    virtual void AddSignal(Float_t q)        {fSignal += q;}     ///< Add signal amplitude
+    virtual void AddPhysicsSignal(Float_t q) {fPhysics += q;}    ///< Add MC physics contribution to signal
     virtual void SetHit(Int_t n)           {fHit = n;}         ///< Set MC hit number
     virtual void SetCathode(Int_t c)       {fCathode = c;}     ///< Set cathode number
-    virtual void SetPhysicsSignal(Int_t q) {fPhysics = q; }    ///< Set MC physics contribution to signal
+    virtual void SetPhysicsSignal(Float_t q) {fPhysics = q; }    ///< Set MC physics contribution to signal
     
     virtual void Print(Option_t* opt="") const;
     
@@ -81,7 +77,7 @@ private:
     Int_t fDetElemId;     ///< Detection element ID
     Int_t fManuId;        ///< Id of the MANU chip.
     Int_t fManuChannel;   ///< Channel within the MANU chip.
-    Int_t fSignal;        ///< Signal amplitude    
+    Float_t fSignal;        ///< Signal amplitude    
       
     Int_t fPadX;          ///< Pad number along x
     Int_t fPadY;          ///< Pad number along y
@@ -92,17 +88,17 @@ private:
     Int_t fNtracks;       ///< MC tracks making to this digit.
     
     /// charges of MC track making this digit
-    Int_t* fTcharges;     //[fNtracks]  charges of MC track making this digit
+    Float_t* fTcharges;     //[fNtracks]  charges of MC track making this digit
 
     /// primary MC tracks making this digit
     Int_t* fTracks;       //[fNtracks]  primary MC tracks making this digit
 
-    Int_t fPhysics;       ///< MC physics contribution to signal 
+    Float_t fPhysics;       ///< MC physics contribution to signal 
     Int_t fHit;           ///< MC hit number - temporary solution
   
     static const UInt_t fgkSaturatedMask = 0x1; ///< the mask (part of fFlags) to indicate this digit is saturated
     static const UInt_t fgkNoiseOnlyMask = 0x1000; ///< indicate a simulated digit due to noise only
     
-    ClassDef(AliMUONDigit,4)  //Digits for MUON
+    ClassDef(AliMUONDigit,5)  //Digits for MUON
 };
 #endif