]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveFMDLoader.h
change eve redraw while processing event
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveFMDLoader.h
1 // -*- mode: C++ -*- 
2 //
3 /* Copyright(c) 2008, Christian Holm Christensen
4  *
5  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
6  *
7  * See cxx source for full Copyright notice                               
8  */
9 /** @file    AliEveFMDLoader.h
10     @author  Christian Holm Christensen <cholm@nbi.dk>
11     @date    Sun Mar 26 17:59:37 2006
12     @brief   Declaration of AliEveFMDLoader singleton class 
13 */
14 //____________________________________________________________________
15 // 
16 // Forward Multiplicity Detector based on Silicon wafers. 
17 // . 
18 // This class is the loader for the event display.
19 // 
20 #ifndef ALIEVEFMDLOADER_H
21 #define ALIEVEFMDLOADER_H
22 #include <TEveElement.h>
23 #include <TEveRGBAPalette.h>
24 #include <TClonesArray.h>
25 // Forward declarations
26 class TEveDigitSet;
27
28 /** @class AliEveFMDLoader 
29     @brief Loader of FMD data for the EVE event display 
30     @ingroup FMD_util
31
32     This class is a singleton, meaning that there's only one instance
33     of this.  This is done to speed up the processing by putting all
34     things that are needed every time into the constructor.
35 */
36 class AliEveFMDLoader : public TEveElementList
37 {
38 public:
39   /** @{ 
40       @name Loading and displaying data */
41   /** Load and display hits */
42   virtual void LoadHits();
43   /** Load and display digits */
44   virtual void LoadDigits();
45   /** Load and display raw data digits */
46   virtual void LoadRaw();
47   /** Load and display ESD */
48   virtual void LoadESD();
49   /** @} */
50
51   /** @{ 
52       @name Hacks to optimise performance */
53   /** Called when the element should be removed from the list. We
54       overload this to allow clearing of signals.
55       @param el Tree to remove from.
56   */
57   virtual Int_t RemoveFromListTrees(TEveElement* el);
58   /** Called when the element should be removed from the list. We
59       overload this to allow clearing of signals.
60       @param el Parent to remove from.
61   */  
62   virtual void RemoveParent(TEveElement* el);
63   /** @} */
64
65   /** @{ 
66       @name Singleton interface */
67   /** Get the singleton instance.  If the instance has not been
68       instantised yet, it will be after this call. */
69   static AliEveFMDLoader* Instance();
70   /** Destructor */
71   virtual ~AliEveFMDLoader();
72   /** @} */
73 protected:
74   struct ModuleData 
75   {
76     Float_t  fScaledSum;
77   };
78   /** Constructor 
79       @param name     Name of the folder. 
80       @param useBoxes Whether to use boxes or Quads for the signals 
81       @param old      Whether to enable reading old RCU data format */
82   AliEveFMDLoader(const char* name="FMD", Bool_t useBoxes=true, 
83                   Bool_t old=kTRUE);
84
85   /** @{ 
86       @name Service functions for loading data */
87   /** Do the actual display of digits 
88       @param type What to show 
89       @param digits The digits */
90   void          DoLoadDigits(const char* type, TClonesArray* digits);
91   /** @} */
92
93   /** @{ 
94       @name Digit set management */
95   /** Find a digit set corresponding to the passed parameters.  If it
96       is not found, one is created 
97       @param type   Type of data 
98       @param d      Detector 
99       @param r      Ring 
100       @param s      Sector 
101       @return a digit set */
102   TEveDigitSet* FindDigitSet(const char* type,UShort_t d, Char_t r, UShort_t s);
103   /** Make a digit set.  The type of digit set depends on the setting
104       of fUseBoxDigits.  If this is true, we return a TEveBoxSet,
105       otherwise a TEveQuadSet 
106       @param name  Name of set. 
107       @param nstr  Number of strips to make room for. 
108       @return newly allocated digit set */
109   virtual TEveDigitSet* MakeDigitSet(const char* name, UShort_t nstr);
110   /** Clear signals of some type.   
111       @param type Type of signals to clear 
112       Type can be one of 
113       - All    All signals 
114       - Hits   Hits 
115       - Digits Digits 
116       - Raw    Raw 
117       - ESD    ESD */
118   virtual void ClearDigitSets(const char* type);
119   /** @} */
120
121   /** @{ 
122       @name Adding signals to digit sets */
123   /** Add a signal to a digit set
124       @param type   Type of data 
125       @param det    Detector 
126       @param rng    Ring 
127       @param sec    Sector 
128       @param str    Strip
129       @param signal Signal value 
130       @param min    Minimum of this kind of signal 
131       @param max    Maximum of this kind of signal 
132       @param ref    Reference object  */
133   void          AddSignal(const char* type, UShort_t det, Char_t ring, 
134                           UShort_t sec, UShort_t str, 
135                           Float_t signal, Float_t min, Float_t  max, 
136                           TObject* ref=0);
137   /** Add a signal to a digit set, with known (x,y,z) coordinates
138       (this is for hits)
139       @param type   Type of data 
140       @param det    Detector 
141       @param rng    Ring 
142       @param sec    Sector 
143       @param str    Strip
144       @param x      X coordinate  
145       @param y      Y coordinate  
146       @param z      Z coordinate  
147       @param signal Signal value 
148       @param min    Minimum of this kind of signal 
149       @param max    Maximum of this kind of signal 
150       @param ref    Reference object */
151   void          AddSignal(const char* type, UShort_t det, Char_t ring, 
152                           UShort_t sec, UShort_t str, 
153                           Double_t x, Double_t y, Double_t z, 
154                           Float_t signal, Float_t min, Float_t  max, 
155                           TObject* ref=0);
156   /** Add a digit to a digit set. 
157       @param signals Digit set. 
158       @param x      X coordinate  
159       @param y      Y coordinate  
160       @param z      Z coordinate  
161       @param w      strip pitch 
162       @param scaled Scaled value 
163       @param value  Signal value 
164       @param ref    Reference object */
165   virtual void AddDigit(TEveDigitSet* signals, 
166                         Double_t x, Double_t y, Double_t z, 
167                         Double_t w, Float_t scaled, Int_t value, 
168                         TObject* ref);
169   /** @} */
170
171   /** @{
172       @name Various service functions */
173   /** check if we shoul re-add ourselves to the current event node */
174   virtual void CheckAdd();
175   void SummarizeModule(TEveElement* module);
176   void SummarizeModules();
177   /** @} */
178
179
180   /** @{ 
181       @name Palettes */
182   TEveRGBAPalette  fHitPalette;    // Palette for hits
183   TEveRGBAPalette  fDigitPalette;  // Palette for ADC values
184   TEveRGBAPalette  fMultPalette;   // Palette for multiplicity values
185   /** @} */
186   
187   /** @{ 
188       @name Settings */
189   Bool_t           fUseBoxDigits;  // Whether to show as boxes or quads
190   /** @} */
191
192   /** @{ 
193       @name Caches */
194   TClonesArray     fHitCache;      // Cache of digits
195   TClonesArray     fDigitCache;    // Cache of digits
196   TClonesArray     fRawCache;      // Cache of raw
197   /** @} */
198
199   /** @{ 
200       @name Singleton interface */
201   static AliEveFMDLoader* fgInstance; // Singleton
202   /** @} */
203
204   ClassDef(AliEveFMDLoader,0)
205 };
206
207   
208   
209 #endif
210 //
211 // EOF
212 //