1 #ifndef AliFMDDISPLAY_H
2 #define AliFMDDISPLAY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * See cxx source for full Copyright notice
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
13 //___________________________________________________________________
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.
21 #include "AliFMDInput.h"
22 #include <TObjArray.h>
30 //___________________________________________________________________
31 /** @class AliFMDDisplay
32 @brief Utility class to visualize FMD data in geometry.
35 class AliFMDDisplay : public AliFMDInput
41 * @param onlyFMD Only show the FMD
42 * @param gAliceFile galice file
44 AliFMDDisplay(Bool_t onlyFMD=kTRUE, const char* gAliceFile="galice.root");
48 virtual ~AliFMDDisplay();
50 * Singleton access function
52 * @return Singleton object.
54 static AliFMDDisplay* Instance();
57 * Continue to next event
59 void Continue() { fWait = kFALSE; }
61 * Run throug events as fast as possible
63 void Start() { fContinous = kTRUE; fWait = kFALSE; }
65 * Pause the processing
67 void Pause() { fContinous = kFALSE; fWait = kTRUE; }
71 void Zoom() { fZoomMode = kTRUE; }
75 void Pick() { fZoomMode = kFALSE; }
79 virtual void Redisplay(); // *MENU*
87 virtual void Render();
92 virtual void ChangeCut();
96 virtual void ChangeFactor();
98 * Called when a mouse or similar event happens in the display.
100 * @param event Event type
101 * @param px where the event happened in pixels along X
102 * @param py where the event happened in pixels along Y
104 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
108 * @param option Not used
110 virtual void Paint(Option_t* option="") { (void)option; }
115 * @return @c false on error
117 virtual Bool_t Init();
119 * Called at beginning of an event
121 * @param event Event number
122 * @return @c false on error
124 virtual Bool_t Begin(Int_t event);
126 * Called at end of an event
128 * @return @c false on error
130 virtual Bool_t End();
136 * @return @c false on error
138 virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle* p);
142 * @param digit Digit to draw
143 * @return @c false on error
145 virtual Bool_t ProcessDigit(AliFMDDigit* digit);
147 * Visualize a summable digit
149 * @param sdigit Summable digit to draw
150 * @return @c false on error
152 virtual Bool_t ProcessSDigit(AliFMDSDigit* sdigit);
154 * Visualize a raw digit
156 * @param digit Raw digit.
157 * @return @c false on error
159 virtual Bool_t ProcessRawDigit(AliFMDDigit* digit);
161 * Visualize a raw digit
163 * @param digit Raw digit.
164 * @return @c false on error
166 virtual Bool_t ProcessRawCalibDigit(AliFMDDigit* digit);
168 * Visualize a reconstructed point.
170 * @param recpoint Reconstructed point
171 * @return @c false on error
173 virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint);
175 * Process ESD data for the FMD. Users should overload this to
176 * deal with ESD data.
178 * @param d Detector number (1-3)
179 * @param r Ring identifier ('I' or 'O')
180 * @param s Sector number (0-19, or 0-39)
181 * @param t Strip number (0-511, or 0-255)
182 * @param eta Psuedo-rapidity
183 * @param mult Psuedo-multiplicity
185 * @return @c false on error
187 virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t,
188 Float_t eta, Float_t mult);
190 * Look up a color index, based on the value @a x and the maximum
194 * @param max Maximum (for example 1023 for digits)
195 * @return @c false on error
197 virtual Int_t LookupColor(Float_t x, Float_t min, Float_t max) const;
200 * Set range of displayed values
202 virtual void SetCut(Float_t l=0., Float_t h=1.); //*MENU*
204 * Set the noise factor
206 * @param f Noise factor
208 virtual void SetFactor(Float_t f=1);
213 * @param o Object to copy from
215 AliFMDDisplay(const AliFMDDisplay& o)
244 fInitialFactor(3./10)
247 * Assignment operator
249 * @return Reference to this object
251 AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; }
253 * Add a marker to the display
255 * @param x X position
256 * @param y Y position
257 * @param z Z position
258 * @param o Object to refer to
260 * @param max Maximum of signal
262 virtual void AddMarker(Float_t x, Float_t y, Float_t z,
263 TObject* o, Float_t s, Float_t min, Float_t max);
265 * Add a marker to the display
267 * @param det Detector
271 * @param o Object to refer to
273 * @param max Maximum of signal
275 virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
276 TObject* o, Float_t s, Float_t min, Float_t max);
279 * Show only the FMD detectors.
285 virtual void MakeCanvas(const char** which);
290 virtual void MakeAux();
295 virtual void DrawAux();
297 * Set the ROOT event loop to idle
302 * Called at end of event loop
305 virtual void AtEnd();
307 * Whether a point is inside
313 * @return true if @a v is inside cut
315 virtual Bool_t InsideCut(Float_t v, const Float_t& min,
316 const Float_t& max) const;
318 * Get the ADC threshold
325 * @return The threshold
327 virtual Double_t GetADCThreshold(UShort_t d, Char_t r,
328 UShort_t s, UShort_t t) const;
330 static AliFMDDisplay* fgInstance; // Static instance
331 Bool_t fWait; // Wait until user presses `Continue'
332 TObjArray* fMarkers; // Cache of markers
333 TObjArray* fHits; // Cache of `hits'
334 TCanvas* fCanvas; // Canvas to draw in
335 TPad* fPad; // View pad.
336 TObjArray fButtons; // Continue button
337 TSlider* fSlider; // Cut slider
338 TSlider* fFactor; // Factor slider
339 Bool_t fZoomMode; // Whether we're in Zoom mode
340 Float_t fX0; // X at lower left corner or range
341 Float_t fY0; // Y at lower left corner or range
342 Float_t fX1; // X at upper right corner or range
343 Float_t fY1; // Y at upper right corner or range
344 Int_t fXPixel; // X pixel of mark
345 Int_t fYPixel; // Y pixel of mark
346 Int_t fOldXPixel; // Old x pixel of mark
347 Int_t fOldYPixel; // Old y pixel of mark
348 Bool_t fLineDrawn; // Whether we're drawing a box
349 Bool_t fOnlyFMD; // Whether to only do FMD
350 TH1* fSpec; // Spectra
351 TH1* fSpecCut; // Cut spectra
352 TCanvas* fAux; // Aux canvas.
353 Bool_t fReturn; // Stop
354 Bool_t fContinous; // Run continuous - do not stop
355 TTimer fTimeout; // Timeout
356 Float_t fInitialMin;// Initial minimum
357 Float_t fInitialMax;// Initial maximum
358 Float_t fInitialFactor;//Initial factor
361 UInt_t fNbins; // Number of bins
362 Float_t fLow; // Low cut
363 Float_t fHigh; // High cut
365 static const Range_t fgkEdepRange; // Energy loss range
366 static const Range_t fgkAdcRange; // ADC counts range
367 static const Range_t fgkMultRange; // Multiplicity range
369 ClassDef(AliFMDDisplay,0) // FMD specialised event display
373 //____________________________________________________________________