1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //------------------------------------------------------------------------
19 // Magnetic field composed by 4 maps: the L3 magnet (inside and outside measured region),
20 // extended region, and dipole magnet.
21 // Used in the configuration macros (macros/Config.C, etc.)
22 // Author: Andreas Morsch <andreas.morsch@cern.ch>
23 //------------------------------------------------------------------------
31 #include "AliFieldMap.h"
32 #include "AliMagFMapsV1.h"
33 #include "AliMagFCheb.h"
35 ClassImp(AliMagFMapsV1)
38 //_______________________________________________________________________
39 AliMagFMapsV1::AliMagFMapsV1():
43 // Default constructor
47 //_______________________________________________________________________
48 AliMagFMapsV1::AliMagFMapsV1(const char *name, const char *title, Int_t integ,
49 Float_t factor, Float_t fmax, Int_t map,
51 AliMagFMaps(name, title, integ, factor, fmax, map, l3),
58 fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/mfcheb.root");
59 TFile* file = new TFile(fname);
61 fMeasuredMap = dynamic_cast<AliMagFCheb*>(file->Get("Sol12_Dip6_Hole"));
63 } else if (fMap == k5kG) {
64 fMeasuredMap = dynamic_cast<AliMagFCheb*>(file->Get("Sol30_Dip6_Hole"));
66 } else if (fMap == k4kG){
77 //_______________________________________________________________________
78 AliMagFMapsV1::~AliMagFMapsV1()
84 //_______________________________________________________________________
85 void AliMagFMapsV1::Field(Float_t *x, Float_t *b) const
88 // Method to calculate the magnetic field at position x
90 const Float_t kRmax2 = 500. * 500.;
91 const Float_t kZmax = 550.;
92 const Float_t kTeslaTokG = 10.;
93 const Float_t kScale = 0.98838; // matching factor
95 // Check if position inside measured map
96 Float_t r2 = x[0] * x[0] + x[1] * x[1];
99 TMath::Abs(x[2]) < kZmax
102 fMeasuredMap->Field(x, b);
107 AliMagFMaps::Field(x, b);
108 // Match to measure map
109 b[0] = - b[0] * kScale;
110 b[2] = - b[2] * kScale;
111 b[1] = - b[1] * kScale;
116 Float_t AliMagFMapsV1::SolenoidField() const
119 // Returns max. L3 (solenoid) field strength
120 // according to field map setting