Adding new macro to visualize the QA results - A couple of modifications in the 2D...
[u/mrichter/AliRoot.git] / FMD / AliFMDDisplay.h
CommitLineData
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 23class TCanvas;
24class TPad;
25class TButton;
a9579262 26class TSlider;
27class TH1;
bf000c32 28
29//___________________________________________________________________
9f662337 30/** @class AliFMDDisplay
31 @brief Utility class to visualize FMD data in geometry.
32 @ingroup FMD_util
33 */
bf000c32 34class AliFMDDisplay : public AliFMDInput
35{
36public:
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*
d98fbfa5 55 /** Break */
56 virtual void Break();
57 /** Render in 3D */
58 virtual void Render();
59
a9579262 60 /** Change cut */
61 virtual void ChangeCut();
d98fbfa5 62 /** Change cut */
63 virtual void ChangeFactor();
9f662337 64 /** Called when a mouse or similar event happens in the display.
65 @param event Event type
66 @param px where the event happened in pixels along X
67 @param py where the event happened in pixels along Y */
a9579262 68 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
9f662337 69 /** Calculate distance from point @f$ (p_x,p_y)@f$ to this object.
70 @param px Pixel X coordinate
71 @param py Pixel Y coordinate
72 @return distance. */
a9579262 73 virtual Int_t DistancetoPrimitive(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);
9f662337 97 /** Visualize a raw digit
98 @param digit Raw digit.
99 @return @c false on error */
d760ea03 100 virtual Bool_t ProcessRaw(AliFMDDigit* digit);
9f662337 101 /** Visualize a reconstructed point.
102 @param recpoint Reconstructed point
103 @return @c false on error */
bf000c32 104 virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint);
a9579262 105 /** Process ESD data for the FMD. Users should overload this to
106 deal with ESD data.
107 @param d Detector number (1-3)
108 @param r Ring identifier ('I' or 'O')
109 @param s Sector number (0-19, or 0-39)
110 @param t Strip number (0-511, or 0-255)
111 @param eta Psuedo-rapidity
112 @param mult Psuedo-multiplicity
113 @return @c false on error */
114 virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t,
115 Float_t eta, Float_t mult);
9f662337 116 /** Look up a color index, based on the value @a x and the maximum
117 value of @a x
118 @param x Value
119 @param max Maximum (for example 1023 for digits)
120 @return @c false on error */
d98fbfa5 121 virtual Int_t LookupColor(Float_t x, Float_t min, Float_t max) const;
bf000c32 122protected:
15b17c89 123 /** Copy constructor
124 @param o Object to copy from */
b5ee4425 125 AliFMDDisplay(const AliFMDDisplay& o)
126 : AliFMDInput(o),
127 fWait(kFALSE),
128 fMarkers(0),
129 fHits(0),
130 fCanvas(0),
131 fPad(0),
2b893216 132 fButtons(0),
a9579262 133 fSlider(0),
d98fbfa5 134 fFactor(0),
b5ee4425 135 fZoomMode(0),
136 fX0(0),
137 fY0(0),
138 fX1(0),
139 fY1(0),
b5ee4425 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),
d98fbfa5 148 fAux(0),
149 fReturn(kFALSE)
b5ee4425 150 { }
15b17c89 151 /** Assignment operator
152 @return Reference to this object */
02a27b50 153 AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; }
15b17c89 154 /** Add a marker to the display
d98fbfa5 155 @param x X position
156 @param y Y position
157 @param z Z position
158 @param o Object to refer to
159 @param s Signal
160 @param max Maximum of signal */
161 virtual void AddMarker(Float_t x, Float_t y, Float_t z,
162 TObject* o, Float_t s, Float_t min, Float_t max);
163 /** Add a marker to the display
15b17c89 164 @param det Detector
165 @param rng Ring
166 @param sec Sector
167 @param str Strip
168 @param o Object to refer to
169 @param s Signal
170 @param max Maximum of signal */
a9579262 171 virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
d98fbfa5 172 TObject* o, Float_t s, Float_t min, Float_t max);
a9579262 173
174 /** Show only the FMD detectors. */
175 void ShowOnlyFMD();
176 /** Make base canvas */
177 virtual void MakeCanvas(const char** which);
178 virtual void MakeAux();
179 virtual void DrawAux();
180 virtual void Idle();
181 virtual void AtEnd();
d98fbfa5 182 virtual Bool_t InsideCut(Float_t v, const Float_t& min,
183 const Float_t& max) const;
02a27b50 184
bf000c32 185 static AliFMDDisplay* fgInstance; // Static instance
186 Bool_t fWait; // Wait until user presses `Continue'
187 TObjArray* fMarkers; // Cache of markers
188 TObjArray* fHits; // Cache of `hits'
189 TCanvas* fCanvas; // Canvas to draw in
190 TPad* fPad; // View pad.
a9579262 191 TObjArray fButtons; // Continue button
192 TSlider* fSlider; // Cut slider
d98fbfa5 193 TSlider* fFactor; // Factor slider
bf000c32 194 Bool_t fZoomMode; // Whether we're in Zoom mode
195 Float_t fX0; // X at lower left corner or range
196 Float_t fY0; // Y at lower left corner or range
197 Float_t fX1; // X at upper right corner or range
198 Float_t fY1; // Y at upper right corner or range
199 Int_t fXPixel; // X pixel of mark
200 Int_t fYPixel; // Y pixel of mark
201 Int_t fOldXPixel; // Old x pixel of mark
202 Int_t fOldYPixel; // Old y pixel of mark
203 Bool_t fLineDrawn; // Whether we're drawing a box
5c96b03f 204 Bool_t fOnlyFMD; // Whether to only do FMD
205 TH1* fSpec; // Spectra
206 TH1* fSpecCut; // Cut spectra
207 TCanvas* fAux; // Aux canvas.
d98fbfa5 208 Bool_t fReturn; // Stop
bf000c32 209 ClassDef(AliFMDDisplay,0) // FMD specialised event display
210};
211
212#endif
213//____________________________________________________________________
214//
215// Local Variables:
216// mode: C++
217// End:
218//
219// EOF
220//