]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDPattern.h
Fix Coverity reports
[u/mrichter/AliRoot.git] / FMD / AliFMDPattern.h
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"
22 #include <TArrayI.h>
23 #include <TObjArray.h>
24 // #include <TGraph.h>
25 #include <TLatex.h>
26 #include "AliPhysicsSelection.h"
27 #include <TLine.h>
28 class TCanvas;
29 class TPad;
30 class TH2;
31
32
33 //___________________________________________________________________
34 /** @class AliFMDPattern 
35     @brief Utility class to visualize FMD data in 2D. 
36     @ingroup FMD_util
37  */
38 class AliFMDPattern : public AliFMDDisplay
39 {
40 public:
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 
48   {
49   public:
50     /** Constructor */
51     AliFMDPatternDetector(UShort_t id);
52     /** Destructor */
53     ~AliFMDPatternDetector();
54     /** Clear this detector */
55     void  Clear();
56     /** Get the total number of hits */
57     Int_t Total() const { return Int_t(fCounts.GetSum()); }
58     /** Called at the  end of things */ 
59     void  End();
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 */
69     void  DrawShape(TObjArray& a);
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 */
75     void  AddMarker(Double_t x, Double_t y, Float_t s, Float_t max);
76     Int_t     fId;     // Identifier # 
77     TArrayI   fCounts; // Number of counts at each level 
78     TObjArray fGraphs; // Array of graphs - one for each level
79     TH2*      fFrame;  // The mother frame 
80   private:
81     /** Copy constructor 
82         - Not implemented. */ 
83     AliFMDPatternDetector(const AliFMDPatternDetector&);
84     /** Assignement operator 
85         -- Not implemented */
86     AliFMDPatternDetector& operator=(const AliFMDPatternDetector&);
87     void CopyShapes(TObjArray& input, TObjArray& own, 
88                     Double_t ang=0, Double_t fx=1, Double_t fy=1);
89     /** Our own cache of shapes */
90     TObjArray fInners;
91     /** Our own cache of shapes */
92     TObjArray fOuters;
93   };
94   
95   
96   /** Constructor
97       @param gAliceFile galice file*/
98   AliFMDPattern(const char* gAliceFile="galice.root");
99   /** DTOR */
100   virtual ~AliFMDPattern();
101
102   /** Initialize
103       @return  @c false on error */
104   virtual Bool_t Init();
105   /** Called at beginning of an event 
106       @param event Event number
107       @return @c false on error  */
108   virtual Bool_t Begin(Int_t event);
109  protected:
110   /** Copy constructor 
111       - Not implemented. */ 
112   AliFMDPattern(const AliFMDPattern&);
113   /** Assignement operator 
114       -- Not implemented */
115   AliFMDPattern& operator=(const AliFMDPattern&);
116   virtual void AddMarker(Float_t x, Float_t y, Float_t z, 
117                          TObject* o, Float_t s, Float_t min, Float_t max)
118   {
119     AliFMDDisplay::AddMarker(x, y, z, o, s, min, max);
120   }
121   /** Add a marker to the display
122       @param det Detector
123       @param rng Ring
124       @param sec Sector 
125       @param str Strip
126       @param o   Object to refer to
127       @param s   Signal 
128       @param max Maximum of signal */
129   virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec,
130                          UShort_t str, TObject* o, Float_t s, 
131                          Float_t min, Float_t max);
132   /** @param hit Hit to process */
133   virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle*);
134   /** Re-draw the patterns */
135   virtual void Redisplay();
136   /** Called at the end. */
137   virtual void AtEnd();
138   /** Graph to show shape of inner sensor */
139   TObjArray fInners;    // Graph to show shape of inner sensor
140   /** Graph to show shape of outer sensor */
141   TObjArray fOuters;    // Graph to show shape of outer sensor
142   /** Max inner radius */
143   Float_t fInnerMax;    // Max inner radius
144   /** Max outer radius */
145   Float_t fOuterMax;    // Max outer radius
146   /** FMD1 Pad */
147   TPad*  fFMD1Pad;      // FMD1 Pad
148   /** FMD1 Frame */
149   AliFMDPatternDetector fFMD1;  // FMD1 Frame
150   /** FMD2 Pad  */
151   TPad*  fFMD2Pad;      // FMD2 Pad 
152   /** FMD2 Frame */
153   AliFMDPatternDetector fFMD2;  // FMD2 Frame
154   /** FMD3 Pad */
155   TPad*  fFMD3Pad;      // FMD3 Pad
156   /** FMD3 Frame */
157   AliFMDPatternDetector fFMD3;  // FMD3 Frame
158   /** Summary pad */
159   TPad* fSummary;       // Summary pad
160   /** Text fields */
161   TLatex fEvent;        // Text fields
162   TLatex fFMD1Sum;      // Total in FMD1
163   TLatex fFMD2Sum;      // Total in FMD1
164   TLatex fFMD3Sum;      // Total in FMD1
165   TLine  fLine;         // Just a line 
166   TLatex fTotal;        // Total in FMD
167
168   Double_t fFMD1Area;   // 
169   Double_t fFMD2Area;   // 
170   Double_t fFMD3Area;   // 
171
172   AliPhysicsSelection* fPhysicsSelection;
173   
174   ClassDef(AliFMDPattern,0) // Display FMD data as hit-patterns. 
175 };
176
177
178 #endif
179 //____________________________________________________________________
180 //
181 // Local Variables:
182 //   mode: C++
183 // End:
184 //
185 // EOF
186 //