]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDPattern.h
Coding rule violation corrected.
[u/mrichter/AliRoot.git] / FMD / AliFMDPattern.h
CommitLineData
a9579262 1#ifndef AliFMDPATTERN_H
2#define AliFMDPATTERN_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 AliFMDPattern.h
9 @author Christian Holm Christensen <cholm@nbi.dk>
10 @date Mon Mar 27 12:39:09 2006
11 @brief FMD Event display (as patterns)
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 "AliFMDDisplay.h"
a1e17193 22#include <TArrayI.h>
a9579262 23#include <TObjArray.h>
f95a63c4 24// #include <TGraph.h>
a9579262 25#include <TLatex.h>
26#include <TLine.h>
09b6c804 27// class AliPhysicsSelection;
a9579262 28class TCanvas;
29class TPad;
30class TH2;
31
32
33//___________________________________________________________________
34/** @class AliFMDPattern
35 @brief Utility class to visualize FMD data in 2D.
36 @ingroup FMD_util
37 */
38class AliFMDPattern : public AliFMDDisplay
39{
40public:
f95a63c4 41 /** @class AliFMDPatternDetector
42 @brief Utility for the pattern display.
43 The name is this long, because the code-checker even cares about
44 nested names, even though it seems a bit nit-picking and
45 retareded. It's a class rather than a structure, because the
46 code checker thinks that structs are only for POD - sigh! */
47 class AliFMDPatternDetector
a9579262 48 {
f95a63c4 49 public:
50 /** Constructor */
51 AliFMDPatternDetector(UShort_t id);
52 /** Destructor */
53 ~AliFMDPatternDetector();
54 /** Clear this detector */
a9579262 55 void Clear();
f95a63c4 56 /** Get the total number of hits */
a9579262 57 Int_t Total() const { return Int_t(fCounts.GetSum()); }
f95a63c4 58 /** Called at the end of things */
a9579262 59 void End();
f95a63c4 60 /** Initiate.
61 @param nlvl Number of levels.
62 @param r Radius
63 @param inners Array of inner shapes
64 @param outers Array of outer shapes */
65 void Begin(Int_t nlvl, Double_t r, TObjArray& inners,
66 TObjArray& outers);
67 /** Draw everything
68 @param a Array of shapes to draw */
09b6c804 69 void DrawShape(const TObjArray& a);
f95a63c4 70 /** Add a marker at specified coordinates
71 @param X X coordinate
72 @param Y Y coordinate
73 @param Z Z coordinate
74 @param max The maximum value to scale to */
a9579262 75 void AddMarker(Double_t x, Double_t y, Float_t s, Float_t max);
09b6c804 76 /**
77 * Get the indentifier
78 *
79 * @return Identifier
80 */
81 Int_t GetId() const { return fId; }
82 /**
83 * Get the counts array. Number of counts at each level
84 *
85 * @return Counts array
86 */
87 TArrayI& GetCounts() { return fCounts; }
88 /**
89 * Get the counts array. Number of counts at each level
90 *
91 * @return Counts array
92 */
93 const TArrayI& GetCounts() const { return fCounts; }
94 /**
95 * Get the list of graphs
96 *
97 * @return Array of graphs - one for each level
98 */
99 TObjArray& GetGraphs() { return fGraphs; }
100 /**
101 * Get the list of graphs
102 *
103 * @return Array of graphs - one for each level
104 */
105 const TObjArray& GetGraphs() const { return fGraphs; }
106 /**
107 * Get the mother frame
108 *
109 * @return The mother frame
110 */
111 TH2*& GetFrame() { return fFrame; }
112 /**
113 * Get the mother frame
114 *
115 * @return The mother frame
116 */
117 const TH2* GetFrame() const { return fFrame; }
f95a63c4 118 private:
09b6c804 119 /**
120 * Copy constructor
121 * - Not implemented.
122 */
2b893216 123 AliFMDPatternDetector(const AliFMDPatternDetector&);
09b6c804 124 /**
125 * Assignement operator
126 * -- Not implemented
127 */
f95a63c4 128 AliFMDPatternDetector& operator=(const AliFMDPatternDetector&);
09b6c804 129 /**
130 * Copy shapes
131 *
132 * @param input Source
133 * @param own Ours
134 * @param ang Angle
135 * @param fx Factor x
136 * @param fy Factor y
137 */
138 void CopyShapes(const TObjArray& input, TObjArray& own,
f38b1653 139 Double_t ang=0, Double_t fx=1, Double_t fy=1);
09b6c804 140 Int_t fId; // Identifier #
141 TArrayI fCounts; // Number of counts at each level
142 TObjArray fGraphs; // Array of graphs - one for each level
143 TH2* fFrame; // The mother frame
144 TObjArray fInners; // Our own cache of shapes
145 TObjArray fOuters; // Our own cache of shapes
a9579262 146 };
147
148
149 /** Constructor
150 @param gAliceFile galice file*/
151 AliFMDPattern(const char* gAliceFile="galice.root");
152 /** DTOR */
153 virtual ~AliFMDPattern();
154
155 /** Initialize
156 @return @c false on error */
157 virtual Bool_t Init();
158 /** Called at beginning of an event
159 @param event Event number
160 @return @c false on error */
161 virtual Bool_t Begin(Int_t event);
162 protected:
f95a63c4 163 /** Copy constructor
164 - Not implemented. */
165 AliFMDPattern(const AliFMDPattern&);
166 /** Assignement operator
167 -- Not implemented */
168 AliFMDPattern& operator=(const AliFMDPattern&);
d98fbfa5 169 virtual void AddMarker(Float_t x, Float_t y, Float_t z,
170 TObject* o, Float_t s, Float_t min, Float_t max)
171 {
172 AliFMDDisplay::AddMarker(x, y, z, o, s, min, max);
173 }
a9579262 174 /** Add a marker to the display
175 @param det Detector
176 @param rng Ring
177 @param sec Sector
178 @param str Strip
179 @param o Object to refer to
180 @param s Signal
181 @param max Maximum of signal */
f95a63c4 182 virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec,
d98fbfa5 183 UShort_t str, TObject* o, Float_t s,
184 Float_t min, Float_t max);
f95a63c4 185 /** @param hit Hit to process */
a9579262 186 virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle*);
f95a63c4 187 /** Re-draw the patterns */
a9579262 188 virtual void Redisplay();
f95a63c4 189 /** Called at the end. */
a9579262 190 virtual void AtEnd();
f95a63c4 191 TObjArray fInners; // Graph to show shape of inner sensor
f95a63c4 192 TObjArray fOuters; // Graph to show shape of outer sensor
f95a63c4 193 Float_t fInnerMax; // Max inner radius
f95a63c4 194 Float_t fOuterMax; // Max outer radius
f95a63c4 195 TPad* fFMD1Pad; // FMD1 Pad
f95a63c4 196 AliFMDPatternDetector fFMD1; // FMD1 Frame
f95a63c4 197 TPad* fFMD2Pad; // FMD2 Pad
f95a63c4 198 AliFMDPatternDetector fFMD2; // FMD2 Frame
f95a63c4 199 TPad* fFMD3Pad; // FMD3 Pad
f95a63c4 200 AliFMDPatternDetector fFMD3; // FMD3 Frame
f95a63c4 201 TPad* fSummary; // Summary pad
f95a63c4 202 TLatex fEvent; // Text fields
203 TLatex fFMD1Sum; // Total in FMD1
09b6c804 204 TLatex fFMD2Sum; // Total in FMD2
205 TLatex fFMD3Sum; // Total in FMD3
f95a63c4 206 TLine fLine; // Just a line
207 TLatex fTotal; // Total in FMD
a9579262 208
09b6c804 209 Double_t fFMD1Area; // estimated FMD1 area
210 Double_t fFMD2Area; // estimated FMD2 area
211 Double_t fFMD3Area; // estimated FMD3 area
e064ab4a 212
09b6c804 213 // AliPhysicsSelection* fPhysicsSelection;
693d8c21 214
f95a63c4 215 ClassDef(AliFMDPattern,0) // Display FMD data as hit-patterns.
a9579262 216};
217
218
219#endif
220//____________________________________________________________________
221//
222// Local Variables:
223// mode: C++
224// End:
225//
226// EOF
227//