]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coding convention corrections + few minor bug fixes
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Jul 2000 18:25:01 +0000 (18:25 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Jul 2000 18:25:01 +0000 (18:25 +0000)
42 files changed:
EVGEN/AliGenBox.cxx
EVGEN/AliGenExtFile.cxx
EVGEN/AliGenHIJINGpara.cxx
EVGEN/AliGenHijing.cxx
EVGEN/AliGenParam.cxx
EVGEN/AliGenPythia.cxx
GEANT321/gtrak/gtreveroot.F [moved from GEANT321/gtrak/gtreve_root.F with 97% similarity]
MUON/Config.C
RICH/Config.C
STEER/AliDisplay.cxx
STEER/AliDisplay.h
STEER/AliGenerator.cxx
STEER/AliGenerator.h
STEER/AliHit.cxx
STEER/AliLego.h
STEER/AliMC.cxx
STEER/AliMC.h
STEER/AliMagF.cxx
STEER/AliMagF.h
STEER/AliMagFC.cxx [new file with mode: 0644]
STEER/AliMagFC.h [new file with mode: 0644]
STEER/AliMagFCM.cxx [new file with mode: 0644]
STEER/AliMagFCM.h [new file with mode: 0644]
STEER/AliMagFDM.cxx [new file with mode: 0644]
STEER/AliMagFDM.h [new file with mode: 0644]
STEER/AliModule.cxx
STEER/AliModule.h
STEER/AliPoints.cxx
STEER/AliPoints.h
STEER/AliRecPoint.cxx
STEER/AliRecPoint.h
STEER/AliRun.cxx
STEER/AliRun.h
STEER/AliSegmentation.h
STEER/Makefile
TGeant3/AliGeant3.cxx
TGeant3/TGeant3.cxx
TGeant3/TGeant3.h
TGeant3/TGeant3Dummy.cxx
TGeant4/TGeant4.cxx
TGeant4/TGeant4.h
macros/Config_gener.C

index 52cc3101356511fa580fb3da2807d013c7083a6c..1613e15b838d62db0ec082dc94a44f5315be445b 100644 (file)
 
 /*
 $Log$
+Revision 1.1  2000/06/09 20:22:58  morsch
+Same class as previously in AliSimpleGen.cxx
+All coding rule violations except RS3 corrected (AM)
+
 */
 
 /*
@@ -100,7 +104,7 @@ void AliGenBox::Generate()
     Float_t random[6];
   //
     for (j=0;j<3;j++) origin[j]=fOrigin[j];
-    if(fVertexSmear==perEvent) {
+    if(fVertexSmear==kPerEvent) {
        gMC->Rndm(random,6);
        for (j=0;j<3;j++) {
            origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
@@ -123,7 +127,7 @@ void AliGenBox::Generate()
        p[1] = pt*TMath::Sin(phi);
        p[2] = pmom*TMath::Cos(theta);
 
-       if(fVertexSmear==perTrack) {
+       if(fVertexSmear==kPerTrack) {
            gMC->Rndm(random,6);
            for (j=0;j<3;j++) {
                origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
index 7950715cb40ef317b2bd0bb4b6dc320f7fe0b274..610664f69180360402293840ac46dfa51208898a 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.9  2000/06/14 15:20:09  morsch
+Include clean-up (IH)
+
 Revision 1.8  2000/06/09 20:36:44  morsch
 All coding rule violations except RS3 corrected
 
@@ -134,7 +137,7 @@ void AliGenExtFile::Generate()
   Int_t i6=fIhead[5];
 
   for (j=0;j<3;j++) origin[j]=fOrigin[j];
-  if(fVertexSmear==perEvent) {
+  if(fVertexSmear==kPerTrack) {
     gMC->Rndm(random,6);
     for (j=0;j<3;j++) {
        origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
@@ -177,7 +180,7 @@ void AliGenExtFile::Generate()
          p[1]=prwn*TMath::Sin(fTheta)*TMath::Sin(fPhi);      
          p[2]=prwn*TMath::Cos(fTheta);
          
-         if(fVertexSmear==perTrack) {
+         if(fVertexSmear==kPerTrack) {
              gMC->Rndm(random,6);
              for (j=0;j<3;j++) {
                  origin[j]=fOrigin[j]
index 6fef731fbf37968a94aa212e31bd2e7881266177..3efb3a7627d621fb2b47ddeedd8d9af539d4dd02 100644 (file)
 
 /*
 $Log$
+Revision 1.1  2000/06/09 20:20:30  morsch
+Same class as previously in AliSimpleGen.cxx
+All coding rule violations except RS3 corrected (AM)
+
 */
 ///////////////////////////////////////////////////////////////////
 //                                                               //
@@ -248,7 +252,7 @@ void AliGenHIJINGpara::Generate()
     Float_t random[6];
     //
     for (j=0;j<3;j++) origin[j]=fOrigin[j];
-    if(fVertexSmear==perEvent) {
+    if(fVertexSmear==kPerEvent) {
        gMC->Rndm(random,6);
        for (j=0;j<3;j++) {
            origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
@@ -277,7 +281,7 @@ void AliGenHIJINGpara::Generate()
            p[0]=pt*TMath::Cos(phi);
            p[1]=pt*TMath::Sin(phi);
            p[2]=pl;
-           if(fVertexSmear==perTrack) {
+           if(fVertexSmear==kPerTrack) {
                gMC->Rndm(random,6);
                for (j=0;j<3;j++) {
                    origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
index bff0c38c4731ac3ea3812701febdf6dec6133a55..5939d32d4306e0e4764241d9d5da6ee6d507b056 100644 (file)
 
 /*
 $Log$
+Revision 1.3  2000/06/30 12:08:36  morsch
+In member data: char* replaced by TString, Init takes care of resizing the strings to
+8 characters required by Hijing.
+
 Revision 1.2  2000/06/15 14:15:05  morsch
 Add possibility for heavy flavor selection: charm and beauty.
 
@@ -114,14 +118,14 @@ void AliGenHijing::Generate()
     
     fTrials=0;
     for (j=0;j<3;j++) origin0[j]=fOrigin[j];
-    if(fVertexSmear==perEvent) {
+    if(fVertexSmear==kPerEvent) {
        gMC->Rndm(random,6);
        for (j=0;j<3;j++) {
            origin0[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
                TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
 //         fHijing->SetMSTP(151,0);
        }
-    } else if (fVertexSmear==perTrack) {
+    } else if (fVertexSmear==kPerTrack) {
 //     fHijing->SetMSTP(151,0);
        for (j=0;j<3;j++) {
 //         fHijing->SetPARP(151+j, fOsigma[j]*10.);
index d98ef7ba94636b2845e43788a3f7ad664ecb2c98..13f4af9cf0b1d7a9c2dd3751753653fb9caae490 100644 (file)
 
 /*
 $Log$
+Revision 1.18  2000/06/29 21:08:27  morsch
+All paramatrisation libraries derive from the pure virtual base class AliGenLib.
+This allows to pass a pointer to a library directly to AliGenParam and avoids the
+use of function pointers in Config.C.
+
 Revision 1.17  2000/06/09 20:33:30  morsch
 All coding rule violations except RS3 corrected
 
@@ -277,7 +282,7 @@ void AliGenParam::Generate()
  
 // Calculating vertex position per event
   for (j=0;j<3;j++) origin0[j]=fOrigin[j];
-  if(fVertexSmear==perEvent) {
+  if(fVertexSmear==kPerEvent) {
       gMC->Rndm(random,6);
       for (j=0;j<3;j++) {
          origin0[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
@@ -323,7 +328,7 @@ void AliGenParam::Generate()
          p[0]=pt*TMath::Cos(phi);
          p[1]=pt*TMath::Sin(phi);
          p[2]=pl;
-         if(fVertexSmear==perTrack) {
+         if(fVertexSmear==kPerTrack) {
              gMC->Rndm(random,6);
              for (j=0;j<3;j++) {
                  origin0[j]=
index 03dbfcdd286db6de331b1134babf28768b408727..fb6a752ac900d39eaa38fc0babf085a4c17b7758 100644 (file)
 
 /*
 $Log$
+Revision 1.18  2000/06/30 12:40:34  morsch
+Pythia takes care of vertex smearing. Correct conversion from Pythia units (mm) to
+Geant units (cm).
+
 Revision 1.17  2000/06/09 20:34:07  morsch
 All coding rule violations except RS3 corrected
 
@@ -181,12 +185,12 @@ void AliGenPythia::Generate()
     
     fTrials=0;
     for (j=0;j<3;j++) origin0[j]=fOrigin[j];
-    if(fVertexSmear==perEvent) {
+    if(fVertexSmear==kPerEvent) {
        fPythia->SetMSTP(151,1);
        for (j=0;j<3;j++) {
            fPythia->SetPARP(151+j, fOsigma[j]/10.);
        }
-    } else if (fVertexSmear==perTrack) {
+    } else if (fVertexSmear==kPerTrack) {
        fPythia->SetMSTP(151,0);
     }
     
similarity index 97%
rename from GEANT321/gtrak/gtreve_root.F
rename to GEANT321/gtrak/gtreveroot.F
index a41f93a1f05423523d16cc6e6d8f39d566d14727..9b27229de0d8bd5bfbbc181606a1ec1ea0e0946a 100644 (file)
@@ -2,6 +2,9 @@
 * $Id$
 *
 * $Log$
+* Revision 1.2  1999/07/01 14:45:34  fca
+* Modifications to allow Cherenkov transport
+*
 * Revision 1.1  1999/06/03 16:38:16  fca
 * First version of gtreve_root, special version of gtreve for AliRoot to be
 * called from gutrev.
@@ -16,7 +19,7 @@
 #include "geant321/pilot.h"
 *CMZ :  3.21/03 07/10/94  18.07.13  by  S.Giani
 *-- Author :
-      SUBROUTINE GTREVE_ROOT
+      SUBROUTINE GTREVEROOT
 C.
 C.    ******************************************************************
 C.    *                                                                *
index 1578552351f512af1cd54cebb72ce72efd251de5..9c866d1e8ae441f309f6b6aef08894e5fe150f3a 100644 (file)
@@ -75,7 +75,7 @@ geant3->SetCUTS(1.e-4, 1.e-4, 1.e-3, 1.e-4, 1.e-4, cut,  cut,  cut, cut,  cut, 1
      gener->SetPhiRange(-360,360);
      gener->SetThetaRange(2., 10.);
      gener->SetOrigin(25,25,510.5);   
-     gener->SetVertexSmear(perTrack); 
+     gener->SetVertexSmear(kPerTrack); 
      //vertex position
      gener->SetSigma(1.8, 1.8,0);           //Sigma in (X,Y,Z) (cm) on IP position
      gener->SetPart(kProton);                    //GEANT particle type
@@ -130,7 +130,7 @@ geant3->SetCUTS(1.e-4, 1.e-4, 1.e-3, 1.e-4, 1.e-4, cut,  cut,  cut, cut,  cut, 1
      gener->SetYRange(-10,10);
      gener->SetPtRange(0,100);
      gener->SetOrigin(0,0,0);          // vertex position
-     gener->SetVertexSmear(perEvent); 
+     gener->SetVertexSmear(kPerEvent); 
      gener->SetSigma(0,0,5.6);         // Sigma in (X,Y,Z) (cm) on IP position
 //     gener->SetStrucFunc(DO_Set_1);
      gener->SetProcess(mb); 
@@ -189,7 +189,7 @@ geant3->SetCUTS(1.e-4, 1.e-4, 1.e-3, 1.e-4, 1.e-4, cut,  cut,  cut, cut,  cut, 1
      gener->SetThetaRange(0.104,33.52);
      gener->SetOrigin(0,0,0);          //vertex position
      gener->SetSigma(0,0,5.6);         //Sigma in (X,Y,Z) (cm) on IP position
-     gener->SetVertexSmear(perTrack); 
+     gener->SetVertexSmear(kPerTrack); 
      gener->SetTrackingFlag(1);
      break;
 
index aef3c1fb9157a92262cef6fd58488b9b2a6a875a..26dab85ccebbe53bf057d462bd60d2ac0a523281 100644 (file)
@@ -72,7 +72,7 @@ geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut,  cut,  cut, cut,  cut, tofm
      gener->SetPhiRange(85,85);
      gener->SetThetaRange(85,85);
      gener->SetOrigin(0,0,0);   
-     gener->SetVertexSmear(perTrack); 
+     gener->SetVertexSmear(kPerTrack); 
      //vertex position
      gener->SetSigma(1.8, 1.8,0);           //Sigma in (X,Y,Z) (cm) on IP position
      gener->SetPart(kPiPlus);                    //GEANT particle type
@@ -127,7 +127,7 @@ geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut,  cut,  cut, cut,  cut, tofm
      gener->SetYRange(-10,10);
      gener->SetPtRange(0,100);
      gener->SetOrigin(0,0,0);          // vertex position
-     gener->SetVertexSmear(perEvent); 
+     gener->SetVertexSmear(kPerEvent); 
      gener->SetSigma(0,0,5.6);         // Sigma in (X,Y,Z) (cm) on IP position
 //     gener->SetStrucFunc(DO_Set_1);
      gener->SetProcess(mb); 
@@ -176,7 +176,7 @@ geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut,  cut,  cut, cut,  cut, tofm
 //*******************************************************
      AliGenExtFile *gener = new AliGenExtFile(-1); 
      gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root");
-     gener->SetVertexSmear(perEvent); 
+     gener->SetVertexSmear(kPerEvent); 
      gener->SetTrackingFlag(1);
      break;
 
@@ -232,7 +232,7 @@ geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut,  cut,  cut, cut,  cut, tofm
 // Activate this line if you want the vertex smearing to happen
 // track by track
 //
-gener->SetVertexSmear(perTrack); 
+gener->SetVertexSmear(kPerTrack); 
 gener->Init();
 gAlice->SetField(0,2);    //Specify maximum magnetic field in Tesla (neg. ==> default field)
 
index 3e4492522046fe3d638a968b9039748c9c3a2ef7..c30a481330ab7ae63aa70a01709b0c65f21fd7e0 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  1999/11/10 07:37:06  fca
+Pads do not inherit editability from canvas any more
+
 Revision 1.6  1999/11/09 07:38:52  fca
 Changes for compatibility with version 2.23 of ROOT
 
@@ -59,8 +62,8 @@ Introduction of the Copyright and cvs Log
 #include "AliPoints.h"
 #include "TParticle.h"
 
-const Float_t ptcutmax  = 2;
-const Float_t etacutmax = 1.5;
+static const Float_t kptcutmax  = 2;
+static const Float_t ketacutmax = 1.5;
 
 ClassImp(AliDisplay)
 
@@ -68,7 +71,10 @@ ClassImp(AliDisplay)
 //_____________________________________________________________________________
 AliDisplay::AliDisplay()
 {
-   fCanvas = 0;
+  //
+  // Default constructor
+  //
+  fCanvas = 0;
 }
 
 //_____________________________________________________________________________
@@ -217,13 +223,13 @@ AliDisplay::AliDisplay(Int_t size)
    fCutPad->SetFillColor(22);
    fCutPad->SetBorderSize(2);
    fCutSlider   = new TSlider("pcut","Momentum cut",0,0,1,1);
-   fCutSlider->SetRange(fPTcut/ptcutmax,1);
+   fCutSlider->SetRange(fPTcut/kptcutmax,1);
    fCutSlider->SetObject(this);
    fCutSlider->SetFillColor(45);
    TSliderBox *sbox = (TSliderBox*)fCutSlider->GetListOfPrimitives()->First();
    sbox->SetFillColor(46);
    fCutSlider->cd();
-   TGaxis *cutaxis = new TGaxis(0.02,0.8,0.98,0.8,0,ptcutmax,510,"");
+   TGaxis *cutaxis = new TGaxis(0.02,0.8,0.98,0.8,0,kptcutmax,510,"");
    cutaxis->SetLabelSize(0.5);
    cutaxis->SetTitleSize(0.6);
    cutaxis->SetTitleOffset(0.5);
@@ -243,7 +249,7 @@ AliDisplay::AliDisplay(Int_t size)
    TSliderBox *sbox2 = (TSliderBox*)fEtaSlider->GetListOfPrimitives()->First();
    sbox2->SetFillColor(46);
    fEtaSlider->cd();
-   TGaxis *etaaxis = new TGaxis(0.9,0.02,0.9,0.98,-etacutmax,etacutmax,510,"");
+   TGaxis *etaaxis = new TGaxis(0.9,0.02,0.9,0.98,-ketacutmax,ketacutmax,510,"");
    etaaxis->SetLabelSize(0.5);
    etaaxis->SetTitleSize(0.6);
    etaaxis->SetTitleOffset(0.2);
@@ -257,9 +263,21 @@ AliDisplay::AliDisplay(Int_t size)
 }
 
 
+//_____________________________________________________________________________
+AliDisplay::AliDisplay(const AliDisplay &disp)
+{
+  //
+  // Copy constructor
+  //
+  disp.Copy(*this);
+}
+
 //_____________________________________________________________________________
 AliDisplay::~AliDisplay()
 {
+  //
+  // Destructor
+  //
 }
 
 //_____________________________________________________________________________
@@ -268,10 +286,19 @@ void AliDisplay::Clear(Option_t *)
 //    Delete graphics temporary objects
 }
 
+//_____________________________________________________________________________
+void AliDisplay::Copy(AliDisplay &disp) const
+{
+  //
+  // Copy *this onto disp -- not implemented
+  //
+  Fatal("Copy","Not implemented~\n");
+}
+
 //----------------------------------------------------------------------------
 void AliDisplay::ShowTrack(Int_t idx) {
-   AliDetector *TPC=(AliDetector*)gAlice->GetModule("TPC");
-   TObjArray *points=TPC->Points();
+   AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
+   TObjArray *points=mTPC->Points();
    int ntracks=points->GetEntriesFast();
    for (int track=0;track<ntracks;track++) {
       AliPoints *pm = (AliPoints*)points->UncheckedAt(track);
@@ -296,8 +323,8 @@ void AliDisplay::ShowTrack(Int_t idx) {
 
 //----------------------------------------------------------------------------
 void AliDisplay::HideTrack(Int_t idx) {
-   AliDetector *TPC=(AliDetector*)gAlice->GetModule("TPC");
-   TObjArray *points=TPC->Points();
+   AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
+   TObjArray *points=mTPC->Points();
    int ntracks=points->GetEntriesFast();
    for (int track=0;track<ntracks;track++) {
       AliPoints *pm = (AliPoints*)points->UncheckedAt(track);
@@ -416,8 +443,8 @@ Int_t AliDisplay::DistancetoPrimitive(Int_t px, Int_t)
    if (gPad == fCutPad)  return 9999;
    if (gPad == fEtaPad)  return 9999;
 
-   const Int_t big = 9999;
-   Int_t dist   = big;
+   const Int_t kbig = 9999;
+   Int_t dist   = kbig;
    Float_t xmin = gPad->GetX1();
    Float_t xmax = gPad->GetX2();
    Float_t dx   = 0.02*(xmax - xmin);
@@ -496,15 +523,15 @@ void AliDisplay::DrawHits()
    //Get cut slider
    smax   = fCutSlider->GetMaximum();
    smin   = fCutSlider->GetMinimum();
-   cutmin = ptcutmax*smin;
-   if (smax < 0.98) cutmax = ptcutmax*smax;
+   cutmin = kptcutmax*smin;
+   if (smax < 0.98) cutmax = kptcutmax*smax;
    else             cutmax = 100000;
    
    //Get eta slider
    smax   = fEtaSlider->GetMaximum();
    smin   = fEtaSlider->GetMinimum();
-   etamin = etacutmax*(2*smin-1);
-   etamax = etacutmax*(2*smax-1);
+   etamin = ketacutmax*(2*smin-1);
+   etamax = ketacutmax*(2*smax-1);
    if (smin < 0.02) etamin = -1000;
    if (smax > 0.98) etamax =  1000;
       
@@ -799,9 +826,9 @@ void AliDisplay::ShowNextEvent(Int_t delta)
 
   if (delta) {
      gAlice->Clear();
-     Int_t current_event = gAlice->GetHeader()->GetEvent();
-     Int_t new_event     = current_event + delta;
-     gAlice->GetEvent(new_event);
+     Int_t currentEvent = gAlice->GetHeader()->GetEvent();
+     Int_t newEvent     = currentEvent + delta;
+     gAlice->GetEvent(newEvent);
      if (!gAlice->TreeH()) return; 
    }
   LoadPoints();
@@ -812,9 +839,22 @@ void AliDisplay::ShowNextEvent(Int_t delta)
 //______________________________________________________________________________
 void AliDisplay::UnZoom()
 {
-   if (fZooms <= 0) return;
-   fZooms--;
-   TPad *pad = (TPad*)gPad->GetPadSave();
-   pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
-   pad->Modified();
+  //
+  // Resets ZOOM 
+  //
+  if (fZooms <= 0) return;
+  fZooms--;
+  TPad *pad = (TPad*)gPad->GetPadSave();
+  pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
+  pad->Modified();
+}
+
+//_____________________________________________________________________________
+AliDisplay & AliDisplay::operator=(const AliDisplay &disp)
+{
+  //
+  // Assignment operator
+  //
+  disp.Copy(*this);
+  return (*this);
 }
index b8c7f2c577f27bf6bffc065161c56f25b82554ad..54db3450573b924ff103feeab944b3292ffe768e 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliDisplay_H
-#define AliDisplay_H
+#ifndef ALIDISPLAY_H
+#define ALIDISPLAY_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -22,50 +22,21 @@ class TSlider;
 class TButton;
 class TArc;
 
-const Int_t kMAXZOOMS = 20;
+static const Int_t kMAXZOOMS = 20;
 
 class AliDisplay : public TObject {
-
-protected:
-   Int_t             fZoomMode;             //=1 if in zoom mode
-   Bool_t            fDrawAllViews;         //Flag True if AllViews selected
-   Bool_t            fDrawParticles;        //Flag True if particles to be drawn
-   Bool_t            fDrawHits;             //Flag True if Hits to be drawn
-   Float_t           fPTcut;                //PT cut to display objects
-   Float_t           fTheta;                //Viewing angle theta
-   Float_t           fPhi;                  //Viewing angle phi
-   Float_t           fPsi;                  //Viewving angle psi (rotation on display)
-   Float_t           fRrange;               //Size of view in R
-   Float_t           fZrange;               //Size of view along Z
-   Float_t           fZoomX0[20];           //Low x range of zoom number i
-   Float_t           fZoomY0[20];           //Low y range of zoom number i
-   Float_t           fZoomX1[20];           //High x range of zoom number i
-   Float_t           fZoomY1[20];           //High y range of zoom number i
-   Int_t             fZooms;                //Number of zooms
-   Int_t             fHitsCuts;             //Number of hits surviving cuts
-   TCanvas          *fCanvas;               //Pointer to the display canvas
-   TPad             *fTrigPad;              //Pointer to the trigger pad 
-   TPad             *fCutPad;               //Pointer to the momentum cut slider pad 
-   TPad             *fEtaPad;               //Pointer to the rapidity cut slider pad 
-   TPad             *fButtons;              //Pointer to the buttons pad
-   TPad             *fPad;                  //Pointer to the event display main pad
-   TSlider          *fCutSlider;            //Momentum cut slider
-   TSlider          *fEtaSlider;            //Rapidity slider
-   TSlider          *fRangeSlider;          //Range slider
-   TButton          *fPickButton;           //Button to activate Pick mode
-   TButton          *fZoomButton;           //Button to activate Zoom mode
-   TArc             *fArcButton;            //Gren/Red button to show Pick/Zoom mode
-   TList            *fFruits;               //List for fruits
    
 public:
                      AliDisplay();
                      AliDisplay(Int_t size);
+                     AliDisplay(const AliDisplay &disp);
    virtual          ~AliDisplay();
    virtual Bool_t    AllViews() {return fDrawAllViews;}
    virtual void      Clear(Option_t *option="");
    TSlider          *CutSlider() {return fCutSlider;}
-   virtual void      ShowTrack(Int_t track_number); // *MENU*
-   virtual void      HideTrack(Int_t track_number); // *MENU*
+   virtual void      ShowTrack(Int_t trackNumber); // *MENU*
+   virtual void      HideTrack(Int_t trackNumber); // *MENU*
+   virtual void      Copy(AliDisplay &disp) const;
    virtual void      DisableDetector(const char *name); // *MENU*
    virtual void      DisplayButtons();
    virtual Int_t     DistancetoPrimitive(Int_t px, Int_t py);
@@ -93,7 +64,39 @@ public:
    virtual void      SetZoomMode();
    virtual void      ShowNextEvent(Int_t delta=1);
    virtual void      UnZoom(); // *MENU*
+   virtual AliDisplay& operator= (const AliDisplay &disp);
    
+protected:
+   Int_t             fZoomMode;             //=1 if in zoom mode
+   Bool_t            fDrawAllViews;         //Flag True if AllViews selected
+   Bool_t            fDrawParticles;        //Flag True if particles to be drawn
+   Bool_t            fDrawHits;             //Flag True if Hits to be drawn
+   Float_t           fPTcut;                //PT cut to display objects
+   Float_t           fTheta;                //Viewing angle theta
+   Float_t           fPhi;                  //Viewing angle phi
+   Float_t           fPsi;                  //Viewving angle psi (rotation on display)
+   Float_t           fRrange;               //Size of view in R
+   Float_t           fZrange;               //Size of view along Z
+   Float_t           fZoomX0[20];           //Low x range of zoom number i
+   Float_t           fZoomY0[20];           //Low y range of zoom number i
+   Float_t           fZoomX1[20];           //High x range of zoom number i
+   Float_t           fZoomY1[20];           //High y range of zoom number i
+   Int_t             fZooms;                //Number of zooms
+   Int_t             fHitsCuts;             //Number of hits surviving cuts
+   TCanvas          *fCanvas;               //Pointer to the display canvas
+   TPad             *fTrigPad;              //Pointer to the trigger pad 
+   TPad             *fCutPad;               //Pointer to the momentum cut slider pad 
+   TPad             *fEtaPad;               //Pointer to the rapidity cut slider pad 
+   TPad             *fButtons;              //Pointer to the buttons pad
+   TPad             *fPad;                  //Pointer to the event display main pad
+   TSlider          *fCutSlider;            //Momentum cut slider
+   TSlider          *fEtaSlider;            //Rapidity slider
+   TSlider          *fRangeSlider;          //Range slider
+   TButton          *fPickButton;           //Button to activate Pick mode
+   TButton          *fZoomButton;           //Button to activate Zoom mode
+   TArc             *fArcButton;            //Gren/Red button to show Pick/Zoom mode
+   TList            *fFruits;               //List for fruits
+
    ClassDef(AliDisplay, 0)   //Utility class to display ALICE outline, tracks, hits,..
 };
 
index 0fde4ff3668992298c86431b0c262eeea7428e21..1c39842d22c66ee852912b15010cab077d604e08 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.5  2000/06/08 13:34:50  fca
+Better control of momentum range in GenBox
+
 Revision 1.4  1999/09/29 09:24:29  fca
 Introduction of the Copyright and cvs Log
 
@@ -50,6 +53,9 @@ TGenerator* AliGenerator::fgMCEvGen=0;
 //____________________________________________________________
 AliGenerator::AliGenerator()
 {
+  //
+  // Default constructor
+  //
     printf("\n AliGenerator Default Constructor\n\n");
     
     gAlice->SetGenerator(this);
@@ -75,6 +81,9 @@ AliGenerator::AliGenerator()
 AliGenerator::AliGenerator(Int_t npart)
     : TNamed(" "," ")
 {
+  //
+  // Standard constructor
+  //
     printf("\n AliGenerator Constructor initializing number of particles \n\n");
     gAlice->SetGenerator(this);
     SetThetaRange(); ResetBit(kThetaRange);
@@ -96,9 +105,40 @@ AliGenerator::AliGenerator(Int_t npart)
     SetNumberParticles(npart);
 }
 
+//____________________________________________________________
+AliGenerator::AliGenerator(const AliGenerator &gen) : TNamed(" "," ")
+{
+  //
+  // Copy constructor
+  //
+  gen.Copy(*this);
+}
+
+//____________________________________________________________
+AliGenerator & AliGenerator::operator=(const AliGenerator &gen)
+{
+  //
+  // Assignment operator
+  //
+  gen.Copy(*this);
+  return (*this);
+}
+
+//____________________________________________________________
+void AliGenerator::Copy(AliGenerator &gen) const
+{
+  //
+  // Copy *this onto gen
+  //
+  Fatal("Copy","Not implemented!\n");
+}
+
 //____________________________________________________________
 AliGenerator::~AliGenerator()
 {
+  //
+  // Destructor
+  //
   fOrigin.Set(0);
   fOsigma.Set(0);
   delete fgMCEvGen;
@@ -106,6 +146,9 @@ AliGenerator::~AliGenerator()
 
 void AliGenerator::Init()
 {   
+  //
+  // Dummy initialisation
+  //
 }
 
 
index c9759dbe8cac1faf568d24a50543a2fbe5983c7b..7f545afa0e725530c37cc335f05f705b93c29409 100644 (file)
 #include "TArrayF.h"
 #include "TGenerator.h"
 
-typedef enum { none, perEvent, perTrack } VertexSmear_t;
+typedef enum { kNoSmear, kPerEvent, kPerTrack } VertexSmear_t;
 
 class AliGenerator : public TNamed
 {
 
-protected:
-    static TGenerator* fgMCEvGen;
-    Float_t     fThetaMin;     //Minimum theta of generation in radians
-    Float_t     fThetaMax;     //Maximum theta of generation in radians
-    Float_t     fPhiMin;       //Minimum phi of generation in radians
-    Float_t     fPhiMax;       //Maximum phi of generation in radians
-    Float_t     fPMin;         //Minimum momentum of generation in GeV/c
-    Float_t     fPMax;         //Minimum momentum of generation in GeV/c
-    Float_t     fPtMin;        //Minimum transverse momentum
-    Float_t     fPtMax;        //Maximum transverse momentum
-    Float_t     fYMin;         //Minimum rapidity
-    Float_t     fYMax;         //Maximum rapidity
-    TArrayF     fVMin;         //Minimum Decaylength
-    TArrayF     fVMax;         //Minimum Decaylength    
-    Int_t       fNpart;        //Maximum number of particles per event
-    Float_t     fParentWeight; //Parent Weight
-    Float_t     fChildWeight;  //ChildWeight
-    Int_t       fTrackit;      // Track the generated final state particle if 1
-    Int_t       fAnalog;       //Flaf for anolog or pt-weighted generation
-   //
-    VertexSmear_t     fVertexSmear; //Vertex Smearing mode
-    Int_t       fTrackIt;    // if 1 Track final state particles 
-    TArrayF     fOrigin;     //Origin of event
-    TArrayF     fOsigma;     //Sigma of the Origin of event
-
-    enum {kThetaRange=1, kVertexRange=2, kPhiRange=4, kPtRange=8,
-         kYRange=32, kMomentumRange=16};
-
  public:
     AliGenerator();
     AliGenerator(Int_t npart);
+    AliGenerator(const AliGenerator &gen);
     virtual ~AliGenerator();
     virtual void Init();
+    virtual void Copy(AliGenerator &gen) const;
     virtual void SetOrigin(Float_t ox, Float_t oy, Float_t oz)
        {fOrigin[0]=ox;fOrigin[1]=oy;fOrigin[2]=oz;}
     virtual void SetOrigin(const TLorentzVector &o)
@@ -92,6 +66,8 @@ protected:
     virtual void SetMC(TGenerator *theMC) 
        {if (!fgMCEvGen) fgMCEvGen =theMC;}
 
+    virtual AliGenerator & operator=(const AliGenerator &gen);
+
   // Getters
 
     virtual void GetOrigin(Float_t &ox, Float_t &oy, Float_t &oz)
@@ -99,6 +75,34 @@ protected:
     virtual void GetOrigin(TLorentzVector &o)
        {o[0]=fOrigin[0];o[1]=fOrigin[1];o[2]=fOrigin[2];o[3]=0;}
 
+protected:
+    static TGenerator* fgMCEvGen; // Pointer to the generator
+    Float_t     fThetaMin;     //Minimum theta of generation in radians
+    Float_t     fThetaMax;     //Maximum theta of generation in radians
+    Float_t     fPhiMin;       //Minimum phi of generation in radians
+    Float_t     fPhiMax;       //Maximum phi of generation in radians
+    Float_t     fPMin;         //Minimum momentum of generation in GeV/c
+    Float_t     fPMax;         //Minimum momentum of generation in GeV/c
+    Float_t     fPtMin;        //Minimum transverse momentum
+    Float_t     fPtMax;        //Maximum transverse momentum
+    Float_t     fYMin;         //Minimum rapidity
+    Float_t     fYMax;         //Maximum rapidity
+    TArrayF     fVMin;         //Minimum Decaylength
+    TArrayF     fVMax;         //Minimum Decaylength    
+    Int_t       fNpart;        //Maximum number of particles per event
+    Float_t     fParentWeight; //Parent Weight
+    Float_t     fChildWeight;  //ChildWeight
+    Int_t       fTrackit;      // Track the generated final state particle if 1
+    Int_t       fAnalog;       //Flaf for anolog or pt-weighted generation
+   //
+    VertexSmear_t     fVertexSmear; //Vertex Smearing mode
+    Int_t       fTrackIt;    // if 1 Track final state particles 
+    TArrayF     fOrigin;     //Origin of event
+    TArrayF     fOsigma;     //Sigma of the Origin of event
+
+    enum {kThetaRange=1, kVertexRange=2, kPhiRange=4, kPtRange=8,
+         kYRange=32, kMomentumRange=16};
+
     ClassDef(AliGenerator,1)
 };
 
index 6decbcb2c84be9cd61fea258eae7e5247aeeeecd..93ad6b504971ccca16ca478f31943fbc3eb2e1a1 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  1999/09/29 09:24:29  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 #include "AliHit.h"
@@ -33,7 +36,7 @@ AliHit::AliHit(Int_t shunt, Int_t track)
   TClonesArray &particles = *(gAlice->Particles());
   if(shunt) {
     int primary = gAlice->GetPrimary(track);
-    ((TParticle *)particles[primary])->SetBit(Keep_Bit);
+    ((TParticle *)particles[primary])->SetBit(kKeepBit);
     fTrack=primary;
   } else {
     fTrack=track;
index 4a1b7f4bd5f0b177efa5c3f3654cb4349e46e1ba..4fc7c6399d34773e86eb5e2d4cf296cc024d031b 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ALILego_H
-#define ALILego_H
+#ifndef ALILEGO_H
+#define ALILEGO_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
index 2f30019dc6ae0acf061302e651eaaeb6faa4c032..dd5fa9ac7d997207826761b3331370d205f02264 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  2000/03/22 18:08:07  fca
+Rationalisation of the virtual MC interfaces
+
 Revision 1.2  1999/09/29 09:24:29  fca
 Introduction of the Copyright and cvs Log
 
@@ -31,6 +34,9 @@ AliMC* gMC;
 
 AliMC::AliMC(const char *name, const char *title) : TNamed(name,title)
 {
+  //
+  // Standard constructor
+  //
   if(fgMC) {
     printf("Cannot initialise twice MonteCarlo class\n");
     exit(1);
index 3881fea39daac104f3f368bdb0c1d50e03a1c445..261e9afb10c183d7f6d42355c449dc4da95ae83f 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ALI_MC_H
-#define ALI_MC_H
+#ifndef ALIMC_H
+#define ALIMC_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -180,7 +180,7 @@ class AliMC : public TNamed
     virtual void Gdman(Float_t, Float_t, const char*) = 0;
     virtual void SetColors() = 0;
     virtual void Gtreve() = 0;
-    virtual void Gtreve_root() = 0;
+    virtual void GtreveRoot() = 0;
     virtual void Gckmat(Int_t, char*) = 0;
     virtual void InitLego() = 0;
     virtual void Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&) = 0; 
@@ -195,10 +195,10 @@ class AliMC : public TNamed
   virtual void ProcessRun(Int_t nevent) = 0;
 
   private:
-    static AliMC*  fgMC;
+  static AliMC*  fgMC;    // Pointer to the virtual MonteCarlo object
 
   ClassDef(AliMC,1)  //Geometry Interface Class
 };
 
-#endif // ALI_MC_H
+#endif 
 
index 0e790ca23b7234ba5847c7e9b23ad4bf82dd55f1..b03e5844d23948ebc45194ce4a636ec2b62ce456 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.5  2000/06/09 19:55:18  morsch
+Introduce new class AliMagFDM - Galina Chabratova
+
 
 Revision 1.4  2000/03/28 12:40:24  fca
 Introduce factor for magnetic field
@@ -32,39 +35,19 @@ Introduction of the Copyright and cvs Log
 #include <stdlib.h>
 #include <stdio.h>
 
-//ZDC part -------------------------------------------------------------------
-
-  static const Float_t G1=20.03;
-  static const Float_t FDIP=-37.34;
-  static const Float_t FDIMU=6.;
-  static const Float_t FCORN=11.72;
-//
-// 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 CORBEG=1920,COREND=CORBEG+190, CORRA2=4.5*4.5;
-//
-  static const Float_t ZBEG=2300;
-  static const Float_t Z1BEG=ZBEG+   0,Z1END=Z1BEG+630,Z1RA2=3.5*3.5;
-  static const Float_t Z2BEG=ZBEG+ 880,Z2END=Z2BEG+550,Z2RA2=3.5*3.5;
-  static const Float_t Z3BEG=ZBEG+1530,Z3END=Z3BEG+550,Z3RA2=3.5*3.5;
-  static const Float_t Z4BEG=ZBEG+2430,Z4END=Z4BEG+630,Z4RA2=3.5*3.5;
-  static const Float_t D1BEG=5843.5   ,D1END=D1BEG+945,D1RA2=4.5*4.5;
-  static const Float_t D2BEG=12113.2  ,D2END=D2BEG+945,D2RA2=4.5*.5;
-
-//ZDC part -------------------------------------------------------------------
 
 ClassImp(AliMagF)
 
 //________________________________________
-AliMagF::AliMagF(const char *name, const char *title, const Int_t integ, const Int_t map, 
-                const Float_t factor, const Float_t fmax)
+AliMagF::AliMagF(const char *name, const char *title, const Int_t integ, 
+                const Int_t map, const Float_t factor, const Float_t fmax)
   : TNamed(name,title)
 {
+  //
+  // Standard constructor
+  //
   fMap = map;
-  fType = Undef;
+  fType = kUndef;
   fInteg = integ;
   fFactor = factor;
   fMax = fmax;
@@ -73,927 +56,13 @@ AliMagF::AliMagF(const char *name, const char *title, const Int_t integ, const I
 //________________________________________
 void AliMagF::Field(Float_t*, Float_t *b)
 {
+  //
+  // Method to return the field in one point -- dummy in this case
+  //
   printf("Undefined MagF Field called, returning 0\n");
   b[0]=b[1]=b[2]=0;
 }
       
-ClassImp(AliMagFC)
-
-//________________________________________
-AliMagFC::AliMagFC(const char *name, const char *title, const Int_t integ, const Int_t map, 
-                const Float_t factor, const Float_t fmax)
-  : AliMagF(name,title,integ,map,factor,fmax)
-{
-  printf("Constant Field %s created: map= %d, factor= %f\n",fName.Data(),map,factor);
-  fType = Const;
-}
-
-//________________________________________
-void AliMagFC::Field(Float_t *x, Float_t *b)
-{
-  b[0]=b[1]=b[2]=0;
-  if(fMap==1) {
-    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;
-      }
-      else {
-//This is the ZDC part
-       Float_t rad2=x[0]*x[0]+x[1]*x[1];
-       if(rad2<D2RA2) {
-         if(x[2]>D2BEG) {
-           
-//    Separator Dipole D2
-           if(x[2]<D2END) b[1]=FDIP;
-         } else if(x[2]>D1BEG) {
-           
-//    Separator Dipole D1
-           if(x[2]<D1END) b[1]=-FDIP;
-         }
-         if(rad2<CORRA2) {
-
-//    First quadrupole of inner triplet de-focussing in x-direction
-//    Inner triplet
-           if(x[2]>Z4BEG) {
-             if(x[2]<Z4END) {
-             
-//    2430 <-> 3060
-               b[0]=-G1*x[1];
-               b[1]=-G1*x[0];
-             }
-           } else if(x[2]>Z3BEG) {
-             if(x[2]<Z3END) {
-
-//    1530 <-> 2080
-               b[0]=G1*x[1];
-               b[1]=G1*x[0];
-             }
-           } else if(x[2]>Z2BEG) {
-             if(x[2]<Z2END) {
-             
-//    890 <-> 1430
-               b[0]=G1*x[1];
-               b[1]=G1*x[0];
-             }
-           } else if(x[2]>Z1BEG) {
-             if(x[2]<Z1END) {
-
-//    0 <->  630
-               b[0]=-G1*x[1];
-               b[1]=-G1*x[0];
-             }
-           } else if(x[2]>CORBEG) {
-             if(x[2]<COREND) {
-//    Corrector dipole (because of dimuon arm)
-               b[0]=FCORN;
-             }
-           }
-         }
-       }
-      }
-    }
-    if(fFactor!=1) {
-      b[0]*=fFactor;
-      b[1]*=fFactor;
-      b[2]*=fFactor;
-    }
-  } else {
-    printf("Invalid field map for constant field %d\n",fMap);
-    exit(1);
-  }
-}
-    
-ClassImp(AliMagFCM)
-
-//________________________________________
-AliMagFCM::AliMagFCM(const char *name, const char *title, const Int_t integ, const Int_t map, 
-                const Float_t factor, const Float_t fmax)
-  : AliMagF(name,title,integ,map,factor,fmax)
-{
-  fType = ConMesh;
-  printf("Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n",fName.Data(),map,factor,fTitle.Data());
-}
-
-//________________________________________
-void AliMagFCM::Field(Float_t *x, Float_t *b)
-{
-  Double_t ratx, raty, ratz, hix, hiy, hiz, ratx1, raty1, ratz1, 
-    bhyhz, bhylz, blyhz, blylz, bhz, blz, xl[3];
-  const Double_t one=1;
-  Int_t ix, iy, iz;
-    
-  // --- find the position in the grid ---
-
-  b[0]=b[1]=b[2]=0;
-  if(-700<x[2] && x[2]<fZbeg && x[0]*x[0]+(x[1]+30)*(x[1]+30) < 560*560) {
-    b[2]=2;
-  } else  {
-    Bool_t infield=(fZbeg<=x[2] && x[2]<fZbeg+fZdel*(fZn-1)
-       &&  ( fXbeg <= TMath::Abs(x[0]) && TMath::Abs(x[0]) < fXbeg+fXdel*(fXn-1) )
-       &&  ( fYbeg <= TMath::Abs(x[1]) && TMath::Abs(x[1]) < fYbeg+fYdel*(fYn-1) ));
-      if(infield) {
-      xl[0]=TMath::Abs(x[0])-fXbeg;
-      xl[1]=TMath::Abs(x[1])-fYbeg;
-      xl[2]=x[2]-fZbeg;
-      
-    // --- start with x
-    
-      hix=xl[0]*fXdeli;
-      ratx=hix-int(hix);
-      ix=int(hix);
-      
-      hiy=xl[1]*fYdeli;
-      raty=hiy-int(hiy);
-      iy=int(hiy);
-      
-      hiz=xl[2]*fZdeli;
-      ratz=hiz-int(hiz);
-      iz=int(hiz);
-    
-      if(fMap==2) {
-      // ... simple interpolation
-       ratx1=one-ratx;
-       raty1=one-raty;
-       ratz1=one-ratz;
-       bhyhz = Bx(ix  ,iy+1,iz+1)*ratx1+Bx(ix+1,iy+1,iz+1)*ratx;
-       bhylz = Bx(ix  ,iy+1,iz  )*ratx1+Bx(ix+1,iy+1,iz  )*ratx;
-       blyhz = Bx(ix  ,iy  ,iz+1)*ratx1+Bx(ix+1,iy  ,iz+1)*ratx;
-       blylz = Bx(ix  ,iy  ,iz  )*ratx1+Bx(ix+1,iy  ,iz  )*ratx;
-       bhz   = blyhz             *raty1+bhyhz             *raty;
-       blz   = blylz             *raty1+bhylz             *raty;
-       b[0]  = blz               *ratz1+bhz               *ratz;
-       //
-       bhyhz = By(ix  ,iy+1,iz+1)*ratx1+By(ix+1,iy+1,iz+1)*ratx;
-       bhylz = By(ix  ,iy+1,iz  )*ratx1+By(ix+1,iy+1,iz  )*ratx;
-       blyhz = By(ix  ,iy  ,iz+1)*ratx1+By(ix+1,iy  ,iz+1)*ratx;
-       blylz = By(ix  ,iy  ,iz  )*ratx1+By(ix+1,iy  ,iz  )*ratx;
-       bhz   = blyhz             *raty1+bhyhz             *raty;
-       blz   = blylz             *raty1+bhylz             *raty;
-       b[1]  = blz               *ratz1+bhz               *ratz;
-       //
-       bhyhz = Bz(ix  ,iy+1,iz+1)*ratx1+Bz(ix+1,iy+1,iz+1)*ratx;
-       bhylz = Bz(ix  ,iy+1,iz  )*ratx1+Bz(ix+1,iy+1,iz  )*ratx;
-       blyhz = Bz(ix  ,iy  ,iz+1)*ratx1+Bz(ix+1,iy  ,iz+1)*ratx;
-       blylz = Bz(ix  ,iy  ,iz  )*ratx1+Bz(ix+1,iy  ,iz  )*ratx;
-       bhz   = blyhz             *raty1+bhyhz             *raty;
-       blz   = blylz             *raty1+bhylz             *raty;
-       b[2]  = blz               *ratz1+bhz               *ratz;
-      //printf("ratx,raty,ratz,b[0],b[1],b[2] %f %f %f %f %f %f\n",
-      //ratx,raty,ratz,b[0],b[1],b[2]);
-      //
-    // ... use the dipole symmetry
-       if (x[0]*x[1] < 0) b[1]=-b[1];
-       if (x[0]<0) b[2]=-b[2];
-      } else {
-       printf("Invalid field map for constant mesh %d\n",fMap);
-      }
-    } else {
-//This is the ZDC part
-      Float_t rad2=x[0]*x[0]+x[1]*x[1];
-      if(rad2<D2RA2) {
-       if(x[2]>D2BEG) {
-         
-//    Separator Dipole D2
-         if(x[2]<D2END) b[1]=FDIP;
-       } else if(x[2]>D1BEG) {
-
-//    Separator Dipole D1
-         if(x[2]<D1END) b[1]=-FDIP;
-       }
-       if(rad2<CORRA2) {
-
-//    First quadrupole of inner triplet de-focussing in x-direction
-//    Inner triplet
-         if(x[2]>Z4BEG) {
-           if(x[2]<Z4END) {
-             
-//    2430 <-> 3060
-             b[0]=-G1*x[1];
-             b[1]=-G1*x[0];
-           }
-         } else if(x[2]>Z3BEG) {
-           if(x[2]<Z3END) {
-
-//    1530 <-> 2080
-             b[0]=G1*x[1];
-             b[1]=G1*x[0];
-           }
-         } else if(x[2]>Z2BEG) {
-           if(x[2]<Z2END) {
-
-//    890 <-> 1430
-             b[0]=G1*x[1];
-             b[1]=G1*x[0];
-           }
-         } else if(x[2]>Z1BEG) {
-           if(x[2]<Z1END) {
-
-//    0 <->  630
-             b[0]=-G1*x[1];
-             b[1]=-G1*x[0];
-           }
-         } else if(x[2]>CORBEG) {
-           if(x[2]<COREND) {
-//    Corrector dipole (because of dimuon arm)
-             b[0]=FCORN;
-           }
-         }
-       }
-      }
-    }
-  }
-  if(fFactor!=1) {
-    b[0]*=fFactor;
-    b[1]*=fFactor;
-    b[2]*=fFactor;
-  }
-}
-
-//________________________________________
-void AliMagFCM::ReadField()
-{
-  FILE *magfile;
-  Int_t ix, iy, iz, ipx, ipy, ipz;
-  Float_t bx, by, bz;
-  char *fname;
-  printf("Reading Magnetic Field %s from file %s\n",fName.Data(),fTitle.Data());
-  fname = gSystem->ExpandPathName(fTitle.Data());
-  magfile=fopen(fname,"r");
-  delete [] fname;
-  if (magfile) {
-    fscanf(magfile,"%d %d %d %f %f %f %f %f %f",
-          &fXn, &fYn, &fZn, &fXdel, &fYdel, &fZdel, &fXbeg, &fYbeg, &fZbeg);
-    printf("fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f\n",
-          fXn, fYn, fZn, fXdel, fYdel, fZdel, fXbeg, fYbeg, fZbeg);
-    fXdeli=1./fXdel;
-    fYdeli=1./fYdel;
-    fZdeli=1./fZdel;
-    fB = new TVector(3*fXn*fYn*fZn);
-    for (iz=0; iz<fZn; iz++) {
-      ipz=iz*3*(fXn*fYn);
-      for (iy=0; iy<fYn; iy++) {
-       ipy=ipz+iy*3*fXn;
-       for (ix=0; ix<fXn; ix++) {
-         ipx=ipy+ix*3;
-         fscanf(magfile,"%f %f %f",&bz,&by,&bx);
-         (*fB)(ipx+2)=bz;
-         (*fB)(ipx+1)=by;
-         (*fB)(ipx  )=bx;
-       }
-      }
-    }
-  } else { 
-    printf("File %s not found !\n",fTitle.Data());
-    exit(1);
-  }
-}
-// ------------------------------------------------------- 
-
-ClassImp(AliMagFDM)
-
-//________________________________________
-AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ,
-const Int_t map, const Float_t factor, const Float_t fmax)
-  : AliMagF(name,title,integ,map,factor,fmax)
-  
-{
-  fType = DipoMap;
-
-  printf("Field Map for Muon Arm from IP till muon filter %s created: map= %d, factor= %f, file=%s\n",fName.Data(),map,factor,fTitle.Data());
-  
-}
-
-//________________________________________
-
-void AliMagFDM::Field(Float_t *xfi, Float_t *b)
-{
-  static  const Double_t eps=0.1E-06;
-  static  const Double_t pi2=.6283185E+01;
-  static  const Double_t one=1;
-  static  const Double_t fdYaxi = 0.3;
-
-  static  const    Int_t  kiip=33; 
-  static  const    Int_t  miip=0;    
-  static  const    Int_t  liip=0;
-
-  static  const    Int_t  kiic=0;
-  static  const    Int_t  miic=0;    
-  static  const    Int_t  liic=0;       
-
-  static  const Double_t    fdZbg=502.92;  // Start of Map using in z
-  static  const Double_t    fdZL3=600;  // Beginning of L3 door in z
-
-  Double_t   x[3];   
-  Double_t   xL3[3]; 
-  Double_t   bint[3]; 
-  
-  Double_t r0;
-  
-  Double_t bbj;
-  Int_t Kvar,jb;
-
-  Double_t Zp1, Zp2,Xp1,Xp2,Yp1,Yp2; 
-  Double_t Zz1, Zz2,Yy1,Yy2,X2,X1; 
-     
-// --- start the map fiel from z = 502.92 cm ---
-
-  x[0] = xfi[0];
-  x[1] = xfi[1];
-  x[2] = xfi[2];
-  b[0]=b[1]=b[2]=0;
-  //       printf("x[0]  %f,x[1] %f,x[2]  %f\n",x[0],x[1],x[2]); 
-
-  Double_t rr=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
-           r0=rr/100;
-  Double_t Rpmax;
-  Rpmax=fdRmax; 
-  if ( (-700<x[2] && x[2]<=fdZbg && 
-        (x[0]*x[0]+(x[1]+30)*(x[1]+30))< 560*560)
-       || (fdZbg<x[2] && x[2]<=fdZL3 && rr>=Rpmax*100) )
-       {
-        b[2]=2;
-       }
-
-  xL3[0]=x[0]/100;
-  xL3[1]=(x[1]+30)/100;
-  xL3[2]=x[2]/100; 
-  Double_t xminn=xL3[2]*fdAx1+fdCx1;
-  Double_t xmaxx=xL3[2]*fdAx2+fdCx2;
-  Double_t Zcmin,Zcmax,Ycmin,Ycmax;
-
-  Zcmin=fdZmin;
-  Zcmax=fdZmax;
-  Ycmin=fdYmin;
-  Ycmax=fdYmax;
-          
-if ((fdZbg/100<xL3[2] && xL3[2]<Zcmin && r0<Rpmax) || ((Zcmin<=xL3[2] && xL3[2] <= Zcmax ) && (Ycmin<=xL3[1] && xL3[1]<= Ycmax) &&  (xminn <= xL3[0] && xL3[0] <= xmaxx)))
-    {
-     if(fMap==3) 
-      { 
-       if (xL3[2]<Zcmin && r0<Rpmax)   
-       {
-       //---------------------  Polar part ----------------------
-       
-       Double_t yyp,ph0;
-       Int_t  kp0, lp0, mp0;
-       Int_t kpi,lpi,mpi;
-       Double_t alp1,alp2,alp3;
-       Double_t zpz,rp,fip,cphi; 
-
-       kpi=kiip; 
-       lpi=liip;
-       mpi=miip;
-   
-       zpz=xL3[2];
-
-       FZ(&zpz, fdZp ,&fdZpdl,&kpi,&kp0,&Zp1 ,&Zp2,&fdZpl) ;
-
-       yyp=xL3[1]- 0.3;
-       cphi=yyp/r0;
-       ph0=TMath::ACos(cphi);
-       if (xL3[0]< 0) {ph0=pi2 - ph0;}  
-                                  
-       fip=ph0;
-       FZ(&fip,fdPhi,&fdPhid ,&mpi,&mp0, &Xp1,&Xp2,&fdPhin); 
-
-       Double_t Rdel;
-       Rdel=fdRdel;
-
-       if (r0<= fdRdel)
-        {
-
-         if(r0< eps) 
-         {
-
-          bint[0]=(Zp1*fdBpx[kp0][0][0] + Zp2*fdBpx[kp0+1][0][0])*10;     
-          bint[1]=(Zp1*fdBpy[kp0][0][0] + Zp2*fdBpy[kp0+1][0][0])*10;      
-          bint[2]=(Zp1*fdBpz[kp0][0][0] + Zp2*fdBpz[kp0+1][0][0])*10; 
-
-         }  
-      
-        alp2= fdB[0][0][mp0]*yyp + fdB[0][1][mp0]*xL3[0]; 
-        alp3= fdB[1][0][mp0]*yyp + fdB[1][1][mp0]*xL3[0];      
-        alp1= one - alp2 - alp3;
-     
-        for (jb=0; jb<3 ; jb++) 
-        {
-         Kvar=jb;     
-         FRfuncBi(&Kvar,&Zp1,&Zp2,&alp1,&alp2,&alp3, &kp0,&mp0, &bbj);
-         bint[jb] = bbj*10 ;
-        }  
-       }
-        else
-       {
-        rp=r0;
-
-        FZ(&rp,fdR ,&fdRdel,&lpi,&lp0,&Yp1,&Yp2,&fdRn);
-
-        for (jb=0; jb<3 ; jb++) 
-        {
-         Kvar=jb;
-         FGfuncBi(&Zp1,&Zp2,&Yp1,&Yp2,&Xp1,&Xp2,&Kvar,&kp0,&lp0,&mp0,&bbj); 
-
-         bint[jb] = bbj*10 ;
-        }
-       }
-
-       b[0]=bint[0];
-       b[1]=bint[1];
-       b[2]=bint[2];
-
-//    fprintf(fitest,"-------------   Freg2 run -------------\n");       
-  
-   }  
-   else 
-   {
-   //-------------- Cartensian part ------------------
-          
-   Double_t zzc,yyc; 
-   Int_t k0, l0,m0;
-   Double_t  xx1, xx2,dx, xxx ,xXl; 
-   Int_t kci,mci,lci;
-
-   kci=kiic;
-   lci=liic;
-   mci=miic;
-
-   xx1 = fdAx1*xL3[2] + fdCx1;
-   xx2 = fdAx2*xL3[2] + fdCx2;
-
-   zzc=xL3[2];
-   FZ(&zzc, fdZc ,&fdZdel, &kci,&k0, &Zz1, &Zz2, &fdZl);     
-
-   yyc=xL3[1];
-   FZ(&yyc, fdY , &fdYdel,&lci, &l0, &Yy1, &Yy2,&fdYl);  
-
-   xXl = fdXl-one; 
-   dx = (xx2-xx1)/xXl;
-   xxx= xL3[0]-xx1;
-   //     xm = xxx/dx; 
-   m0 = int(xxx/dx);   
-
-   if(xL3[0]<(xx1+m0*dx) || xL3[0] >(xx1+(m0+1)*dx)) 
-    {
-      m0=m0+1;   
-      printf(" m0 %d, m0+1 %d\n",m0,m0+1);  
-    }
-
-   X2=(xL3[0]-( xx1+m0*dx))/dx;
-   X1=one-X2;
-   m0=m0-1;
-   for (jb=3; jb<6; jb++) 
-     {
-       Kvar=jb;     
-       FGfuncBi(&Zz1,&Zz2,&Yy1,&Yy2,&X1,&X2,&Kvar,&k0, &l0, &m0, &bbj); 
-       bint[jb-3] = bbj*10 ; 
-     }    
-   b[0]=bint[0];
-   b[1]=bint[1];
-   b[2]=bint[2]; 
-
-//   fprintf(fitest,"------------   Freg1 run -----------------\n");            
-   } 
-
-  } else {
-        printf("Unknown map of Dipole region %d\n",fMap);
- }
-           
-} else {
-
-//This is the ZDC part
-      Float_t rad2=x[0]*x[0]+x[1]*x[1];
-      if(rad2<D2RA2) {
-        if(x[2]>D2BEG) {
-          
-//    Separator Dipole D2
-          if(x[2]<D2END) b[1]=FDIP;
-        } else if(x[2]>D1BEG) {
-
-//    Separator Dipole D1
-          if(x[2]<D1END) b[1]=-FDIP;
-        }
-        if(rad2<CORRA2) {
-
-//    First quadrupole of inner triplet de-focussing in x-direction
-//    Inner triplet
-          if(x[2]>Z4BEG) {
-            if(x[2]<Z4END) {
-              
-//    2430 <-> 3060
-              b[0]=-G1*x[1];
-              b[1]=-G1*x[0];
-            }
-          } else if(x[2]>Z3BEG) {
-            if(x[2]<Z3END) {
-
-//    1530 <-> 2080
-              b[0]=G1*x[1];
-              b[1]=G1*x[0];
-            }
-          } else if(x[2]>Z2BEG) {
-            if(x[2]<Z2END) {
-
-//    890 <-> 1430
-              b[0]=G1*x[1];
-              b[1]=G1*x[0];
-            }
-          } else if(x[2]>Z1BEG) {
-            if(x[2]<Z1END) {
-
-//    0 <->  630
-              b[0]=-G1*x[1];
-              b[1]=-G1*x[0];
-            }
-          } else if(x[2]>CORBEG) {
-            if(x[2]<COREND) {
-//    Corrector dipole (because of dimuon arm)
-//            b[0]=FCORN;
-              b[0]=-FCORN;
-            }
-          }
-        }
-      }
-    }
-
-  if(fFactor!=1) {
-    b[0]*=fFactor;
-    b[1]*=fFactor;
-    b[2]*=fFactor;
-  }
-}
-
-//_________________________________________
-
-void AliMagFDM::FZ(Double_t *u, Float_t  *Ar, Float_t *du,Int_t *ki,Int_t *kf,Double_t *a1,Double_t *a2 ,Int_t *nu)
-
- {
-  static  const Double_t one=1;
-  Int_t l,ik,ikj;
-  Double_t temp;
-  Double_t ddu,delu,ar;
-
-  Int_t nk,ku;
-  temp=*u;
-  nk=*nu;
-  ik=*ki;
-  delu=*du; 
-
-  ar=Ar[ik];
-  ddu=temp-ar;
-
-  ku=int(ddu/delu);
-  ikj=ik+ku;
-  if (ddu<=0) ikj=0;
-
-   for(l=ikj; l<nk; l++)
-   {
-
-    if(temp < Ar[l])
-     {
-      *kf=l;
-      *a2=(temp-Ar[l])/(Ar[l+1]-Ar[l]);
-      *a1= one - *a2;
-      break;     
-     }
-    }
-  }
-
-/*-------------FRfuncBi----------------*/
-
-void AliMagFDM::FRfuncBi(Int_t *kai,Double_t *za1, Double_t *za2, Double_t *al1, Double_t *al2, Double_t *al3, Int_t *ka, Int_t *ma, Double_t *ba)
-  
-{
-Double_t fa11,fa12,fa13;
-Double_t fa21,fa22,fa23;
-Double_t faY1,faY2;
-Double_t bba;
-
-Double_t zaa1,zaa2,alf1,alf2,alf3;
-Int_t kaai,kaa,maa;
-kaai=*kai;
-kaa=*ka;
-maa=*ma;
-zaa1=*za1;
-zaa2=*za2;
-alf1=*al1;  
-alf2=*al2;
-alf3=*al3; 
-
- if (kaai==0 ) {
-              fa11 = fdBpx[kaa][0][0];
-              fa12 = fdBpx[kaa][0][maa];
-              fa13 = fdBpx[kaa][0][maa+1];
-              fa21 = fdBpx[kaa+1][0][0];
-              fa22 = fdBpx[kaa+1][0][maa];               
-              fa23 = fdBpx[kaa+1][0][maa+1]; 
-              }
- if (kaai==1 ) {
-              fa11 = fdBpy[kaa][0][0];
-              fa12 = fdBpy[kaa][0][maa];
-              fa13 = fdBpy[kaa][0][maa+1];
-              fa21 = fdBpy[kaa+1][0][0];
-              fa22 = fdBpy[kaa+1][0][maa];               
-              fa23 = fdBpy[kaa+1][0][maa+1]; 
-              }
- if (kaai==2 ) {
-              fa11 = fdBpz[kaa][0][0];
-              fa12 = fdBpz[kaa][0][maa];
-              fa13 = fdBpz[kaa][0][maa+1];
-              fa21 = fdBpz[kaa+1][0][0];
-              fa22 = fdBpz[kaa+1][0][maa];               
-              fa23 = fdBpz[kaa+1][0][maa+1]; 
-              }                            
-    faY1=alf1*fa11+alf2*fa12+alf3*fa13;
-    faY2=alf1*fa21+alf2*fa22+alf3*fa23;
-    bba =  zaa1*faY1+zaa2*faY2;    
-    *ba=bba;
-
-}
-
-  
-/*----------- FGfuncBi------------*/
-
-void AliMagFDM::FGfuncBi(Double_t *zz1,Double_t *zz2, Double_t *yy1,Double_t *yy2, Double_t *xx1,Double_t *xx2, Int_t *kvr, Int_t *kk, Int_t *ll, Int_t *mm, Double_t *bb)
-
-{  
-Double_t fy1, fy2, ffy;
-Double_t gy1,gy2,ggy;
-Double_t z1,z2,y1,y2,x1,x2;
-
-Int_t k,l,m,kv;
-Double_t bbi;
-
-Double_t bf11,bf12,bf21,bf22;
-Double_t bg11,bg12,bg21,bg22;
-k=*kk;
-l=*ll;
-m=*mm;
-
-kv=*kvr;
-
-z1=*zz1;
-z2=*zz2;
-y1=*yy1;
-y2=*yy2;
-x1=*xx1;
-x2=*xx2; 
-/*-----------------Polar part ------------------*/
-
-if(kv==0) {
-           bf11=fdBpx[k][l][m];
-           bf12=fdBpx[k+1][l][m];
-           bf21=fdBpx[k+1][l+1][m];
-           bf22=fdBpx[k][l+1][m];
-           
-           bg11=fdBpx[k][l][m+1];
-           bg12=fdBpx[k+1][l][m+1];
-           bg21=fdBpx[k+1][l+1][m+1];
-           bg22=fdBpx[k][l+1][m+1];
-           }
- if(kv==1) {
-           bf11=fdBpy[k][l][m];
-           bf12=fdBpy[k+1][l][m];
-           bf21=fdBpy[k+1][l+1][m];
-           bf22=fdBpy[k][l+1][m];
-           
-           bg11=fdBpy[k][l][m+1];
-           bg12=fdBpy[k+1][l][m+1];
-           bg21=fdBpy[k+1][l+1][m+1];
-           bg22=fdBpy[k][l+1][m+1];
-           }  
-                   
- if(kv==2) {
-           bf11=fdBpz[k][l][m];
-           bf12=fdBpz[k+1][l][m];
-           bf21=fdBpz[k+1][l+1][m];
-           bf22=fdBpz[k][l+1][m];
-           
-           bg11=fdBpz[k][l][m+1];
-           bg12=fdBpz[k+1][l][m+1];
-           bg21=fdBpz[k+1][l+1][m+1];
-           bg22=fdBpz[k][l+1][m+1];           
-           } 
-/*-----------------Cartensian part ---------------*/ 
-                   
- if(kv==3) {
-           bf11=fdBcx[k][l][m];
-           bf12=fdBcx[k+1][l][m];
-           bf21=fdBcx[k+1][l+1][m];
-           bf22=fdBcx[k][l+1][m];
-           
-           bg11=fdBcx[k][l][m+1];
-           bg12=fdBcx[k+1][l][m+1];
-           bg21=fdBcx[k+1][l+1][m+1];
-           bg22=fdBcx[k][l+1][m+1];
-           }          
-                      
- if(kv==4) {
-           bf11=fdBcy[k][l][m];
-           bf12=fdBcy[k+1][l][m];
-           bf21=fdBcy[k+1][l+1][m];
-           bf22=fdBcy[k][l+1][m];
-           
-           bg11=fdBcy[k][l][m+1];
-           bg12=fdBcy[k+1][l][m+1];
-           bg21=fdBcy[k+1][l+1][m+1];
-           bg22=fdBcy[k][l+1][m+1];
-           }          
- if(kv==5) {
-           bf11=fdBcz[k][l][m];
-           bf12=fdBcz[k+1][l][m];
-           bf21=fdBcz[k+1][l+1][m];
-           bf22=fdBcz[k][l+1][m];
-           
-           bg11=fdBcz[k][l][m+1];
-           bg12=fdBcz[k+1][l][m+1];
-           bg21=fdBcz[k+1][l+1][m+1];
-           bg22=fdBcz[k][l+1][m+1];
-           }  
-
-                                       
-     fy1=z1*bf11+z2*bf12;
-     fy2=z2*bf21+z1* bf22;
-     ffy=y1*fy1+ y2*fy2; 
-     
-
-     gy1 = z1*bg11+z2*bg12;
-     gy2 = z2*bg21+z1*bg22;
-     ggy= y1*gy1 +  y2*gy2;
-
-     bbi =  x1*ffy+x2*ggy;
-   
-     *bb=bbi; 
-     
-}     
-//____________________________________________
-
-void AliMagFDM::ReadField()
-{
-  FILE *magfile;
-
-  Int_t ik, il, im;
-  Float_t zzp, rr,phii;
-  Float_t zz, yy, bx,by,bz,bb;
-
-  char *fname;
-  printf("Reading Magnetic Field %s from file %s\n",fName.Data(),fTitle.Data());
-  fname = gSystem->ExpandPathName(fTitle.Data());
-  magfile=fopen(fname,"r");
-  delete [] fname;
-
-  printf("Cartensian part\n");
-  if (magfile) {
-  
-//  Cartensian part 
-    fscanf(magfile,"%d %d %d ",&fdYl, &fdXl, &fdZl); 
-    
-    printf("fdYl %d, fdXl %d, fdZl %d\n",fdYl, fdXl, fdZl);     
-    
-    for (ik=0; ik<fdZl; ik++)
-    { 
-   
-      fscanf(magfile, " %e ", &zz);
-      fdZc[ik]=zz; 
-
-    } 
-   
-    for (ik=0; ik<fdYl; ik++)
-    {    
-       fscanf(magfile, " %e ", &yy); 
-       fdY[ik]=yy;
-    } 
-    for (ik=0; ik<81; ik++)
-    {    
-           printf("fdZc %e,fdY %e\n", fdZc[ik],fdY[ik]); 
-    }   
-             
-    fscanf(magfile," %e %e %e %e %e %e %e %e %e %e %e ", &fdYdel,&fdXdel,&fdZdel,&fdZmax,&fdZmin,&fdYmax,&fdYmin,&fdAx1,&fdCx1,&fdAx2,&fdCx2); 
-
-printf("fdYdel %e, fdXdel %e, fdZdel %e\n",fdYdel,fdXdel,fdZdel);
-printf("fdZmax %e, fdZmin %e, fdYmax %e,fdYmin %e\n",fdZmax,fdZmin,fdYmax,fdYmin);
-printf("fdAx1 %e, fdCx1 %e, fdAx2 %e, fdCx %e\n",fdAx1,fdCx1,fdAx2,fdCx2);
-
-    for (il=0; il<44; il++)  { 
-     for (im=0; im<81; im++)  {      
-      for (ik=0; ik<81; ik++)  {      
-      
-      fscanf(magfile, " %e ", &by); 
-      fdBcy[ik][im][il]=by;        
-      }
-     }
-    } 
-
-    for (il=0; il<44; il++)  { 
-     for (im=0; im<81; im++)  {      
-      for (ik=0; ik<81; ik++)  {      
-      
-      fscanf(magfile, " %e ", &bx); 
-      fdBcx[ik][im][il]=bx;        
-      }    
-     }     
-    }
-    
-   for (il=0; il<44; il++)  { 
-     for (im=0; im<81; im++)  {      
-      for (ik=0; ik<81; ik++)  {      
-      
-      fscanf(magfile, " %e ", &bz); 
-      fdBcz[ik][im][il]=bz;          
-      }              
-     }     
-    } 
-//----------------------   Polar part ---------------------------------
-
-    printf("Polar part\n");
-    fscanf(magfile,"%d %d %d ", &fdZpl, &fdRn, &fdPhin); 
-    printf("fdZpl %d, fdRn %d, fdPhin %d\n",fdZpl,fdRn,fdPhin);   
-
-    printf(" fdZp array\n"); 
-     
-    for (ik=0; ik<51; ik++) 
-    {    
-     fscanf(magfile, " %e ", &zzp);
-     fdZp[ik]=zzp; 
-     printf(" %e\n",fdZp[ik]);      
-    } 
-  
-    printf(" fdR array\n"); 
-         
-    for (ik=0; ik<10; ik++) 
-    {    
-     fscanf(magfile, " %e ", &rr); 
-     fdR[ik]=rr;
-     printf(" %e\n",fdR[ik]);
-    } 
-    
-//    printf("fdPhi array\n"); 
-     
-     for (il=0; il<33; il++)  
-     {
-       fscanf(magfile, " %e ", &phii); 
-       fdPhi[il]=phii; 
-//        printf(" %e\n",fdPhi[il]);          
-     }
-
-    fscanf(magfile," %e %e %e %e %e %e %e ",&fdZpdl,&fdPhid,&fdRdel,&fdZpmx,&fdZpmn,&fdRmax, &fdRmin); 
-
-printf("fdZpdl %e, fdPhid %e, fdRdel %e, fdZpmx %e, fdZpmn %e,fdRmax %e,fdRmin %e \n", fdZpdl,fdPhid, fdRdel,fdZpmx, fdZpmn,fdRmax, fdRmin);
-
-                      
-    for (il=0; il<33; il++)  { 
-     for (im=0; im<10; im++)  {      
-      for (ik=0; ik<51; ik++)  {
-      fscanf(magfile, " %e ", &by); 
-        fdBpy[ik][im][il]=by;        
-      }
-     }
-    } 
-    
-    for (il=0; il<33; il++)  { 
-     for (im=0; im<10; im++)  {      
-      for (ik=0; ik<51; ik++)  {
-      fscanf(magfile, " %e ", &bx); 
-        fdBpx[ik][im][il]=bx;                     
-      }    
-     }     
-    }      
-
-
-    for (il=0; il<33; il++)  { 
-     for (im=0; im<10; im++)  {      
-      for (ik=0; ik<51; ik++)  {
-      fscanf(magfile, " %e ", &bz); 
-        fdBpz[ik][im][il]=bz;                      
-      }              
-     }     
-    } 
-    
-    
-    for (il=0; il<32; il++) { 
-     for (im=0; im<2; im++)  {      
-      for (ik=0; ik<2; ik++)  {
-      fscanf(magfile, " %e ", &bb);    
-        fdB[ik][im][il]=bb;  
-      }              
-     } 
-    }
-//
-  } else { 
-    printf("File %s not found !\n",fTitle.Data());
-    exit(1);
-  }
-}
-//________________________________  
 
 
   
index cb7416b4d7df3a2f6e35ac47fc32a8bfaf633dfc..15b7001671a0c455a039201acc70499047757ac7 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliMagF_H
-#define AliMagF_H
+#ifndef ALIMAGF_H
+#define ALIMAGF_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -8,17 +8,10 @@
 #include "TNamed.h"
 #include "TVector.h"
 
-enum Field_t {Undef=1, Const=1, ConMesh=2, DipoMap=3};
+enum Field_t {kUndef=1, kConst=1, kConMesh=2, kDipoMap=3};
 
 class AliMagF : public TNamed {
 
-protected:
-  Int_t     fMap;    // Field Map identifier
-  Int_t     fType;   // Mag Field type
-  Int_t     fInteg;  // Integration method as indicated in Geant
-  Float_t   fFactor; // Multiplicative factor
-  Float_t   fMax;    // Max Field as indicated in Geant
-
 public:
   AliMagF(){}
   AliMagF(const char *name, const char *title, const Int_t integ, const Int_t map, 
@@ -32,137 +25,38 @@ public:
   virtual Float_t Factor() const {return fFactor;}
   virtual void ReadField() {}
   
-  ClassDef(AliMagF,1)  //Base class for all Alice MagField
-};
-
-class AliMagFC  : public AliMagF
-{
-  //Alice Constant Magnetic Field
-private:
-
-public:
-  AliMagFC(){}
-  AliMagFC(const char *name, const char *title, const Int_t integ, const Int_t map, 
-          const Float_t factor, const Float_t fmax);
-  virtual ~AliMagFC() {}
-  virtual void Field(Float_t *x, Float_t *b);
-  virtual void ReadField() {}
-  
-  ClassDef(AliMagFC,1)  //Class for all Alice Constant MagField 
-};
-
-class AliMagFCM : public AliMagF
-{
-  //Alice Magnetic Field with constan mesh
 protected:
+  Int_t     fMap;    // Field Map identifier
+  Int_t     fType;   // Mag Field type
+  Int_t     fInteg;  // Integration method as indicated in Geant
+  Float_t   fFactor; // Multiplicative factor
+  Float_t   fMax;    // Max Field as indicated in Geant
 
-  Float_t    fXbeg;  // Start of mesh in x
-  Float_t    fYbeg;  // Start of mesh in y
-  Float_t    fZbeg;  // Start of mesh in z
-  Float_t    fXdel;  // Mesh step in x
-  Float_t    fYdel;  // Mesh step in y
-  Float_t    fZdel;  // Mesh step in z
-  Double_t   fXdeli; // Inverse of Mesh step in x
-  Double_t   fYdeli; // Inverse of Mesh step in y
-  Double_t   fZdeli; // Inverse of Mesh step in z
-  Int_t      fXn;    // Number of mesh points in x
-  Int_t      fYn;    // Number of mesh points in y
-  Int_t      fZn;    // Number of mesh points in z
-  TVector   *fB;     // Field map
-public:
-  AliMagFCM(){}
-  AliMagFCM(const char *name, const char *title, const Int_t integ, const Int_t map, 
-          const Float_t factor, const Float_t fmax);
-  virtual ~AliMagFCM() {delete fB;}
-  virtual void Field(Float_t *x, Float_t *b);
-  virtual void ReadField();
-
-  inline Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) {
-    return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix));
-  }
-  inline Float_t By(const Int_t ix, const Int_t iy, const Int_t iz) {
-    return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+1);
-  }
-  inline Float_t Bz(const Int_t ix, const Int_t iy, const Int_t iz) {
-    return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+2);
-  }
-  
-  ClassDef(AliMagFCM,1)  //Class for all Alice MagField with Constant Mesh
+  ClassDef(AliMagF,1)  //Base class for all Alice MagField
 };
-//************************************
-//
-class AliMagFDM : public AliMagF
-{
-//Alice Magnetic Field:Magnetic field map from IP to muon filter for Muon arm
 
-protected:
+//ZDC part -------------------------------------------------------------------
 
+  static const Float_t kG1=20.03;
+  static const Float_t kFDIP=-37.34;
+  static const Float_t kFDIMU=6.;
+  static const Float_t kFCORN=11.72;
 //
-
-  Int_t      fdInd;   // Character number of validity Map region
-
-  Float_t fdZmin;  // Start of the cartesian  part  of MAP in z
-  Float_t fdZmax;  // End of Map in z   
-  Float_t fdYmax;  // Start of the cartesian  part  of MAP in y
-  Float_t fdYmin;  // End  of the cartesian  part  of MAP in y
-  Float_t fdZpmx;  // End of the polar  part  of MAP in z
-  Float_t fdZpmn;  // Start of the polar  part  of MAP in z
-  Float_t fdRmax;  // Maximal radius of the polar  part  of MAP 
-  Float_t fdRmin;  // Minimal radius of the polar  part  of MAP  
-              
-
-  Float_t    fdXdel;  //  step in x - cartesian  part  of MAP
-  Float_t    fdYdel;  //  step in y - cartesian  part  of MAP
-  Float_t    fdZdel;  //  step in z - cartesian  part  of MAP
-  
-  Float_t    fdRdel;  //  step in r - polar  part  of MAP
-  Float_t    fdPhid;  //  step in Phi - polar  part  of MAP
-  Float_t    fdZpdl;  //  step in z - polar  part  of MAP 
-  
-  Float_t    fdCx1, fdCx2;
-  Float_t    fdAx1, fdAx2; 
-   
-  Float_t fdZc[81];  // z coordinates in cartesian  part
-  Float_t fdY[81];   // y coordinates in cartesian  part 
-  Float_t fdBcx[81][81][44]; // Bx array for cartesian  part
-  Float_t fdBcy[81][81][44]; // By array for cartesian  part
-  Float_t fdBcz[81][81][44]; // Bz array for cartesian  part
-
-  Float_t  fdZp[51];  // z coordinates in polar  part
-  Float_t  fdR[10];   // r coordinates in polar  part  
-  Float_t  fdPhi[33]; // Phi coordinates in polar  part
-
-  Float_t  fdBpx[51][10][33]; // Bx array for polar  part
-  Float_t  fdBpy[51][10][33]; // By array for polar  part
-  Float_t  fdBpz[51][10][33]; // Bx array for polar  part 
-  Float_t  fdB[2][2][32]; 
-  
-  Int_t      fdXl;    // Number steps in x for cartesian  part
-  Int_t      fdYl;    // Number steps in y  for cartesian  par
-  Int_t      fdZl;    // Number steps in z  for cartesian  part
-    
-  Int_t      fdRn;    // Number steps in r for polar  part
-  Int_t      fdPhin;  // Number steps in Phi for polar  part
-  Int_t      fdZpl;   // Number steps in z for polar  part 
-  
-  Float_t  rrtes;
-
-public:
-  AliMagFDM(){}
-  AliMagFDM(const char *name, const char *title, const Int_t integ, const Int_t
-  map, const Float_t factor, const Float_t fmax);
-  virtual ~AliMagFDM(){} 
-  virtual void Field(Float_t *x, Float_t *b);
-  virtual void ReadField(); 
-  
-
-  void FZ(Double_t *u, Float_t *Ar, Float_t *du, Int_t *ki, Int_t *kf, Double_t *a1, Double_t *a2 , Int_t *nu);
-  void FRfuncBi(Int_t *kai, Double_t *za1, Double_t *za2, Double_t *al1, Double_t *al2, Double_t *al3, Int_t *ka, Int_t *ma,Double_t  *ba);
-  void FGfuncBi(Double_t *z1, Double_t *z2, Double_t *y1, Double_t *y2, Double_t *x1, Double_t *x2, Int_t *kvr, Int_t *k, Int_t *l, Int_t *m, Double_t *bb); 
-//_________________________________________
-
-  ClassDef(AliMagFDM,1) //Class Magnetic field map from IP till muon filter
-};
-
+// 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 kCORBEG=1920,kCOREND=kCORBEG+190, kCORRA2=4.5*4.5;
+//
+  static const Float_t kZBEG=2300;
+  static const Float_t kZ1BEG=kZBEG+   0,kZ1END=kZ1BEG+630,kZ1RA2=3.5*3.5;
+  static const Float_t kZ2BEG=kZBEG+ 880,kZ2END=kZ2BEG+550,kZ2RA2=3.5*3.5;
+  static const Float_t kZ3BEG=kZBEG+1530,kZ3END=kZ3BEG+550,kZ3RA2=3.5*3.5;
+  static const Float_t kZ4BEG=kZBEG+2430,kZ4END=kZ4BEG+630,kZ4RA2=3.5*3.5;
+  static const Float_t kD1BEG=5843.5    ,kD1END=kD1BEG+945,kD1RA2=4.5*4.5;
+  static const Float_t kD2BEG=12113.2   ,kD2END=kD2BEG+945,kD2RA2=4.5*.5;
+
+//ZDC part -------------------------------------------------------------------
 
 #endif
diff --git a/STEER/AliMagFC.cxx b/STEER/AliMagFC.cxx
new file mode 100644 (file)
index 0000000..8029770
--- /dev/null
@@ -0,0 +1,117 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliMagFC.h"
+
+ClassImp(AliMagFC)
+
+//________________________________________
+AliMagFC::AliMagFC(const char *name, const char *title, const Int_t integ, 
+                  const Int_t map, const Float_t factor, const Float_t fmax)
+  : AliMagF(name,title,integ,map,factor,fmax)
+{
+  // 
+  // Standard constructor
+  //
+  printf("Constant Field %s created: map= %d, factor= %f\n",fName.Data(),map,
+        factor);
+  fType = kConst;
+}
+
+//________________________________________
+void AliMagFC::Field(Float_t *x, Float_t *b)
+{
+  //
+  // Method to return the field in a point
+  //
+  b[0]=b[1]=b[2]=0;
+  if(fMap==1) {
+    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;
+      }
+      else {
+//This is the ZDC part
+       Float_t rad2=x[0]*x[0]+x[1]*x[1];
+       if(rad2<kD2RA2) {
+         if(x[2]>kD2BEG) {
+           
+//    Separator Dipole D2
+           if(x[2]<kD2END) b[1]=kFDIP;
+         } else if(x[2]>kD1BEG) {
+           
+//    Separator Dipole D1
+           if(x[2]<kD1END) b[1]=-kFDIP;
+         }
+         if(rad2<kCORRA2) {
+
+//    First quadrupole of inner triplet de-focussing in x-direction
+//    Inner triplet
+           if(x[2]>kZ4BEG) {
+             if(x[2]<kZ4END) {
+             
+//    2430 <-> 3060
+               b[0]=-kG1*x[1];
+               b[1]=-kG1*x[0];
+             }
+           } else if(x[2]>kZ3BEG) {
+             if(x[2]<kZ3END) {
+
+//    1530 <-> 2080
+               b[0]=kG1*x[1];
+               b[1]=kG1*x[0];
+             }
+           } else if(x[2]>kZ2BEG) {
+             if(x[2]<kZ2END) {
+             
+//    890 <-> 1430
+               b[0]=kG1*x[1];
+               b[1]=kG1*x[0];
+             }
+           } else if(x[2]>kZ1BEG) {
+             if(x[2]<kZ1END) {
+
+//    0 <->  630
+               b[0]=-kG1*x[1];
+               b[1]=-kG1*x[0];
+             }
+           } else if(x[2]>kCORBEG) {
+             if(x[2]<kCOREND) {
+//    Corrector dipole (because of dimuon arm)
+               b[0]=kFCORN;
+             }
+           }
+         }
+       }
+      }
+    }
+    if(fFactor!=1) {
+      b[0]*=fFactor;
+      b[1]*=fFactor;
+      b[2]*=fFactor;
+    }
+  } else {
+    printf("Invalid field map for constant field %d\n",fMap);
+    exit(1);
+  }
+}
+
diff --git a/STEER/AliMagFC.h b/STEER/AliMagFC.h
new file mode 100644 (file)
index 0000000..d1a9b9e
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef ALIMAGFC_H
+#define ALIMAGFC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMagF.h"
+
+class AliMagFC  : public AliMagF
+{
+  //Alice Constant Magnetic Field
+
+public:
+  AliMagFC(){}
+  AliMagFC(const char *name, const char *title, const Int_t integ, 
+          const Int_t map, const Float_t factor, const Float_t fmax);
+  virtual ~AliMagFC() {}
+  virtual void Field(Float_t *x, Float_t *b);
+  virtual void ReadField() {}
+  
+  ClassDef(AliMagFC,1)  //Class for all Alice Constant MagField 
+};
+
+#endif
diff --git a/STEER/AliMagFCM.cxx b/STEER/AliMagFCM.cxx
new file mode 100644 (file)
index 0000000..2de1a2d
--- /dev/null
@@ -0,0 +1,241 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliMagFCM.h"
+#include "TSystem.h"
+
+ClassImp(AliMagFCM)
+
+//________________________________________
+AliMagFCM::AliMagFCM(const char *name, const char *title, const Int_t integ, 
+                    const Int_t map, const Float_t factor, const Float_t fmax)
+  : AliMagF(name,title,integ,map,factor,fmax)
+{
+  //
+  // Standard constructor
+  //
+  fType = kConMesh;
+  printf("Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n",
+        fName.Data(),map,factor,fTitle.Data());
+}
+
+//________________________________________
+AliMagFCM::AliMagFCM(const AliMagFCM &magf)
+{
+  //
+  // Copy constructor
+  //
+  magf.Copy(*this);
+}
+
+//________________________________________
+void AliMagFCM::Field(Float_t *x, Float_t *b)
+{
+  //
+  // Method to calculate the magnetic field
+  //
+  Double_t ratx, raty, ratz, hix, hiy, hiz, ratx1, raty1, ratz1, 
+    bhyhz, bhylz, blyhz, blylz, bhz, blz, xl[3];
+  const Double_t kone=1;
+  Int_t ix, iy, iz;
+  
+  // --- find the position in the grid ---
+  
+  b[0]=b[1]=b[2]=0;
+  if(-700<x[2] && x[2]<fZbeg && x[0]*x[0]+(x[1]+30)*(x[1]+30) < 560*560) {
+    b[2]=2;
+  } else  {
+    Bool_t infield=(fZbeg<=x[2] && x[2]<fZbeg+fZdel*(fZn-1)
+                   &&  ( fXbeg <= TMath::Abs(x[0]) && TMath::Abs(x[0]) < fXbeg+fXdel*(fXn-1) )
+                   &&  ( fYbeg <= TMath::Abs(x[1]) && TMath::Abs(x[1]) < fYbeg+fYdel*(fYn-1) ));
+    if(infield) {
+      xl[0]=TMath::Abs(x[0])-fXbeg;
+      xl[1]=TMath::Abs(x[1])-fYbeg;
+      xl[2]=x[2]-fZbeg;
+      
+      // --- start with x
+      
+      hix=xl[0]*fXdeli;
+      ratx=hix-int(hix);
+      ix=int(hix);
+      
+      hiy=xl[1]*fYdeli;
+      raty=hiy-int(hiy);
+      iy=int(hiy);
+      
+      hiz=xl[2]*fZdeli;
+      ratz=hiz-int(hiz);
+      iz=int(hiz);
+      
+      if(fMap==2) {
+       // ... simple interpolation
+       ratx1=kone-ratx;
+       raty1=kone-raty;
+       ratz1=kone-ratz;
+       bhyhz = Bx(ix  ,iy+1,iz+1)*ratx1+Bx(ix+1,iy+1,iz+1)*ratx;
+       bhylz = Bx(ix  ,iy+1,iz  )*ratx1+Bx(ix+1,iy+1,iz  )*ratx;
+       blyhz = Bx(ix  ,iy  ,iz+1)*ratx1+Bx(ix+1,iy  ,iz+1)*ratx;
+       blylz = Bx(ix  ,iy  ,iz  )*ratx1+Bx(ix+1,iy  ,iz  )*ratx;
+       bhz   = blyhz             *raty1+bhyhz             *raty;
+       blz   = blylz             *raty1+bhylz             *raty;
+       b[0]  = blz               *ratz1+bhz               *ratz;
+       //
+       bhyhz = By(ix  ,iy+1,iz+1)*ratx1+By(ix+1,iy+1,iz+1)*ratx;
+       bhylz = By(ix  ,iy+1,iz  )*ratx1+By(ix+1,iy+1,iz  )*ratx;
+       blyhz = By(ix  ,iy  ,iz+1)*ratx1+By(ix+1,iy  ,iz+1)*ratx;
+       blylz = By(ix  ,iy  ,iz  )*ratx1+By(ix+1,iy  ,iz  )*ratx;
+       bhz   = blyhz             *raty1+bhyhz             *raty;
+       blz   = blylz             *raty1+bhylz             *raty;
+       b[1]  = blz               *ratz1+bhz               *ratz;
+       //
+       bhyhz = Bz(ix  ,iy+1,iz+1)*ratx1+Bz(ix+1,iy+1,iz+1)*ratx;
+       bhylz = Bz(ix  ,iy+1,iz  )*ratx1+Bz(ix+1,iy+1,iz  )*ratx;
+       blyhz = Bz(ix  ,iy  ,iz+1)*ratx1+Bz(ix+1,iy  ,iz+1)*ratx;
+       blylz = Bz(ix  ,iy  ,iz  )*ratx1+Bz(ix+1,iy  ,iz  )*ratx;
+       bhz   = blyhz             *raty1+bhyhz             *raty;
+       blz   = blylz             *raty1+bhylz             *raty;
+       b[2]  = blz               *ratz1+bhz               *ratz;
+       //printf("ratx,raty,ratz,b[0],b[1],b[2] %f %f %f %f %f %f\n",
+       //ratx,raty,ratz,b[0],b[1],b[2]);
+       //
+       // ... use the dipole symmetry
+       if (x[0]*x[1] < 0) b[1]=-b[1];
+       if (x[0]<0) b[2]=-b[2];
+      } else {
+       printf("Invalid field map for constant mesh %d\n",fMap);
+      }
+    } else {
+      //This is the ZDC part
+      Float_t rad2=x[0]*x[0]+x[1]*x[1];
+      if(rad2<kD2RA2) {
+       if(x[2]>kD2BEG) {
+         
+         //    Separator Dipole D2
+         if(x[2]<kD2END) b[1]=kFDIP;
+       } else if(x[2]>kD1BEG) {
+         
+         //    Separator Dipole D1
+         if(x[2]<kD1END) b[1]=-kFDIP;
+       }
+       if(rad2<kCORRA2) {
+         
+         //    First quadrupole of inner triplet de-focussing in x-direction
+         //    Inner triplet
+         if(x[2]>kZ4BEG) {
+           if(x[2]<kZ4END) {
+             
+             //    2430 <-> 3060
+             b[0]=-kG1*x[1];
+             b[1]=-kG1*x[0];
+           }
+         } else if(x[2]>kZ3BEG) {
+           if(x[2]<kZ3END) {
+             
+             //    1530 <-> 2080
+             b[0]=kG1*x[1];
+             b[1]=kG1*x[0];
+           }
+         } else if(x[2]>kZ2BEG) {
+           if(x[2]<kZ2END) {
+             
+             //    890 <-> 1430
+             b[0]=kG1*x[1];
+             b[1]=kG1*x[0];
+           }
+         } else if(x[2]>kZ1BEG) {
+           if(x[2]<kZ1END) {
+             
+             //    0 <->  630
+             b[0]=-kG1*x[1];
+             b[1]=-kG1*x[0];
+           }
+         } else if(x[2]>kCORBEG) {
+           if(x[2]<kCOREND) {
+             //    Corrector dipole (because of dimuon arm)
+             b[0]=kFCORN;
+           }
+         }
+       }
+      }
+    }
+  }
+  if(fFactor!=1) {
+    b[0]*=fFactor;
+    b[1]*=fFactor;
+    b[2]*=fFactor;
+  }
+}
+
+//________________________________________
+void AliMagFCM::ReadField()
+{
+  // 
+  // Method to read the magnetic field map from file
+  //
+  FILE *magfile;
+  Int_t ix, iy, iz, ipx, ipy, ipz;
+  Float_t bx, by, bz;
+  char *fname;
+  printf("Reading Magnetic Field %s from file %s\n",fName.Data(),fTitle.Data());
+  fname = gSystem->ExpandPathName(fTitle.Data());
+  magfile=fopen(fname,"r");
+  delete [] fname;
+  if (magfile) {
+    fscanf(magfile,"%d %d %d %f %f %f %f %f %f",
+          &fXn, &fYn, &fZn, &fXdel, &fYdel, &fZdel, &fXbeg, &fYbeg, &fZbeg);
+    printf("fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f\n",
+          fXn, fYn, fZn, fXdel, fYdel, fZdel, fXbeg, fYbeg, fZbeg);
+    fXdeli=1./fXdel;
+    fYdeli=1./fYdel;
+    fZdeli=1./fZdel;
+    fB = new TVector(3*fXn*fYn*fZn);
+    for (iz=0; iz<fZn; iz++) {
+      ipz=iz*3*(fXn*fYn);
+      for (iy=0; iy<fYn; iy++) {
+       ipy=ipz+iy*3*fXn;
+       for (ix=0; ix<fXn; ix++) {
+         ipx=ipy+ix*3;
+         fscanf(magfile,"%f %f %f",&bz,&by,&bx);
+         (*fB)(ipx+2)=bz;
+         (*fB)(ipx+1)=by;
+         (*fB)(ipx  )=bx;
+       }
+      }
+    }
+  } else { 
+    printf("File %s not found !\n",fTitle.Data());
+    exit(1);
+  }
+}
+
+//________________________________________
+void AliMagFCM::Copy(AliMagFCM &magf) const
+{
+  //
+  // Copy *this onto magf
+  //
+  Fatal("Copy","Not implemented!\n");
+}
+
+//________________________________________
+AliMagFCM & AliMagFCM::operator =(const AliMagFCM &magf)
+{
+  magf.Copy(*this);
+  return *this;
+}
diff --git a/STEER/AliMagFCM.h b/STEER/AliMagFCM.h
new file mode 100644 (file)
index 0000000..08c1ad4
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIMAGFCM_H
+#define ALIMAGFCM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMagF.h"
+
+class AliMagFCM : public AliMagF
+{
+  //Alice Magnetic Field with constan mesh
+
+public:
+  AliMagFCM(){}
+  AliMagFCM(const char *name, const char *title, const Int_t integ, const Int_t map, 
+          const Float_t factor, const Float_t fmax);
+  AliMagFCM(const AliMagFCM &mag);
+  virtual ~AliMagFCM() {delete fB;}
+  virtual void Field(Float_t *x, Float_t *b);
+  virtual void ReadField();
+  virtual void Copy(AliMagFCM &magf) const;
+  virtual AliMagFCM & operator=(const AliMagFCM &magf);
+
+  Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) {
+    return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix));
+  }
+  Float_t By(const Int_t ix, const Int_t iy, const Int_t iz) {
+    return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+1);
+  }
+  Float_t Bz(const Int_t ix, const Int_t iy, const Int_t iz) {
+    return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+2);
+  }
+
+protected:
+
+  Float_t    fXbeg;  // Start of mesh in x
+  Float_t    fYbeg;  // Start of mesh in y
+  Float_t    fZbeg;  // Start of mesh in z
+  Float_t    fXdel;  // Mesh step in x
+  Float_t    fYdel;  // Mesh step in y
+  Float_t    fZdel;  // Mesh step in z
+  Double_t   fXdeli; // Inverse of Mesh step in x
+  Double_t   fYdeli; // Inverse of Mesh step in y
+  Double_t   fZdeli; // Inverse of Mesh step in z
+  Int_t      fXn;    // Number of mesh points in x
+  Int_t      fYn;    // Number of mesh points in y
+  Int_t      fZn;    // Number of mesh points in z
+  TVector   *fB;     // Field map
+  
+  ClassDef(AliMagFCM,1)  //Class for all Alice MagField with Constant Mesh
+};
+
+#endif
diff --git a/STEER/AliMagFDM.cxx b/STEER/AliMagFDM.cxx
new file mode 100644 (file)
index 0000000..42e5000
--- /dev/null
@@ -0,0 +1,677 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliMagFDM.h"
+#include "TSystem.h"
+    
+
+ClassImp(AliMagFDM)
+
+//________________________________________
+AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ,
+const Int_t map, const Float_t factor, const Float_t fmax)
+  : AliMagF(name,title,integ,map,factor,fmax)
+  
+{
+  fType = kDipoMap;
+
+  printf("Field Map for Muon Arm from IP till muon filter %s created: map= %d, factor= %f, file=%s\n",fName.Data(),map,factor,fTitle.Data());
+  
+}
+
+//________________________________________
+
+void AliMagFDM::Field(Float_t *xfi, Float_t *b)
+{
+  //
+  // Main routine to compute the field in a point
+  //
+  static  const Double_t keps=0.1E-06;
+  static  const Double_t kpi2=.6283185E+01;
+  static  const Double_t kone=1;
+
+  static  const    Int_t  kiip=33; 
+  static  const    Int_t  kmiip=0;    
+  static  const    Int_t  kliip=0;
+
+  static  const    Int_t  kiic=0;
+  static  const    Int_t  kmiic=0;    
+  static  const    Int_t  kliic=0;       
+
+  static  const Double_t    kfdZbg=502.92;  // Start of Map using in z
+  static  const Double_t    kfdZL3=600;  // Beginning of L3 door in z
+
+  Double_t   x[3];   
+  Double_t   xL3[3]; 
+  Double_t   bint[3]; 
+  
+  Double_t r0;
+  
+  Double_t bbj;
+  Int_t iKvar,jb;
+
+  Double_t zp1, zp2,xp1,xp2,yp1,yp2; 
+  Double_t zz1, zz2,yy1,yy2,x2,x1; 
+     
+// --- start the map fiel from z = 502.92 cm ---
+
+  x[0] = xfi[0];
+  x[1] = xfi[1];
+  x[2] = xfi[2];
+  b[0]=b[1]=b[2]=0;
+  //       printf("x[0]  %f,x[1] %f,x[2]  %f\n",x[0],x[1],x[2]); 
+
+  Double_t rr=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
+           r0=rr/100;
+  Double_t rPmax;
+  rPmax=fdRmax; 
+  if ( (-700<x[2] && x[2]<=kfdZbg && 
+        (x[0]*x[0]+(x[1]+30)*(x[1]+30))< 560*560)
+       || (kfdZbg<x[2] && x[2]<=kfdZL3 && rr>=rPmax*100) )
+       {
+        b[2]=2;
+       }
+
+  xL3[0]=x[0]/100;
+  xL3[1]=(x[1]+30)/100;
+  xL3[2]=x[2]/100; 
+  Double_t xminn=xL3[2]*fdAx1+fdCx1;
+  Double_t xmaxx=xL3[2]*fdAx2+fdCx2;
+  Double_t zCmin,zCmax,yCmin,yCmax;
+
+  zCmin=fdZmin;
+  zCmax=fdZmax;
+  yCmin=fdYmin;
+  yCmax=fdYmax;
+          
+if ((kfdZbg/100<xL3[2] && xL3[2]<zCmin && r0<rPmax) || ((zCmin<=xL3[2] && xL3[2] <= zCmax ) && (yCmin<=xL3[1] && xL3[1]<= yCmax) &&  (xminn <= xL3[0] && xL3[0] <= xmaxx)))
+    {
+     if(fMap==3) 
+      { 
+       if (xL3[2]<zCmin && r0<rPmax)   
+       {
+       //---------------------  Polar part ----------------------
+       
+       Double_t yyp,ph0;
+       Int_t  kp0, lp0, mp0;
+       Int_t kpi,lpi,mpi;
+       Double_t alp1,alp2,alp3;
+       Double_t zpz,rp,fip,cphi; 
+
+       kpi=kiip; 
+       lpi=kliip;
+       mpi=kmiip;
+   
+       zpz=xL3[2];
+
+       FZ(&zpz, fdZp ,&fdZpdl,&kpi,&kp0,&zp1 ,&zp2,&fdZpl) ;
+
+       yyp=xL3[1]- 0.3;
+       cphi=yyp/r0;
+       ph0=TMath::ACos(cphi);
+       if (xL3[0]< 0) {ph0=kpi2 - ph0;}  
+                                  
+       fip=ph0;
+       FZ(&fip,fdPhi,&fdPhid ,&mpi,&mp0, &xp1,&xp2,&fdPhin); 
+
+       Double_t rDel;
+       rDel=fdRdel;
+
+       if (r0<= fdRdel)
+        {
+
+         if(r0< keps) 
+         {
+
+          bint[0]=(zp1*fdBpx[kp0][0][0] + zp2*fdBpx[kp0+1][0][0])*10;     
+          bint[1]=(zp1*fdBpy[kp0][0][0] + zp2*fdBpy[kp0+1][0][0])*10;      
+          bint[2]=(zp1*fdBpz[kp0][0][0] + zp2*fdBpz[kp0+1][0][0])*10; 
+
+         }  
+      
+        alp2= fdB[0][0][mp0]*yyp + fdB[0][1][mp0]*xL3[0]; 
+        alp3= fdB[1][0][mp0]*yyp + fdB[1][1][mp0]*xL3[0];      
+        alp1= kone - alp2 - alp3;
+     
+        for (jb=0; jb<3 ; jb++) 
+        {
+         iKvar=jb;     
+         FRfuncBi(&iKvar,&zp1,&zp2,&alp1,&alp2,&alp3, &kp0,&mp0, &bbj);
+         bint[jb] = bbj*10 ;
+        }  
+       }
+        else
+       {
+        rp=r0;
+
+        FZ(&rp,fdR ,&fdRdel,&lpi,&lp0,&yp1,&yp2,&fdRn);
+
+        for (jb=0; jb<3 ; jb++) 
+        {
+         iKvar=jb;
+         FGfuncBi(&zp1,&zp2,&yp1,&yp2,&xp1,&xp2,&iKvar,&kp0,&lp0,&mp0,&bbj); 
+
+         bint[jb] = bbj*10 ;
+        }
+       }
+
+       b[0]=bint[0];
+       b[1]=bint[1];
+       b[2]=bint[2];
+
+//    fprintf(fitest,"-------------   Freg2 run -------------\n");       
+  
+   }  
+   else 
+   {
+   //-------------- Cartensian part ------------------
+          
+   Double_t zzc,yyc; 
+   Int_t k0, l0,m0;
+   Double_t  xx1, xx2,dx, xxx ,xXl; 
+   Int_t kci,mci,lci;
+
+   kci=kiic;
+   lci=kliic;
+   mci=kmiic;
+
+   xx1 = fdAx1*xL3[2] + fdCx1;
+   xx2 = fdAx2*xL3[2] + fdCx2;
+
+   zzc=xL3[2];
+   FZ(&zzc, fdZc ,&fdZdel, &kci,&k0, &zz1, &zz2, &fdZl);     
+
+   yyc=xL3[1];
+   FZ(&yyc, fdY , &fdYdel,&lci, &l0, &yy1, &yy2,&fdYl);  
+
+   xXl = fdXl-kone; 
+   dx = (xx2-xx1)/xXl;
+   xxx= xL3[0]-xx1;
+   //     xm = xxx/dx; 
+   m0 = int(xxx/dx);   
+
+   if(xL3[0]<(xx1+m0*dx) || xL3[0] >(xx1+(m0+1)*dx)) 
+    {
+      m0=m0+1;   
+      printf(" m0 %d, m0+1 %d\n",m0,m0+1);  
+    }
+
+   x2=(xL3[0]-( xx1+m0*dx))/dx;
+   x1=kone-x2;
+   m0=m0-1;
+   for (jb=3; jb<6; jb++) 
+     {
+       iKvar=jb;     
+       FGfuncBi(&zz1,&zz2,&yy1,&yy2,&x1,&x2,&iKvar,&k0, &l0, &m0, &bbj); 
+       bint[jb-3] = bbj*10 ; 
+     }    
+   b[0]=bint[0];
+   b[1]=bint[1];
+   b[2]=bint[2]; 
+
+//   fprintf(fitest,"------------   Freg1 run -----------------\n");            
+   } 
+
+  } else {
+        printf("Unknown map of Dipole region %d\n",fMap);
+ }
+           
+} else {
+
+//This is the ZDC part
+      Float_t rad2=x[0]*x[0]+x[1]*x[1];
+      if(rad2<kD2RA2) {
+        if(x[2]>kD2BEG) {
+          
+//    Separator Dipole D2
+          if(x[2]<kD2END) b[1]=kFDIP;
+        } else if(x[2]>kD1BEG) {
+
+//    Separator Dipole D1
+          if(x[2]<kD1END) b[1]=-kFDIP;
+        }
+        if(rad2<kCORRA2) {
+
+//    First quadrupole of inner triplet de-focussing in x-direction
+//    Inner triplet
+          if(x[2]>kZ4BEG) {
+            if(x[2]<kZ4END) {
+              
+//    2430 <-> 3060
+              b[0]=-kG1*x[1];
+              b[1]=-kG1*x[0];
+            }
+          } else if(x[2]>kZ3BEG) {
+            if(x[2]<kZ3END) {
+
+//    1530 <-> 2080
+              b[0]=kG1*x[1];
+              b[1]=kG1*x[0];
+            }
+          } else if(x[2]>kZ2BEG) {
+            if(x[2]<kZ2END) {
+
+//    890 <-> 1430
+              b[0]=kG1*x[1];
+              b[1]=kG1*x[0];
+            }
+          } else if(x[2]>kZ1BEG) {
+            if(x[2]<kZ1END) {
+
+//    0 <->  630
+              b[0]=-kG1*x[1];
+              b[1]=-kG1*x[0];
+            }
+          } else if(x[2]>kCORBEG) {
+            if(x[2]<kCOREND) {
+//    Corrector dipole (because of dimuon arm)
+//            b[0]=kFCORN;
+              b[0]=-kFCORN;
+            }
+          }
+        }
+      }
+    }
+
+  if(fFactor!=1) {
+    b[0]*=fFactor;
+    b[1]*=fFactor;
+    b[2]*=fFactor;
+  }
+}
+
+//_________________________________________
+
+void AliMagFDM::FZ(Double_t *u, Float_t  *Ar, Float_t *du,Int_t *ki,Int_t *kf,Double_t *a1,Double_t *a2 ,Int_t *nu)
+  
+{
+  //
+  // Z component of the field
+  //
+  static  const Double_t kone=1;
+  Int_t l,ik,ikj;
+  Double_t temp;
+  Double_t ddu,delu,ar;
+
+  Int_t nk,ku;
+  temp=*u;
+  nk=*nu;
+  ik=*ki;
+  delu=*du; 
+
+  ar=Ar[ik];
+  ddu=temp-ar;
+
+  ku=int(ddu/delu);
+  ikj=ik+ku;
+  if (ddu<=0) ikj=0;
+
+   for(l=ikj; l<nk; l++)
+   {
+
+    if(temp < Ar[l])
+     {
+      *kf=l;
+      *a2=(temp-Ar[l])/(Ar[l+1]-Ar[l]);
+      *a1= kone - *a2;
+      break;     
+     }
+    }
+  }
+
+/*-------------FRfuncBi----------------*/
+
+void AliMagFDM::FRfuncBi(Int_t *kai,Double_t *za1, Double_t *za2, Double_t *al1, Double_t *al2, Double_t *al3, Int_t *ka, Int_t *ma, Double_t *ba)
+{
+  //
+  // This method needs to be commented
+  //
+  Double_t fa11,fa12,fa13;
+  Double_t fa21,fa22,fa23;
+  Double_t faY1,faY2;
+  Double_t bba;
+  
+  Double_t zaa1,zaa2,alf1,alf2,alf3;
+  Int_t kaai,kaa,maa;
+  kaai=*kai;
+  kaa=*ka;
+  maa=*ma;
+  zaa1=*za1;
+  zaa2=*za2;
+  alf1=*al1;  
+  alf2=*al2;
+  alf3=*al3; 
+  
+  if (kaai==0 ) {
+    fa11 = fdBpx[kaa][0][0];
+    fa12 = fdBpx[kaa][0][maa];
+    fa13 = fdBpx[kaa][0][maa+1];
+    fa21 = fdBpx[kaa+1][0][0];
+    fa22 = fdBpx[kaa+1][0][maa];               
+    fa23 = fdBpx[kaa+1][0][maa+1]; 
+  }
+  if (kaai==1 ) {
+    fa11 = fdBpy[kaa][0][0];
+    fa12 = fdBpy[kaa][0][maa];
+    fa13 = fdBpy[kaa][0][maa+1];
+    fa21 = fdBpy[kaa+1][0][0];
+    fa22 = fdBpy[kaa+1][0][maa];               
+    fa23 = fdBpy[kaa+1][0][maa+1]; 
+  }
+  if (kaai==2 ) {
+    fa11 = fdBpz[kaa][0][0];
+    fa12 = fdBpz[kaa][0][maa];
+    fa13 = fdBpz[kaa][0][maa+1];
+    fa21 = fdBpz[kaa+1][0][0];
+    fa22 = fdBpz[kaa+1][0][maa];               
+    fa23 = fdBpz[kaa+1][0][maa+1]; 
+  }                            
+  faY1=alf1*fa11+alf2*fa12+alf3*fa13;
+  faY2=alf1*fa21+alf2*fa22+alf3*fa23;
+  bba =  zaa1*faY1+zaa2*faY2;    
+  *ba=bba;
+  
+}
+
+  
+/*----------- FGfuncBi------------*/
+
+void AliMagFDM::FGfuncBi(Double_t *zz1,Double_t *zz2, Double_t *yy1,Double_t *yy2, Double_t *xx1,Double_t *xx2, Int_t *kvr, Int_t *kk, Int_t *ll, Int_t *mm, Double_t *bb)
+{  
+  //
+  // This method needs to be commented
+  //
+  Double_t fy1, fy2, ffy;
+  Double_t gy1,gy2,ggy;
+  Double_t z1,z2,y1,y2,x1,x2;
+  
+  Int_t k,l,m,kv;
+  Double_t bbi;
+  
+  Double_t bf11,bf12,bf21,bf22;
+  Double_t bg11,bg12,bg21,bg22;
+  k=*kk;
+  l=*ll;
+  m=*mm;
+  
+  kv=*kvr;
+  
+  z1=*zz1;
+  z2=*zz2;
+  y1=*yy1;
+  y2=*yy2;
+  x1=*xx1;
+  x2=*xx2; 
+  
+  /*-----------------Polar part ------------------*/
+  
+  if(kv==0) {
+    bf11=fdBpx[k][l][m];
+    bf12=fdBpx[k+1][l][m];
+    bf21=fdBpx[k+1][l+1][m];
+    bf22=fdBpx[k][l+1][m];
+    
+    bg11=fdBpx[k][l][m+1];
+    bg12=fdBpx[k+1][l][m+1];
+    bg21=fdBpx[k+1][l+1][m+1];
+    bg22=fdBpx[k][l+1][m+1];
+  }
+  if(kv==1) {
+    bf11=fdBpy[k][l][m];
+    bf12=fdBpy[k+1][l][m];
+    bf21=fdBpy[k+1][l+1][m];
+    bf22=fdBpy[k][l+1][m];
+    
+    bg11=fdBpy[k][l][m+1];
+    bg12=fdBpy[k+1][l][m+1];
+    bg21=fdBpy[k+1][l+1][m+1];
+    bg22=fdBpy[k][l+1][m+1];
+  }  
+  
+  if(kv==2) {
+    bf11=fdBpz[k][l][m];
+    bf12=fdBpz[k+1][l][m];
+    bf21=fdBpz[k+1][l+1][m];
+    bf22=fdBpz[k][l+1][m];
+    
+    bg11=fdBpz[k][l][m+1];
+    bg12=fdBpz[k+1][l][m+1];
+    bg21=fdBpz[k+1][l+1][m+1];
+    bg22=fdBpz[k][l+1][m+1];           
+  } 
+  /*-----------------Cartensian part ---------------*/ 
+  
+  if(kv==3) {
+    bf11=fdBcx[k][l][m];
+    bf12=fdBcx[k+1][l][m];
+    bf21=fdBcx[k+1][l+1][m];
+    bf22=fdBcx[k][l+1][m];
+    
+    bg11=fdBcx[k][l][m+1];
+    bg12=fdBcx[k+1][l][m+1];
+    bg21=fdBcx[k+1][l+1][m+1];
+    bg22=fdBcx[k][l+1][m+1];
+  }          
+  
+  if(kv==4) {
+    bf11=fdBcy[k][l][m];
+    bf12=fdBcy[k+1][l][m];
+    bf21=fdBcy[k+1][l+1][m];
+    bf22=fdBcy[k][l+1][m];
+    
+    bg11=fdBcy[k][l][m+1];
+    bg12=fdBcy[k+1][l][m+1];
+    bg21=fdBcy[k+1][l+1][m+1];
+    bg22=fdBcy[k][l+1][m+1];
+  }          
+  if(kv==5) {
+    bf11=fdBcz[k][l][m];
+    bf12=fdBcz[k+1][l][m];
+    bf21=fdBcz[k+1][l+1][m];
+    bf22=fdBcz[k][l+1][m];
+    
+    bg11=fdBcz[k][l][m+1];
+    bg12=fdBcz[k+1][l][m+1];
+    bg21=fdBcz[k+1][l+1][m+1];
+    bg22=fdBcz[k][l+1][m+1];
+  }  
+  
+  
+  
+  fy1=z1*bf11+z2*bf12;
+  fy2=z2*bf21+z1* bf22;
+  ffy=y1*fy1+ y2*fy2; 
+  
+  
+  gy1 = z1*bg11+z2*bg12;
+  gy2 = z2*bg21+z1*bg22;
+  ggy= y1*gy1 +  y2*gy2;
+  
+  bbi =  x1*ffy+x2*ggy;
+  
+  *bb=bbi; 
+  
+}     
+//____________________________________________
+
+void AliMagFDM::ReadField()
+{
+  //
+  // Method to read the magnetic field from file
+  //
+  FILE *magfile;
+
+  Int_t ik, il, im;
+  Float_t zzp, rr,phii;
+  Float_t zz, yy, bx,by,bz,bb;
+
+  char *fname;
+  printf("Reading Magnetic Field %s from file %s\n",fName.Data(),fTitle.Data());
+  fname = gSystem->ExpandPathName(fTitle.Data());
+  magfile=fopen(fname,"r");
+  delete [] fname;
+
+  printf("Cartensian part\n");
+  if (magfile) {
+  
+//  Cartensian part 
+    fscanf(magfile,"%d %d %d ",&fdYl, &fdXl, &fdZl); 
+    
+    printf("fdYl %d, fdXl %d, fdZl %d\n",fdYl, fdXl, fdZl);     
+    
+    for (ik=0; ik<fdZl; ik++)
+    { 
+   
+      fscanf(magfile, " %e ", &zz);
+      fdZc[ik]=zz; 
+
+    } 
+   
+    for (ik=0; ik<fdYl; ik++)
+    {    
+       fscanf(magfile, " %e ", &yy); 
+       fdY[ik]=yy;
+    } 
+    for (ik=0; ik<81; ik++)
+    {    
+           printf("fdZc %e,fdY %e\n", fdZc[ik],fdY[ik]); 
+    }   
+             
+    fscanf(magfile," %e %e %e %e %e %e %e %e %e %e %e ", &fdYdel,&fdXdel,&fdZdel,&fdZmax,&fdZmin,&fdYmax,&fdYmin,&fdAx1,&fdCx1,&fdAx2,&fdCx2); 
+
+printf("fdYdel %e, fdXdel %e, fdZdel %e\n",fdYdel,fdXdel,fdZdel);
+printf("fdZmax %e, fdZmin %e, fdYmax %e,fdYmin %e\n",fdZmax,fdZmin,fdYmax,fdYmin);
+printf("fdAx1 %e, fdCx1 %e, fdAx2 %e, fdCx %e\n",fdAx1,fdCx1,fdAx2,fdCx2);
+
+    for (il=0; il<44; il++)  { 
+     for (im=0; im<81; im++)  {      
+      for (ik=0; ik<81; ik++)  {      
+      
+      fscanf(magfile, " %e ", &by); 
+      fdBcy[ik][im][il]=by;        
+      }
+     }
+    } 
+
+    for (il=0; il<44; il++)  { 
+     for (im=0; im<81; im++)  {      
+      for (ik=0; ik<81; ik++)  {      
+      
+      fscanf(magfile, " %e ", &bx); 
+      fdBcx[ik][im][il]=bx;        
+      }    
+     }     
+    }
+    
+   for (il=0; il<44; il++)  { 
+     for (im=0; im<81; im++)  {      
+      for (ik=0; ik<81; ik++)  {      
+      
+      fscanf(magfile, " %e ", &bz); 
+      fdBcz[ik][im][il]=bz;          
+      }              
+     }     
+    } 
+//----------------------   Polar part ---------------------------------
+
+    printf("Polar part\n");
+    fscanf(magfile,"%d %d %d ", &fdZpl, &fdRn, &fdPhin); 
+    printf("fdZpl %d, fdRn %d, fdPhin %d\n",fdZpl,fdRn,fdPhin);   
+
+    printf(" fdZp array\n"); 
+     
+    for (ik=0; ik<51; ik++) 
+    {    
+     fscanf(magfile, " %e ", &zzp);
+     fdZp[ik]=zzp; 
+     printf(" %e\n",fdZp[ik]);      
+    } 
+  
+    printf(" fdR array\n"); 
+         
+    for (ik=0; ik<10; ik++) 
+    {    
+     fscanf(magfile, " %e ", &rr); 
+     fdR[ik]=rr;
+     printf(" %e\n",fdR[ik]);
+    } 
+    
+//    printf("fdPhi array\n"); 
+     
+     for (il=0; il<33; il++)  
+     {
+       fscanf(magfile, " %e ", &phii); 
+       fdPhi[il]=phii; 
+//        printf(" %e\n",fdPhi[il]);          
+     }
+
+    fscanf(magfile," %e %e %e %e %e %e %e ",&fdZpdl,&fdPhid,&fdRdel,&fdZpmx,&fdZpmn,&fdRmax, &fdRmin); 
+
+printf("fdZpdl %e, fdPhid %e, fdRdel %e, fdZpmx %e, fdZpmn %e,fdRmax %e,fdRmin %e \n", fdZpdl,fdPhid, fdRdel,fdZpmx, fdZpmn,fdRmax, fdRmin);
+
+                      
+    for (il=0; il<33; il++)  { 
+     for (im=0; im<10; im++)  {      
+      for (ik=0; ik<51; ik++)  {
+      fscanf(magfile, " %e ", &by); 
+        fdBpy[ik][im][il]=by;        
+      }
+     }
+    } 
+    
+    for (il=0; il<33; il++)  { 
+     for (im=0; im<10; im++)  {      
+      for (ik=0; ik<51; ik++)  {
+      fscanf(magfile, " %e ", &bx); 
+        fdBpx[ik][im][il]=bx;                     
+      }    
+     }     
+    }      
+
+
+    for (il=0; il<33; il++)  { 
+     for (im=0; im<10; im++)  {      
+      for (ik=0; ik<51; ik++)  {
+      fscanf(magfile, " %e ", &bz); 
+        fdBpz[ik][im][il]=bz;                      
+      }              
+     }     
+    } 
+    
+    
+    for (il=0; il<32; il++) { 
+     for (im=0; im<2; im++)  {      
+      for (ik=0; ik<2; ik++)  {
+      fscanf(magfile, " %e ", &bb);    
+        fdB[ik][im][il]=bb;  
+      }              
+     } 
+    }
+//
+  } else { 
+    printf("File %s not found !\n",fTitle.Data());
+    exit(1);
+  }
+}
+//________________________________  
diff --git a/STEER/AliMagFDM.h b/STEER/AliMagFDM.h
new file mode 100644 (file)
index 0000000..2ab0b01
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef ALIMAGFDM_H
+#define ALIMAGFDM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliMagF.h"
+//
+class AliMagFDM : public AliMagF
+{
+//Alice Magnetic Field:Magnetic field map from IP to muon filter for Muon arm
+
+public:
+  AliMagFDM(){}
+  AliMagFDM(const char *name, const char *title, const Int_t integ, const Int_t
+  map, const Float_t factor, const Float_t fmax);
+  virtual ~AliMagFDM(){} 
+  virtual void Field(Float_t *x, Float_t *b);
+  virtual void ReadField(); 
+  
+
+  void FZ(Double_t *u, Float_t *Ar, Float_t *du, Int_t *ki, Int_t *kf, Double_t *a1, Double_t *a2 , Int_t *nu);
+  void FRfuncBi(Int_t *kai, Double_t *za1, Double_t *za2, Double_t *al1, Double_t *al2, Double_t *al3, Int_t *ka, Int_t *ma,Double_t  *ba);
+  void FGfuncBi(Double_t *z1, Double_t *z2, Double_t *y1, Double_t *y2, Double_t *x1, Double_t *x2, Int_t *kvr, Int_t *k, Int_t *l, Int_t *m, Double_t *bb); 
+
+
+protected:
+
+//
+
+  Int_t      fdInd;   // Character number of validity Map region
+
+  Float_t fdZmin;  // Start of the cartesian  part  of MAP in z
+  Float_t fdZmax;  // End of Map in z   
+  Float_t fdYmax;  // Start of the cartesian  part  of MAP in y
+  Float_t fdYmin;  // End  of the cartesian  part  of MAP in y
+  Float_t fdZpmx;  // End of the polar  part  of MAP in z
+  Float_t fdZpmn;  // Start of the polar  part  of MAP in z
+  Float_t fdRmax;  // Maximal radius of the polar  part  of MAP 
+  Float_t fdRmin;  // Minimal radius of the polar  part  of MAP  
+              
+
+  Float_t    fdXdel;  //  step in x - cartesian  part  of MAP
+  Float_t    fdYdel;  //  step in y - cartesian  part  of MAP
+  Float_t    fdZdel;  //  step in z - cartesian  part  of MAP
+  
+  Float_t    fdRdel;  //  step in r - polar  part  of MAP
+  Float_t    fdPhid;  //  step in Phi - polar  part  of MAP
+  Float_t    fdZpdl;  //  step in z - polar  part  of MAP 
+  
+  Float_t    fdCx1;   // Field constant
+  Float_t    fdCx2;   // Field constant
+  Float_t    fdAx1;   // Field constant
+  Float_t    fdAx2;   // Field constant
+   
+  Float_t fdZc[81];  // z coordinates in cartesian  part
+  Float_t fdY[81];   // y coordinates in cartesian  part 
+  Float_t fdBcx[81][81][44]; // Bx array for cartesian  part
+  Float_t fdBcy[81][81][44]; // By array for cartesian  part
+  Float_t fdBcz[81][81][44]; // Bz array for cartesian  part
+
+  Float_t  fdZp[51];  // z coordinates in polar  part
+  Float_t  fdR[10];   // r coordinates in polar  part  
+  Float_t  fdPhi[33]; // Phi coordinates in polar  part
+
+  Float_t  fdBpx[51][10][33]; // Bx array for polar  part
+  Float_t  fdBpy[51][10][33]; // By array for polar  part
+  Float_t  fdBpz[51][10][33]; // Bx array for polar  part 
+  Float_t  fdB[2][2][32];     // Limits of field
+  
+  Int_t      fdXl;    // Number steps in x for cartesian  part
+  Int_t      fdYl;    // Number steps in y  for cartesian  par
+  Int_t      fdZl;    // Number steps in z  for cartesian  part
+    
+  Int_t      fdRn;    // Number steps in r for polar  part
+  Int_t      fdPhin;  // Number steps in Phi for polar  part
+  Int_t      fdZpl;   // Number steps in z for polar  part 
+  
+
+  ClassDef(AliMagFDM,1) //Class Magnetic field map from IP till muon filter
+};
+
+#endif
index 51714b44553ac2e433857d49a3c1c3c4e896945f..8028594ea1e5179e86fb1913e5b6632394da1e01 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.9  2000/05/16 08:45:08  fca
+Correct dtor, thanks to J.Belikov
+
 Revision 1.8  2000/02/23 16:25:22  fca
 AliVMC and AliGeant3 classes introduced
 ReadEuclid moved from AliRun to AliModule
