]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRealDigit.cxx
Remove lgamma and replace by TMath::LnGamma which should work across platforms.
[u/mrichter/AliRoot.git] / MUON / AliMUONRealDigit.cxx
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
7 * Permission to use, copy, modify and distribute this software and its   *
8 * documentation strictly for non-commercial purposes is hereby granted   *
9 * without fee, provided that the above copyright notice appears in all   *
10 * copies and that both the copyright notice and this permission notice   *
11 * appear in the supporting documentation. The authors make no claims     *
12 * about the suitability of this software for any purpose. It is          *
13 * provided "as is" without express or implied warranty.                  *
14 **************************************************************************/
15
16 // $Id$
17
18 #include "AliMUONRealDigit.h"
19
20 //-----------------------------------------------------------------------------
21 /// \class AliMUONRealDigit
22 ///
23 /// Implementation of AliMUONVDigit for real digit.
24 /// 
25 /// This class should store the bare minimum in order to save disk space
26 ///
27 /// \author Laurent Aphecetche
28 //-----------------------------------------------------------------------------
29
30 /// \cond CLASSIMP
31 ClassImp(AliMUONRealDigit)
32 /// \endcond
33
34 //_____________________________________________________________________________
35 AliMUONRealDigit::AliMUONRealDigit() 
36   : AliMUONVDigit(),
37   fCharge(0),
38   fPadXY(0),
39   fADC(0),
40   fStatusMap(0)
41 {
42       /// default ctor
43 }
44
45 //_____________________________________________________________________________
46 AliMUONRealDigit::AliMUONRealDigit(Int_t detElemId, Int_t manuId, 
47                                    Int_t manuChannel, Int_t cathode)
48 : AliMUONVDigit(detElemId,manuId,manuChannel,cathode),
49 fCharge(0),
50 fPadXY(0),
51 fADC(0),
52 fStatusMap(0)
53 {
54   /// normal ctor
55 }
56
57 //_____________________________________________________________________________
58 AliMUONRealDigit::~AliMUONRealDigit()
59 {
60   /// empty ctor
61 }
62
63 //_____________________________________________________________________________
64 Bool_t
65 AliMUONRealDigit::MergeWith(const AliMUONVDigit& src)
66 {
67   /// Merge with src.
68   
69   Bool_t check = ( src.DetElemId() == DetElemId() &&
70                    src.PadX() == PadX() &&
71                    src.PadY() == PadY() &&
72                    src.Cathode() == Cathode() );
73   if (!check)
74   {
75     return kFALSE;
76   }
77   
78   AddCharge(src.Charge());
79   return kTRUE;
80 }
81
82 //_____________________________________________________________________________
83 Int_t
84 AliMUONRealDigit::PadX() const
85 {
86   /// Return (integer) position in x (within the detection element)
87   return fPadXY & 0xFFFF;
88 }
89
90 //_____________________________________________________________________________
91 Int_t
92 AliMUONRealDigit::PadY() const
93 {
94   /// Return (integer) position in y (within the detection element)
95   return ( fPadXY & 0xFFFF0000 ) >> 16;
96 }
97
98 //_____________________________________________________________________________
99 void
100 AliMUONRealDigit::SetPadXY(Int_t padx, Int_t pady)
101 {
102   /// Set the pad (integer) positions
103   fPadXY = ( padx | (pady << 16) );
104 }
105