]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDisplay.h
method AddAlignableVolumes added
[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 class TObjArray;
23 class TCanvas;
24 class TPad;
25 class TButton;
26
27 //___________________________________________________________________
28 /** @class AliFMDDisplay 
29     @brief Utility class to visualize FMD data in geometry. 
30     @ingroup FMD_util
31  */
32 class AliFMDDisplay : public AliFMDInput
33 {
34 public:
35   /** Constructor
36       @param gAliceFile galice file*/
37   AliFMDDisplay(const char* gAliceFile="galice.root");
38   /** DTOR */
39   virtual ~AliFMDDisplay() {}
40   /** Singleton access function
41       @return Singleton object. */
42   static AliFMDDisplay* Instance();
43
44   /** Continue to next event */
45   void  Continue() { fWait = kFALSE; }
46   /** Zoom mode */
47   void  Zoom() { fZoomMode = kTRUE; }
48   /** Pick mode */
49   void  Pick() { fZoomMode = kFALSE; }
50   /** Called when a mouse or similar event happens in the display. 
51       @param event Event type
52       @param px    where the event happened in pixels along X
53       @param py    where the event happened in pixels along Y */
54   void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
55   /** Calculate distance from point @f$ (p_x,p_y)@f$ to this object. 
56       @param px Pixel X coordinate 
57       @param py Pixel Y coordinate 
58       @return distance. */
59   Int_t DistancetoPrimitive(Int_t px, Int_t py);
60   /** Paint into canvas 
61       @param option Not used */
62   void  Paint(Option_t* option="") { (void)option; }
63
64   /** Initialize
65       @return  @c false on error */
66   virtual Bool_t Init();
67   /** Called at beginning of an event 
68       @param event Event number
69       @return @c false on error  */
70   virtual Bool_t Begin(Int_t event);
71   /** Called at end of an event 
72       @return @c false on error  */
73   virtual Bool_t End();
74   /** Visualize a hit
75       @param hit Hit
76       @param p   Track
77       @return @c false on error  */
78   virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle* p);
79   /** Visualize a digit
80       @param digit Digit to draw
81       @return @c false on error  */
82   virtual Bool_t ProcessDigit(AliFMDDigit* digit);
83   /** Visualize a raw digit
84       @param digit Raw digit.
85       @return @c false on error  */
86   virtual Bool_t ProcessRaw(AliFMDDigit* digit);
87   /** Visualize a reconstructed point.
88       @param recpoint Reconstructed point
89       @return @c false on error  */
90   virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint);
91   /** Visualize data in ESD 
92       @param esd FMD ESD data 
93       @return  Always @c true */
94   virtual Bool_t ProcessESD(AliESDFMD* esd);
95   /** Look up a color index, based on the value @a x and the maximum
96       value of @a x
97       @param x   Value 
98       @param max Maximum (for example 1023 for digits)
99       @return @c false on error  */
100   virtual Int_t  LookupColor(Float_t x, Float_t max)  const;
101   /** Set multiplicity cut 
102       @param cut Cut-off in multiplicity */
103   virtual void SetMultiplicityCut(Float_t c=.01) { fMultCut = c; }//*MENU*
104   /** Set pedestal width factor 
105       @param fac Factor */
106   virtual void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }//*MENU*
107 protected:
108   /** Copy constructor 
109       @param o Object to copy from  */
110   AliFMDDisplay(const AliFMDDisplay& o) 
111     : AliFMDInput(o),
112       fWait(kFALSE),
113       fMarkers(0),
114       fHits(0),
115       fCanvas(0),
116       fPad(0),
117       fButton(0),
118       fZoom(0),
119       fPick(0),
120       fZoomMode(0),
121       fX0(0),
122       fY0(0),
123       fX1(0),
124       fY1(0),
125       fMultCut(0),
126       fPedestalFactor(0),
127       fXPixel(0),
128       fYPixel(0),
129       fOldXPixel(0),
130       fOldYPixel(0),
131       fLineDrawn(0)
132   { } 
133   /** Assignment operator 
134       @return Reference to this object */
135   AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; } 
136   /** Add a marker to the display
137       @param det Detector
138       @param rng Ring
139       @param sec Sector 
140       @param str Strip
141       @param o   Object to refer to
142       @param s   Signal 
143       @param max Maximum of signal */
144   void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str, 
145                  TObject* o, Float_t s, Float_t max);
146   
147   static AliFMDDisplay* fgInstance; // Static instance 
148   Bool_t                fWait;      // Wait until user presses `Continue'
149   TObjArray*            fMarkers;   // Cache of markers
150   TObjArray*            fHits;      // Cache of `hits'
151   TCanvas*              fCanvas;    // Canvas to draw in 
152   TPad*                 fPad;       // View pad. 
153   TButton*              fButton;    // Continue button
154   TButton*              fZoom;      // Zoom button
155   TButton*              fPick;      // Pick button
156   Bool_t                fZoomMode;  // Whether we're in Zoom mode
157   Float_t               fX0;        // X at lower left corner or range 
158   Float_t               fY0;        // Y at lower left corner or range 
159   Float_t               fX1;        // X at upper right corner or range 
160   Float_t               fY1;        // Y at upper right corner or range 
161   Float_t               fMultCut;   // Multiplicity cut  
162   Float_t               fPedestalFactor; // ADC acceptance factor 
163   Int_t                 fXPixel;    // X pixel of mark
164   Int_t                 fYPixel;    // Y pixel of mark
165   Int_t                 fOldXPixel; // Old x pixel of mark
166   Int_t                 fOldYPixel; // Old y pixel of mark
167   Bool_t                fLineDrawn; // Whether we're drawing a box
168   ClassDef(AliFMDDisplay,0)  // FMD specialised event display
169 };
170
171 #endif
172 //____________________________________________________________________
173 //
174 // Local Variables:
175 //   mode: C++
176 // End:
177 //
178 // EOF
179 //