@@ -59,6 +62,8 @@ AliModule::AliModule()
   //
   fHistograms = 0;
   fNodes      = 0;
+  fIdtmed     = 0;
+  fIdmate     = 0;
 }
  
 //_____________________________________________________________________________
@@ -100,6 +105,15 @@ AliModule::AliModule(const char* name,const char *title):TNamed(name,title)
   fHiMedium = 0;
 }
  
+//_____________________________________________________________________________
+AliModule::AliModule(const AliModule &mod)
+{
+  //
+  // Copy constructor
+  //
+  Copy(*this);
+}
+
 //_____________________________________________________________________________
 AliModule::~AliModule()
 {
@@ -119,6 +133,15 @@ AliModule::~AliModule()
   delete fIdmate;
 }
  
+//_____________________________________________________________________________
+void AliModule::Copy(AliModule &mod) const
+{
+  //
+  // Copy *this onto mod, not implemented for AliModule
+  //
+  Fatal("Copy","Not implemented!\n");
+}
+
 //_____________________________________________________________________________
 void AliModule::Disable()
 {
@@ -294,6 +317,13 @@ void AliModule::AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
   gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3); 
 } 
 
+//_____________________________________________________________________________
+AliModule& AliModule::operator=(const AliModule &mod)
+{
+  mod.Copy(*this);
+  return (*this);
+}
+
 //_____________________________________________________________________________
 void AliModule::SetEuclidFile(char* material, char* geometry)
 {
@@ -341,8 +371,8 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol)
   Float_t par[50];
   Float_t teta1, phi1, teta2, phi2, teta3, phi3, orig, step;
   Float_t xo, yo, zo;
