]>
Commit | Line | Data |
---|---|---|
bf000c32 | 1 | #ifndef AliFMDDISPLAY_H |
2 | #define AliFMDDISPLAY_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * See cxx source for full Copyright notice | |
7 | */ | |
c2fc1258 | 8 | /** @file AliFMDDisplay.h |
9 | @author Christian Holm Christensen <cholm@nbi.dk> | |
10 | @date Mon Mar 27 12:39:09 2006 | |
11 | @brief FMD Event display | |
12 | */ | |
bf000c32 | 13 | //___________________________________________________________________ |
14 | // | |
15 | // The classes defined here, are utility classes for reading in data | |
16 | // for the FMD. They are put in a seperate library to not polute the | |
17 | // normal libraries. The classes are intended to be used as base | |
18 | // classes for customized class that do some sort of analysis on the | |
19 | // various types of data produced by the FMD. | |
20 | // | |
21 | #include "AliFMDInput.h" | |
a9579262 | 22 | #include <TObjArray.h> |
2eddac03 | 23 | #include <TTimer.h> |
bf000c32 | 24 | class TCanvas; |
25 | class TPad; | |
26 | class TButton; | |
a9579262 | 27 | class TSlider; |
28 | class TH1; | |
bf000c32 | 29 | |
30 | //___________________________________________________________________ | |
9f662337 | 31 | /** @class AliFMDDisplay |
32 | @brief Utility class to visualize FMD data in geometry. | |
33 | @ingroup FMD_util | |
34 | */ | |
bf000c32 | 35 | class AliFMDDisplay : public AliFMDInput |
36 | { | |
37 | public: | |
9f662337 | 38 | /** Constructor |
a9579262 | 39 | @param onlyFMD Only show the FMD |
9f662337 | 40 | @param gAliceFile galice file*/ |
a9579262 | 41 | AliFMDDisplay(Bool_t onlyFMD=kTRUE, const char* gAliceFile="galice.root"); |
9f662337 | 42 | /** DTOR */ |
a9579262 | 43 | virtual ~AliFMDDisplay(); |
9f662337 | 44 | /** Singleton access function |
45 | @return Singleton object. */ | |
bf000c32 | 46 | static AliFMDDisplay* Instance(); |
47 | ||
9f662337 | 48 | /** Continue to next event */ |
bf000c32 | 49 | void Continue() { fWait = kFALSE; } |
2eddac03 | 50 | /** Run throug events as fast as possible */ |
51 | void Start() { fContinous = kTRUE; fWait = kFALSE; } | |
52 | /** Pause the processing */ | |
53 | void Pause() { fContinous = kFALSE; fWait = kTRUE; } | |
9f662337 | 54 | /** Zoom mode */ |
bf000c32 | 55 | void Zoom() { fZoomMode = kTRUE; } |
9f662337 | 56 | /** Pick mode */ |
bf000c32 | 57 | void Pick() { fZoomMode = kFALSE; } |
a9579262 | 58 | /** Redisplay the event */ |
59 | virtual void Redisplay(); // *MENU* | |
d98fbfa5 | 60 | /** Break */ |
61 | virtual void Break(); | |
62 | /** Render in 3D */ | |
63 | virtual void Render(); | |
64 | ||
a9579262 | 65 | /** Change cut */ |
66 | virtual void ChangeCut(); | |
d98fbfa5 | 67 | /** Change cut */ |
68 | virtual void ChangeFactor(); | |
9f662337 | 69 | /** Called when a mouse or similar event happens in the display. |
70 | @param event Event type | |
71 | @param px where the event happened in pixels along X | |
72 | @param py where the event happened in pixels along Y */ | |
a9579262 | 73 | virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); |
9f662337 | 74 | /** Paint into canvas |
75 | @param option Not used */ | |
a9579262 | 76 | virtual void Paint(Option_t* option="") { (void)option; } |
bf000c32 | 77 | |
9f662337 | 78 | /** Initialize |
79 | @return @c false on error */ | |
bf000c32 | 80 | virtual Bool_t Init(); |
9f662337 | 81 | /** Called at beginning of an event |
82 | @param event Event number | |
83 | @return @c false on error */ | |
bf000c32 | 84 | virtual Bool_t Begin(Int_t event); |
9f662337 | 85 | /** Called at end of an event |
86 | @return @c false on error */ | |
bf000c32 | 87 | virtual Bool_t End(); |
9f662337 | 88 | /** Visualize a hit |
89 | @param hit Hit | |
90 | @param p Track | |
91 | @return @c false on error */ | |
bf000c32 | 92 | virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle* p); |
9f662337 | 93 | /** Visualize a digit |
94 | @param digit Digit to draw | |
95 | @return @c false on error */ | |
bf000c32 | 96 | virtual Bool_t ProcessDigit(AliFMDDigit* digit); |
42f1b2f5 | 97 | /** Visualize a summable digit |
98 | @param sdigit Summable digit to draw | |
99 | @return @c false on error */ | |
100 | virtual Bool_t ProcessSDigit(AliFMDSDigit* sdigit); | |
9f662337 | 101 | /** Visualize a raw digit |
102 | @param digit Raw digit. | |
103 | @return @c false on error */ | |
59194467 | 104 | virtual Bool_t ProcessRawDigit(AliFMDDigit* digit); |
e064ab4a | 105 | /** Visualize a raw digit |
106 | @param digit Raw digit. | |
107 | @return @c false on error */ | |
108 | virtual Bool_t ProcessRawCalibDigit(AliFMDDigit* digit); | |
9f662337 | 109 | /** Visualize a reconstructed point. |
110 | @param recpoint Reconstructed point | |
111 | @return @c false on error */ | |
bf000c32 | 112 | virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint); |
a9579262 | 113 | /** Process ESD data for the FMD. Users should overload this to |
114 | deal with ESD data. | |
115 | @param d Detector number (1-3) | |
116 | @param r Ring identifier ('I' or 'O') | |
117 | @param s Sector number (0-19, or 0-39) | |
118 | @param t Strip number (0-511, or 0-255) | |
119 | @param eta Psuedo-rapidity | |
120 | @param mult Psuedo-multiplicity | |
121 | @return @c false on error */ | |
122 | virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t, | |
123 | Float_t eta, Float_t mult); | |
9f662337 | 124 | /** Look up a color index, based on the value @a x and the maximum |
125 | value of @a x | |
126 | @param x Value | |
127 | @param max Maximum (for example 1023 for digits) | |
128 | @return @c false on error */ | |
d98fbfa5 | 129 | virtual Int_t LookupColor(Float_t x, Float_t min, Float_t max) const; |
ef8e8623 | 130 | |
131 | /** Set range of displayed values */ | |
132 | virtual void SetCut(Float_t l=0., Float_t h=1.); //*MENU* | |
e1a9aea4 | 133 | virtual void SetFactor(Float_t f=1); |
bf000c32 | 134 | protected: |
15b17c89 | 135 | /** Copy constructor |
136 | @param o Object to copy from */ | |
b5ee4425 | 137 | AliFMDDisplay(const AliFMDDisplay& o) |
138 | : AliFMDInput(o), | |
139 | fWait(kFALSE), | |
140 | fMarkers(0), | |
141 | fHits(0), | |
142 | fCanvas(0), | |
143 | fPad(0), | |
2b893216 | 144 | fButtons(0), |
a9579262 | 145 | fSlider(0), |
d98fbfa5 | 146 | fFactor(0), |
b5ee4425 | 147 | fZoomMode(0), |
148 | fX0(0), | |
149 | fY0(0), | |
150 | fX1(0), | |
151 | fY1(0), | |
b5ee4425 | 152 | fXPixel(0), |
153 | fYPixel(0), | |
154 | fOldXPixel(0), | |
155 | fOldYPixel(0), | |
2b893216 | 156 | fLineDrawn(0), |
157 | fOnlyFMD(kTRUE), | |
158 | fSpec(0), | |
159 | fSpecCut(0), | |
d98fbfa5 | 160 | fAux(0), |
2eddac03 | 161 | fReturn(kFALSE), |
162 | fContinous(kFALSE), | |
e1a9aea4 | 163 | fTimeout(), |
164 | fInitialMin(0), | |
165 | fInitialMax(1), | |
166 | fInitialFactor(3./10) | |
b5ee4425 | 167 | { } |
15b17c89 | 168 | /** Assignment operator |
169 | @return Reference to this object */ | |
02a27b50 | 170 | AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; } |
d98fbfa5 | 171 | /** Add a marker to the display |
172 | @param x X position | |
173 | @param y Y position | |
174 | @param z Z position | |
175 | @param o Object to refer to | |
176 | @param s Signal | |
177 | @param max Maximum of signal */ | |
178 | virtual void AddMarker(Float_t x, Float_t y, Float_t z, | |
179 | TObject* o, Float_t s, Float_t min, Float_t max); | |
15b17c89 | 180 | /** Add a marker to the display |
181 | @param det Detector | |
182 | @param rng Ring | |
183 | @param sec Sector | |
184 | @param str Strip | |
185 | @param o Object to refer to | |
186 | @param s Signal | |
187 | @param max Maximum of signal */ | |
a9579262 | 188 | virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str, |
d98fbfa5 | 189 | TObject* o, Float_t s, Float_t min, Float_t max); |
a9579262 | 190 | |
191 | /** Show only the FMD detectors. */ | |
192 | void ShowOnlyFMD(); | |
193 | /** Make base canvas */ | |
194 | virtual void MakeCanvas(const char** which); | |
195 | virtual void MakeAux(); | |
196 | virtual void DrawAux(); | |
197 | virtual void Idle(); | |
198 | virtual void AtEnd(); | |
d98fbfa5 | 199 | virtual Bool_t InsideCut(Float_t v, const Float_t& min, |
200 | const Float_t& max) const; | |
e064ab4a | 201 | virtual Double_t GetADCThreshold(UShort_t d, Char_t r, |
202 | UShort_t s, UShort_t t) const; | |
02a27b50 | 203 | |
bf000c32 | 204 | static AliFMDDisplay* fgInstance; // Static instance |
205 | Bool_t fWait; // Wait until user presses `Continue' | |
206 | TObjArray* fMarkers; // Cache of markers | |
207 | TObjArray* fHits; // Cache of `hits' | |
208 | TCanvas* fCanvas; // Canvas to draw in | |
209 | TPad* fPad; // View pad. | |
a9579262 | 210 | TObjArray fButtons; // Continue button |
211 | TSlider* fSlider; // Cut slider | |
d98fbfa5 | 212 | TSlider* fFactor; // Factor slider |
bf000c32 | 213 | Bool_t fZoomMode; // Whether we're in Zoom mode |
214 | Float_t fX0; // X at lower left corner or range | |
215 | Float_t fY0; // Y at lower left corner or range | |
216 | Float_t fX1; // X at upper right corner or range | |
217 | Float_t fY1; // Y at upper right corner or range | |
218 | Int_t fXPixel; // X pixel of mark | |
219 | Int_t fYPixel; // Y pixel of mark | |
220 | Int_t fOldXPixel; // Old x pixel of mark | |
221 | Int_t fOldYPixel; // Old y pixel of mark | |
222 | Bool_t fLineDrawn; // Whether we're drawing a box | |
5c96b03f | 223 | Bool_t fOnlyFMD; // Whether to only do FMD |
224 | TH1* fSpec; // Spectra | |
225 | TH1* fSpecCut; // Cut spectra | |
226 | TCanvas* fAux; // Aux canvas. | |
d98fbfa5 | 227 | Bool_t fReturn; // Stop |
2eddac03 | 228 | Bool_t fContinous; |
229 | TTimer fTimeout; | |
e1a9aea4 | 230 | Float_t fInitialMin; |
231 | Float_t fInitialMax; | |
232 | Float_t fInitialFactor; | |
ef8e8623 | 233 | |
234 | struct Range_t { | |
235 | UInt_t fNbins; | |
236 | Float_t fLow; | |
237 | Float_t fHigh; | |
238 | }; | |
239 | static const Range_t fgkEdepRange; | |
240 | static const Range_t fgkAdcRange; | |
241 | static const Range_t fgkMultRange; | |
242 | ||
bf000c32 | 243 | ClassDef(AliFMDDisplay,0) // FMD specialised event display |
244 | }; | |
245 | ||
246 | #endif | |
247 | //____________________________________________________________________ | |
248 | // | |
249 | // Local Variables: | |
250 | // mode: C++ | |
251 | // End: | |
252 | // | |
253 | // EOF | |
254 | // |