]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliMagFC.cxx
Coding convention correction and warning removal
[u/mrichter/AliRoot.git] / STEER / AliMagFC.cxx
CommitLineData
aee8290b 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/*
17$Log$
8918e700 18Revision 1.1 2000/07/11 18:24:59 fca
19Coding convention corrections + few minor bug fixes
20
aee8290b 21*/
22
23#include "AliMagFC.h"
8918e700 24#include <stdlib.h>
aee8290b 25
26ClassImp(AliMagFC)
27
28//________________________________________
29AliMagFC::AliMagFC(const char *name, const char *title, const Int_t integ,
30 const Int_t map, const Float_t factor, const Float_t fmax)
31 : AliMagF(name,title,integ,map,factor,fmax)
32{
33 //
34 // Standard constructor
35 //
36 printf("Constant Field %s created: map= %d, factor= %f\n",fName.Data(),map,
37 factor);
38 fType = kConst;
39}
40
41//________________________________________
42void AliMagFC::Field(Float_t *x, Float_t *b)
43{
44 //
45 // Method to return the field in a point
46 //
47 b[0]=b[1]=b[2]=0;
48 if(fMap==1) {
49 if(TMath::Abs(x[2])<700 && x[0]*x[0]+(x[1]+30)*(x[1]+30) < 560*560) {
50 b[2]=2;
51 } else {
52 if ( 725 <= x[2] && x[2] <= 1225 ) {
53 Float_t dz = TMath::Abs(975-x[2])*0.01;
54 b[0]=(1-0.1*dz*dz)*7;
55 }
56 else {
57//This is the ZDC part
58 Float_t rad2=x[0]*x[0]+x[1]*x[1];
59 if(rad2<kD2RA2) {
60 if(x[2]>kD2BEG) {
61
62// Separator Dipole D2
63 if(x[2]<kD2END) b[1]=kFDIP;
64 } else if(x[2]>kD1BEG) {
65
66// Separator Dipole D1
67 if(x[2]<kD1END) b[1]=-kFDIP;
68 }
69 if(rad2<kCORRA2) {
70
71// First quadrupole of inner triplet de-focussing in x-direction
72// Inner triplet
73 if(x[2]>kZ4BEG) {
74 if(x[2]<kZ4END) {
75
76// 2430 <-> 3060
77 b[0]=-kG1*x[1];
78 b[1]=-kG1*x[0];
79 }
80 } else if(x[2]>kZ3BEG) {
81 if(x[2]<kZ3END) {
82
83// 1530 <-> 2080
84 b[0]=kG1*x[1];
85 b[1]=kG1*x[0];
86 }
87 } else if(x[2]>kZ2BEG) {
88 if(x[2]<kZ2END) {
89
90// 890 <-> 1430
91 b[0]=kG1*x[1];
92 b[1]=kG1*x[0];
93 }
94 } else if(x[2]>kZ1BEG) {
95 if(x[2]<kZ1END) {
96
97// 0 <-> 630
98 b[0]=-kG1*x[1];
99 b[1]=-kG1*x[0];
100 }
101 } else if(x[2]>kCORBEG) {
102 if(x[2]<kCOREND) {
103// Corrector dipole (because of dimuon arm)
104 b[0]=kFCORN;
105 }
106 }
107 }
108 }
109 }
110 }
111 if(fFactor!=1) {
112 b[0]*=fFactor;
113 b[1]*=fFactor;
114 b[2]*=fFactor;
115 }
116 } else {
117 printf("Invalid field map for constant field %d\n",fMap);
118 exit(1);
119 }
120}
121