3 /* Copyright(c) 2008, Christian Holm Christensen
5 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7 * See cxx source for full Copyright notice
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
14 //____________________________________________________________________
16 // Forward Multiplicity Detector based on Silicon wafers.
18 // This class is the loader for the event display.
20 #ifndef ALIEVEFMDLOADER_H
21 #define ALIEVEFMDLOADER_H
22 #include <TEveElement.h>
23 #include <TEveRGBAPalette.h>
24 #include <TClonesArray.h>
25 // Forward declarations
28 /** @class AliEveFMDLoader
29 @brief Loader of FMD data for the EVE event display
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.
36 class AliEveFMDLoader : public TEveElementList
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();
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.
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.
62 virtual void RemoveParent(TEveElement* el);
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();
71 virtual ~AliEveFMDLoader();
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,
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);
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
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
118 virtual void ClearDigitSets(const char* type);
122 @name Adding signals to digit sets */
123 /** Add a signal to a digit set
124 @param type Type of data
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,
137 /** Add a signal to a digit set, with known (x,y,z) coordinates
139 @param type Type of data
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,
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
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,
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();
182 TEveRGBAPalette fHitPalette; // Palette for hits
183 TEveRGBAPalette fDigitPalette; // Palette for ADC values
184 TEveRGBAPalette fMultPalette; // Palette for multiplicity values
189 Bool_t fUseBoxDigits; // Whether to show as boxes or quads
194 TClonesArray fHitCache; // Cache of digits
195 TClonesArray fDigitCache; // Cache of digits
196 TClonesArray fRawCache; // Cache of raw
200 @name Singleton interface */
201 static AliEveFMDLoader* fgInstance; // Singleton
204 ClassDef(AliEveFMDLoader,0)