]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDisplay.h
remove obselete clean QA macros command
[u/mrichter/AliRoot.git] / FMD / AliFMDDisplay.h
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  */
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 */
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"
22 #include <TObjArray.h>
23 #include <TTimer.h>
24 class TCanvas;
25 class TPad;
26 class TButton;
27 class TSlider;
28 class TH1;
29
30 //___________________________________________________________________
31 /** @class AliFMDDisplay 
32     @brief Utility class to visualize FMD data in geometry. 
33     @ingroup FMD_util
34  */
35 class AliFMDDisplay : public AliFMDInput
36 {
37 public:
38   /** Constructor
39       @param onlyFMD Only show the FMD
40       @param gAliceFile galice file*/
41   AliFMDDisplay(Bool_t onlyFMD=kTRUE, const char* gAliceFile="galice.root");
42   /** DTOR */
43   virtual ~AliFMDDisplay();
44   /** Singleton access function
45       @return Singleton object. */
46   static AliFMDDisplay* Instance();
47
48   /** Continue to next event */
49   void  Continue() { fWait = kFALSE; }
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; }
54   /** Zoom mode */
55   void  Zoom() { fZoomMode = kTRUE; }
56   /** Pick mode */
57   void  Pick() { fZoomMode = kFALSE; }
58   /** Redisplay the event */ 
59   virtual void Redisplay(); // *MENU*
60   /** Break */
61   virtual void Break();
62   /** Render in 3D */
63   virtual void Render();
64   
65   /** Change cut */
66   virtual void ChangeCut();
67   /** Change cut */
68   virtual void ChangeFactor();
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 */
73   virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
74   /** Paint into canvas 
75       @param option Not used */
76   virtual void  Paint(Option_t* option="") { (void)option; }
77
78   /** Initialize
79       @return  @c false on error */
80   virtual Bool_t Init();
81   /** Called at beginning of an event 
82       @param event Event number
83       @return @c false on error  */
84   virtual Bool_t Begin(Int_t event);
85   /** Called at end of an event 
86       @return @c false on error  */
87   virtual Bool_t End();
88   /** Visualize a hit
89       @param hit Hit
90       @param p   Track
91       @return @c false on error  */
92   virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle* p);
93   /** Visualize a digit
94       @param digit Digit to draw
95       @return @c false on error  */
96   virtual Bool_t ProcessDigit(AliFMDDigit* digit);
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);
101   /** Visualize a raw digit
102       @param digit Raw digit.
103       @return @c false on error  */
104   virtual Bool_t ProcessRawDigit(AliFMDDigit* digit);
105   /** Visualize a reconstructed point.
106       @param recpoint Reconstructed point
107       @return @c false on error  */
108   virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint);
109   /** Process ESD data for the FMD.  Users should overload this to
110       deal with ESD data. 
111       @param d    Detector number (1-3)
112       @param r    Ring identifier ('I' or 'O')
113       @param s    Sector number (0-19, or 0-39)
114       @param t    Strip number (0-511, or 0-255)
115       @param eta  Psuedo-rapidity 
116       @param mult Psuedo-multiplicity 
117       @return  @c false on error  */
118   virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t, 
119                             Float_t eta, Float_t mult);
120   /** Look up a color index, based on the value @a x and the maximum
121       value of @a x
122       @param x   Value 
123       @param max Maximum (for example 1023 for digits)
124       @return @c false on error  */
125   virtual Int_t  LookupColor(Float_t x, Float_t min, Float_t max)  const;
126
127   /** Set range of displayed values */
128   virtual void SetCut(Float_t l=0., Float_t h=1.); //*MENU*
129 protected:
130   /** Copy constructor 
131       @param o Object to copy from  */
132   AliFMDDisplay(const AliFMDDisplay& o) 
133     : AliFMDInput(o),
134       fWait(kFALSE),
135       fMarkers(0),
136       fHits(0),
137       fCanvas(0),
138       fPad(0),
139       fButtons(0),
140       fSlider(0),
141       fFactor(0),
142       fZoomMode(0),
143       fX0(0),
144       fY0(0),
145       fX1(0),
146       fY1(0),
147       fXPixel(0),
148       fYPixel(0),
149       fOldXPixel(0),
150       fOldYPixel(0),
151       fLineDrawn(0), 
152       fOnlyFMD(kTRUE),
153       fSpec(0), 
154       fSpecCut(0),
155       fAux(0),
156       fReturn(kFALSE),
157       fContinous(kFALSE), 
158       fTimeout()
159   { } 
160   /** Assignment operator 
161       @return Reference to this object */
162   AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; } 
163   /** Add a marker to the display
164       @param x   X position
165       @param y   Y position
166       @param z   Z position
167       @param o   Object to refer to
168       @param s   Signal 
169       @param max Maximum of signal */
170   virtual void AddMarker(Float_t x, Float_t y, Float_t z, 
171                          TObject* o, Float_t s, Float_t min, Float_t max);
172   /** Add a marker to the display
173       @param det Detector
174       @param rng Ring
175       @param sec Sector 
176       @param str Strip
177       @param o   Object to refer to
178       @param s   Signal 
179       @param max Maximum of signal */
180   virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str, 
181                          TObject* o, Float_t s, Float_t min, Float_t max);
182   
183   /** Show only the FMD detectors. */
184   void ShowOnlyFMD();
185   /** Make base canvas */ 
186   virtual void MakeCanvas(const char** which);
187   virtual void MakeAux();
188   virtual void DrawAux();
189   virtual void Idle();
190   virtual void AtEnd();
191   virtual Bool_t InsideCut(Float_t v, const Float_t& min, 
192                          const Float_t& max) const;
193   
194   static AliFMDDisplay* fgInstance; // Static instance 
195   Bool_t                fWait;      // Wait until user presses `Continue'
196   TObjArray*            fMarkers;   // Cache of markers
197   TObjArray*            fHits;      // Cache of `hits'
198   TCanvas*              fCanvas;    // Canvas to draw in 
199   TPad*                 fPad;       // View pad. 
200   TObjArray             fButtons;   // Continue button
201   TSlider*              fSlider;    // Cut slider
202   TSlider*              fFactor;    // Factor slider
203   Bool_t                fZoomMode;  // Whether we're in Zoom mode
204   Float_t               fX0;        // X at lower left corner or range 
205   Float_t               fY0;        // Y at lower left corner or range 
206   Float_t               fX1;        // X at upper right corner or range 
207   Float_t               fY1;        // Y at upper right corner or range 
208   Int_t                 fXPixel;    // X pixel of mark
209   Int_t                 fYPixel;    // Y pixel of mark
210   Int_t                 fOldXPixel; // Old x pixel of mark
211   Int_t                 fOldYPixel; // Old y pixel of mark
212   Bool_t                fLineDrawn; // Whether we're drawing a box
213   Bool_t                fOnlyFMD;   // Whether to only do FMD
214   TH1*                  fSpec;      // Spectra
215   TH1*                  fSpecCut;   // Cut spectra
216   TCanvas*              fAux;       // Aux canvas.
217   Bool_t                fReturn;    // Stop 
218   Bool_t                fContinous;
219   TTimer                fTimeout;
220   
221
222   struct Range_t { 
223     UInt_t  fNbins;
224     Float_t fLow;
225     Float_t fHigh;
226   };
227   static const Range_t fgkEdepRange;
228   static const Range_t fgkAdcRange;
229   static const Range_t fgkMultRange;
230
231   ClassDef(AliFMDDisplay,0)  // FMD specialised event display
232 };
233
234 #endif
235 //____________________________________________________________________
236 //
237 // Local Variables:
238 //   mode: C++
239 // End:
240 //
241 // EOF
242 //