-  const Int_t maxrot=5000;
-  Int_t idrot[maxrot],istop[7000];
+  const Int_t kMaxRot=5000;
+  Int_t idrot[kMaxRot],istop[7000];
   FILE *lun;
   //
   // *** The input filnam name will be with extension '.euc'
@@ -355,7 +385,7 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol)
   }
   //* --- definition of rotation matrix 0 ---  
   TArrayI &idtmed = *fIdtmed;
-  for(i=1; i<maxrot; ++i) idrot[i]=-99;
+  for(i=1; i<kMaxRot; ++i) idrot[i]=-99;
   idrot[0]=0;
   nvol=0;
  L10:
@@ -386,7 +416,7 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol)
     //*
   } else if (!strcmp(key,"ROTM")) {
     sscanf(&card[4],"%d %f %f %f %f %f %f",&irot,&teta1,&phi1,&teta2,&phi2,&teta3,&phi3);
-    if( irot<=0 || irot>=maxrot ) {
+    if( irot<=0 || irot>=kMaxRot ) {
       Error("ReadEuclid","ROTM rotation matrix number %d illegal\n",irot);
       exit(1);
     }
@@ -421,7 +451,7 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol)
     //*
   } else if (!strcmp(key,"POSI")) {
     sscanf(&card[5],"'%[^']' %d '%[^']' %f %f %f %d '%[^']'", name, &nr, mother, &xo, &yo, &zo, &irot, konly);
-    if( irot<0 || irot>=maxrot ) {
+    if( irot<0 || irot>=kMaxRot ) {
       Error("ReadEuclid","POSI %s#%d rotation matrix number %d illegal\n",name,nr,irot);
       exit(1);
     }
@@ -438,7 +468,7 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol)
     //*
   } else if (!strcmp(key,"POSP")) {
     sscanf(&card[5],"'%[^']' %d '%[^']' %f %f %f %d '%[^']' %d", name, &nr, mother, &xo, &yo, &zo, &irot, konly, &npar);
-    if( irot<0 || irot>=maxrot ) {
+    if( irot<0 || irot>=kMaxRot ) {
       Error("ReadEuclid","POSP %s#%d rotation matrix number %d illegal\n",name,nr,irot);
       exit(1);
     }
@@ -525,8 +555,8 @@ void AliModule::ReadEuclidMedia(const char* filnam)
   }
   //
   // Retrieve Mag Field parameters
-  Int_t ISXFLD=gAlice->Field()->Integ();
-  Float_t SXMGMX=gAlice->Field()->Max();
+  Int_t globField=gAlice->Field()->Integ();
+  Float_t globMaxField=gAlice->Field()->Max();
   //  TArrayI &idtmed = *fIdtmed;
   //
  L10:
@@ -560,7 +590,7 @@ void AliModule::ReadEuclidMedia(const char* filnam)
     while(i<20) natmed[i++]=' ';
     natmed[i]='\0';
     //
-    AliMedium(itmed,natmed,nmat,isvol,ISXFLD,SXMGMX,tmaxfd,
+    AliMedium(itmed,natmed,nmat,isvol,globField,globMaxField,tmaxfd,
                   stemax,deemax,epsil,stmin,ubuf,nwbuf);
     //    (*fImedia)[idtmed[itmed]-1]=id_det;
     //*
index a109764ca12ff7fb1af22cddd0dabc773300132a..03d4ac1f19d6b2965295299bf8bb84f4cc998245 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliModule_H
-#define AliModule_H
+#ifndef ALIMODULE_H
+#define ALIMODULE_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 #include <AliHit.h>
 
 class AliModule : public TNamed , public TAttLine, public TAttMarker {
-
-  // Data members
-protected:      
-  
-  TString       fEuclidMaterial;  //Name of the Euclid file for materials (if any)
-  TString       fEuclidGeometry;  //Name of the Euclid file for geometry (if any)
-  
-  TArrayI      *fIdtmed;      //List of tracking medium numbers
-  TArrayI      *fIdmate;      //List of material numbers
-  Int_t         fLoMedium;   //Minimum tracking medium ID for this Module
-  Int_t         fHiMedium;   //Maximum tracking medium ID for this Module
-
-  Bool_t        fActive;      //Detector activity flag
-  TList        *fHistograms;  //List of histograms
-  TList        *fNodes;       //List of geometry nodes
-
 public:
 
   // Creators - distructors
   AliModule(const char* name, const char *title);
   AliModule();
+  AliModule(const AliModule &mod);
   virtual ~AliModule();
 
   // Inline functions
@@ -55,14 +40,23 @@ public:
   virtual  Int_t&        HiMedium() {return fHiMedium;}
 
   // Module composition
-  virtual void  AliMaterial(Int_t, const char*, Float_t, Float_t, Float_t, Float_t,
-                           Float_t, Float_t* buf=0, Int_t nwbuf=0) const;
-  virtual void  AliGetMaterial(Int_t, char*, Float_t&, Float_t&, Float_t&,
-                              Float_t&, Float_t&);
-  virtual void  AliMixture(Int_t, const char*, Float_t*, Float_t*, Float_t, Int_t, Float_t*) const;
-  virtual void  AliMedium(Int_t, const char*, Int_t, Int_t, Int_t, Float_t, Float_t, 
-                  Float_t, Float_t, Float_t, Float_t, Float_t* ubuf=0, Int_t nbuf=0) const;
-  virtual void  AliMatrix(Int_t&, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t) const;
+  virtual void AliMaterial(Int_t imat, const char* name, Float_t a, 
+                          Float_t z, Float_t dens, Float_t radl,
+                          Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
+  virtual void AliGetMaterial(Int_t imat, char* name, Float_t &a, 
+                               Float_t &z, Float_t &dens, Float_t &radl,
+                               Float_t &absl);
+  virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
+                         Float_t *z, Float_t dens, Int_t nlmat,
+                         Float_t *wmat) const;
+  virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
+                        Int_t isvol, Int_t ifield, Float_t fieldm,
+                        Float_t tmaxfd, Float_t stemax, Float_t deemax,
+                        Float_t epsil, Float_t stmin, Float_t *ubuf=0,
+                        Int_t nbuf=0) const;
+  virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
+                        Float_t theta2, Float_t phi2, Float_t theta3,
+                        Float_t phi3) const;
   
   // Virtual methods
   virtual void  BuildGeometry() {};
@@ -97,11 +91,28 @@ public:
   virtual void        StepManager() {}
   //virtual AliHit*     FirstHit(Int_t) {return 0;}
   //virtual AliHit*     NextHit() {return 0;}
-  virtual void        SetBufferSize(Int_t) {}  
-  virtual void        SetEuclidFile(char*,char*geometry=0);
-  virtual void ReadEuclid(const char*, char*);
-  virtual void ReadEuclidMedia(const char*);
+  virtual void        SetBufferSize(Int_t bufsiz) {}  
+  virtual void        SetEuclidFile(char *material,char *geometry=0);
+  virtual void ReadEuclid(const char *filnam, char *topvol);
+  virtual void ReadEuclidMedia(const char *filnam);
+  virtual AliModule& operator=(const AliModule &mod);
+  virtual void Copy(AliModule &mod) const;
  
+protected:      
+  // Data members
+  
+  TString       fEuclidMaterial;  //Name of the Euclid file for materials (if any)
+  TString       fEuclidGeometry;  //Name of the Euclid file for geometry (if any)
+  
+  TArrayI      *fIdtmed;      //List of tracking medium numbers
+  TArrayI      *fIdmate;      //List of material numbers
+  Int_t         fLoMedium;   //Minimum tracking medium ID for this Module
+  Int_t         fHiMedium;   //Maximum tracking medium ID for this Module
+
+  Bool_t        fActive;      //Detector activity flag
+  TList        *fHistograms;  //List of histograms
+  TList        *fNodes;       //List of geometry nodes
+
   ClassDef(AliModule,1)  //Base class for ALICE Modules
 };
 #endif
