]>
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> |
bf000c32 | 23 | class TCanvas; |
24 | class TPad; | |
25 | class TButton; | |
a9579262 | 26 | class TSlider; |
27 | class TH1; | |
bf000c32 | 28 | |
29 | //___________________________________________________________________ | |
9f662337 | 30 | /** @class AliFMDDisplay |
31 | @brief Utility class to visualize FMD data in geometry. | |
32 | @ingroup FMD_util | |
33 | */ | |
bf000c32 | 34 | class AliFMDDisplay : public AliFMDInput |
35 | { | |
36 | public: | |
9f662337 | 37 | /** Constructor |
a9579262 | 38 | @param onlyFMD Only show the FMD |
9f662337 | 39 | @param gAliceFile galice file*/ |
a9579262 | 40 | AliFMDDisplay(Bool_t onlyFMD=kTRUE, const char* gAliceFile="galice.root"); |
9f662337 | 41 | /** DTOR */ |
a9579262 | 42 | virtual ~AliFMDDisplay(); |
9f662337 | 43 | /** Singleton access function |
44 | @return Singleton object. */ | |
bf000c32 | 45 | static AliFMDDisplay* Instance(); |
46 | ||
9f662337 | 47 | /** Continue to next event */ |
bf000c32 | 48 | void Continue() { fWait = kFALSE; } |
9f662337 | 49 | /** Zoom mode */ |
bf000c32 | 50 | void Zoom() { fZoomMode = kTRUE; } |
9f662337 | 51 | /** Pick mode */ |
bf000c32 | 52 | void Pick() { fZoomMode = kFALSE; } |
a9579262 | 53 | /** Redisplay the event */ |
54 | virtual void Redisplay(); // *MENU* | |
55 | /** Change cut */ | |
56 | virtual void ChangeCut(); | |
9f662337 | 57 | /** Called when a mouse or similar event happens in the display. |
58 | @param event Event type | |
59 | @param px where the event happened in pixels along X | |
60 | @param py where the event happened in pixels along Y */ | |
a9579262 | 61 | virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py); |
9f662337 | 62 | /** Calculate distance from point @f$ (p_x,p_y)@f$ to this object. |
63 | @param px Pixel X coordinate | |
64 | @param py Pixel Y coordinate | |
65 | @return distance. */ | |
a9579262 | 66 | virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); |
9f662337 | 67 | /** Paint into canvas |
68 | @param option Not used */ | |
a9579262 | 69 | virtual void Paint(Option_t* option="") { (void)option; } |
bf000c32 | 70 | |
9f662337 | 71 | /** Initialize |
72 | @return @c false on error */ | |
bf000c32 | 73 | virtual Bool_t Init(); |
9f662337 | 74 | /** Called at beginning of an event |
75 | @param event Event number | |
76 | @return @c false on error */ | |
bf000c32 | 77 | virtual Bool_t Begin(Int_t event); |
9f662337 | 78 | /** Called at end of an event |
79 | @return @c false on error */ | |
bf000c32 | 80 | virtual Bool_t End(); |
9f662337 | 81 | /** Visualize a hit |
82 | @param hit Hit | |
83 | @param p Track | |
84 | @return @c false on error */ | |
bf000c32 | 85 | virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle* p); |
9f662337 | 86 | /** Visualize a digit |
87 | @param digit Digit to draw | |
88 | @return @c false on error */ | |
bf000c32 | 89 | virtual Bool_t ProcessDigit(AliFMDDigit* digit); |
9f662337 | 90 | /** Visualize a raw digit |
91 | @param digit Raw digit. | |
92 | @return @c false on error */ | |
d760ea03 | 93 | virtual Bool_t ProcessRaw(AliFMDDigit* digit); |
9f662337 | 94 | /** Visualize a reconstructed point. |
95 | @param recpoint Reconstructed point | |
96 | @return @c false on error */ | |
bf000c32 | 97 | virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint); |
a9579262 | 98 | /** Process ESD data for the FMD. Users should overload this to |
99 | deal with ESD data. | |
100 | @param d Detector number (1-3) | |
101 | @param r Ring identifier ('I' or 'O') | |
102 | @param s Sector number (0-19, or 0-39) | |
103 | @param t Strip number (0-511, or 0-255) | |
104 | @param eta Psuedo-rapidity | |
105 | @param mult Psuedo-multiplicity | |
106 | @return @c false on error */ | |
107 | virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t, | |
108 | Float_t eta, Float_t mult); | |
9f662337 | 109 | /** Look up a color index, based on the value @a x and the maximum |
110 | value of @a x | |
111 | @param x Value | |
112 | @param max Maximum (for example 1023 for digits) | |
113 | @return @c false on error */ | |
bf000c32 | 114 | virtual Int_t LookupColor(Float_t x, Float_t max) const; |
15b17c89 | 115 | /** Set multiplicity cut |
116 | @param cut Cut-off in multiplicity */ | |
117 | virtual void SetMultiplicityCut(Float_t c=.01) { fMultCut = c; }//*MENU* | |
118 | /** Set pedestal width factor | |
119 | @param fac Factor */ | |
120 | virtual void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }//*MENU* | |
bf000c32 | 121 | protected: |
15b17c89 | 122 | /** Copy constructor |
123 | @param o Object to copy from */ | |
b5ee4425 | 124 | AliFMDDisplay(const AliFMDDisplay& o) |
125 | : AliFMDInput(o), | |
126 | fWait(kFALSE), | |
127 | fMarkers(0), | |
128 | fHits(0), | |
129 | fCanvas(0), | |
130 | fPad(0), | |
2b893216 | 131 | fButtons(0), |
a9579262 | 132 | fSlider(0), |
b5ee4425 | 133 | fZoomMode(0), |
134 | fX0(0), | |
135 | fY0(0), | |
136 | fX1(0), | |
137 | fY1(0), | |
138 | fMultCut(0), | |
139 | fPedestalFactor(0), | |
140 | fXPixel(0), | |
141 | fYPixel(0), | |
142 | fOldXPixel(0), | |
143 | fOldYPixel(0), | |
2b893216 | 144 | fLineDrawn(0), |
145 | fOnlyFMD(kTRUE), | |
146 | fSpec(0), | |
147 | fSpecCut(0), | |
148 | fAux(0) | |
b5ee4425 | 149 | { } |
15b17c89 | 150 | /** Assignment operator |
151 | @return Reference to this object */ | |
02a27b50 | 152 | AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; } |
15b17c89 | 153 | /** Add a marker to the display |
154 | @param det Detector | |
155 | @param rng Ring | |
156 | @param sec Sector | |
157 | @param str Strip | |
158 | @param o Object to refer to | |
159 | @param s Signal | |
160 | @param max Maximum of signal */ | |
a9579262 | 161 | virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str, |
162 | TObject* o, Float_t s, Float_t max); | |
163 | ||
164 | /** Show only the FMD detectors. */ | |
165 | void ShowOnlyFMD(); | |
166 | /** Make base canvas */ | |
167 | virtual void MakeCanvas(const char** which); | |
168 | virtual void MakeAux(); | |
169 | virtual void DrawAux(); | |
170 | virtual void Idle(); | |
171 | virtual void AtEnd(); | |
02a27b50 | 172 | |
bf000c32 | 173 | static AliFMDDisplay* fgInstance; // Static instance |
174 | Bool_t fWait; // Wait until user presses `Continue' | |
175 | TObjArray* fMarkers; // Cache of markers | |
176 | TObjArray* fHits; // Cache of `hits' | |
177 | TCanvas* fCanvas; // Canvas to draw in | |
178 | TPad* fPad; // View pad. | |
a9579262 | 179 | TObjArray fButtons; // Continue button |
180 | TSlider* fSlider; // Cut slider | |
bf000c32 | 181 | Bool_t fZoomMode; // Whether we're in Zoom mode |
182 | Float_t fX0; // X at lower left corner or range | |
183 | Float_t fY0; // Y at lower left corner or range | |
184 | Float_t fX1; // X at upper right corner or range | |
185 | Float_t fY1; // Y at upper right corner or range | |
15b17c89 | 186 | Float_t fMultCut; // Multiplicity cut |
187 | Float_t fPedestalFactor; // ADC acceptance factor | |
bf000c32 | 188 | Int_t fXPixel; // X pixel of mark |
189 | Int_t fYPixel; // Y pixel of mark | |
190 | Int_t fOldXPixel; // Old x pixel of mark | |
191 | Int_t fOldYPixel; // Old y pixel of mark | |
192 | Bool_t fLineDrawn; // Whether we're drawing a box | |
5c96b03f | 193 | Bool_t fOnlyFMD; // Whether to only do FMD |
194 | TH1* fSpec; // Spectra | |
195 | TH1* fSpecCut; // Cut spectra | |
196 | TCanvas* fAux; // Aux canvas. | |
bf000c32 | 197 | ClassDef(AliFMDDisplay,0) // FMD specialised event display |
198 | }; | |
199 | ||
200 | #endif | |
201 | //____________________________________________________________________ | |
202 | // | |
203 | // Local Variables: | |
204 | // mode: C++ | |
205 | // End: | |
206 | // | |
207 | // EOF | |
208 | // |