]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveDet/AliEveFMDLoader.h
Fixes for report #71652 BAD_FREE reported by Coverity
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveFMDLoader.h
CommitLineData
274799f3 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
26class 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*/
36class AliEveFMDLoader : public TEveElementList
37{
38public:
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 /** @} */
73protected:
74 /** Constructor
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,
79 Bool_t old=kTRUE);
80
81 /** @{
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);
87 /** @} */
88
89 /** @{
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
94 @param d Detector
95 @param r Ring
96 @param s Sector
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
108 Type can be one of
109 - All All signals
110 - Hits Hits
111 - Digits Digits
112 - Raw Raw
113 - ESD ESD */
114 virtual void ClearDigitSets(const char* type);
115 /** @} */
116
117 /** @{
118 @name Adding signals to digit sets */
119 /** Add a signal to a digit set
120 @param type Type of data
121 @param det Detector
122 @param rng Ring
123 @param sec Sector
124 @param str Strip
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,
132 TObject* ref=0);
133 /** Add a signal to a digit set, with known (x,y,z) coordinates
134 (this is for hits)
135 @param type Type of data
136 @param det Detector
137 @param rng Ring
138 @param sec Sector
139 @param str Strip
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,
151 TObject* ref=0);
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
157 @param w strip pitch
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,
164 TObject* ref);
165 /** @} */
166
167 /** @{
168 @name Various service functions */
169 /** check if we shoul re-add ourselves to the current event node */
170 virtual void CheckAdd();
171 /** @} */
172
173 /** @{
174 @name Palettes */
175 TEveRGBAPalette fHitPalette; // Palette for hits
176 TEveRGBAPalette fDigitPalette; // Palette for ADC values
177 TEveRGBAPalette fMultPalette; // Palette for multiplicity values
178 /** @} */
179
180 /** @{
181 @name Settings */
182 Bool_t fUseBoxDigits; // Whether to show as boxes or quads
183 /** @} */
184
185 /** @{
186 @name Caches */
187 TClonesArray fHitCache; // Cache of digits
188 TClonesArray fDigitCache; // Cache of digits
189 TClonesArray fRawCache; // Cache of raw
190 /** @} */
191
192 /** @{
193 @name Singleton interface */
194 static AliEveFMDLoader* fgInstance; // Singleton
195 /** @} */
196
197 ClassDef(AliEveFMDLoader,0)
198};
199
200
201
202#endif
203//
204// EOF
205//