]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added the magnetic field as a static member of the AliL3Transform class,
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 May 2002 14:23:15 +0000 (14:23 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 May 2002 14:23:15 +0000 (14:23 +0000)
together with setter and getter. This makes it possible to change the
field without recompiling. Earlier this had to be set in AliL3Defs.h as
a constant global variable.

HLT/src/AliL3ConfMapFit.cxx
HLT/src/AliL3ConfMapTrack.cxx
HLT/src/AliL3ConfMapper.cxx
HLT/src/AliL3Defs.h
HLT/src/AliL3Display.cxx
HLT/src/AliL3Track.cxx
HLT/src/AliL3Transform.cxx
HLT/src/AliL3Transform.h

index 4478370182a3536b50749f9161eff0eba3f5df28..573869935336d2ab1db264d55a934177ae5324a6 100644 (file)
@@ -11,6 +11,7 @@
 #include "AliL3Vertex.h"
 #include "AliL3ConfMapTrack.h"
 #include "AliL3ConfMapPoint.h"
+#include "AliL3Transform.h"
 
 //_____________________________________________________________
 // AliL3ConfMapFit
@@ -373,7 +374,7 @@ Int_t AliL3ConfMapFit::FitCircle()
   psi  = psi + q * 0.5F * pi ;
   if ( psi < 0 ) psi = psi + 2*pi;
   
-  pt   = (Double_t)(BFACT * BField * radius ) ;
+  pt   = (Double_t)(BFACT * AliL3Transform::GetBField() * radius ) ;
   fTrack->SetPsi(psi);
   fTrack->SetPt(pt);
 
@@ -403,7 +404,7 @@ Int_t AliL3ConfMapFit::FitLine ( )
   //find sum , sums ,sumz, sumss 
   // 
   Double_t dx, dy ;
-  Double_t radius = (Double_t)(fTrack->GetPt() / ( BFACT * BField ) ) ;
+  Double_t radius = (Double_t)(fTrack->GetPt() / ( BFACT * AliL3Transform::GetBField() ) ) ;
 
   //TObjArray *hits = fTrack->GetHits();
   //Int_t num_of_hits = fTrack->GetNumberOfPoints();
index fc6447fd055468cfae85f798b460130f662b94c7..a09083477984017cd0116ad835d7f56a0bafc83e 100644 (file)
@@ -10,6 +10,7 @@
 #include "AliL3ConfMapPoint.h"
 #include "AliL3ConfMapFit.h"
 #include "AliL3ConfMapTrack.h"
+#include "AliL3Transform.h"
 #include <math.h>
 
 //_____________________________________________________________
@@ -165,8 +166,8 @@ void AliL3ConfMapTrack::Fill(AliL3Vertex *vertex,Double_t max_Dca)
   Double_t radius = sqrt(a2Xy*a2Xy+1)/(2*fabs(a1Xy));
   SetRadius(radius);
 
-  //fPt = (Double_t)(BFACT * BField * fRadius);
-  Double_t pt = (Double_t)(BFACT * BField * GetRadius());
+  //fPt = (Double_t)(BFACT * AliL3Transform::GetBField() * fRadius);
+  Double_t pt = (Double_t)(BFACT * AliL3Transform::GetBField() * GetRadius());
   SetPt(pt);
 
   if(GetPt() > max_Dca) //go for fit of helix in real space
@@ -204,7 +205,7 @@ void AliL3ConfMapTrack::UpdateToFirstPoint()
   Double_t tPhi0 = GetPsi() + GetCharge() * 0.5 * pi / fabs(GetCharge()) ;
   Double_t x0    = GetR0() * cos(GetPhi0()) ;
   Double_t y0    = GetR0() * sin(GetPhi0()) ;
-  Double_t rc    = fabs(GetPt()) / ( BFACT * BField )  ;
+  Double_t rc    = fabs(GetPt()) / ( BFACT * AliL3Transform::GetBField() )  ;
   Double_t xc    = x0 - rc * cos(tPhi0) ;
   Double_t yc    = y0 - rc * sin(tPhi0) ;
   
index fc287a663b6b8fe42c5122d25020b199d8322725..7e5934811bb67650686f6f5fedb8012b065ea9e7 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliL3ConfMapTrack.h"
 #include "AliL3ConfMapPoint.h"
 #include "AliL3TrackArray.h"
+#include "AliL3Transform.h"
 
 //_____________________________________________________________
 // AliL3ConfMapper
@@ -143,7 +144,7 @@ void AliL3ConfMapper::InitSector(Int_t sector,Int_t *rowrange,Float_t *etarange)
   
   fNumRowSegment = fRowMax - fRowMin; //number of rows to be considered by tracker
   LOG(AliL3Log::kInformational,"AliL3ConfMapper::InitSector","B-field")
-    <<"Tracker initializing assuming magnetic field of "<<BField<<ENDLOG;
+    <<"Tracker initializing assuming magnetic field of "<<AliL3Transform::GetBField()<<ENDLOG;
   
   fTrack->Reset();
 }
