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 Revision 1.2 2000/07/12 08:56:25 fca
19 Coding convention correction and warning removal
21 Revision 1.1 2000/07/11 18:24:59 fca
22 Coding convention corrections + few minor bug fixes
31 //________________________________________
32 AliMagFC::AliMagFC(const char *name, const char *title, const Int_t integ,
33 const Int_t map, const Float_t factor, const Float_t fmax)
34 : AliMagF(name,title,integ,map,factor,fmax)
37 // Standard constructor
39 printf("Constant Field %s created: map= %d, factor= %f\n",fName.Data(),map,
44 //________________________________________
45 void AliMagFC::Field(Float_t *x, Float_t *b)
48 // Method to return the field in a point
52 if(TMath::Abs(x[2])<700 && x[0]*x[0]+(x[1]+30)*(x[1]+30) < 560*560) {
55 if ( 725 <= x[2] && x[2] <= 1225 ) {
56 Float_t dz = TMath::Abs(975-x[2])*0.01;
60 //This is the ZDC part
61 Float_t rad2=x[0]*x[0]+x[1]*x[1];
62 if(x[2]>kCORBEG1 && x[2]<kCOREND1){
67 else if(x[2]>kCORBEG2 && x[2]<kCOREND2){
72 else if(x[2]>kZ1BEG && x[2]<kZ1END){
78 else if(x[2]>kZ2BEG && x[2]<kZ2END){
84 else if(x[2]>kZ3BEG && x[2]<kZ3END){
90 else if(x[2]>kZ4BEG && x[2]<kZ4END){
96 else if(x[2]>kD1BEG && x[2]<kD1END){
101 else if(x[2]>kD2BEG && x[2]<kD2END){
102 if(((x[0]-kXCEN1D2)*(x[0]-kXCEN1D2)+(x[1]-kYCEN1D2)*(x[1]-kYCEN1D2))<kD2RA2
103 || ((x[0]-kXCEN2D2)*(x[0]-kXCEN2D2)+(x[1]-kYCEN2D2)*(x[1]-kYCEN2D2))<kD2RA2){
116 printf("Invalid field map for constant field %d\n",fMap);