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();
75 @param name Name of the folder.
76 @param useBoxes Whether to use boxes or Quads for the signals
77 @param old Whether to enable reading old RCU data format */
78 AliEveFMDLoader(const char* name="FMD", Bool_t useBoxes=true,
82 @name Service functions for loading data */
83 /** Do the actual display of digits
84 @param type What to show
85 @param digits The digits */
86 void DoLoadDigits(const char* type, TClonesArray* digits);
90 @name Digit set management */
91 /** Find a digit set corresponding to the passed parameters. If it
92 is not found, one is created
93 @param type Type of data
97 @return a digit set */
98 TEveDigitSet* FindDigitSet(const char* type,UShort_t d, Char_t r, UShort_t s);
99 /** Make a digit set. The type of digit set depends on the setting
100 of fUseBoxDigits. If this is true, we return a TEveBoxSet,
101 otherwise a TEveQuadSet
102 @param name Name of set.
103 @param nstr Number of strips to make room for.
104 @return newly allocated digit set */
105 virtual TEveDigitSet* MakeDigitSet(const char* name, UShort_t nstr);
106 /** Clear signals of some type.
107 @param type Type of signals to clear
114 virtual void ClearDigitSets(const char* type);
118 @name Adding signals to digit sets */
119 /** Add a signal to a digit set
120 @param type Type of data
125 @param signal Signal value
126 @param min Minimum of this kind of signal
127 @param max Maximum of this kind of signal
128 @param ref Reference object */
129 void AddSignal(const char* type, UShort_t det, Char_t ring,
130 UShort_t sec, UShort_t str,
131 Float_t signal, Float_t min, Float_t max,
133 /** Add a signal to a digit set, with known (x,y,z) coordinates
135 @param type Type of data
140 @param x X coordinate
141 @param y Y coordinate
142 @param z Z coordinate
143 @param signal Signal value
144 @param min Minimum of this kind of signal
145 @param max Maximum of this kind of signal
146 @param ref Reference object */
147 void AddSignal(const char* type, UShort_t det, Char_t ring,
148 UShort_t sec, UShort_t str,
149 Double_t x, Double_t y, Double_t z,
150 Float_t signal, Float_t min, Float_t max,
152 /** Add a digit to a digit set.
153 @param signals Digit set.
154 @param x X coordinate
155 @param y Y coordinate
156 @param z Z coordinate
158 @param scaled Scaled value
159 @param value Signal value
160 @param ref Reference object */
161 virtual void AddDigit(TEveDigitSet* signals,
162 Double_t x, Double_t y, Double_t z,
163 Double_t w, Float_t scaled, Int_t value,
168 @name Various service functions */
169 /** check if we shoul re-add ourselves to the current event node */
170 virtual void CheckAdd();
175 TEveRGBAPalette fHitPalette; // Palette for hits
176 TEveRGBAPalette fDigitPalette; // Palette for ADC values
177 TEveRGBAPalette fMultPalette; // Palette for multiplicity values
182 Bool_t fUseBoxDigits; // Whether to show as boxes or quads
187 TClonesArray fHitCache; // Cache of digits
188 TClonesArray fDigitCache; // Cache of digits
189 TClonesArray fRawCache; // Cache of raw
193 @name Singleton interface */
194 static AliEveFMDLoader* fgInstance; // Singleton
197 ClassDef(AliEveFMDLoader,0)