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 // Constant magnetic field class
20 // Used by AliRun class
22 //-------------------------------------------------------------------------
31 //________________________________________
35 fBeamType(kBeamTypepp),
44 // Default constructor
48 //________________________________________
49 AliMagFC::AliMagFC(const char *name, const char *title, Int_t integ,
50 Float_t factor, Float_t fmax)
51 : AliMagF(name,title,integ,factor,fmax),
53 fBeamType(kBeamTypepp),
63 // Standard constructor
68 //////////////////////////////////////////////////////////////////////
69 // ---- Magnetic field values (according to beam type and energy) ----
71 if(fBeamType==kBeamTypepp && fBeamEnergy==5000.){
72 fQuadGradient = 15.7145;
73 fDipoleField = 27.0558;
77 fACorr1Field = -13.2143;
78 fACorr2Field = -11.9909;
80 // Pb-Pb @ 2.7+2.7 TeV or p-p @ 7+7 TeV
82 fQuadGradient = 22.0002;
83 fDipoleField = 37.8781;
87 fACorr1Field = -13.2014;
88 fACorr2Field = -9.6908;
92 //________________________________________
93 void AliMagFC::Field(Float_t *x, Float_t *b) const
96 // Method to return the field in a point
100 if(TMath::Abs(x[2])<700 && x[0]*x[0]+(x[1]+30)*(x[1]+30) < 560*560) {
104 if(-725 >= x[2] && x[2] >= -1225 ){
105 Float_t dz = TMath::Abs(-975-x[2])*0.01;
106 b[0] = - (1-0.1*dz*dz)*7;
119 AliFatal(Form("Invalid field map for constant field %d",fMap));
123 //___________________________________________________
124 void AliMagFC::ZDCField(Float_t *x, Float_t *b) const
126 // ---- This is the ZDC part
128 Float_t rad2 = x[0] * x[0] + x[1] * x[1];
130 // SIDE C **************************************************
132 if(x[2] < kCCorrBegin && x[2] > kCCorrEnd && rad2 < kCCorrSqRadius){
137 else if(x[2] < kCQ1Begin && x[2] > kCQ1End && rad2 < kCQ1SqRadius){
138 b[0] = fQuadGradient*x[1];
139 b[1] = fQuadGradient*x[0];
142 else if(x[2] < kCQ2Begin && x[2] > kCQ2End && rad2 < kCQ2SqRadius){
143 b[0] = -fQuadGradient*x[1];
144 b[1] = -fQuadGradient*x[0];
147 else if(x[2] < kCQ3Begin && x[2] > kCQ3End && rad2 < kCQ3SqRadius){
148 b[0] = -fQuadGradient*x[1];
149 b[1] = -fQuadGradient*x[0];
152 else if(x[2] < kCQ4Begin && x[2] > kCQ4End && rad2 < kCQ4SqRadius){
153 b[0] = fQuadGradient*x[1];
154 b[1] = fQuadGradient*x[0];
157 else if(x[2] < kCD1Begin && x[2] > kCD1End && rad2 < kCD1SqRadius){
162 else if(x[2] < kCD2Begin && x[2] > kCD2End){
163 if(((x[0]-kCD2XCentre1)*(x[0]-kCD2XCentre1)+(x[1]*x[1]))<kCD2SqRadius
164 || ((x[0]-kCD2XCentre2)*(x[0]-kCD2XCentre2)+(x[1]*x[1]))<kCD2SqRadius){
165 b[1] = -fDipoleField;
172 // SIDE A **************************************************
174 if(fCompensator && (x[2] > kACorr1Begin && x[2] < kACorr1End) && rad2 < kCCorr1SqRadius) {
175 // Compensator magnet at z = 1075 m
182 if(x[2] > kACorr2Begin && x[2] < kACorr2End && rad2 < kCCorr2SqRadius){
187 else if(x[2] > kAQ1Begin && x[2] < kAQ1End && rad2 < kAQ1SqRadius){
188 // First quadrupole of inner triplet de-focussing in x-direction
189 b[0] = -fQuadGradient*x[1];
190 b[1] = -fQuadGradient*x[0];
193 else if(x[2] > kAQ2Begin && x[2] < kAQ2End && rad2 < kAQ2SqRadius){
194 b[0] = fQuadGradient*x[1];
195 b[1] = fQuadGradient*x[0];
198 else if(x[2] > kAQ3Begin && x[2] < kAQ3End && rad2 < kAQ3SqRadius){
199 b[0] = fQuadGradient*x[1];
200 b[1] = fQuadGradient*x[0];
203 else if(x[2] > kAQ4Begin && x[2] < kAQ4End && rad2 < kAQ4SqRadius){
204 b[0] = -fQuadGradient*x[1];
205 b[1] = -fQuadGradient*x[0];
208 else if(x[2] > kAD1Begin && x[2] < kAD1End && rad2 < kAD1SqRadius){
210 b[1] = -fDipoleField;
213 else if(x[2] > kAD2Begin && x[2] < kAD2End){
214 if(((x[0]-kAD2XCentre1)*(x[0]-kAD2XCentre1)+(x[1]*x[1])) < kAD2SqRadius
215 || ((x[0]-kAD2XCentre2)*(x[0]-kAD2XCentre2)+(x[1]*x[1])) < kAD2SqRadius){