]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONDigit.h
hardcoded detector position; bug in alignment pth fixed
[u/mrichter/AliRoot.git] / MUON / AliMUONDigit.h
1 #ifndef ALIMUONDIGIT_H
2 #define ALIMUONDIGIT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 // Revision of includes 07/05/2004
8
9 /// \ingroup base
10 /// \class AliMUONDigit
11 /// \brief MUON digit
12
13 #include <TObject.h>
14
15 class AliMUONDigit : public TObject 
16 {
17  public:
18     AliMUONDigit();
19     AliMUONDigit(const AliMUONDigit& rhs);
20     // deprecated
21     AliMUONDigit(Int_t *digits);
22     // deprecated
23     AliMUONDigit(Int_t *tracks, Int_t *charges, Int_t *digits);
24     virtual ~AliMUONDigit();
25
26     AliMUONDigit& operator=(const AliMUONDigit& rhs);
27     
28     virtual Bool_t IsSortable() const {return kTRUE;}        ///< Return true if sortable
29     virtual int Compare(const TObject *obj) const;
30
31     virtual Int_t DetElemId()const     {return fDetElemId;}  ///< Return detection element ID  
32     virtual Int_t PadX() const         {return fPadX;}       ///< Return pad number along x
33     virtual Int_t PadY() const         {return fPadY;}       ///< Return pad number along y
34     virtual Int_t Cathode() const      {return fCathode;}    ///< Return cathode number
35     
36     virtual Int_t Signal() const       {return fSignal;}     ///< Return signal amplitude
37     
38     virtual Int_t Physics() const      {return fPhysics;}    ///< Return MC physics contribution to signal
39     
40     virtual Int_t Hit() const          {return fHit;}        ///< Return MC hit number
41     
42     virtual Int_t Ntracks() const { return fNtracks; }       ///< Return MC tracks making to this digit
43     virtual void AddTrack(Int_t trackNumber, Int_t trackCharge);
44     virtual Int_t Track(Int_t i) const;
45     virtual Int_t TrackCharge(Int_t i) const;
46     
47     virtual Int_t ADC() const { return fADC; }                 ///< Return ADC value
48     virtual Int_t ManuId() const { return fManuId; }           ///< Return Id of the MANU chip
49     virtual Int_t ManuChannel() const { return fManuChannel; } ///< Return Channel within the MANU chip
50     virtual Bool_t IsSaturated() const;
51     virtual Bool_t IsNoiseOnly() const;
52     
53     virtual void NoiseOnly(Bool_t value=kTRUE);
54     virtual void Saturated(Bool_t saturated=kTRUE);
55     virtual void SetElectronics(Int_t manuId, Int_t manuChannel);
56     virtual void SetADC(Int_t adc) { fADC=adc; }
57     virtual void SetDetElemId(Int_t id)    {fDetElemId = id;}  ///< Set detection element ID
58     virtual void SetPadX(Int_t pad)        {fPadX = pad;}      ///< Set pad number along x
59     virtual void SetPadY(Int_t pad)        {fPadY = pad;}      ///< Set pad number along y
60     virtual void SetSignal(Int_t q)        {fSignal = q;}      ///< Set signal amplitude
61     virtual void AddSignal(Int_t q)        {fSignal += q;}     ///< Add signal amplitude
62     virtual void AddPhysicsSignal(Int_t q) {fPhysics += q;}    ///< Add MC physics contribution to signal
63     virtual void SetHit(Int_t n)           {fHit = n;}         ///< Set MC hit number
64     virtual void SetCathode(Int_t c)       {fCathode = c;}     ///< Set cathode number
65     virtual void SetPhysicsSignal(Int_t q) {fPhysics = q; }    ///< Set MC physics contribution to signal
66     
67     virtual void Print(Option_t* opt="") const;
68     
69     virtual void Copy(TObject& digit) const;
70     
71     /** Delete the internal track arrays (which are dynamically allocated).
72       * This is to insure we can put those digits in e.g. TClonesArray
73       * w/o leaking memory.
74       */
75     virtual void Clear(Option_t*);
76     
77     // Add mask to the track numbers.
78     virtual void PatchTracks(Int_t mask);
79     
80 private:
81     Int_t fDetElemId;     ///< Detection element ID
82     Int_t fManuId;        ///< Id of the MANU chip.
83     Int_t fManuChannel;   ///< Channel within the MANU chip.
84     Int_t fSignal;        ///< Signal amplitude    
85       
86     Int_t fPadX;          ///< Pad number along x
87     Int_t fPadY;          ///< Pad number along y
88     Int_t fCathode;       ///< Cathode number
89     Int_t fADC;           ///< ADC value
90     UInt_t fFlags;        ///< Special flags (e.g. is the signal an overflow ?)
91     
92     Int_t fNtracks;       ///< MC tracks making to this digit.
93     
94     /// charges of MC track making this digit
95     Int_t* fTcharges;     //[fNtracks]  charges of MC track making this digit
96
97     /// primary MC tracks making this digit
98     Int_t* fTracks;       //[fNtracks]  primary MC tracks making this digit
99
100     Int_t fPhysics;       ///< MC physics contribution to signal 
101     Int_t fHit;           ///< MC hit number - temporary solution
102   
103     static const UInt_t fgkSaturatedMask = 0x1; ///< the mask (part of fFlags) to indicate this digit is saturated
104     static const UInt_t fgkNoiseOnlyMask = 0x1000; ///< indicate a simulated digit due to noise only
105     
106     ClassDef(AliMUONDigit,4)  //Digits for MUON
107 };
108 #endif