virtual void ReadField() {}
virtual void SetDebug(Int_t level=0) {fDebug=level;}
virtual Float_t SolenoidField() const {return 2.;}
-
virtual Int_t GetDebug() const {return fDebug;}
protected:
ClassDef(AliMagF,1) //Base class for all Alice MagField
};
-//ZDC part -------------------------------------------------------------------
-
-// ************************ LHC optics v6.4 *****************************
-static const Float_t kG1=20.443;
-static const Float_t kFDIP=-37.85;
-static const Float_t kFCORN2=-9.6979;
-//
-// ZBEG Beginning of the inner triplet
-// D1BEG Beginning of separator dipole 1
-// D2BEG Beginning of separator dipole 2
-// CORBEG Corrector dipole beginning (because of dimuon arm)
-//
-static const Float_t kCORBEG2=1972.5,kCOREND2=kCORBEG2+153., kCOR2RA2=4.5*4.5;
-//
-static const Float_t kZBEG=2296.5;
-static const Float_t kZ1BEG=kZBEG+ 0., kZ1END=kZ1BEG+637.,kZ1RA2=3.5*3.5;
-static const Float_t kZ2BEG=kZBEG+ 908.5,kZ2END=kZ2BEG+550.,kZ2RA2=3.5*3.5;
-static const Float_t kZ3BEG=kZBEG+1558.5,kZ3END=kZ3BEG+550.,kZ3RA2=3.5*3.5;
-static const Float_t kZ4BEG=kZBEG+2430., kZ4END=kZ4BEG+637.,kZ4RA2=3.5*3.5;
-static const Float_t kD1BEG=5838.3 ,kD1END=kD1BEG+945.,kD1RA2=4.5*4.5;
-static const Float_t kD2BEG=12167.8 ,kD2END=kD2BEG+945.,kD2RA2=4.5*4.5;
-//
-static const Float_t kXCEN1D2=-9.7 ,kYCEN1D2=0.;
-static const Float_t kXCEN2D2=9.7 ,kYCEN2D2=0.;
-
-//ZDC part -------------------------------------------------------------------
-
#endif
if(TMath::Abs(x[2])<700 && x[0]*x[0]+(x[1]+30)*(x[1]+30) < 560*560) {
b[2]=2;
} else {
- if ( 725 <= x[2] && x[2] <= 1225 ) {
- Float_t dz = TMath::Abs(975-x[2])*0.01;
- b[0]=(1-0.1*dz*dz)*7;
+ if ( -725 >= x[2] && x[2] >= -1225 ) {
+ Float_t dz = TMath::Abs(-975-x[2])*0.01;
+ b[0] = - (1-0.1*dz*dz)*7;
}
else {
-//This is the ZDC part
- Float_t rad2=x[0]*x[0]+x[1]*x[1];
- if(x[2]>kCORBEG2 && x[2]<kCOREND2){
- if(rad2<kCOR2RA2){
- b[0] = kFCORN2;
+ ZDCField(x, b);
}
}
- else if(x[2]>kZ1BEG && x[2]<kZ1END){
- if(rad2<kZ1RA2){
- b[0] = -kG1*x[1];
- b[1] = -kG1*x[0];
- }
+ if(fFactor!=1) {
+ b[0]*=fFactor;
+ b[1]*=fFactor;
+ b[2]*=fFactor;
}
- else if(x[2]>kZ2BEG && x[2]<kZ2END){
- if(rad2<kZ2RA2){
- b[0] = kG1*x[1];
- b[1] = kG1*x[0];
- }
+ } else {
+ printf("Invalid field map for constant field %d\n",fMap);
+ exit(1);
+ }
+}
+
+
+void AliMagFC::ZDCField(Float_t *x, Float_t *b)
+{
+//This is the ZDC part
+ Float_t rad2=x[0]*x[0]+x[1]*x[1];
+ if(x[2] < kCORBEG2 && x[2] > kCOREND2){
+ if(rad2<kCOR2RA2){
+ b[0] = - kFCORN2;
+ }
}
- else if(x[2]>kZ3BEG && x[2]<kZ3END){
- if(rad2<kZ3RA2){
- b[0] = kG1*x[1];
- b[1] = kG1*x[0];
- }
+ else if(x[2] < kZ1BEG && x[2] > kZ1END){
+ if(rad2<kZ1RA2){
+ b[0] = kG1*x[1];
+ b[1] = -kG1*x[0];
+ }
}
- else if(x[2]>kZ4BEG && x[2]<kZ4END){
- if(rad2<kZ4RA2){
- b[0] = -kG1*x[1];
- b[1] = -kG1*x[0];
- }
+ else if(x[2] < kZ2BEG && x[2] > kZ2END){
+ if(rad2<kZ2RA2){
+ b[0] = -kG1*x[1];
+ b[1] = kG1*x[0];
+ }
}
- else if(x[2]>kD1BEG && x[2]<kD1END){
- if(rad2<kD1RA2){
- b[1] = -kFDIP;
- }
+ else if(x[2] < kZ3BEG && x[2] > kZ3END){
+ if(rad2<kZ3RA2){
+ b[0] = -kG1*x[1];
+ b[1] = kG1*x[0];
+ }
}
- else if(x[2]>kD2BEG && x[2]<kD2END){
- if(((x[0]-kXCEN1D2)*(x[0]-kXCEN1D2)+(x[1]-kYCEN1D2)*(x[1]-kYCEN1D2))<kD2RA2
- || ((x[0]-kXCEN2D2)*(x[0]-kXCEN2D2)+(x[1]-kYCEN2D2)*(x[1]-kYCEN2D2))<kD2RA2){
- b[1] = kFDIP;
- }
+ else if(x[2] < kZ4BEG && x[2] > kZ4END){
+ if(rad2<kZ4RA2){
+ b[0] = kG1*x[1];
+ b[1] = -kG1*x[0];
+ }
}
-
- }
+ else if(x[2] < kD1BEG && x[2] > kD1END){
+ if(rad2<kD1RA2){
+ b[1] = -kFDIP;
+ }
}
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
+ else if(x[2] < kD2BEG && x[2] > kD2END){
+ if(((x[0]-kXCEN1D2)*(x[0]-kXCEN1D2)+(x[1]-kYCEN1D2)*(x[1]-kYCEN1D2))<kD2RA2
+ || ((x[0]-kXCEN2D2)*(x[0]-kXCEN2D2)+(x[1]-kYCEN2D2)*(x[1]-kYCEN2D2))<kD2RA2){
+ b[1] = kFDIP;
+ }
}
- } else {
- printf("Invalid field map for constant field %d\n",fMap);
- exit(1);
- }
+
}
-
virtual ~AliMagFC() {}
virtual void Field(Float_t *x, Float_t *b);
virtual void ReadField() {}
-
+ virtual void ZDCField(Float_t *x, Float_t *b);
ClassDef(AliMagFC,1) //Class for all Alice Constant MagField
};
+
+//ZDC part -------------------------------------------------------------------
+
+// ************************ LHC optics v6.4 *****************************
+static const Float_t kG1=20.443;
+static const Float_t kFDIP=-37.85;
+static const Float_t kFCORN2=-9.6979;
+//
+// ZBEG Beginning of the inner triplet
+// D1BEG Beginning of separator dipole 1
+// D2BEG Beginning of separator dipole 2
+// CORBEG Corrector dipole beginning (because of dimuon arm)
+//
+static const Float_t kCORBEG2 = -1972.5,kCOREND2 = kCORBEG2 - 153., kCOR2RA2 = 4.5 * 4.5;
+//
+static const Float_t kZBEG = -2296.5;
+static const Float_t kZ1BEG = kZBEG + 0., kZ1END = kZ1BEG - 637.,kZ1RA2 = 3.5 * 3.5;
+static const Float_t kZ2BEG = kZBEG - 908.5, kZ2END = kZ2BEG - 550.,kZ2RA2 = 3.5 * 3.5;
+static const Float_t kZ3BEG = kZBEG - 1558.5, kZ3END = kZ3BEG - 550.,kZ3RA2 = 3.5 * 3.5;
+static const Float_t kZ4BEG = kZBEG - 2430., kZ4END = kZ4BEG - 637.,kZ4RA2 = 3.5 * 3.5;
+static const Float_t kD1BEG = - 5838.3 ,kD1END = kD1BEG - 945., kD1RA2 = 4.5 * 4.5;
+static const Float_t kD2BEG = - 12167.8 ,kD2END = kD2BEG - 945., kD2RA2 = 4.5 * 4.5;
+//
+static const Float_t kXCEN1D2 = -9.7 ,kYCEN1D2 = 0.;
+static const Float_t kXCEN2D2 = 9.7 ,kYCEN2D2 = 0.;
+
+//ZDC part -------------------------------------------------------------------
+
#endif