- Change of coordinate system (x->-x, z->-z)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Sep 2003 08:02:27 +0000 (08:02 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Sep 2003 08:02:27 +0000 (08:02 +0000)
- ZDC specific code moved to AliMagFC, method ZDCField added

STEER/AliMagF.h
STEER/AliMagFC.cxx
STEER/AliMagFC.h

index 5b53ee9c9016d2c63ca82875235f650425c15d03..5c1bf646cc4b36f478fe8b783fd8c9649095a5d6 100644 (file)
@@ -25,7 +25,6 @@ public:
   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:
@@ -39,31 +38,4 @@ 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
index 83f3ba4ea45e1aa9eb2b81fd7a55b40b8e492061..d0707913aa4545c71fbd8fa07f6e430a9e5c98fe 100644 (file)
@@ -52,64 +52,69 @@ void AliMagFC::Field(Float_t *x, Float_t *b)
     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);
-  }
+    
 }
-
index 8dea7addfe6034cce1f7bc970826b2173a8c69bd..448ead7fe728cb51db86203907bf6b140c402677 100644 (file)
@@ -18,8 +18,36 @@ public:
   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