]>
Commit | Line | Data |
---|---|---|
d6c3334d | 1 | #ifndef ALIMUONVDIGIT_H |
2 | #define ALIMUONVDIGIT_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | // $Id$ | |
8 | ||
9 | /// \ingroup base | |
10 | /// \class AliMUONVDigit | |
11 | /// \brief ABC of a MUON digit | |
12 | // Author Laurent Aphecetche, Subatech | |
13 | ||
14 | #ifndef ROOT_TObject | |
15 | # include "TObject.h" | |
16 | #endif | |
17 | ||
18 | class AliMUONVDigit : public TObject | |
19 | { | |
20 | public: | |
21 | AliMUONVDigit(); | |
22 | AliMUONVDigit(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t cathode); | |
23 | virtual ~AliMUONVDigit(); | |
24 | ||
36a01415 | 25 | virtual Bool_t IsEqual(const TObject* object) const; |
22dce0e3 | 26 | /// Advertise that we can be sorted in TCollections |
36a01415 | 27 | virtual Bool_t IsSortable() const { return kTRUE; } |
28 | virtual Int_t Compare(const TObject* object) const; | |
29 | ||
d6c3334d | 30 | virtual const char* GetName() const; |
31 | ||
32 | /// The detection element this digit belongs to | |
33 | virtual Int_t DetElemId() const=0; | |
34 | /// The x-index of this digit (>=0) | |
35 | virtual Int_t PadX() const=0; | |
36 | /// The y-index of this digit (>=0) | |
37 | virtual Int_t PadY() const=0; | |
38 | /// Cathode number this digit is on (0 or 1) | |
39 | virtual Int_t Cathode() const=0; | |
40 | ||
41 | /// The charge of this digit, calibrated or not depending on IsCalibrated() | |
42 | virtual Float_t Charge() const=0; | |
43 | ||
44 | /// Raw ADC value of this digit | |
45 | virtual Int_t ADC() const = 0; | |
46 | ||
47 | /// The electronic card id this digit belongs to (manuId for tracker, localboardId for trigger) | |
48 | virtual Int_t ManuId() const = 0; | |
49 | /// The channel within ManuId() this digit belongs to (manuChannel for tracker, localBoardChannel for trigger) | |
50 | virtual Int_t ManuChannel() const=0; | |
51 | ||
52 | /// Whether the ADC has saturated | |
53 | virtual Bool_t IsSaturated() const=0; | |
54 | /// Set the saturation status | |
55 | virtual void Saturated(Bool_t saturated=kTRUE)=0; | |
56 | ||
57 | /// Whether this (simulated) digit is purely noise | |
58 | virtual Bool_t IsNoiseOnly() const=0; | |
59 | /// Set the noiseOnly status | |
60 | virtual void NoiseOnly(Bool_t /*value*/=kTRUE) { } | |
61 | ||
62 | /// Whether this (simulated) digit got corrected by chamber efficiency | |
63 | virtual Bool_t IsEfficiencyApplied() const=0; | |
64 | /// Set the efficiencyApplied status | |
65 | virtual void EfficiencyApplied(Bool_t /*value*/=kTRUE) {} | |
66 | ||
67 | /// Whether this digit has been calibrated or not | |
68 | virtual Bool_t IsCalibrated() const=0; | |
69 | /// Set the calibrated status | |
70 | virtual void Calibrated(Bool_t value)=0; | |
71 | ||
ca8c8223 | 72 | /// Whether or not this digit was obtained from a conversion (e.g. real to simulated) |
73 | virtual Bool_t IsConverted() const { return kFALSE; } | |
74 | ||
d6c3334d | 75 | /// Whether this digit is used somewhere (typically in a cluster) |
76 | virtual Bool_t IsUsed() const = 0; | |
77 | /// Set the used status | |
78 | virtual void Used(Bool_t value) = 0; | |
79 | ||
80 | /// A word describing the status of the neighbours of this digit | |
81 | virtual UInt_t StatusMap() const=0; | |
82 | /// Set the statusMap | |
83 | virtual void SetStatusMap(UInt_t statusMap)=0; | |
84 | ||
85 | /// Set the ADC value | |
86 | virtual void SetADC(Int_t adc)=0; | |
87 | /// Set the ix and iy of this digit | |
88 | virtual void SetPadXY(Int_t padx, Int_t pady)=0; | |
89 | /// Set the charge of this digit | |
90 | virtual void SetCharge(Float_t q)=0; | |
91 | /// Add a charge | |
92 | virtual void AddCharge(Float_t q) { SetCharge(Charge()+q); } | |
93 | ||
94 | /// Merge this with other | |
95 | virtual Bool_t MergeWith(const AliMUONVDigit& other)=0; | |
96 | ||
97 | /// Whether this digit is a tracker digit (false if belongs to trigger) | |
98 | virtual Bool_t IsTracker() const { return !IsTrigger(); } | |
99 | /** FIXME: how to get this information w/o hard-coding, yet being efficient ? | |
100 | Use one fFlags that must be set when creating the digit for instance ? | |
101 | */ | |
102 | virtual Bool_t IsTrigger() const { return DetElemId()>=1100; } | |
103 | ||
104 | virtual void Print(Option_t* opt="") const; | |
105 | ||
106 | /// Below are methods only relevant for MC digigts. | |
107 | ||
108 | /// Whether we implement MC methods. | |
109 | virtual Bool_t HasMCInformation() const = 0; | |
110 | ||
111 | /// Hit number that contributed to this simulated digit | |
112 | virtual Int_t Hit() const { return 0; } | |
113 | /// Set the hit number | |
114 | virtual void SetHit(Int_t /*n*/) { } | |
ea232c10 | 115 | /// Hit age |
116 | virtual Float_t Time() const {return 0;} | |
117 | /// Set hit age | |
118 | virtual void SetTime(Float_t /*t*/) { } | |
d6c3334d | 119 | /// Number of tracks contributing to this digit |
120 | virtual Int_t Ntracks() const { return 0; } | |
121 | /// Add a track (and its charge) to the list of tracks we handle | |
122 | virtual void AddTrack(Int_t /*trackNumber*/, Float_t /*trackCharge*/) {} | |
123 | /// Return the i-th track number | |
124 | virtual Int_t Track(Int_t /*i*/) const { return 0; } | |
125 | /// Return the i-th track charge | |
126 | virtual Float_t TrackCharge(Int_t /*i*/) const { return 0; } | |
127 | /// Patch track with a mask | |
128 | virtual void PatchTracks(Int_t /*mask*/) {} | |
129 | ||
130 | static UInt_t BuildUniqueID(Int_t detElemId, Int_t manuId, | |
131 | Int_t manuChannel, Int_t cathode); | |
132 | ||
133 | static void DecodeUniqueID(UInt_t uniqueID, | |
134 | Int_t& detElemId, Int_t& manuId, | |
135 | Int_t& manuChannel, Int_t& cathode); | |
136 | ||
137 | static Int_t DetElemId(UInt_t uniqueID); | |
138 | static Int_t ManuId(UInt_t uniqueID); | |
139 | static Int_t ManuChannel(UInt_t uniqueID); | |
140 | static Int_t Cathode(UInt_t uniqueID); | |
141 | ||
142 | /// Return the localBoardNumber from the uniqueID | |
143 | static Int_t LocalBoardNumber(UInt_t uniqueID) { return ManuId(uniqueID); } | |
144 | /// Return the localBoardChannel from the uniqueID | |
145 | static Int_t LocalBoardChannel(UInt_t uniqueID) { return ManuChannel(uniqueID); } | |
146 | ||
147 | ||
148 | ClassDef(AliMUONVDigit,0) // ABC of a MUON Digit | |
149 | }; | |
150 | ||
151 | #endif |