index a47f54080fabca4d5c9b64c0f6dc58b8c80b4ac4..9f5f9199d17e5fee33f6828e638a3604226f92a1 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.4  1999/09/29 09:24:29  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -48,6 +51,15 @@ AliPoints::AliPoints()
   fIndex    = 0;
 }
 
+//_____________________________________________________________________________
+AliPoints::AliPoints(const AliPoints &pts)
+{
+  //
+  // Copy constructor
+  //
+  pts.Copy(*this);
+}
+
 //_____________________________________________________________________________
 AliPoints::AliPoints(Int_t nhits)
   :TPolyMarker3D(nhits)
@@ -70,6 +82,22 @@ AliPoints::~AliPoints()
   fIndex    = 0;
 }
 
+//_____________________________________________________________________________
+void AliPoints::Copy(AliPoints &pts) const
+{
+  //
+  // Copy *this onto pts
+  //
+  if(this != &pts) {
+    ((TPolyMarker3D*)this)->Copy((TPolyMarker3D&)pts);
+    pts.fGLList = fGLList;
+    pts.fLastPoint = fLastPoint;
+    pts.fDetector = fDetector;
+    pts.fIndex = fIndex;
+  }
+}
+
+
 //_____________________________________________________________________________
 Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py)
 {
@@ -165,6 +193,16 @@ void AliPoints::InspectParticle()
   if (particle) particle->Inspect();
 }
 
