]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDPattern.h
Adding histos
[u/mrichter/AliRoot.git] / FMD / AliFMDPattern.h
index d94f6a9a01cf04b562d481f7744323ca01a96f61..f230a04e1c7c399a5d13ced5288c4c8ab318c2f1 100644 (file)
 // various types of data produced by the FMD. 
 //
 #include "AliFMDDisplay.h"
+#include <TArrayI.h>
 #include <TObjArray.h>
-#include <TGraph.h>
+// #include <TGraph.h>
 #include <TLatex.h>
 #include <TLine.h>
+// class AliPhysicsSelection;
 class TCanvas;
 class TPad;
 class TH2;
@@ -36,20 +38,111 @@ class TH2;
 class AliFMDPattern : public AliFMDDisplay
 {
 public:
-  struct Detector 
+  /** @class AliFMDPatternDetector 
+      @brief Utility for the pattern display. 
+      The name is this long, because the code-checker even cares about
+      nested names, even though it seems a bit nit-picking and
+      retareded.   It's a class rather than a structure, because the
+      code checker thinks that structs are only for POD - sigh! */
+  class AliFMDPatternDetector 
   {
-    Detector(UShort_t id);
-    ~Detector();
+  public:
+    /** Constructor */
+    AliFMDPatternDetector(UShort_t id);
+    /** Destructor */
+    ~AliFMDPatternDetector();
+    /** Clear this detector */
     void  Clear();
+    /** Get the total number of hits */
     Int_t Total() const { return Int_t(fCounts.GetSum()); }
+    /** Called at the  end of things */ 
     void  End();
-    void  Begin(Int_t nlvl, Double_t r, TObjArray& inners, TObjArray& outers);
-    void  DrawShape(TObjArray& a);
+    /** Initiate. 
+       @param nlvl Number of levels. 
+       @param r    Radius 
+       @param inners Array of inner shapes  
+       @param outers Array of outer shapes */
+    void  Begin(Int_t nlvl, Double_t r, TObjArray& inners, 
+               TObjArray&  outers);
+    /** Draw everything 
+       @param a Array of shapes to draw */
+    void  DrawShape(const TObjArray& a);
+    /** Add a marker at specified coordinates 
+       @param X X coordinate 
+       @param Y Y coordinate 
+       @param Z Z coordinate 
+       @param max The maximum value to scale to */
     void  AddMarker(Double_t x, Double_t y, Float_t s, Float_t max);
-    Int_t     fId;
-    TArrayI   fCounts;
-    TObjArray fGraphs;
-    TH2*      fFrame;
+    /** 
+     * Get the indentifier 
+     * 
+     * @return Identifier 
+     */
+    Int_t GetId() const { return fId; }
+    /** 
+     * Get the counts array. Number of counts at each level  
+     * 
+     * @return Counts array
+     */
+    TArrayI&     GetCounts() { return fCounts; }
+    /** 
+     * Get the counts array. Number of counts at each level 
+     * 
+     * @return Counts array
+     */
+    const TArrayI& GetCounts() const { return fCounts; }
+    /** 
+     * Get the list of graphs 
+     * 
+     * @return Array of graphs - one for each level
+     */
+    TObjArray& GetGraphs() { return fGraphs; }
+    /** 
+     * Get the list of graphs 
+     * 
+     * @return Array of graphs - one for each level
+     */
+    const TObjArray& GetGraphs() const { return fGraphs; } 
+    /** 
+     * Get the mother frame
+     * 
+     * @return The mother frame 
+     */
+    TH2*& GetFrame() { return fFrame; }
+    /** 
+     * Get the mother frame
+     * 
+     * @return The mother frame 
+     */
+    const TH2* GetFrame() const { return fFrame; }  
+  private:
+    /** 
+     * Copy constructor 
+     * - Not implemented. 
+     */ 
+    AliFMDPatternDetector(const AliFMDPatternDetector&);
+    /** 
+     * Assignement operator 
+     * -- Not implemented 
+     */
+    AliFMDPatternDetector& operator=(const AliFMDPatternDetector&);
+    /** 
+     * Copy shapes
+     * 
+     * @param input  Source
+     * @param own    Ours
+     * @param ang    Angle 
+     * @param fx     Factor x
+     * @param fy     Factor y
+     */
+    void CopyShapes(const TObjArray& input, TObjArray& own, 
+                   Double_t ang=0, Double_t fx=1, Double_t fy=1);
+    Int_t     fId;     // Identifier # 
+    TArrayI   fCounts; // Number of counts at each level 
+    TObjArray fGraphs; // Array of graphs - one for each level
+    TH2*      fFrame;  // The mother frame 
+    TObjArray fInners; // Our own cache of shapes
+    TObjArray fOuters; // Our own cache of shapes
   };
   
   
@@ -67,6 +160,17 @@ public:
       @return @c false on error  */
   virtual Bool_t Begin(Int_t event);
  protected:
+  /** Copy constructor 
+      - Not implemented. */ 
+  AliFMDPattern(const AliFMDPattern&);
+  /** Assignement operator 
+      -- Not implemented */
+  AliFMDPattern& operator=(const AliFMDPattern&);
+  virtual void AddMarker(Float_t x, Float_t y, Float_t z, 
+                        TObject* o, Float_t s, Float_t min, Float_t max)
+  {
+    AliFMDDisplay::AddMarker(x, y, z, o, s, min, max);
+  }
   /** Add a marker to the display
       @param det Detector
       @param rng Ring
@@ -75,42 +179,40 @@ public:
       @param o   Object to refer to
       @param s   Signal 
       @param max Maximum of signal */
-  virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str, 
-                        TObject* o, Float_t s, Float_t max);
+  virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec,
+                        UShort_t str, TObject* o, Float_t s, 
+                        Float_t min, Float_t max);
+  /** @param hit Hit to process */
   virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle*);
