]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added calculation of a strip in a FMD ring
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Jan 2009 14:54:31 +0000 (14:54 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Jan 2009 14:54:31 +0000 (14:54 +0000)
FMD/AliFMDRing.cxx
FMD/AliFMDRing.h

index f23b955606b71ce783ac685abca909a6447e93db..376a2ce0831c203867a74006f0367e18bc1844c6 100644 (file)
@@ -310,8 +310,57 @@ AliFMDRing::XYZ2Detector(Double_t  x,
   sector = sec;
   return kTRUE;
 }
-
-
+//____________________________________________________________________
+Float_t 
+AliFMDRing::GetStripLength(UShort_t strip) const 
+{
+  if(strip >= GetNStrips())
+    Error("GetStripLength", "Invalid strip number %d (>=%d)", 
+         strip, GetNStrips(), fId);
+  
+  Float_t rad        = GetMaxR()-GetMinR();
+  
+  Float_t segment    = rad / GetNStrips();
+  
+  TVector2* corner1  = GetVertex(2);  
+  TVector2* corner2  = GetVertex(3);
+  
+  Float_t slope      = (corner1->Y() - corner2->Y()) / (corner1->X() - corner2->X());
+  Float_t constant   = (corner2->Y()*corner1->X()-(corner2->X()*corner1->Y())) / (corner1->X() - corner2->X());
+  Float_t radius     = GetMinR() + strip*segment;
+  
+  Float_t d          = TMath::Power(TMath::Abs(radius*slope),2) + TMath::Power(radius,2) - TMath::Power(constant,2);
+  
+  Float_t arclength  = GetBaseStripLength(strip);
+  if(d>0) {
+    
+    Float_t x        = (-1*TMath::Sqrt(d) -slope*constant) / (1+TMath::Power(slope,2));
+    Float_t y        = slope*x + constant;
+    Float_t theta    = TMath::ATan2(x,y);
+    
+    if(x < corner1->X() && y > corner1->Y()) {
+      arclength = radius*theta;                        //One sector since theta is by definition half-hybrid
+      
+    }
+    
+  }
+  
+  return arclength;
+  
+  
+}
+//____________________________________________________________________
+Float_t 
+AliFMDRing::GetBaseStripLength(UShort_t strip) const 
+{  
+  Float_t rad             = GetMaxR()-GetMinR();
+  Float_t segment         = rad / GetNStrips();
+  Float_t basearc         = 2*TMath::Pi() / (0.5*GetNSectors()); // One hybrid: 36 degrees inner, 18 outer
+  Float_t radius          = GetMinR() + strip*segment;
+  Float_t basearclength   = 0.5*basearc * radius;                // One sector   
+  
+  return basearclength;
+}
 //
 // EOF
 //
index 3861aba99a0073813297e56a2c0cb7015d29266b..b2914d3f95959558ee172a58f5ceb23740435b10 100644 (file)
@@ -376,8 +376,22 @@ public:
    * @return The foot position of stand-off @a i 
    */  
   TVector2* GetFootPosition(Int_t i) const;
-    
-     
+  /** 
+   * Get the real length of a strip
+   * 
+   * @param strip strip number
+   * 
+   * @return length of strip 
+   */ 
+  Float_t GetStripLength(UShort_t strip) const ;
+  /** 
+   * Get the length of a strip assuming the corners are not cut off
+   * 
+   * @param strip strip number
+   * 
+   * @return length of strip w/o corners 
+   */ 
+  Float_t GetBaseStripLength(UShort_t strip) const ;
   /** Not used */
   void Detector2XYZ(UShort_t sector, UShort_t strip, 
                    Double_t& x, Double_t& y, Double_t& z) const;