+//_____________________________________________________________________________
+AliPoints & AliPoints::operator=(const AliPoints &pts)
+{
+  //
+  // Assignment operator
+  //
+  pts.Copy(*this);
+  return (*this);
+}
+
 //_____________________________________________________________________________
 void AliPoints::Propagate()
 {
index abd176f3383d0edd50d5001d23c645e0d794475b..7dd1955aedc0f9c91e81aac42bb0661f001d4ca4 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliPoints_H
-#define AliPoints_H
+#ifndef ALIPOINTS_H
+#define ALIPOINTS_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 #include "TParticle.h"
 
 class AliPoints : public TPolyMarker3D {
-protected:
-   AliDetector     *fDetector;    //Pointer to AliDetector object
-   Int_t            fIndex;       //Particle number in AliRun::fParticles
-
 public:
   AliPoints();
+  AliPoints(const AliPoints& pts);
   AliPoints(Int_t nhits);
   virtual ~AliPoints();
+  virtual void          Copy(AliPoints &pts) const;
   virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
   virtual void          ExecuteEvent(Int_t event, Int_t px, Int_t py);
   AliDetector          *GetDetector() {return fDetector;}
@@ -27,10 +25,15 @@ public:
   virtual void          InspectParticle(); // *MENU*
   virtual void          DumpParticle(); // *MENU*
   virtual Text_t       *GetObjectInfo(Int_t px, Int_t py);
+  virtual AliPoints &   operator=(const AliPoints &pts);
   virtual void          Propagate(); // *MENU*
   virtual void          SetDetector(AliDetector *det) {fDetector = det;}
   virtual void          SetParticle(Int_t index) {fIndex = index;}
   
+protected:
+   AliDetector     *fDetector;    //Pointer to AliDetector object
+   Int_t            fIndex;       //Particle number in AliRun::fParticles
+
   ClassDef(AliPoints,1) //Class to draw detector hits (is PolyMarker3D)
 };
 #endif
index 94bba4372dca0d231d1bf05469d598efc1ef3a52..13cc66c2c2db1244b8cfdc6070c4d5cc83446923 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.4  2000/05/16 08:30:02  fca
+Using automatic streamer for c arrays
+
 Revision 1.3  2000/03/20 14:22:25  fca
 New version to support new PHOS code
 
@@ -64,6 +67,15 @@ AliRecPoint::AliRecPoint()
   fIndexInList = -1 ; // to be set when the point is already stored
 }
 
