From ef79795d66eeea5e9faabeceb87e83a228eb7127 Mon Sep 17 00:00:00 2001 From: vestbo Date: Thu, 2 May 2002 14:23:15 +0000 Subject: [PATCH] Added the magnetic field as a static member of the AliL3Transform class, 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 | 5 +++-- HLT/src/AliL3ConfMapTrack.cxx | 7 ++++--- HLT/src/AliL3ConfMapper.cxx | 3 ++- HLT/src/AliL3Defs.h | 1 - HLT/src/AliL3Display.cxx | 1 + HLT/src/AliL3Track.cxx | 2 +- HLT/src/AliL3Transform.cxx | 1 + HLT/src/AliL3Transform.h | 3 +++ 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/HLT/src/AliL3ConfMapFit.cxx b/HLT/src/AliL3ConfMapFit.cxx index 4478370182a..57386993533 100644 --- a/HLT/src/AliL3ConfMapFit.cxx +++ b/HLT/src/AliL3ConfMapFit.cxx @@ -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(); diff --git a/HLT/src/AliL3ConfMapTrack.cxx b/HLT/src/AliL3ConfMapTrack.cxx index fc6447fd055..a0908347798 100644 --- a/HLT/src/AliL3ConfMapTrack.cxx +++ b/HLT/src/AliL3ConfMapTrack.cxx @@ -10,6 +10,7 @@ #include "AliL3ConfMapPoint.h" #include "AliL3ConfMapFit.h" #include "AliL3ConfMapTrack.h" +#include "AliL3Transform.h" #include //_____________________________________________________________ @@ -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) ; diff --git a/HLT/src/AliL3ConfMapper.cxx b/HLT/src/AliL3ConfMapper.cxx index fc287a663b6..7e5934811bb 100644 --- a/HLT/src/AliL3ConfMapper.cxx +++ b/HLT/src/AliL3ConfMapper.cxx @@ -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 "<Reset(); } diff --git a/HLT/src/AliL3Defs.h b/HLT/src/AliL3Defs.h index af3554a0d44..59f919e85c8 100644 --- a/HLT/src/AliL3Defs.h +++ b/HLT/src/AliL3Defs.h @@ -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_ */ diff --git a/HLT/src/AliL3Display.cxx b/HLT/src/AliL3Display.cxx index 9e91787b984..c743055d86c 100644 --- a/HLT/src/AliL3Display.cxx +++ b/HLT/src/AliL3Display.cxx @@ -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++) diff --git a/HLT/src/AliL3Track.cxx b/HLT/src/AliL3Track.cxx index 6f85aac86ea..e8d908e2ada 100644 --- a/HLT/src/AliL3Track.cxx +++ b/HLT/src/AliL3Track.cxx @@ -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; diff --git a/HLT/src/AliL3Transform.cxx b/HLT/src/AliL3Transform.cxx index e1f6be93aac..bd6c4fd376b 100644 --- a/HLT/src/AliL3Transform.cxx +++ b/HLT/src/AliL3Transform.cxx @@ -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 ; diff --git a/HLT/src/AliL3Transform.h b/HLT/src/AliL3Transform.h index eab53b8828d..0ec7810d16a 100644 --- a/HLT/src/AliL3Transform.h +++ b/HLT/src/AliL3Transform.h @@ -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;} -- 2.43.0