index af3554a0d449c27e9241459dcc435cf0a3cc7512..59f919e85c889e33c538cf05d4eec3ca3a4e9a3c 100644 (file)
@@ -11,6 +11,5 @@ const Double_t Pi = 3.14159265358979323846;
 const Double_t ToRad = Pi/180.;
 const Int_t MaxNPads = 256;
 const Int_t MaxNTimeBins = 512;
-const Double_t BField = 0.2;
 
 #endif /* _ALIL3DEFS_H_ */
index 9e91787b984c393aa246223d47bcc1f1e3cf8ee3..c743055d86ccc31c463c8f6cb5ad50188509f43d 100644 (file)
@@ -71,6 +71,7 @@ void AliL3Display::Setup(Char_t *trackfile,Char_t *path)
 {
   //Read in the hit and track information from produced files.
   
+  AliL3Transform::Init(path);
   Char_t fname[256];
   AliL3MemHandler *clusterfile[36][6];
   for(Int_t s=fMinSlice; s<=fMaxSlice; s++)
index 6f85aac86eae8b94e4b4bcf0ade7c538308c677a..e8d908e2ada52ef47d1b274f143b35ecbc8ffe4c 100644 (file)
@@ -155,7 +155,7 @@ void AliL3Track::CalculateHelix(){
   //Calculate Radius, CenterX and Centery from Psi, X0, Y0
   //
   
-  fRadius = fPt / (BFACT*BField);
+  fRadius = fPt / (BFACT*AliL3Transform::GetBField());
   if(fRadius) fKappa = -fQ*1./fRadius;
   else fRadius = 999999;  //just zero
   Double_t trackPhi0 = fPsi + fQ *0.5 * pi;
index e1f6be93aac63552c532e370ab04794575744257..bd6c4fd376b59aaa876c5a309a9d6cdd75a9506b 100644 (file)
@@ -34,6 +34,7 @@
 
 ClassImp(AliL3Transform)
 
+Double_t AliL3Transform::fBField = 0.2;
 Int_t AliL3Transform::fVersion = 0;
 Int_t AliL3Transform::fNTimeBins = 446 ;
 Int_t AliL3Transform::fNRowLow = 64 ;
index eab53b8828d150d8ed79b3b1b8c0101b7057a94a..0ec7810d16a24c5b6577b2c7dfbd848c37335f9d 100644 (file)
@@ -7,6 +7,7 @@ class AliL3Transform {
 
  private:
   
+  static Double_t fBField;
   static Int_t fNTimeBins;
   static Int_t fNRowLow;
   static Int_t fNRowUp;
@@ -31,6 +32,8 @@ class AliL3Transform {
   
   static void Init(const Char_t* path); //new init for all AliRoot versions
   
+  static void SetBField(Double_t f) {fBField = f;}
+  static Double_t GetBField() {return fBField;}
   static Int_t GetVersion(){return fVersion;}
   static Double_t GetPadPitchWidthLow() {return fPadPitchWidthLow;}
   static Double_t GetPadPitchWidthUp() {return fPadPitchWidthUp;}