+//____________________________________________________________________________
+AliRecPoint::AliRecPoint(const AliRecPoint& recp)
+{
+  //
+  // Copy constructor
+  //
+  recp.Copy(*this);
+}
+
 //____________________________________________________________________________
 AliRecPoint::~AliRecPoint()
 {
@@ -120,6 +132,33 @@ void AliRecPoint::AddDigit(AliDigitNew & digit)
 //   fTracksList[fMulTrack++]=  (int) &Track  ; 
 // }
 
+//____________________________________________________________________________
+void AliRecPoint::Copy(AliRecPoint& recp) const
+{
+  //
+  // Copy *this onto pts
+  //
+  // Copy all first
+  if(this != &recp) {
+    ((TObject*) this)->Copy((TObject&)recp);
+    recp.fAmp = fAmp;
+    recp.fGeom = fGeom;
+    recp.fIndexInList = fIndexInList;
+    recp.fLocPos = fLocPos;
+    recp.fLocPosM = new TMatrix(*fLocPosM);
+    recp.fMaxDigit = fMaxDigit;
+    recp.fMulDigit = fMulDigit;
+    recp.fMaxTrack = fMaxTrack;
+    recp.fMulTrack = fMulTrack;
+    
+    // Duplicate pointed objects
+    recp.fDigitsList = new Int_t[fMulDigit];
+    memcpy(recp.fDigitsList,fDigitsList,fMulDigit*sizeof(Int_t));
+    recp.fTracksList = new Int_t[fMulTrack];
+    memcpy(recp.fTracksList,fTracksList,fMulTrack*sizeof(Int_t));
+  }
+}
+
 //____________________________________________________________________________
 void AliRecPoint::GetCovarianceMatrix(TMatrix & mat)
 {
@@ -139,6 +178,14 @@ void AliRecPoint::GetLocalPosition(TVector3 & pos)
  
 }
 
+//____________________________________________________________________________
+AliRecPoint & AliRecPoint::operator= (const AliRecPoint &recp)
+{
+  recp.Copy(*this);
+  return (*this);
+}
+
+
 //____________________________________________________________________________
 void AliRecPoint::GetGlobalPosition(TVector3 & gpos, TMatrix & gmat)
 {
index e726c8dcee36953ecebe10ff9f1941f777acf2bd..76d56040aac9e0f5a3eb41bb3abbf7a1ff31b4b7 100644 (file)
@@ -39,10 +39,12 @@ class AliRecPoint : public TObject {
 public:
 
   AliRecPoint() ;                   // ctor            
+  AliRecPoint(const AliRecPoint &recp);  // copy ctor
   virtual ~AliRecPoint() ;          // dtor
  
   virtual void  AddDigit(AliDigitNew & digit) ;  // add a digit to the digit's indexes list  
   //  virtual void  AddTrack(AliTrack & track) ;  // add a track to the tracks list  
+  virtual void  Copy(AliRecPoint &recp) const;
   virtual void  GetCovarianceMatrix(TMatrix & mat) ;
   virtual AliGeometry * GetGeom() const { return fGeom; } 
   virtual void  GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) ; // return the global position in ALICE
@@ -56,6 +58,7 @@ public:
   virtual Int_t GetMaximumTrackMultiplicity() const { return  fMaxTrack; } 
   virtual Int_t GetTracksMultiplicity(void) const { return fMulTrack ; }
   virtual void  Print(Option_t * opt = "void") = 0 ; 
+  virtual AliRecPoint & operator= (const AliRecPoint &recp);
   void          SetIndexInList(Int_t val) { fIndexInList = val ; } 
 
 
@@ -73,9 +76,6 @@ protected:
   Int_t *       fDigitsList ; //[fMulDigit] list of digit's indexes from which the point was reconstructed 
   Int_t *       fTracksList ; //[fMulTrack] list of tracks to which the point was assigned 
 
-public:
-  
-
   ClassDef(AliRecPoint,1)
  
 };
index 3f853fca47f5f8b19954766c8c6603ecec9262b7..07b95fb1f0957c97c8e8b2109be13e2c46f4c3d3 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.38  2000/06/20 13:05:45  fca
+Writing down the TREE headers before job starts
+
 Revision 1.37  2000/06/09 20:05:11  morsch
 Introduce possibility to chose magnetic field version 3: AliMagFDM + field02.dat
 
@@ -110,6 +113,9 @@ Introduction of the Copyright and cvs Log
 #include "AliDisplay.h"
 #include "AliMC.h"
 #include "AliLego.h"
+#include "AliMagFC.h"
+#include "AliMagFCM.h"
+#include "AliMagFDM.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -117,7 +123,7 @@ Introduction of the Copyright and cvs Log
  
 AliRun *gAlice;
 
-static AliHeader *header;
+static AliHeader *gAliHeader;
 
 ClassImp(AliRun)
 
@@ -127,7 +133,7 @@ AliRun::AliRun()
   //
   // Default constructor for AliRun
   //
-  header=&fHeader;
+  gAliHeader=&fHeader;
   fRun       = 0;
   fEvent     = 0;
   fCurrent   = -1;
@@ -193,7 +199,7 @@ AliRun::AliRun(const char *name, const char *title)
   fNtrack=0;
   fHgwmk=0;
   fCurrent=-1;
-  header=&fHeader;
+  gAliHeader=&fHeader;
   fRun       = 0;
   fEvent     = 0;
   //
@@ -218,6 +224,16 @@ AliRun::AliRun(const char *name, const char *title)
   fHitLists  = new TList();
 }
 
