]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv11Geometry.h
load AddTaskEmcalJet.C
[u/mrichter/AliRoot.git] / ITS / AliITSv11Geometry.h
index 8b3bea7718ac8a76154c94e25b67a0796eea1b6d..866c74488ddb47acc02aac4cb6ac7902eab2e908 100644 (file)
@@ -11,6 +11,7 @@
   Base class for defining large parts of the ITS geometry, v11.
  */
 #include <TObject.h>
+#include <AliLog.h>
 class TGeoArb8;
 class TGeoPcon;
 class TGeoTube;
@@ -20,16 +21,16 @@ class TGeoBBox;
 
 class AliITSv11Geometry : public TObject {
   public:
-    AliITSv11Geometry(){fDebug=kTRUE;};
-    AliITSv11Geometry(Bool_t debug){fDebug=debug;};
+    AliITSv11Geometry():fDebug(AliDebugLevel()) {};
+    AliITSv11Geometry(Int_t debug):fDebug(debug) {};
     virtual ~AliITSv11Geometry(){};
     //
     // Sets the debug flag for debugging output
-    void SetDebug(){fDebug=kTRUE;}
+    void SetDebug(Int_t level=5){fDebug=level;}
     // Clears the debug flag so no debugging output will be generated
-    void SetNoDebug(){fDebug=kFALSE;}
+    void SetNoDebug(){fDebug=0;}
     // Returns the debug flag value
-    Bool_t GetDebug()const {return fDebug;}
+    Bool_t GetDebug(Int_t level=1)const {return fDebug>=level;}
     //
     // Static functions
     //
@@ -40,6 +41,15 @@ class AliITSv11Geometry : public TObject {
     Double_t CosD(Double_t deg)const{return TMath::Cos(deg*TMath::DegToRad());}
     // Tangent function
     Double_t TanD(Double_t deg)const{return TMath::Tan(deg*TMath::DegToRad());}
+    // Determine the intersection of two lines
+    void IntersectLines(Double_t m, Double_t x0, Double_t y0,
+                       Double_t n, Double_t x1, Double_t y1,
+                       Double_t &xi, Double_t &yi)const;
+    // Determine the intersection of a line and a circle
+    static Bool_t IntersectCircle(Double_t m, Double_t x0, Double_t y0,
+                          Double_t rr, Double_t xc, Double_t yc,
+                                 Double_t &xi1, Double_t &yi1,
+                          Double_t &xi2, Double_t &yi2);
     // Given the line, defined by the two points (x0,y0) and (x1,y1) and the
     // point x, return the value of y.
     Double_t Yfrom2Points(Double_t x0,Double_t y0,
@@ -104,7 +114,7 @@ class AliITSv11Geometry : public TObject {
     void InsidePoint(const TGeoPcon *p,Int_t i1,Int_t i2,Int_t i3,
                         Double_t Cthick,TGeoPcon *q,Int_t j1,Bool_t max)const;
     // Given two intersecting lines defined by the points (x0,y0), (x1,y1) and
-    // (x1,y1), (x1,y2) {intersecting at (x1,y1)} the point (x,y) a distance
+    // (x1,y1), (x2,y2) {intersecting at (x1,y1)} the point (x,y) a distance
     // c away is returned such that two lines a distance c away from the
     // lines defined above intersect at (x,y).
      void InsidePoint(Double_t x0,Double_t y0,Double_t x1,Double_t y1,
@@ -136,16 +146,49 @@ class AliITSv11Geometry : public TObject {
                           Int_t linec=3,Int_t lines=1,Int_t linew=4,
                           Int_t markc=2,Int_t marks=4,
                           Float_t marksize=1.0) const;
+    // Compute the angles where a line intersects a circle.
+    Bool_t AngleOfIntersectionWithLine(Double_t x0,Double_t y0,
+                                       Double_t x1,Double_t y1,
+                                       Double_t xc,Double_t yc,
+                                       Double_t rc,Double_t &t0,
+                                       Double_t &t1)const;
+    void AnglesForRoundedCorners(Double_t x0,Double_t y0,Double_t r0,
+                                 Double_t x1,Double_t y1,Double_t r1,
+                                 Double_t &t0,Double_t &t1)const;
+    // Define a general CreateMaterials function here so that if
+    // any specific subdetector does not define it this null function
+    // will due. This function is not declaired const so that a sub-
+    // detector's version may use class variables if they wish.
+    void CreateDefaultMaterials();
+    virtual void CreateMaterials(){};
+    // Function to create figure needed for this class' documentation
+    void MakeFigure1(Double_t x0=0.0,Double_t y0=0.0,Double_t r0=2.0,
+                     Double_t x1=-4.0,Double_t y1=-2.0,Double_t r1=1.0);
   protected:
 
     // Units, Convert from k?? to cm,degree,GeV,seconds,
+    static const Double_t fgkmicron; // Convert micron to TGeom's cm.
     static const Double_t fgkmm; // Convert mm to TGeom's cm.
-    static const Double_t fgkcm; // Convert cv to TGeom's cm.
+    static const Double_t fgkcm; // Convert cm to TGeom's cm.
     static const Double_t fgkDegree; //Convert degrees to TGeom's degrees
     static const Double_t fgkRadian; //To Radians
+    static const Double_t fgkgcm3;   // Density in g/cm^3
+    static const Double_t fgkKgm3;   // Density in kg/m^3
+    static const Double_t fgkKgdm3;   // Density in kg/dm^3
+    static const Double_t fgkCelsius; // Temperature in degrees Celcius
+    static const Double_t fgkPascal;  // Preasure in Pascal
+    static const Double_t fgkKPascal;  // Preasure in KPascal
+    static const Double_t fgkeV;  // Energy in eV
+    static const Double_t fgkKeV;  // Energy in KeV
+    static const Double_t fgkMeV;  // Energy in MeV
+    static const Double_t fgkGeV;  // Energy in GeV
 
   private:
-    Bool_t fDebug; //! Debug flag
+    Double_t AngleForRoundedCorners0(Double_t dx,Double_t dy,
+                                     Double_t sdr)const;
+    Double_t AngleForRoundedCorners1(Double_t dx,Double_t dy,
+                                     Double_t sdr)const;
+    Int_t fDebug; //! Debug flag/level
     ClassDef(AliITSv11Geometry,1) // Base class for ITS v11 geometry
 };