+  /** Re-draw the patterns */
   virtual void Redisplay();
+  /** Called at the end. */
   virtual void AtEnd();
-  /** Graph to show shape of inner sensor */
-  TObjArray fInners;
-  /** Graph to show shape of outer sensor */
-  TObjArray fOuters;
-  /** Max inner radius */
-  Float_t fInnerMax;
-  /** Max outer radius */
-  Float_t fOuterMax;
-  /** FMD1 Pad */
-  TPad*  fFMD1Pad;
-  /** FMD1 Frame */ 
-  Detector fFMD1;
-  /** FMD2 Pad  */
-  TPad*  fFMD2Pad;
-  /** FMD2 Frame */ 
-  Detector fFMD2;
-  /** FMD3 Pad */
-  TPad*  fFMD3Pad;
-  /** FMD3 Frame */ 
-  Detector fFMD3;
-  /** Summary pad */
-  TPad* fSummary;
-  /** Text fields */
-  TLatex fEvent;
-  TLatex fFMD1Sum;
-  TLatex fFMD2Sum;
-  TLatex fFMD3Sum;
-  TLine  fLine;
-  TLatex fTotal;
+  TObjArray fInners;   // Graph to show shape of inner sensor
+  TObjArray fOuters;   // Graph to show shape of outer sensor
+  Float_t fInnerMax;   // Max inner radius
+  Float_t fOuterMax;   // Max outer radius
+  TPad*  fFMD1Pad;     // FMD1 Pad
+  AliFMDPatternDetector fFMD1; // FMD1 Frame
+  TPad*  fFMD2Pad;     // FMD2 Pad 
+  AliFMDPatternDetector fFMD2; // FMD2 Frame
+  TPad*  fFMD3Pad;     // FMD3 Pad
+  AliFMDPatternDetector fFMD3; // FMD3 Frame
+  TPad* fSummary;      // Summary pad
+  TLatex fEvent;       // Text fields
+  TLatex fFMD1Sum;     // Total in FMD1
+  TLatex fFMD2Sum;     // Total in FMD2
+  TLatex fFMD3Sum;     // Total in FMD3
+  TLine  fLine;                // Just a line 
+  TLatex fTotal;       // Total in FMD
+
+  Double_t fFMD1Area;   // estimated FMD1 area
+  Double_t fFMD2Area;   // estimated FMD2 area
+  Double_t fFMD3Area;   // estimated FMD3 area
 
-  ClassDef(AliFMDPattern,0)
+  // AliPhysicsSelection* fPhysicsSelection;
+  
+  ClassDef(AliFMDPattern,0) // Display FMD data as hit-patterns. 
 };