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"
34 ClassImp(AliMagFMapsV1)
37 //_______________________________________________________________________
38 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){
78 //_______________________________________________________________________
79 AliMagFMapsV1::AliMagFMapsV1(const AliMagFMapsV1 &magf):
89 //_______________________________________________________________________
90 AliMagFMapsV1::~AliMagFMapsV1()
96 //_______________________________________________________________________
97 void AliMagFMapsV1::Field(Float_t *x, Float_t *b) const
100 // Method to calculate the magnetic field at position x
102 const Float_t kRmax2 = 500. * 500.;
103 const Float_t kZmax = 550.;
104 const Float_t kTeslaTokG = 10.;
105 const Float_t kScale = 0.98838; // matching factor
107 // Check if position inside measured map
108 Float_t r2 = x[0] * x[0] + x[1] * x[1];
111 TMath::Abs(x[2]) < kZmax
114 fMeasuredMap->Field(x, b);
119 AliMagFMaps::Field(x, b);
120 // Match to measure map
121 b[0] = - b[0] * kScale;
122 b[2] = - b[2] * kScale;
123 b[1] = - b[1] * kScale;
128 Float_t AliMagFMapsV1::SolenoidField() const
131 // Returns max. L3 (solenoid) field strength
132 // according to field map setting
137 void AliMagFMapsV1::Copy(TObject &fm) const
139 // dummy since the base class constructor is dummy
140 AliMagFMaps::Copy(fm);
141 AliMagFMapsV1* fmp = (AliMagFMapsV1*) &fm;
142 fmp->SetMeasuredMap(fMeasuredMap);