+//_____________________________________________________________________________
+AliRun::AliRun(const AliRun &run)
+{
+  // 
+  // Copy constructor
+  //
+  run.Copy(*this);
+}
+
+
 //_____________________________________________________________________________
 AliRun::~AliRun()
 {
@@ -338,7 +354,7 @@ void AliRun::CleanParents()
   int i;
   for(i=0; i<fNtrack; i++) {
     part = (TParticle *)particles.UncheckedAt(i);
-    if(!part->TestBit(Daughters_Bit)) {
+    if(!part->TestBit(kDaughtersBit)) {
       part->SetFirstDaughter(-1);
       part->SetLastDaughter(-1);
     }
@@ -532,16 +548,16 @@ void AliRun::FinishRun()
   EnergySummary();
   
   // file is retrieved from whatever tree
-  TFile *File = 0;
-  if (fTreeK) File = fTreeK->GetCurrentFile();
-  if ((!File) && (fTreeH)) File = fTreeH->GetCurrentFile();
-  if ((!File) && (fTreeD)) File = fTreeD->GetCurrentFile();
-  if ((!File) && (fTreeE)) File = fTreeE->GetCurrentFile();
-  if( NULL==File ) {
+  TFile *file = 0;
+  if (fTreeK) file = fTreeK->GetCurrentFile();
+  if ((!file) && (fTreeH)) file = fTreeH->GetCurrentFile();
+  if ((!file) && (fTreeD)) file = fTreeD->GetCurrentFile();
+  if ((!file) && (fTreeE)) file = fTreeE->GetCurrentFile();
+  if( NULL==file ) {
     Error("FinishRun","There isn't root file!");
     exit(1);
   }
-  File->cd();
+  file->cd();
   fTreeE->Write(0,TObject::kOverwrite);
   
   // Clean tree information
@@ -565,7 +581,7 @@ void AliRun::FinishRun()
   Write();
   
   // Close output file
-  File->Write();
+  file->Write();
 }
 
 //_____________________________________________________________________________
@@ -582,10 +598,10 @@ void AliRun::FlagTrack(Int_t track)
     particle=(TParticle*)fParticles->UncheckedAt(curr);
     
     // If the particle is flagged the three from here upward is saved already
-    if(particle->TestBit(Keep_Bit)) return;
+    if(particle->TestBit(kKeepBit)) return;
     
     // Save this particle
-    particle->SetBit(Keep_Bit);
+    particle->SetBit(kKeepBit);
     
     // Move to father if any
     if((curr=particle->GetFirstMother())==-1) return;
@@ -603,7 +619,7 @@ void AliRun::EnergySummary()
   Float_t edtot=0;
   Float_t ed, ed2;
   Int_t kn, i, left, j, id;
-  const Float_t zero=0;
+  const Float_t kzero=0;
   Int_t ievent=fHeader.GetEvent()+1;
   //
   // Energy loss information
@@ -617,11 +633,11 @@ void AliRun::EnergySummary()
          ed=ed/ievent;
          ed2=fSum2Energy[kn];
          ed2=ed2/ievent;
-         ed2=100*TMath::Sqrt(TMath::Max(ed2-ed*ed,zero))/ed;
+         ed2=100*TMath::Sqrt(TMath::Max(ed2-ed*ed,kzero))/ed;
        } else 
          ed2=99;
        fSummEnergy[ndep]=ed;
-       fSum2Energy[ndep]=TMath::Min((Float_t) 99.,TMath::Max(ed2,zero));
+       fSum2Energy[ndep]=TMath::Min((Float_t) 99.,TMath::Max(ed2,kzero));
        edtot+=ed;
        ndep++;
       }
@@ -795,7 +811,7 @@ void AliRun::GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom,
   TParticle *track;
   for(Int_t i=fNtrack-1; i>=0; i--) {
     track=(TParticle*) fParticles->UncheckedAt(i);
-    if(!track->TestBit(Done_Bit)) {
+    if(!track->TestBit(kDoneBit)) {
       //
       // The track has not yet been processed
       fCurrent=i;
@@ -812,7 +828,7 @@ void AliRun::GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom,
       polar[1]=pol.Y();
       polar[2]=pol.Z();
       tof=track->T();
-      track->SetBit(Done_Bit);
+      track->SetBit(kDoneBit);
       break;
     }
   }
@@ -998,18 +1014,18 @@ void AliRun::SetTransPar(char* filename)
   //
 
 
-  const Int_t ncuts=10;
-  const Int_t nflags=11;
-  const Int_t npars=ncuts+nflags;
-  const char pars[npars][7] = {"CUTGAM" ,"CUTELE","CUTNEU","CUTHAD","CUTMUO",
+  const Int_t kncuts=10;
+  const Int_t knflags=11;
+  const Int_t knpars=kncuts+knflags;
+  const char kpars[knpars][7] = {"CUTGAM" ,"CUTELE","CUTNEU","CUTHAD","CUTMUO",
                               "BCUTE","BCUTM","DCUTE","DCUTM","PPCUTM","ANNI",
                               "BREM","COMP","DCAY","DRAY","HADR","LOSS",
                               "MULS","PAIR","PHOT","RAYL"};
   char line[256];
   char detName[7];
   char* filtmp;
-  Float_t cut[ncuts];
-  Int_t flag[nflags];
+  Float_t cut[kncuts];
+  Int_t flag[knflags];
   Int_t i, itmed, iret, ktmed, kz;
   FILE *lun;
   //
@@ -1029,8 +1045,8 @@ void AliRun::SetTransPar(char* filename)
   //
   while(1) {
     // Initialise cuts and flags
-    for(i=0;i<ncuts;i++) cut[i]=-99;
-    for(i=0;i<nflags;i++) flag[i]=-99;
+    for(i=0;i<kncuts;i++) cut[i]=-99;
+    for(i=0;i<knflags;i++) flag[i]=-99;
     itmed=0;
     for(i=0;i<256;i++) line[i]='\0';
     // Read up to the end of line excluded
@@ -1070,19 +1086,19 @@ void AliRun::SetTransPar(char* filename)
          continue;
        }
        // Set energy thresholds
-       for(kz=0;kz<ncuts;kz++) {
+       for(kz=0;kz<kncuts;kz++) {
          if(cut[kz]>=0) {
            printf(" *  %-6s set to %10.3E for tracking medium code %4d for %s\n",
-                  pars[kz],cut[kz],itmed,mod->GetName());
-           gMC->Gstpar(ktmed,pars[kz],cut[kz]);
+                  kpars[kz],cut[kz],itmed,mod->GetName());
+           gMC->Gstpar(ktmed,kpars[kz],cut[kz]);
          }
        }
        // Set transport mechanisms
-       for(kz=0;kz<nflags;kz++) {
+       for(kz=0;kz<knflags;kz++) {
          if(flag[kz]>=0) {
            printf(" *  %-6s set to %10d for tracking medium code %4d for %s\n",
-                  pars[ncuts+kz],flag[kz],itmed,mod->GetName());
-           gMC->Gstpar(ktmed,pars[ncuts+kz],Float_t(flag[kz]));
+                  kpars[kncuts+kz],flag[kz],itmed,mod->GetName());
+           gMC->Gstpar(ktmed,kpars[kncuts+kz],Float_t(flag[kz]));
          }
        }
       } else {
@@ -1107,39 +1123,39 @@ void AliRun::MakeTree(Option_t *option)
   char hname[30];
   //
   // Analyse options
-  char *K = strstr(option,"K");
-  char *H = strstr(option,"H");
-  char *E = strstr(option,"E");
-  char *D = strstr(option,"D");
-  char *R = strstr(option,"R");
+  char *oK = strstr(option,"K");
+  char *oH = strstr(option,"H");
+  char *oE = strstr(option,"E");
+  char *oD = strstr(option,"D");
+  char *oR = strstr(option,"R");
   //
-  if (K && !fTreeK) {
+  if (oK && !fTreeK) {
     sprintf(hname,"TreeK%d",fEvent);
     fTreeK = new TTree(hname,"Kinematics");
     //  Create a branch for particles
     fTreeK->Branch("Particles",&fParticles,4000);
     fTreeK->Write();
   }
-  if (H && !fTreeH) {
+  if (oH && !fTreeH) {
     sprintf(hname,"TreeH%d",fEvent);
     fTreeH = new TTree(hname,"Hits");
     fTreeH->SetAutoSave(1000000000); //no autosave
     fTreeH->Write();
   }
-  if (D && !fTreeD) {
+  if (oD && !fTreeD) {
     sprintf(hname,"TreeD%d",fEvent);
     fTreeD = new TTree(hname,"Digits");
     fTreeD->Write();
   }
-  if (R && !fTreeR) {
+  if (oR && !fTreeR) {
     sprintf(hname,"TreeR%d",fEvent);
     fTreeR = new TTree(hname,"Reconstruction");
     fTreeR->Write();
   }
-  if (E && !fTreeE) {
+  if (oE && !fTreeE) {
     fTreeE = new TTree("TE","Header");
     //  Create a branch for Header
-    fTreeE->Branch("Header","AliHeader",&header,4000);
+    fTreeE->Branch("Header","AliHeader",&gAliHeader,4000);
     fTreeE->Write();
   }
   //
@@ -1149,7 +1165,7 @@ void AliRun::MakeTree(Option_t *option)
   TIter next(fModules);
   AliModule *detector;
   while((detector = (AliModule*)next())) {
-     if (H || D || R) detector->MakeBranch(option);
+     if (oH || oD || oR) detector->MakeBranch(option);
   }
 }
 
@@ -1184,12 +1200,12 @@ void AliRun::PurifyKine()
   for(i=0; i<fNtrack; i++) {
     // Preset map, to be removed later
     if(i<=fHgwmk) map[i]=i ; else map[i] = -99;
-    ((TParticle *)particles.UncheckedAt(i))->ResetBit(Daughters_Bit);
+    ((TParticle *)particles.UncheckedAt(i))->ResetBit(kDaughtersBit);
   }
   // Second pass, build map between old and new numbering
   for(i=fHgwmk+1; i<fNtrack; i++) {
     part = (TParticle *)particles.UncheckedAt(i);
-    if(part->TestBit(Keep_Bit)) {
+    if(part->TestBit(kKeepBit)) {
       
       // This particle has to be kept
       map[i]=nkeep;
@@ -1219,7 +1235,7 @@ void AliRun::PurifyKine()
     parent = part->GetFirstMother();
     if(parent>=0) {
       father = (TParticle *)particles.UncheckedAt(parent);
-      if(father->TestBit(Daughters_Bit)) {
+      if(father->TestBit(kDaughtersBit)) {
       
        if(i<father->GetFirstDaughter()) father->SetFirstDaughter(i);
        if(i>father->GetLastDaughter())  father->SetLastDaughter(i);
@@ -1227,7 +1243,7 @@ void AliRun::PurifyKine()
        // Iitialise daughters info for first pass
        father->SetFirstDaughter(i);
        father->SetLastDaughter(i);
-       father->SetBit(Daughters_Bit);
+       father->SetBit(kDaughtersBit);
       }
     }
   }
@@ -1476,9 +1492,9 @@ void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
   TClonesArray &particles = *fParticles;
   TParticle *particle;
   Float_t mass;
-  const Int_t firstdaughter=-1;
-  const Int_t lastdaughter=-1;
-  const Int_t KS=0;
+  const Int_t kfirstdaughter=-1;
+  const Int_t klastdaughter=-1;
+  const Int_t kS=0;
   //  const Float_t tlife=0;
   
   //
@@ -1492,19 +1508,19 @@ void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
   Float_t e=TMath::Sqrt(mass*mass+pmom[0]*pmom[0]+
                        pmom[1]*pmom[1]+pmom[2]*pmom[2]);
   
-  //printf("Loading particle %s mass %f ene %f No %d ip %d pos %f %f %f mom %f %f %f KS %d m %s\n",
-  //pname,mass,e,fNtrack,pdg,vpos[0],vpos[1],vpos[2],pmom[0],pmom[1],pmom[2],KS,mecha);
+  //printf("Loading particle %s mass %f ene %f No %d ip %d pos %f %f %f mom %f %f %f kS %d m %s\n",
+  //pname,mass,e,fNtrack,pdg,vpos[0],vpos[1],vpos[2],pmom[0],pmom[1],pmom[2],kS,mecha);
   
-  particle=new(particles[fNtrack]) TParticle(pdg,KS,parent,-1,firstdaughter,
-                                            lastdaughter,pmom[0],pmom[1],pmom[2],
+  particle=new(particles[fNtrack]) TParticle(pdg,kS,parent,-1,kfirstdaughter,
+                                            klastdaughter,pmom[0],pmom[1],pmom[2],
                                             e,vpos[0],vpos[1],vpos[2],tof);
   //                                        polar[0],polar[1],polar[2],tof,
   //                                        mecha,weight);
   ((TParticle*)particles[fNtrack])->SetPolarisation(TVector3(polar[0],polar[1],polar[2]));
   ((TParticle*)particles[fNtrack])->SetWeight(weight);
-  if(!done) particle->SetBit(Done_Bit);
+  if(!done) particle->SetBit(kDoneBit);
   //Declare that the daughter information is valid
-  ((TParticle*)particles[fNtrack])->SetBit(Daughters_Bit);
+  ((TParticle*)particles[fNtrack])->SetBit(kDaughtersBit);
   
   if(parent>=0) {
     particle=(TParticle*) fParticles->UncheckedAt(parent);
@@ -1529,7 +1545,7 @@ void AliRun::KeepTrack(const Int_t track)
   // flags a track to be kept
   //
   TClonesArray &particles = *fParticles;
-  ((TParticle*)particles[track])->SetBit(Keep_Bit);
+  ((TParticle*)particles[track])->SetBit(kKeepBit);
 }
  
 //_____________________________________________________________________________
@@ -1554,6 +1570,26 @@ void AliRun::StepManager(Int_t id)
   }
 }
 
+//_____________________________________________________________________________
+AliRun& AliRun::operator = (const AliRun &run)
+{
+  //
+  // Assignment operator
+  //
+  if(this != &run) run.Copy(*this);
+  return (*this);
+}
+
+
+//_____________________________________________________________________________
+void AliRun::Copy(AliRun &run) const
+{
+  //
+  // Copy *this onto run, not implemented for AliRun
+  //
+  Fatal("operator =","Assignment operator not implemented!\n");
+}
+
 //_____________________________________________________________________________
 void AliRun::Streamer(TBuffer &R__b)
 {
@@ -1566,7 +1602,7 @@ void AliRun::Streamer(TBuffer &R__b)
     if (!gAlice) gAlice = this;
     gROOT->GetListOfBrowsables()->Add(this,"Run");
     fTreeE = (TTree*)gDirectory->Get("TE");
-    if (fTreeE) fTreeE->SetBranchAddress("Header", &header);
+    if (fTreeE) fTreeE->SetBranchAddress("Header", &gAliHeader);
     else    Error("Streamer","cannot find Header Tree\n");
     R__b >> fNtrack;
     R__b >> fHgwmk;
index 499a34b6b4b565a52d291df75d7afdc10b042694..428dbcc4568a3f25c8d8babc05a0d89a20e467b3 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef AliRun_H
-#define AliRun_H
+#ifndef ALIRUN_H
+#define ALIRUN_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 #include "AliMC.h"
 #include "AliGenerator.h"
 class AliLego;
-//#include "AliLego.h"
 
-enum {Keep_Bit=1, Daughters_Bit=2, Done_Bit=4};
+enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
 
 class AliDisplay;
 
 class AliRun : public TNamed {
-
-protected:
-  Int_t         fRun;          //Current run number
-  Int_t         fEvent;        //Current event number (from 1)
-  Int_t         fNtrack;       //Number of tracks
-  Int_t         fHgwmk;        //Last track purified
-  Int_t         fCurrent;      //Last track returned from the stack
-  Int_t         fDebug;        //Debug flag
-  AliHeader     fHeader;       //Header information
-  TTree        *fTreeD;        //Pointer to Tree for Digits
-  TTree        *fTreeK;        //Pointer to Tree for Kinematics
-  TTree        *fTreeH;        //Pointer to Tree for Hits
-  TTree        *fTreeE;        //Pointer to Tree for Header
-  TTree        *fTreeR;        //Pointer to Tree for Reconstructed Objects
-  TObjArray    *fModules;      //List of Detectors
-  TClonesArray *fParticles;    //Pointer to list of particles
-  TGeometry    *fGeometry;     //Pointer to geometry
-  AliDisplay   *fDisplay;      //Pointer to event display
-  TStopwatch    fTimer;        //Timer object
-  AliMagF      *fField;        //Magnetic Field Map
-  AliMC        *fMC;           //pointer to MonteCarlo object
-  TArrayI      *fImedia;       //Array of correspondence between media and detectors
-  Int_t         fNdets;        //Number of detectors
-  Float_t       fTrRmax;       //Maximum radius for tracking
-  Float_t       fTrZmax;       //Maximu z for tracking
-  AliGenerator *fGenerator;    //Generator used in the MC
-  Bool_t        fInitDone;     //true when initialisation done
-  AliLego      *fLego;         //pointer to aliLego object if it exists
-  TDatabasePDG *fPDGDB;        //Particle factory object!
-  TList        *fHitLists;     //Lists of hits to be remapped by PurifyKine
-  TArrayF       fEventEnergy;  //Energy deposit for current event
-  TArrayF       fSummEnergy;   //Energy per event in each volume
-  TArrayF       fSum2Energy;   //Energy squared per event in each volume
-  TString       fConfigFunction; //Configuration file to be executed
-
-  
 public:
    // Creators - distructors
    AliRun();
    AliRun(const char *name, const char *title);
+   AliRun(const AliRun &run);
    virtual ~AliRun();
 
    virtual  void  AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
@@ -141,7 +105,7 @@ public:
                               Float_t *pmom, Float_t *vpos, Float_t *polar, 
                                Float_t tof, const char *mecha, Int_t &ntr,
                                Float_t weight=1);
-   virtual  void  KeepTrack(const Int_t);
+  virtual  void  KeepTrack(const Int_t itra);
    virtual  void  MediaTable();
    virtual  Float_t TrackingZmax() const {return fTrZmax;}
    virtual  Float_t TrackingRmax() const {return fTrRmax;}
@@ -152,6 +116,8 @@ public:
    virtual  void ResetGenerator(AliGenerator *generator);
    virtual  void EnergySummary();
    virtual  const TDatabasePDG* PDGDB() const {return fPDGDB;}
+   virtual  AliRun& operator = (const AliRun &run);
+   virtual  void Copy(AliRun &run) const;
 
 
    TTree         *TreeD() {return fTreeD;}
@@ -160,7 +126,39 @@ public:
    TTree         *TreeK() {return fTreeK;}
    TTree         *TreeR() {return fTreeR;}
 
-  // --------------------------- commons -------------------------------------
+protected:
+  Int_t         fRun;          //Current run number
+  Int_t         fEvent;        //Current event number (from 1)
+  Int_t         fNtrack;       //Number of tracks
+  Int_t         fHgwmk;        //Last track purified
+  Int_t         fCurrent;      //Last track returned from the stack
+  Int_t         fDebug;        //Debug flag
+  AliHeader     fHeader;       //Header information
+  TTree        *fTreeD;        //Pointer to Tree for Digits
+  TTree        *fTreeK;        //Pointer to Tree for Kinematics
+  TTree        *fTreeH;        //Pointer to Tree for Hits
+  TTree        *fTreeE;        //Pointer to Tree for Header
+  TTree        *fTreeR;        //Pointer to Tree for Reconstructed Objects
+  TObjArray    *fModules;      //List of Detectors
+  TClonesArray *fParticles;    //Pointer to list of particles
+  TGeometry    *fGeometry;     //Pointer to geometry
+  AliDisplay   *fDisplay;      //Pointer to event display
+  TStopwatch    fTimer;        //Timer object
+  AliMagF      *fField;        //Magnetic Field Map
+  AliMC        *fMC;           //pointer to MonteCarlo object
+  TArrayI      *fImedia;       //Array of correspondence between media and detectors
+  Int_t         fNdets;        //Number of detectors
+  Float_t       fTrRmax;       //Maximum radius for tracking
+  Float_t       fTrZmax;       //Maximu z for tracking
+  AliGenerator *fGenerator;    //Generator used in the MC
+  Bool_t        fInitDone;     //true when initialisation done
+  AliLego      *fLego;         //pointer to aliLego object if it exists
+  TDatabasePDG *fPDGDB;        //Particle factory object!
+  TList        *fHitLists;     //Lists of hits to be remapped by PurifyKine
+  TArrayF       fEventEnergy;  //Energy deposit for current event
+  TArrayF       fSummEnergy;   //Energy per event in each volume
+  TArrayF       fSum2Energy;   //Energy squared per event in each volume
+  TString       fConfigFunction; //Configuration file to be executed
 
    ClassDef(AliRun,3)      //Supervisor class for all Alice detectors
 };
index 4662b03239437119454cba542cddb5a9c3742ca4..73f252b65d6a25cf73466c3b7c2b3c17ab89b9db 100644 (file)
@@ -18,6 +18,7 @@ public TObject {
  public:
     // Set Chamber Segmentation Parameters
     //
+    virtual ~AliSegmentation() {}
     // Pad size Dx*Dy 
     virtual void    SetPadSize(Float_t p1, Float_t p2)                                   = 0;
     // Anod Pitch
index 36fb721e079cf80d1dc2f2bb8da93fef0a5ef7d0..c2ba22d9d0049c0d314445d9ddb534deffb76dcf 100644 (file)
@@ -14,7 +14,8 @@ SRCS          = AliDetector.cxx       AliHeader.cxx   AliMagF.cxx \
                 AliDisplay.cxx AliMC.cxx       AliRun.cxx AliGenerator.cxx \
                AliLego.cxx     AliModule.cxx   AliDigitNew.cxx \
                AliGeometry.cxx AliRecPoint.cxx AliSegmentation.cxx \
-               AliHitMap.cxx
+               AliHitMap.cxx   AliMagFC.cxx    AliMagFCM.cxx \
+               AliMagFDM.cxx
 
 # C++ Headers
 
index 0128691c898825b13dc971d6042fc07852a81dd0..6a6b9b4f54cd68563b0dda68389f40cb590a001a 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.5  2000/05/20 14:49:48  fca
+Call gdebug at the end of gustep
+
 Revision 1.4  2000/04/26 10:17:32  fca
 Changes in Lego for G4 compatibility
 
@@ -217,7 +220,7 @@ extern "C" void type_of_call  rxkeep(const Int_t &n)
       exit(1);
     }
   
-  ((TParticle*)(gAlice->Particles()->UncheckedAt(n-1)))->SetBit(Keep_Bit);
+  ((TParticle*)(gAlice->Particles()->UncheckedAt(n-1)))->SetBit(kKeepBit);
 }
 
 //_____________________________________________________________________________
@@ -263,7 +266,7 @@ extern "C" void type_of_call  rxouth ()
 #  define ghelix ghelix_
 #  define grkuta grkuta_
 #  define gtrack gtrack_
-#  define gtreve_root gtreve_root_
+#  define gtreveroot gtreveroot_
 #  define glast  glast_
 
 #else
@@ -299,7 +302,7 @@ extern "C" void type_of_call  rxouth ()
 #  define ghelix GHELIX
 #  define grkuta GRKUTA
 #  define gtrack GTRACK
-#  define gtreve_root GTREVE_ROOT
+#  define gtreveroot GTREVEROOT
 #  define glast  GLAST
 
 #endif
@@ -314,7 +317,7 @@ extern "C" type_of_call void ghelx3(Float_t&, Float_t&, Float_t*, Float_t*);
 extern "C" type_of_call void ghelix(Float_t&, Float_t&, Float_t*, Float_t*);
 extern "C" type_of_call void grkuta(Float_t&, Float_t&, Float_t*, Float_t*);
 extern "C" type_of_call void gtrack();
-extern "C" type_of_call void gtreve_root();
+extern "C" type_of_call void gtreveroot();
 extern "C" type_of_call void glast();
 
 extern "C" type_of_call {
@@ -659,7 +662,7 @@ void gutrev()
 //
 //    ------------------------------------------------------------------
 //
-  gtreve_root();
+  gtreveroot();
 }
 
 
index 729545e01c8c825b20fd77bcc66e05a44dd47f51..43a75efd89110e0ceb5875f77123c6e632370e6b 100644 (file)
 
 /*
 $Log$
+Revision 1.28  2000/06/29 10:51:55  morsch
+Add some charmed and bottom baryons to the particle list (TDatabasePDG). This
+is needed by Hijing. Should be part of a future review of TDatabasePDG.
+
 Revision 1.27  2000/06/21 17:40:15  fca
 Adding possibility to set ISTRA, PAI model
 
@@ -122,7 +126,7 @@ Introduction of the Copyright and cvs Log
 # define gsxyz   gsxyz_ 
 # define gtrack  gtrack_ 
 # define gtreve  gtreve_ 
-# define gtreve_root  gtreve_root_ 
+# define gtreveroot  gtreveroot_ 
 # define grndm   grndm_ 
 # define grndmq  grndmq_ 
 # define gdtom   gdtom_ 
@@ -219,7 +223,7 @@ Introduction of the Copyright and cvs Log
 # define gsxyz   GSXYZ 
 # define gtrack  GTRACK 
 # define gtreve  GTREVE 
-# define gtreve_root  GTREVE_ROOT
+# define gtreveroot  GTREVEROOT
 # define grndm   GRNDM
 # define grndmq  GRNDMQ
 # define gdtom   GDTOM 
@@ -347,7 +351,7 @@ extern "C"
 
   void type_of_call gtreve(); 
 
-  void type_of_call gtreve_root(); 
+  void type_of_call gtreveroot(); 
 
   void type_of_call grndm(Float_t *, const Int_t &); 
 
@@ -2268,12 +2272,12 @@ void  TGeant3::Gtreve()
 } 
 
 //_____________________________________________________________________________
-void  TGeant3::Gtreve_root() 
+void  TGeant3::GtreveRoot() 
 { 
   //
   //   Controls tracking of all particles belonging to the current event
   //
-  gtreve_root(); 
+  gtreveroot(); 
 } 
 
 //_____________________________________________________________________________
index abd353be2bbf29f1e666e324b1583710ca5fc906..402ead9017fa6034ddecf7ea246eef458568c41c 100644 (file)
@@ -114,7 +114,7 @@ typedef struct  {
   Int_t    kcase; 
   Int_t    ngkine; 
   Float_t  gkin[MXGKIN][5]; 
-  Int_t    tofd[MXGKIN]; 
+  Float_t  tofd[MXGKIN]; 
   Int_t    iflgk[MXGKIN]; 
 } Gcking_t; 
 
@@ -752,7 +752,7 @@ public:
    virtual  void  Gsxyz(); 
    virtual  void  Gtrack(); 
    virtual  void  Gtreve(); 
-   virtual  void  Gtreve_root(); 
+   virtual  void  GtreveRoot(); 
    virtual  void  Grndm(Float_t *rvec, const Int_t len) const; 
    virtual  void  Grndmq(Int_t &is1, Int_t &is2, const Int_t iseq, const Text_t *chopt); 
  
index 440a3e7f5fad1f7b3452a92d894fab855ddfd82f..7a47bbe6bb6ad304728f0ff3402e84e91cdb54c2 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.21  2000/06/27 09:26:18  fca
+Adding dummy SetSTRA
+
 Revision 1.20  2000/05/16 13:10:41  fca
 New method IsNewTrack and fix for a problem in Father-Daughter relations
 
@@ -199,7 +202,7 @@ void  TGeant3::Gsstak(Int_t) {}
 void  TGeant3::Gsxyz() {}
 void  TGeant3::Gtrack() {}
 void  TGeant3::Gtreve() {}
-void  TGeant3::Gtreve_root() {}
+void  TGeant3::GtreveRoot() {}
 void  TGeant3::Grndm(Float_t*, const Int_t) const {}
 void  TGeant3::Grndmq(Int_t&, Int_t&, const Int_t, const Text_t*) {}
 
index a14bf4faceb229a90858220fc38e2a8e581aeffb..cc9d3738b4644dbe94a8110e0c45d4156b13d07a 100644 (file)
@@ -418,9 +418,9 @@ void TGeant4::Gtreve() {
   TG4Globals:: Warning("TGeant4::Gtreve() is not implemented."); 
 }
 
-void TGeant4::Gtreve_root() { 
+void TGeant4::GtreveRoot() { 
 //
-  TG4Globals:: Warning("TGeant4::Gtreve_root() is not implemented."); 
+  TG4Globals:: Warning("TGeant4::GtreveRoot() is not implemented."); 
 }
 
 void TGeant4::Gckmat(Int_t itmed, char* natmed) { 
index f47f0f2c09c74ff2867f5ef40575a5851a5949cf..9fa75aeedea7991cb8d492dcaebb788ce5362493 100644 (file)
@@ -191,7 +191,7 @@ class TGeant4: public AliMC
     virtual void Gdman(Float_t u, Float_t v, const char* type);
     virtual void SetColors();
     virtual void Gtreve();
-    virtual void Gtreve_root();
+    virtual void GtreveRoot();
     virtual void Gckmat(Int_t itmed, char* natmed);
     virtual void InitLego();
     virtual void Gfpart(Int_t ipart, char *name, Int_t& itrtyp,  
index 93235656666bc6d70e3d39cac845159cd457346c..31117bd65d4f8499160b9aa7347092a9c138e279 100644 (file)
@@ -137,7 +137,7 @@ geant3->SetCUTS(cut,cut, cut, cut, cut, cut,  cut,  cut, cut,  cut, tofmax);
 //     
      gener->SetOrigin(0., 0.0 ,0);
      gener->SetSigma(0,0,5.3);
-     gener->SetVertexSmear(perEvent); 
+     gener->SetVertexSmear(kPerEvent); 
 // no tracking
      gener->SetTrackingFlag(0);
  case pythia:
@@ -152,7 +152,7 @@ geant3->SetCUTS(cut,cut, cut, cut, cut, cut,  cut,  cut, cut,  cut, tofmax);
      gener->SetYRange(-10,10);
      gener->SetPtRange(0,100);
      gener->SetOrigin(0,0,0);          // vertex position
-     gener->SetVertexSmear(perEvent); 
+     gener->SetVertexSmear(kPerEvent); 
      gener->SetSigma(0,0,5.6);         // Sigma in (X,Y,Z) (cm) on IP position
 //     gener->SetStrucFunc(DO_Set_1);
      gener->SetProcess(mb); 
@@ -255,7 +255,7 @@ geant3->SetCUTS(cut,cut, cut, cut, cut, cut,  cut,  cut, cut,  cut, tofmax);
 //*******************************************************
      AliGenExtFile *gener = new AliGenExtFile(-1); 
      gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root");
-     gener->SetVertexSmear(perEvent); 
+     gener->SetVertexSmear(kPerEvent); 
      gener->SetTrackingFlag(1);
      break;
 
@@ -305,7 +305,7 @@ geant3->SetCUTS(cut,cut, cut, cut, cut, cut,  cut,  cut, cut,  cut, tofmax);
 // Activate this line if you want the vertex smearing to happen
 // track by track
 //
-// gener->SetVertexSmear(perTrack); 
+// gener->SetVertexSmear(kPerTrack); 
 
 gener->Init();