Magnetic qField is used in AliRoot.
- Only one field will be supported, the Chebichev parametrisation
developed by R.Shahoyan, with the name AliMagF. Different field
strengths will be obtained by changing the scale factor for the
dipole and the solenoid fields. Some highlights of these changes are
here
- All other mag field classes and maps are deleted
- The field is accessed via a call to
TGeoGlobalMagField::Instance()->Field(...) both in simulation and in
reconstruction. This has involved changes in very many files in the
following modules: ACORDE, BCM, EMCAL, EVE, FMD, HLT, HMPID, ITS,
MONITOR, MUON, PHOS, PMD, PWG1, PWG3, RAW, STEER, STRUCT, T0, TOF,
TPC, TRD, VZERO, ZDC, test.
- The modifications to account for the new field were done in the
compilable code and in all the macro. These have now to be carefully
tested by the authors.
- If your macros are creating the field, note that the field should be
constructed as:
AliMagF* fld = new AliMagF(
const char *anyname, // same as before, up to you
const char* anytitle, // same as before, ...
Int_t integ, // same as before, geant
Double_t factorSol=1.,// scaling (including the sign) for the solenoid
Double_t factorDip=1.,// new parameter, scaling for dipole
Double_t fmax=15, // same as before
BMap_t maptype = k5kG,// map type: choices are AliMagF::k5kG,
// AliMagF::k2kG and k5kGUniform
// the latter will provide former AliMagFC-like
// field: constant Bz for L3, BX parabolic in
// Z for dipole
const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
// parameterization file to use.
BeamType_t btype=kBeamTypepp, // used to define the field for ZDC,
// choices are: AliMagF::kBeamTypeAA,
// AliMagF::kBeamTypepp, liMagF::kNoBeamField
Double_t benergy=7000., // currently only 450, 5000 and 7000 are
//supported, will be changed soon
Bool_t compensator=kFALSE // this are compensator dipoles for the
// Muon dipole, most probably it will be
// eliminated soon, set it to kTRUE for
// the moment
);
- Note that in order to make the field available to Aliroot it should
be registered by
TGeoGlobalMagField::Instance()->SetField(fld);
- The following lock will prevent the field from resetting:
TGeoGlobalMagField::Instance()->Lock();
- In the macros and in the code the field may be accessed via either
direct call
TGeoGlobalMagField::Instance()->Field(const double* x,double *b)
or casted to
AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
in case you need the methods like GetTPCInt().
- Since many classes use only Bz component, I've added a new method
AliMagF::GetBz(const double* x) which computes the Bz w/o spending
the time on Bx,By.
///////////////////////////////////////////////////////////////////////////////
#include <TClonesArray.h>
-#include <TTree.h>
-#include <TVirtualMC.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
#include <TStopwatch.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
#include "AliACORDE.h"
#include "AliMagF.h"
void AliACORDE::CreateMaterials()
{
// Magnatic field inside the pit
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
//Magnetic field above the Magnet.
Int_t xfield = 0; // no Magnetic field.
//
-
// Configuration for the Physics Data Challenge 2006
-
//
-
-
-
// One can use the configuration macro in compiled mode by
-
// root [0] gSystem->Load("libgeant321");
-
// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
-
// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
-
// root [0] .x grun.C(1,"Config_PDC06.C++")
-
-
-
#if !defined(__CINT__) || defined(__MAKECINT__)
-
#include <Riostream.h>
-
#include <TRandom.h>
-
#include <TDatime.h>
-
#include <TSystem.h>
-
#include <TVirtualMC.h>
-
#include <TGeant3TGeo.h>
-
#include "EVGEN/AliGenCocktail.h"
-
#include "EVGEN/AliGenParam.h"
-
#include "EVGEN/AliGenMUONlib.h"
-
#include "STEER/AliRunLoader.h"
-
#include "STEER/AliRun.h"
-
#include "STEER/AliConfig.h"
-
#include "PYTHIA6/AliDecayerPythia.h"
-
#include "PYTHIA6/AliGenPythia.h"
-
-#include "STEER/AliMagFMaps.h"
-
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
-
#include "STRUCT/AliMAG.h"
-
#include "STRUCT/AliABSOv0.h"
-
#include "STRUCT/AliDIPOv2.h"
-
#include "STRUCT/AliHALL.h"
-
#include "STRUCT/AliFRAMEv2.h"
-
#include "STRUCT/AliSHILv2.h"
-
#include "STRUCT/AliPIPEv0.h"
-
#include "ITS/AliITSgeom.h"
-
#include "ITS/AliITSvPPRasymmFMD.h"
-
#include "TPC/AliTPCv2.h"
-
#include "TOF/AliTOFv5T0.h"
-
#include "HMPID/AliHMPIDv1.h"
-
#include "ZDC/AliZDCv2.h"
-
#include "TRD/AliTRDv1.h"
-
#include "FMD/AliFMDv1.h"
-
#include "MUON/AliMUONv1.h"
-
#include "PHOS/AliPHOSv1.h"
-
#include "PMD/AliPMDv1.h"
-
#include "T0/AliT0v1.h"
-
#include "EMCAL/AliEMCALv2.h"
-
#include "CRT/AliCRTv0.h"
-
#include "VZERO/AliVZEROv7.h"
-
#endif
-
-
-
//--- Trigger config ---
-
enum TrigConf_t
-
{
-
kDefaultPPTrig, kDefaultPbPbTrig
-
};
-
-
-
const char * TrigConfName[] = {
-
"p-p","Pb-Pb"
-
};
-
-
-
-
-
-
-
//--- Decay Mode ---
-
enum DecayHvFl_t
-
{
-
kNature, kHadr, kSemiEl, kSemiMu
-
};
-
//--- Rapidity Cut ---
-
enum YCut_t
-
{
-
kFull, kBarrel, kMuonArm
-
};
-
-//--- Magnetic Field ---
-
-enum Mag_t
-
-{
-
- k2kG, k4kG, k5kG
-
-};
-
-
-
void ProcessEnvironmentVars();
-
-
-
// This part for configuration
-
static DecayHvFl_t decHvFl = kNature;
-
static YCut_t ycut = kFull;
-
-static Mag_t mag = k5kG;
-
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static TrigConf_t trig = kDefaultPPTrig;
-
//========================//
-
// Set Random Number seed //
-
//========================//
-
TDatime dt;
-
static UInt_t seed = dt.Get();
-
-
-
-
-
// Comment line
-
static TString comment;
-
-
-
void Config()
-
{
-
-
-
-
// Get settings from environment variables
-
ProcessEnvironmentVars();
-
-
-
gRandom->SetSeed(seed);
-
// gRandom->SetSeed(12345);
-
cerr<<"Seed for random number generation= "<<seed<<endl;
-
-
-
// libraries required by geant321
-
#if defined(__CINT__)
-
gSystem->Load("libgeant321");
-
#endif
-
-
-
new TGeant3TGeo("C++ Interface to Geant3");
-
-
-
//=======================================================================
-
// Create the output file
-
-
-
-
AliRunLoader* rl=0x0;
-
-
-
cout<<"Config.C: Creating Run Loader ..."<<endl;
-
rl = AliRunLoader::Open("galice.root",
-
AliConfig::GetDefaultEventFolderName(),
-
"recreate");
-
if (rl == 0x0)
-
{
-
gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
-
return;
-
}
-
rl->SetCompressionLevel(2);
-
rl->SetNumberOfEventsPerFile(1000);
-
gAlice->SetRunLoader(rl);
-
-
// Set the trigger configuration
-
gAlice->SetTriggerDescriptor(TrigConfName[trig]);
-
cout<<"Trigger configuration is set to "<<TrigConfName[trig]<<endl;
-
-
-
//
-
//=======================================================================
-
// ************* STEERING parameters FOR ALICE SIMULATION **************
-
// --- Specify event type to be tracked through the ALICE setup
-
// --- All positions are in cm, angles in degrees, and P and E in GeV
-
-
-
-
-
gMC->SetProcess("DCAY",1);
-
gMC->SetProcess("PAIR",1);
-
gMC->SetProcess("COMP",1);
-
gMC->SetProcess("PHOT",1);
-
gMC->SetProcess("PFIS",0);
-
gMC->SetProcess("DRAY",0);
-
gMC->SetProcess("ANNI",1);
-
gMC->SetProcess("BREM",1);
-
gMC->SetProcess("MUNU",1);
-
gMC->SetProcess("CKOV",1);
-
gMC->SetProcess("HADR",1);
-
gMC->SetProcess("LOSS",2);
-
gMC->SetProcess("MULS",1);
-
gMC->SetProcess("RAYL",1);
-
-
-
Float_t cut = 1.e-3; // 1MeV cut by default
-
Float_t tofmax = 1.e10;
-
-
-
gMC->SetCut("CUTGAM", cut);
-
gMC->SetCut("CUTELE", cut);
-
gMC->SetCut("CUTNEU", cut);
-
gMC->SetCut("CUTHAD", cut);
-
gMC->SetCut("CUTMUO", cut);
-
gMC->SetCut("BCUTE", cut);
-
gMC->SetCut("BCUTM", cut);
-
gMC->SetCut("DCUTE", cut);
-
gMC->SetCut("DCUTM", cut);
-
gMC->SetCut("PPCUTM", cut);
-
gMC->SetCut("TOFMAX", tofmax);
-
// ((TGeant3 *) gMC)->SetSWIT(2,2);
-
// ((TGeant3 *) gMC)->SetDEBU(1,999,1);
-
-
-
-
-
-
-
-
-
// Set External decayer //
-
//======================//
-
TVirtualMCDecayer* decayer = new AliDecayerPythia();
-
// DECAYS
-
//
-
switch(decHvFl) {
-
case kNature:
-
decayer->SetForceDecay(kAll);
-
break;
-
case kHadr:
-
decayer->SetForceDecay(kHadronicD);
-
break;
-
case kSemiEl:
-
decayer->SetForceDecay(kSemiElectronic);
-
break;
-
case kSemiMu:
-
decayer->SetForceDecay(kSemiMuonic);
-
break;
-
}
-
decayer->Init();
-
gMC->SetExternalDecayer(decayer);
-
-
-
//=========================//
-
// Generator Configuration //
-
//=========================//
-
AliGenBox* gener = new AliGenBox();
-
gener->SetThetaRange(45,135);
-
gener->SetPhiRange(30,150);
-
gener->SetMomentumRange(9.8,10.2);
-
gener->SetPart(kMuonMinus);
-
gener->SetNumberParticles(20);
-
-
-
-
-
gener->Init();
-
-
-
// FIELD
-
//
-
- if (mag == k2kG) {
-
+ if (mag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
-
- } else if (mag == k4kG) {
-
- comment = comment.Append(" | L3 field 0.4 T");
-
- } else if (mag == k5kG) {
-
+ } else if (mag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
-
}
-
printf("\n \n Comment: %s \n \n", comment.Data());
-
-
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
-
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,mag);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
-
-
-
-
-
-
-
Int_t iABSO = 0;
-
Int_t iACORDE = 1;
-
Int_t iDIPO = 0;
-
Int_t iEMCAL = 0;
-
Int_t iFMD = 0;
-
Int_t iFRAME = 0;
-
Int_t iHALL = 0;
-
Int_t iITS = 0;
-
Int_t iMAG = 0;
-
Int_t iMUON = 0;
-
Int_t iPHOS = 0;
-
Int_t iPIPE = 0;
-
Int_t iPMD = 0;
-
Int_t iHMPID = 0;
-
Int_t iSHIL = 0;
-
Int_t iT0 = 0;
-
Int_t iTOF = 0;
-
Int_t iTPC = 0;
-
Int_t iTRD = 0;
-
Int_t iVZERO = 0;
-
Int_t iZDC = 0;
-
-
-
-
//=================== Alice BODY parameters =============================
-
AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
-
-
-
-
-
if (iMAG)
-
{
-
//=================== MAG parameters ============================
-
// --- Start with Magnet since detector layouts may be depending ---
-
// --- on the selected Magnet dimensions ---
-
AliMAG *MAG = new AliMAG("MAG", "Magnet");
-
}
-
-
-
-
-
if (iABSO)
-
{
-
//=================== ABSO parameters ============================
-
AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
-
}
-
-
-
if (iDIPO)
-
- {
-
- //=================== DIPO parameters ============================
-
-
-
+ {
+ //=================== DIPO parameters ============================
AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
-
}
-
-
-
if (iHALL)
-
{
-
//=================== HALL parameters ============================
-
-
-
AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
-
}
-
-
-
-
-
if (iFRAME)
-
{
-
//=================== FRAME parameters ============================
-
-
-
AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
-
}
-
-
-
if (iSHIL)
-
{
-
//=================== SHIL parameters ============================
-
-
-
AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
-
}
-
-
-
-
-
if (iPIPE)
-
{
-
//=================== PIPE parameters ============================
-
-
-
AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
-
}
-
-
if(iITS) {
-
-
-
//=================== ITS parameters ============================
-
//
-
// As the innermost detector in ALICE, the Inner Tracking System "impacts" on
-
// almost all other detectors. This involves the fact that the ITS geometry
-
// still has several options to be followed in parallel in order to determine
-
// the best set-up which minimizes the induced background. All the geometries
-
// available to date are described in the following. Read carefully the comments
-
// and use the default version (the only one uncommented) unless you are making
-
// comparisons and you know what you are doing. In this case just uncomment the
-
// ITS geometry you want to use and run Aliroot.
-
//
-
// Detailed geometries:
-
//
-
//
-
//AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
-
//
-
//AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
-
//
-
AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
-
ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
-
ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
-
// ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
-
ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
-
ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
-
ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
-
ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
-
ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
-
ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
-
-
-
// Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
-
// for reconstruction !):
-
//
-
//
-
//AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
-
//ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
-
//ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
-
//
-
//AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
-
//ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
-
//ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
-
//
-
//
-
//
-
// Geant3 <-> EUCLID conversion
-
// ============================
-
//
-
// SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
-
// media to two ASCII files (called by default ITSgeometry.euc and
-
// ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
-
// The default (=0) means that you dont want to use this facility.
-
//
-
ITS->SetEUCLID(0);
-
}
-
-
-
if (iTPC)
-
{
-
//============================ TPC parameters =====================
-
AliTPC *TPC = new AliTPCv2("TPC", "Default");
-
}
-
-
-
-
-
if (iTOF) {
-
//=================== TOF parameters ============================
-
AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
-
// Partial geometry: modules at 2,3,4,6,7,11,12,14,15,16
-
// starting at 6h in positive direction
-
// Int_t TOFSectors[18]={-1,-1,0,0,0,-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0};
-
// Partial geometry: modules at 1,2,6,7,9,10,11,12,15,16,17
-
// (ALICE numbering convention)
-
Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};
-
TOF->SetTOFSectors(TOFSectors);
-
}
-
-
-
-
-
if (iHMPID)
-
{
-
//=================== HMPID parameters ===========================
-
AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
-
-
-
}
-
-
-
-
-
if (iZDC)
-
{
-
//=================== ZDC parameters ============================
-
-
-
AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
-
}
-
-
-
if (iTRD)
-
{
-
//=================== TRD parameters ============================
-
-
-
AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
-
AliTRDgeometry *geoTRD = TRD->GetGeometry();
-
// Partial geometry: modules at 2,3,4,6,11,12,14,15
-
// starting at 6h in positive direction
-
geoTRD->SetSMstatus(0,0);
-
geoTRD->SetSMstatus(1,0);
-
geoTRD->SetSMstatus(5,0);
-
geoTRD->SetSMstatus(7,0);
-
geoTRD->SetSMstatus(8,0);
-
geoTRD->SetSMstatus(9,0);
-
geoTRD->SetSMstatus(10,0);
-
geoTRD->SetSMstatus(13,0);
-
geoTRD->SetSMstatus(16,0);
-
geoTRD->SetSMstatus(17,0);
-
}
-
-
-
if (iFMD)
-
{
-
//=================== FMD parameters ============================
-
AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
-
}
-
-
-
if (iMUON)
-
{
-
//=================== MUON parameters ===========================
-
// New MUONv1 version (geometry defined via builders)
-
AliMUON *MUON = new AliMUONv1("MUON", "default");
-
}
-
//=================== PHOS parameters ===========================
-
-
-
if (iPHOS)
-
{
-
AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
-
}
-
-
-
-
-
if (iPMD)
-
{
-
//=================== PMD parameters ============================
-
AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
-
}
-
-
-
if (iT0)
-
{
-
//=================== T0 parameters ============================
-
AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
-
}
-
-
-
if (iEMCAL)
-
{
-
//=================== EMCAL parameters ============================
-
AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
-
}
-
-
-
if (iACORDE)
-
{
-
//=================== ACORDE parameters ============================
-
AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
-
// ACORDE->SetITSGeometry(kTRUE);
-
// ACORDE->SetCreateCavern(kFALSE);
-
}
-
-
-
if (iVZERO)
-
{
-
//=================== VZERO parameters =============================
-
AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
-
}
-
}
-
-
-
void ProcessEnvironmentVars()
-
{
-
// Run type
-
if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
-
for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
-
if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
-
proc = (PDC06Proc_t)iRun;
-
cout<<"Run type set to "<<pprRunName[iRun]<<endl;
-
}
-
}
-
}
-
-
-
// Random Number seed
-
if (gSystem->Getenv("CONFIG_SEED")) {
-
seed = atoi(gSystem->Getenv("CONFIG_SEED"));
-
}
-
}
-
-
-
-
-
-
-
// andreas.morsch@cern.ch //
///////////////////////////////////////////////////////////////////////////////
-#include <TVirtualMC.h>
#include <TClonesArray.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TGeoMaterial.h>
-#include <TGeoMedium.h>
-#include <TGeoVolume.h>
#include <TGeoMatrix.h>
+#include <TGeoMedium.h>
#include <TGeoPgon.h>
+#include <TGeoVolume.h>
#include <TGeoXtru.h>
-#include <TGeoCompositeShape.h>
-#include <TGeoManager.h>
+#include <TVirtualMC.h>
#include "AliBCM.h"
#include "AliBCMHit.h"
Float_t tmaxfd = -20. ; // Maximum angle due to field deflection
Float_t deemax = -.01; // Maximum fractional energy loss, DLS
Float_t stmin = -.8;
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
AliMaterial(1, "PCD", 12.011, 6., rho, radl, absl);
//
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 1;
Int_t iACORDE = 0;
// --- ROOT system ---
class TFile;
#include <TFolder.h>
-#include <TTree.h>
-#include <TVirtualMC.h>
+#include <TGeoGlobalMagField.h>
+#include <TGraph.h>
#include <TH1F.h>
#include <TRandom.h>
-#include <TGraph.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
// --- Standard library ---
// DEFINITION OF THE TRACKING MEDIA
// for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
- Int_t isxfld = gAlice->Field()->Integ() ;
- Float_t sxmgmx = gAlice->Field()->Max() ;
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ() ;
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max() ;
// Air -> idtmed[1599]
AliMedium(0, "Air$", 0, 0,
#include "TVector3.h"
#include "AliLog.h"
-#include "AliTracker.h"
#include "AliESDtrack.h"
#include "AliEMCALTrack.h"
//
//------------------------------------------------------------------------------
//
-Double_t AliEMCALTrack::GetBz() const
-{
- //
- // Returns Z-component of the magnetic field in kG.
- // In case it B is not constant, its value is returned
- // at the current position of the track (local X,Y,Z)
- //
-
- // if magnetic field is constant...
- if (AliTracker::UniformField()) return AliTracker::GetBz();
-
- // ...else:
- Double_t r[3];
- GetXYZ(r);
- return AliTracker::GetBz(r);
-}
-//
-//------------------------------------------------------------------------------
-//
Bool_t AliEMCALTrack::PropagateTo(Double_t xk, Double_t d, Double_t x0)
{
//
AliEMCALTrack& operator=(const AliEMCALTrack &t);
Int_t Compare(const TObject *o) const;
-
- Double_t GetBz() const;
Int_t GetClusterIndex() const {return fClusterIndex;}
Double_t GetClusterDist() const {return fClusterDist;}
Double_t GetMass() const {return fMass;}
AliCDBManager::Instance()->SetSpecificStorage("EMCAL/Calib/Data","local://$ALICE_ROOT/EMCAL/beamtest07/");
//AliLog::SetGlobalDebugLevel(2);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliTracker::SetFieldMap(field,kFALSE);
AliReconstruction rec ;
rec.SetOption("EMCAL","OldRCUFormat");
#include "AliEMCALJetFinder.h"
#include "AliHeader.h"
#include "AliMagF.h"
-#include "AliMagFCM.h"
#include "AliRun.h"
#include "AliGenerator.h"
#include "AliRunLoader.h"
//
static Float_t b = 0.0, rEMCAL = -1.0;
// Get field in kGS
- b = gAlice->Field()->SolenoidField();
+ b = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField();
// Get EMCAL radius in cm
rEMCAL = AliEMCALGeometry::GetInstance()->GetIPDistance();
Float_t dPhi = 0.;
Float_t b = 0.0, rEMCAL = -1.0;
if(rEMCAL<0)
{
- b = gAlice->Field()->SolenoidField();
+ b = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField();
rEMCAL = AliEMCALGeometry::GetInstance()->GetIPDistance();
}
Float_t dPhi = 0.;
}
}
- if (gAlice && gAlice->Field())
- bfield = gAlice->Field()->SolenoidField();
+ if (gAlice && ((AliMagF*)TGeoGlobalMagField::Instance()->GetField()))
+ bfield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField();
else
bfield = 0.4;
rEMCAL = AliEMCALGeometry::GetInstance()->GetIPDistance();
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 0;
Int_t iDIPO = 0;
//rec.SetInput("raw.root");
//rec.SetRunQA(":");
- // **** The field map settings must be the same as in Config.C !
- AliMagFMaps *field=new AliMagFMaps("Maps","Maps",2,1.,10.,AliMagFMaps::k5kG);
- Bool_t uniform=kFALSE;
- AliTracker::SetFieldMap(field,uniform);
-
TStopwatch timer;
timer.Start();
#include <AliRawReaderRoot.h>
#include <AliRawReaderFile.h>
#include <AliRawReaderDate.h>
-#include <AliMagFMaps.h>
+#include <AliMagF.h>
#include <AliCDBManager.h>
#include <AliCDBStorage.h>
#include <AliHeader.h>
TString AliEveEventManager::fgRawFileName("raw.root");
TString AliEveEventManager::fgCdbUri("local://$ALICE_ROOT");
-AliMagF* AliEveEventManager::fgMagField = 0;
-
TList* AliEveEventManager::fgAODfriends = 0;
AliEveEventManager* AliEveEventManager::fgMaster = 0;
return fgCurrent->fRawReader;
}
-AliMagF* AliEveEventManager::AssertMagField()
-{
- // Make sure AliMagF is initialized and returns it.
- // Run-loader must be initialized to get the correct magnetic field!
- // Throws exception in case magnetic field is not available.
- // Static utility for macros.
-
- // !!!! This should be fixed ... get field also in some other way,
- // not only via run-loader.
-
- static const TEveException kEH("AliEveEventManager::AssertMagField ");
-
- if (fgMagField == 0)
- {
- if (fgMaster && fgMaster->fRunLoader && fgMaster->fRunLoader->GetAliRun())
- {
- ::Info(kEH, "Retrieving magnetic field from AliRun.");
- fgMagField = fgMaster->fRunLoader->GetAliRun()->Field();
- }
- else
- {
- ::Warning(kEH, "Instantiating default magnetic field (5kG).");
- fgMagField = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- }
- }
- return fgMagField;
-}
TGeoManager* AliEveEventManager::AssertGeometry()
{
static AliAODEvent* AssertAOD();
static AliRawReader* AssertRawReader();
- static AliMagF* AssertMagField();
-
static TGeoManager* AssertGeometry();
static AliEveEventManager* AddDependentManager(const TString& name, const TString& path);
static Bool_t fgAssertAOD; // Global flag specifying if AODEvent must be asserted during opening of the event-data.
static Bool_t fgAssertRaw; // Global flag specifying if raw-data presence must be asserted during opening of the event-data.
- static AliMagF *fgMagField; // Global pointer to magnetic field.
-
static TList *fgAODfriends; // Global list of AOD friend names to be attached during opening of the event-data (empty by default).
private:
#include <EveBase/AliEveEventManager.h>
#include <AliMagF.h>
-#include <AliMagFMaps.h>
#include <AliLog.h>
#include <AliESDMuonTrack.h>
#include <AliESDEvent.h>
#include <AliMUONVCluster.h>
#include <TClonesArray.h>
-#include <TStyle.h>
-#include <TROOT.h>
+#include <TGeoGlobalMagField.h>
#include <TParticle.h>
#include <TParticlePDG.h>
+#include <TROOT.h>
+#include <TStyle.h>
#include <Riostream.h>
ClassImp(AliEveMUONTrack)
-AliMagF* AliEveMUONTrack::fgFieldMap = 0;
//______________________________________________________________________________
AliEveMUONTrack::AliEveMUONTrack(TEveRecTrack* t, TEveTrackPropagator* rs) :
//
// constructor
//
-
- if (fgFieldMap == 0)
- fgFieldMap = AliEveEventManager::AssertMagField();
}
//______________________________________________________________________________
}
-//______________________________________________________________________________
-void AliEveMUONTrack::GetField(Double_t *position, Double_t *field)
-{
- //
- // returns field components at position, for a give field map
- //
-
- /// interface for arguments in double precision (Why ? ChF)
- Float_t x[3], b[3];
-
- x[0] = position[0]; x[1] = position[1]; x[2] = position[2];
-
- if (fgFieldMap) {
- fgFieldMap->Field(x,b);
- }
- else {
- AliWarning("No field map");
- field[0] = field[1] = field[2] = 0.0;
- return;
- }
-
- // force components
- //b[1] = 0.0;
- //b[2] = 0.0;
-
- field[0] = b[0]; field[1] = b[1]; field[2] = b[2];
-
- return;
-
-}
-
//______________________________________________________________________________
void AliEveMUONTrack::OneStepRungekutta(Double_t charge, Double_t step,
Double_t* vect, Double_t* vout)
rest = step - tl;
if (TMath::Abs(h) > TMath::Abs(rest)) h = rest;
//cmodif: call gufld(vout,f) changed into:
-
- GetField(vout,f);
+ TGeoGlobalMagField::Instance()->Field(vout,f);
// *
// * start of integration
xyzt[2] = zt;
//cmodif: call gufld(xyzt,f) changed into:
- GetField(xyzt,f);
+ TGeoGlobalMagField::Instance()->Field(xyzt,f);
at = a + secxs[0];
bt = b + secys[0];
xyzt[2] = zt;
//cmodif: call gufld(xyzt,f) changed into:
- GetField(xyzt,f);
+ TGeoGlobalMagField::Instance()->Field(xyzt,f);
z = z + (c + (seczs[0] + seczs[1] + seczs[2]) * kthird) * h;
y = y + (b + (secys[0] + secys[1] + secys[2]) * kthird) * h;
void MakeESDTrack(AliESDMuonTrack *mtrack);
void MakeMCTrack(TParticle *part);
void MakeRefTrack(AliMUONTrack *mtrack);
- void GetField(Double_t *position, Double_t *field);
void Propagate(Float_t *xr, Float_t *yr, Float_t *zr, Int_t i1, Int_t i2);
void OneStepRungekutta(Double_t charge, Double_t step,
Double_t* vect, Double_t* vout);
Bool_t fIsMCTrack; // track from Kinematics.root
Bool_t fIsRefTrack; // track from TrackRefs.root
- static AliMagF *fgFieldMap; // pointer to the magnetic field map
-
ClassDef(AliEveMUONTrack, 0); // Produce TEveUtil:TEveTrack from AliMUONTrack
};
Int_t g_currentEvent = -1;
Bool_t g_fromRaw = kFALSE;
-AliMagFMaps *g_field = 0;
-
void MUON_displayData(Bool_t fromRaw = kFALSE, Bool_t showTracks = kTRUE, Bool_t clustersFromESD = kTRUE)
{
//
if (!AliMpSegmentation::Instance()) AliMpCDB::LoadMpSegmentation();
if (!AliMpDDLStore::Instance()) AliMpCDB::LoadDDLStore();
- if (g_field == 0) {
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
printf("Loading field map...\n");
- g_field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(g_field, kFALSE);
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
}
+ // set the magnetic field for track extrapolations
+ AliMUONTrackExtrap::SetField();
TTree* dt = 0;
TTree* ct = 0;
Int_t g_currentEvent = -1;
Bool_t g_fromRaw = kFALSE;
-AliMagFMaps *g_field = 0;
void MUON_displaySimu(Bool_t fromRaw = kFALSE, Bool_t showTracks = kTRUE, Bool_t clustersFromESD = kTRUE)
{
if (!AliMpSegmentation::Instance()) AliMpCDB::LoadMpSegmentation();
if (!AliMpDDLStore::Instance()) AliMpCDB::LoadDDLStore();
- if (g_field == 0) {
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
printf("Loading field map...\n");
- g_field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(g_field, kFALSE);
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
}
+ // set the magnetic field for track extrapolations
+ AliMUONTrackExtrap::SetField();
TTree* dt = 0;
TTree* ct = 0;
TEveTrackList* cont = new TEveTrackList("Kine Tracks");
cont->SetMainColor(3);
TEveTrackPropagator* rnrStyle = cont->GetPropagator();
- Float_t mag_field = 0;
- if (gAlice && gAlice->Field())
- {
- // !!! Watch the '-', apparently different sign convention then for ESD.
- mag_field = -0.1*gAlice->Field()->SolenoidField();
- }
- else
- {
- Warning("kine_tracks.C", "Could not determine magnetic field from gAlice - using zero.");
- }
- rnrStyle->SetMagField(mag_field);
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ rnrStyle->SetMagField(fld ? -0.1*fld->SolenoidField() : 0);
gEve->AddElement(cont);
Int_t count = 0;
TEveTrackPropagator* rnrStyle = tlist->GetPropagator();
// !!! Watch the '-', apparently different sign convention then for ESD.
- rnrStyle->SetMagField( -0.1*gAlice->Field()->SolenoidField() );
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ rnrStyle->SetMagField( fld ? -0.1*fld->SolenoidField() : 0 );
char tooltip[1000];
sprintf(tooltip,"Ndaughters=%d", p->GetNDaughters());
tlist->SetTitle(tooltip);
cdb->SetDefaultStorage("local://$ALICE_ROOT");
cdb->SetRun(0);
AliEveEventManager::AssertGeometry();
- AliMagFMaps *field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kTRUE);
AliTRDReconstructor *reco = new AliTRDReconstructor();
reco->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
}
gEve->AddElement(tracks);
gEve->Redraw3D();
-}
\ No newline at end of file
+}
// These files are not in the same directory, so there's no reason to
// ask the preprocessor to search in the current directory for these
// files by including them with `#include "..."'
-#include <cmath> // __CMATH__
+#include <TBrowser.h> // ROOT_TBrowser
#include <TClonesArray.h> // ROOT_TClonesArray
+#include <TGeoGlobalMagField.h> // ROOT_TGeoGlobalMagField
+#include <TGeoManager.h> // ROOT_TGeoManager
#include <TRotMatrix.h> // ROOT_TRotMatrix
#include <TTree.h> // ROOT_TTree
-#include <TBrowser.h> // ROOT_TBrowser
-#include <TVirtualMC.h> // ROOT_TVirtualMC
#include <TVector2.h> // ROOT_TVector2
-#include <TGeoManager.h> // ROOT_TGeoManager
+#include <TVirtualMC.h> // ROOT_TVirtualMC
+#include <cmath> // __CMATH__
#include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
#include <AliLoader.h> // ALILOADER_H
Double_t density = 0;
Double_t radiationLength = 0;
Double_t absorbtionLength = 999;
- Int_t fieldType = gAlice->Field()->Integ(); // Field type
- Double_t maxField = gAlice->Field()->Max(); // Field max.
+ Int_t fieldType = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Double_t maxField = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Double_t maxBending = 0; // Max Angle
Double_t maxStepSize = 0.001; // Max step size
Double_t maxEnergyLoss = 1; // Max Delta E
kNoGluonRadiation //
};
-//____________________________________________________________________
-enum Mag_t {
- k2kG, //
- k4kG, //
- k5kG //
-};
-
//____________________________________________________________________
enum MC_t {
kFLUKA,
// EG_t eg = kFMD2Flat;
Geo_t geo = kNoHoles;
Rad_t rad = kGluonRadiation;
- Mag_t mag = k5kG;
+ AliMagF::BMap_t mag = AliMagF::k5kG;
Int_t seed = 12345; //Set 0 to use the current time
MC_t mc = kGEANT3TGEO;
//__________________________________________________________________
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
+
TFile* magF = TFile::Open("mag.root", "RECREATE");
field->Write("mag");
magF->Close();
kNoGluonRadiation //
};
-//____________________________________________________________________
-enum Mag_t {
- k2kG, //
- k4kG, //
- k5kG //
-};
-
//____________________________________________________________________
enum MC_t {
kFLUKA,
// EG_t eg = kFMDFlat;
Geo_t geo = kNoHoles;
Rad_t rad = kGluonRadiation;
- Mag_t mag = k5kG;
+ AliMagF::BMap_t mag = AliMagF::k5kG;
Int_t seed = 12345; //Set 0 to use the current time
MC_t mc = kGEANT3TGEO;
// Comments
//
switch (mag) {
- case k2kG: comment = comment.Append(" | L3 field 0.2 T"); break;
- case k4kG: comment = comment.Append(" | L3 field 0.4 T"); break;
- case k5kG: comment = comment.Append(" | L3 field 0.5 T"); break;
+ case AliMagF::k2kG: comment = comment.Append(" | L3 field 0.2 T"); break;
+ case AliMagF::k5kG: comment = comment.Append(" | L3 field 0.5 T"); break;
}
switch (rad) {
//__________________________________________________________________
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
//__________________________________________________________________
//
#include "STEER/AliConfig.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
{
kFull, kBarrel, kMuonArm
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
-
//--- Trigger config ---
enum TrigConf_t
{
static PDC06Proc_t proc = kPyOmegaPlus;
static DecayHvFl_t decHvFl = kNature;
static YCut_t ycut = kFull;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static TrigConf_t trig = kDefaultPPTrig; // default pp trigger configuration
static Int_t runNumber= 0;
//========================//
if (mag == k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (mag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
} else if (mag == k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
printf("\n \n Comment: %s \n \n", comment.Data());
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,mag);
field->SetL3ConstField(0); //Using const. field in the barrel
- rl->CdGAFile();
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(field);
+ rl->CdGAFile();
Int_t iABSO = 1;
Int_t iCRT = 0;
while (getline(in, line)) {
sline = line ;
sline.ReplaceAll(" ", "") ;
- if (sline.Contains("AliMagFMaps*field=newAliMagFMaps(")) {
+ if (sline.Contains("AliMagF*field=newAliMagF(")) {
sarg = sline(sline.Last(',')+1, sline.Last(')')-sline.Last(',')-1) ;
break ;
}
rv = "30000" ;
else if (sarg == "k2kG")
rv = "12000" ;
- else if (sarg == "k4kG")
- rv = "24000";
break ;
}
}
fBestTrack.UpdateESDtrack(AliESDtrack::kITSin);
{
AliESDtrack *esdTrack =fBestTrack.GetESDtrack();
- Float_t r[3]={0.,0.,0.};
+ Double_t r[3]={0.,0.,0.};
Double_t maxD=3.;
esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD);
}
#include "AliITStrackerV2.h"
#include "AliRun.h"
#include "AliESD.h"
- #include "AliMagF.h"
#include "AliGenEventHeader.h"
#include "AliHLTITStrack.h"
#include <AliTPCRF1D.h>
#endif
#ifdef use_root
+#include <TError.h>
#include <TFile.h>
-#include <TUnixSystem.h>
+#include <TGeoGlobalMagField.h>
#include <TTimeStamp.h>
-#include <TError.h>
+#include <TUnixSystem.h>
#endif
#include "AliHLTTPCLogging.h"
}
fgVersion=kValiroot;
- SetBFieldFactor((Double_t)runLoader->GetAliRun()->Field()->Factor());
- SetSolenoidBField(-
- (Double_t)runLoader->GetAliRun()->Field()->SolenoidField()/
- (Double_t)runLoader->GetAliRun()->Field()->Factor()
- );
+ AliMagF* mag = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ double fc = mag ? mag->GetFactorSol() : 0;
+ double bz = mag ? -mag->SolenoidField() : 0;
+ if (fc!=0) bz/=fc;
+ SetBFieldFactor( fc );
+ SetSolenoidBField( bz );
fgPadPitchWidthLow=param->GetInnerPadPitchWidth();
fgPadPitchWidthUp=param->GetOuterPadPitchWidth();
fgZWidth=param->GetZWidth();
}
fgVersion=kValiroot;
- SetBFieldFactor((Double_t)lgAlice->Field()->Factor());
- SetSolenoidBField(-
- (Double_t)lgAlice->Field()->SolenoidField()/
- (Double_t)lgAlice->Field()->Factor()
- );
+ AliMagF* mag = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ double fc = mag ? mag->GetFactorSol() : 0;
+ double bz = mag ? -mag->SolenoidField() : 0;
+ if (fc!=0) bz/=fc;
+ SetBFieldFactor( fc );
+ SetSolenoidBField( bz );
+
+ // SetBFieldFactor((Double_t)l((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Factor());
+ // SetSolenoidBField(-
+ // (Double_t)l((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField()/
+ // (Double_t)l((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Factor()
+ // );
fgPadPitchWidthLow=param->GetInnerPadPitchWidth();
fgPadPitchWidthUp=param->GetOuterPadPitchWidth();
fgZWidth=param->GetZWidth();
rec.SetRunTracking("");
rec.SetLoadAlignFromCDB(0);
rec.SetRunQA(":");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
//rec.SetFillESD("HLT");
rec.SetFillESD("");
rec.SetFillTriggerESD(false);
rec.SetFillESD("");
rec.SetRunQA(":");
rec.SetRunGlobalQA(kFALSE);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kFALSE);
rec.SetFillTriggerESD(kFALSE);
rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libANALYSIS.so libANALYSISalice.so libTPCcalib.so libAliHLTTPC.so loglevel=0x7c chains=sink1");
rec.Run();
rec.SetRunTracking("");
rec.SetLoadAlignFromCDB(0);
rec.SetRunQA(":");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
//rec.SetFillESD("HLT");
rec.SetFillESD("");
rec.SetFillTriggerESD(false);
rec.SetRunTracking("");
rec.SetLoadAlignFromCDB(0);
rec.SetRunQA(":");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
rec.SetFillESD("HLT");
rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so chains=sink1");
rec.Run();
rec.SetFillESD("");
rec.SetRunQA(":");
rec.SetRunGlobalQA(kFALSE);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kFALSE);
rec.SetFillTriggerESD(kFALSE);
rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1");
rec.Run();
rec.SetRunTracking("");
rec.SetLoadAlignFromCDB(0);
rec.SetRunQA(":");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
rec.SetFillESD("HLT");
rec.SetFillTriggerESD(false);
rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=globalmerger");
rec.SetRunTracking("");
rec.SetLoadAlignFromCDB(0);
rec.SetRunQA(":");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
// NOTE: FillESD is a step in the AliReconstruction sequence and has
// nothing to do with the fact that this macro writes ESD output
#include "AliRawReaderMemory.h"
#include "AliTPCclustererMI.h"
#include "AliTPCClustersRow.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliDAQ.h"
#include "TString.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliGeomManager.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTPCReconstructor.h"
#include "AliTPCParam.h"
#include "AliTPCRecoParam.h"
// TODO: check if there is common functionality in the AliMagF* classes
float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof();
if (SolenoidBz<kAlmost0Field) SolenoidBz=kAlmost0Field;
- float factor=1.;
- int map=AliMagFMaps::k2kG;
+ AliMagF::BMap_t map = AliMagF::k5kG;
+ float factor=SolenoidBz/5;
if (SolenoidBz<3.) {
- map=AliMagFMaps::k2kG;
+ map=AliMagF::k2kG;
factor=SolenoidBz/2;
- } else if (SolenoidBz>=3. && SolenoidBz<4.5) {
+ } /*else if (SolenoidBz>=3. && SolenoidBz<4.5) {
map=AliMagFMaps::k4kG;
factor=SolenoidBz/4;
- } else {
+ }
+ else {
map=AliMagFMaps::k5kG;
factor=SolenoidBz/5;
- }
+ } */
+ //
// the magnetic field map is not supposed to change
// field initialization should be done once in the beginning
// TODO: does the factor need adjustment?
- const AliMagF* currentMap=AliTracker::GetFieldMap();
+ const AliMagF* currentMap = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
if (!currentMap) {
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., map);
- AliTracker::SetFieldMap(field,kFALSE);
+ AliMagF* field = new AliMagF("MagneticFieldMap", "BMap", 2, 1., 1., 10., map);
+ TGeoGlobalMagField::Instance()->SetField(field);
HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map);
- } else if (currentMap->Map()!=map) {
- HLTWarning("omitting request to override field map %s with %s", currentMap->Map(), map);
+ } else if (currentMap->GetMapType()!=map) {
+ HLTWarning("omitting request to override field map %d with %d", currentMap->GetMapType(), map);
}
continue;
} else {
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliGeomManager.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTPCReconstructor.h"
#include "AliTPCParam.h"
#include "AliTPCRecoParam.h"
// TODO: check if there is common functionality in the AliMagF* classes
float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof();
if (SolenoidBz<kAlmost0Field) SolenoidBz=kAlmost0Field;
- float factor=1.;
- int map=AliMagFMaps::k2kG;
+ float factor=SolenoidBz/5;
+ //
+ AliMagF::BMap_t map = AliMagF::k5kG;
if (SolenoidBz<3.) {
- map=AliMagFMaps::k2kG;
+ map=AliMagF::k2kG;
factor=SolenoidBz/2;
- } else if (SolenoidBz>=3. && SolenoidBz<4.5) {
+ } /*else if (SolenoidBz>=3. && SolenoidBz<4.5) {
map=AliMagFMaps::k4kG;
factor=SolenoidBz/4;
- } else {
+ }
+ else {
map=AliMagFMaps::k5kG;
factor=SolenoidBz/5;
- }
+ } */
// the magnetic field map is not supposed to change
// field initialization should be done once in the beginning
// TODO: does the factor need adjustment?
- const AliMagF* currentMap=AliTracker::GetFieldMap();
+ const AliMagF* currentMap = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
if (!currentMap) {
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., map);
- AliTracker::SetFieldMap(field,kFALSE);
+ AliMagF* field = new AliMagF("MagneticFieldMap", "BMap", 2, 1., 1., 10., map);
+ TGeoGlobalMagField::Instance()->SetField(field);
HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map);
- } else if (currentMap->Map()!=map) {
- HLTWarning("omitting request to override field map %s with %s", currentMap->Map(), map);
+ } else if (currentMap->GetMapType()!=map) {
+ HLTWarning("omitting request to override field map %d with %d", currentMap->GetMapType(), map);
}
continue;
} else {
//#include "AliTRDtrackerHLT.h"
#include "AliTRDtracker.h"
#include "AliTRDCalibraFillHisto.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTRDcluster.h"
#include "AliESDfriend.h"
#include <cstdlib>
, fOutputPercentage(100) // By default we copy to the output exactly what we got as input
, fStrorageDBpath("local://$ALICE_ROOT")
, fCDB(NULL)
- , fField(NULL)
, fGeometryFileName("")
, fGeometryFile(NULL)
, fGeoManager(NULL)
return EINVAL;
}
- //init alifield map - temporarly fixed - should come from a DB
- fField = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- if (fField)
- AliTracker::SetFieldMap(fField,1);
- else
- HLTError("Unable to init the field");
fCDB = AliCDBManager::Instance();
if (!fCDB)
{
// Deinitialization of the component
- delete fField;
- fField = 0;
-
delete fTracker;
fTracker = 0;
class TGeoManager;
//class AliTRDtrackerHLT;
class AliTRDtracker;
-class AliMagFMaps;
+class AliMagF;
/**
* @class AliHLTTRDTrackerComponent
string fStrorageDBpath; // Default path for OCDB
AliCDBManager *fCDB; //! Pointer to OCDB
- AliMagFMaps* fField; //! magn. field settings
-
string fGeometryFileName; // Path to geometry file
TFile *fGeometryFile; //! // Pointer to the geom root file
TGeoManager *fGeoManager; //! Pointer to geometry manager
#include "AliGeomManager.h"
#include "AliCDBManager.h"
#include "AliESDEvent.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliESDfriend.h"
#include "AliTRDcalibDB.h"
fOutputPercentage(100), // By default we copy to the output exactly what we got as input
fStrorageDBpath("local://$ALICE_ROOT"),
fCDB(NULL),
- fField(NULL),
fGeometryFileName(""),
fUseHLTClusters(kFALSE),
fUseHLTTracks(kFALSE),
HLTWarning("No magnetic field switch stated. Use -magnetic_field_ON or -magnetic_field_OFF flag. Defaulting to OFF = NO MAGNETIC FIELD");
}
- if (iMagneticField == 0)
- {
- // magnetic field OFF
- fField = new AliMagFMaps("Maps","Maps", 2, 0., 10., 1);
- HLTDebug("Magnetic field is OFF.");
- }
-
- if (iMagneticField == 1)
- {
- // magnetic field ON
- fField = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- HLTDebug("Magnetic field is ON.");
- }
-
- if (fField == 0)
- {
- HLTError("Unable to init the field. Trouble at this point.");
- return -1;
- }
-
- // kTRUE sets the map uniform
- AliTracker::SetFieldMap(fField,kTRUE);
+ if (!TGeoGlobalMagField::Instance()->IsLocked()) {
+ if (iMagneticField == 0)
+ {
+ // magnetic field OFF
+ AliMagF* field = new AliMagF("Maps","Maps",2,0.,0., 10.,AliMagF::k5kGUniform);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ HLTDebug("Magnetic field is OFF.");
+ }
+
+ if (iMagneticField == 1)
+ {
+ // magnetic field ON
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ HLTDebug("Magnetic field is ON.");
+ }
+ }
+ else {
+ HLTError("Magnetic field is already set and locked, cannot redefine it." );
+ }
// reconstruction parameters
if (iRecoParamType < 0 || iRecoParamType > 2)
int AliHLTTRDTrackerV1Component::DoDeinit()
{
// Deinitialization of the component
-
- delete fField;
- fField = 0x0;
fTracker->SetClustersOwner(kFALSE);
delete fTracker;
class TGeoManager;
class AliCDBManager;
-class AliMagFMaps;
+class AliMagF;
class AliTRDtrackerV1;
class AliTRDrecoParam;
class AliTRDReconstructor;
string fStrorageDBpath; // Default path for OCDB
AliCDBManager *fCDB; //! Pointer to OCDB
- AliMagFMaps* fField; //! magn. field settings
-
string fGeometryFileName; // Path to geometry file
Bool_t fUseHLTClusters;
Bool_t fUseHLTTracks;
rec.SetRunTracking("");
rec.SetLoadAlignFromCDB(0);
rec.SetRunQA(":");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
rec.SetFillESD("HLT");
rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTRD.so libAliHLTTPC.so libAliHLTGlobal.so chains=sink1");
rec.Run();
}
// init solenoid field
- Bool_t bUniformField=kTRUE;
- AliTracker::SetFieldMap(pRunLoader->GetAliRun()->Field(),bUniformField);
Double_t solenoidBz=AliTracker::GetBz();
AliCDBManager* man = AliCDBManager::Instance();
if (man && man->IsDefaultStorageSet())
}
return kTRUE;
}//PropagateTo()
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Double_t AliHMPIDtrack::GetBz() const {
- //
- // Arguments: none
- // Returns: Bz component of the magnetic field (kG)
- //
- if (AliTracker::UniformField()) return AliTracker::GetBz();
- Double_t r[3]; GetXYZ(r);
- return AliTracker::GetBz(r);
-}//GetBz()
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
Bool_t AliHMPIDtrack::Intersect(Double_t pnt[3], Double_t norm[3], Double_t bz) const {
//+++++++++++++++++++++++++++++++++++++++++
// Origin: K. Shileev (Kirill.Shileev@cern.ch)
Int_t GetProlongation(Double_t xk, Double_t &y, Double_t &z);
Bool_t Intersect(Double_t pnt[3], Double_t norm[3], Double_t bz) const; //HMPID method moved from AliExternalTrackParam
Bool_t Intersect(AliHMPIDtrack *pTrk,Double_t pnt[3], Double_t norm[3]) ; //just for test
- Double_t GetBz() const;
Bool_t Update(const AliHMPIDCluster *pClu, Double_t chi2, Int_t index);
protected:
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
//#include <TGeoManager.h> //CreateGeometry()
+#include <AliCDBEntry.h> //CreateMaterials()
+#include <AliCDBManager.h> //CreateMaterials()
#include <TF1.h> //DefineOpticalProperties()
#include <TF2.h> //DefineOpticalProperties()
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h> //IsLostByFresnel()
-#include <AliCDBManager.h> //CreateMaterials()
-#include <AliCDBEntry.h> //CreateMaterials()
ClassImp(AliHMPIDv1)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Int_t matId=0; //tmp material id number
Int_t unsens = 0, sens=1; //sensitive or unsensitive medium
- Int_t itgfld = gAlice->Field()->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
- Float_t maxfld = gAlice->Field()->Max(); //max field value
+ Int_t itgfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
+ Float_t maxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); //max field value
Float_t tmaxfd = -10.0; //max deflection angle due to magnetic field in one step
Float_t deemax = - 0.2; //max fractional energy loss in one step
Float_t stemax = - 0.1; //mas step allowed [cm]
#include <AliMC.h> //StepManager()
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
+#include "AliGeomManager.h" //AddAlignableVolumes()
+#include <AliCDBEntry.h> //CreateMaterials()
+#include <AliCDBManager.h> //CreateMaterials()
#include <TF1.h> //DefineOpticalProperties()
#include <TF2.h> //DefineOpticalProperties()
-#include <TLorentzVector.h> //IsLostByFresnel()
-#include <AliCDBManager.h> //CreateMaterials()
-#include <AliCDBEntry.h> //CreateMaterials()
+#include <TGeoGlobalMagField.h>
#include <TGeoPhysicalNode.h> //AddAlignableVolumes()
-#include "AliGeomManager.h" //AddAlignableVolumes()
+#include <TLorentzVector.h> //IsLostByFresnel()
ClassImp(AliHMPIDv2)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Int_t matId=0; //tmp material id number
Int_t unsens = 0, sens=1; //sensitive or unsensitive medium
- Int_t itgfld = gAlice->Field()->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
- Float_t maxfld = gAlice->Field()->Max(); //max field value
+ Int_t itgfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
+ Float_t maxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); //max field value
Float_t tmaxfd = -10.0; //max deflection angle due to magnetic field in one step
Float_t deemax = - 0.2; //max fractional energy loss in one step
Float_t stemax = - 0.1; //max step allowed [cm]
#include <AliMC.h> //StepManager()
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
+#include "AliGeomManager.h" //AddAlignableVolumes()
+#include <AliCDBEntry.h> //CreateMaterials()
+#include <AliCDBManager.h> //CreateMaterials()
#include <TF1.h> //DefineOpticalProperties()
#include <TF2.h> //DefineOpticalProperties()
-#include <TLorentzVector.h> //IsLostByFresnel()
-#include <AliCDBManager.h> //CreateMaterials()
-#include <AliCDBEntry.h> //CreateMaterials()
+#include <TGeoCompositeShape.h> //CradleBaseVolume()
+#include <TGeoGlobalMagField.h>
#include <TGeoPhysicalNode.h> //AddAlignableVolumes()
#include <TGeoXtru.h> //CradleBaseVolume()
-#include <TGeoCompositeShape.h> //CradleBaseVolume()
+#include <TLorentzVector.h> //IsLostByFresnel()
#include <TString.h> //StepManager()
-#include "AliGeomManager.h" //AddAlignableVolumes()
ClassImp(AliHMPIDv3)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Int_t matId=0; //tmp material id number
Int_t unsens = 0, sens=1; //sensitive or unsensitive medium
- Int_t itgfld = gAlice->Field()->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
- Float_t maxfld = gAlice->Field()->Max(); //max field value
+ Int_t itgfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); //type of field intergration 0 no field -1 user in guswim 1 Runge Kutta 2 helix 3 const field along z
+ Float_t maxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); //max field value
Float_t tmaxfd = -10.0; //max deflection angle due to magnetic field in one step
Float_t deemax = - 0.2; //max fractional energy loss in one step
Float_t stemax = - 0.1; //max step allowed [cm]
if(fRecB->GetState()){
- if(fMagBG->GetButton(kFld0)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,0,10.,2);//no field\n");
- else if(fMagBG->GetButton(kFld2)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,0);//0.2 Tesla field\n");
- else if(fMagBG->GetButton(kFld4)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,1);//0.4 Tesla field\n");
- else if(fMagBG->GetButton(kFld5)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,2);//0.5 Tesla field\n");
- else if(fMagBG->GetButton(kFld_2)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,0);//-0.2 Tesla field\n");
- else if(fMagBG->GetButton(kFld_4)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,1);//-0.4 Tesla field\n");
- else if(fMagBG->GetButton(kFld_5)->GetState()) fprintf(fp," AliMagFMaps *field=new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,2);//-0.5 Tesla field\n");
+ if(fMagBG->GetButton(kFld0)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,0,1,10.,2);//no field\n");
+ else if(fMagBG->GetButton(kFld2)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,1,1,10,0);//0.2 Tesla field\n");
+ else if(fMagBG->GetButton(kFld4)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,1,1,10,1);//0.4 Tesla field\n");
+ else if(fMagBG->GetButton(kFld5)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,1,1,10,2);//0.5 Tesla field\n");
+ else if(fMagBG->GetButton(kFld_2)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,0);//-0.2 Tesla field\n");
+ else if(fMagBG->GetButton(kFld_4)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,1);//-0.4 Tesla field\n");
+ else if(fMagBG->GetButton(kFld_5)->GetState()) fprintf(fp," AliMagF *field=new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,2);//-0.5 Tesla field\n");
fprintf(fp," Bool_t uniform=kTRUE;\n");
fprintf(fp," AliTracker::SetFieldMap(field,uniform);\n\n");
WritePhys(pF); //physics processes
//Field
- if(fMagBG->GetButton(kFld0)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,0,10,2)); //no field\n\n");
- else if(fMagBG->GetButton(kFld2)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,0));//0.2 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld4)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,1));//0.4 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld5)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,2));//0.5 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld_2)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,0));//-0.2 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld_4)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,1));//-0.4 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld_5)->GetState()) fprintf(pF," gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,2));//-0.5 Tesla field\n\n");
+ if(fMagBG->GetButton(kFld0)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,0,0,10,2)); //no field\n\n");
+ else if(fMagBG->GetButton(kFld2)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,1,1,10,0));//0.2 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld4)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,1,1,10,1));//0.4 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld5)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,1,1,10,2));//0.5 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld_2)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,0));//-0.2 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld_4)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,1));//-0.4 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld_5)->GetState()) fprintf(pF," gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,2));//-0.5 Tesla field\n\n");
fprintf(pF," pAL->CdGAFile();\n\n"); //????
//Generator
f<<Form(" gMC->SetExternalDecayer(pDecayer);\n\n");
//Field
- if(fMagBG->GetButton(kFld0)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",0,1,10,0)); //no field\n\n");
- else if(fMagBG->GetButton(kFld2)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,0));//0.2 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld4)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,1));//0.4 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld5)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,1,10,2));//0.5 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld_2)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,0));//-0.2 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld_4)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,1));//-0.4 Tesla field\n\n");
- else if(fMagBG->GetButton(kFld_5)->GetState()) f<<Form(" gAlice->SetField(new AliMagFMaps(\"Maps\",\"Maps\",2,-1,10,2));//-0.5 Tesla field\n\n");
+ if(fMagBG->GetButton(kFld0)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",0,1,1,10,0)); //no field\n\n");
+ else if(fMagBG->GetButton(kFld2)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,1,1,10,0));//0.2 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld4)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,1,1,10,1));//0.4 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld5)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,1,1,10,2));//0.5 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld_2)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,0));//-0.2 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld_4)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,1));//-0.4 Tesla field\n\n");
+ else if(fMagBG->GetButton(kFld_5)->GetState()) f<<Form(" gAlice->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,2));//-0.5 Tesla field\n\n");
if(fProBG->GetButton(kDCAY)->GetState()) f<<Form(" gMC->SetProcess(\"DCAY\",1); ");else f<<Form(" gMC->SetProcess(\"DCAY\",0); ");
if(fProBG->GetButton(kPAIR)->GetState()) f<<Form(" gMC->SetProcess(\"PAIR\",1); ");else f<<Form(" gMC->SetProcess(\"PAIR\",0); ");
#include "TStopwatch.h"
#include "AliRun.h"
- #include "AliMagF.h"
#include "AliESD.h"
#include "AliTracker.h"
#include "AliRunLoader.h"
#include "TStopwatch.h"
#include "AliRun.h"
- #include "AliMagF.h"
#include "AliRunLoader.h"
#include "AliTPCLoader.h"
#include "AliITSLoader.h"
// #include "AliTPCLoader.h"
#include "AliITSLoader.h"
#include "TStopwatch.h"
- #include "AliMagF.h"
#endif
Int_t AliITSFindTracksSA(Int_t evin=0,Int_t nevents=1,char *opt="onlyITS+6/6",const Char_t *clusterFileName="clusters.root", const Char_t *tracksFileName="ITS.TracksSA.root") {
//////////////////////////////////////// gets magnetic field factor ////////////////////////////////
- // AliMagF * fieldPointer = gAlice->Field();
+ // AliMagF * fieldPointer = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField());
// fFieldFactor =(Double_t)fieldPointer-> SolenoidField()/10/.2;
fFieldFactor = fieldfactor;
//cout<< " field factor = "<<fFieldFactor<<"\n"; getchar();
//////////////////////////////////////// gets magnetic field factor ////////////////////////////////
- // AliMagF * fieldPointer = gAlice->Field();
+ // AliMagF * fieldPointer = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField());
// fFieldFactor =(Double_t)fieldPointer-> SolenoidField()/10/.2;
fFieldFactor = fieldfactor;
// cout<< " field factor dentro alitrack = "<<fFieldFactor<<"\n";/* getchar();*/
////////// gets magnetic field factor //////////////////////////////
-
- AliMagF * fieldPointer = gAlice->Field();
- // fFieldFactor = (Double_t)fieldPointer->Factor();
- fFieldFactor =(Double_t)fieldPointer-> SolenoidField()/10/.2;
+ AliMagF * fieldPointer = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ fFieldFactor = fieldPointer ? fieldPointer->SolenoidField()/10/.2 : 0;
// cout<< " field factor = "<<fFieldFactor<<"\n"; getchar();
delete rl;
gAlice->GetEvent(evNumber); //modificato per gestire hbt
- AliKalmanTrack::SetFieldMap(gAlice->Field());
- // cout<<" field = "<<gAlice->Field()->SolenoidField()<<endl;
-
-
TFile *cf=TFile::Open("AliTPCclusters.root");
AliTPCParam *digp= (AliTPCParam*)cf->Get("75x40_100x60_150x60");
if (!digp) { cerr<<"TPC parameters have not been found !\n"; getchar();}
*/
#include <Riostream.h>
+#include <TGeoGlobalMagField.h>
#include <TH1.h>
#include <TString.h>
#include "AliITS.h"
}
Double_t WeightEle=1.-WeightHole;
AliITSSimuParam* simpar = fDetType->GetSimuParam();
- AliMagF *mf = gAlice->Field();
- Float_t pos[3]={0.,0.,0.};
- Float_t B[3]={0.,0.,0.};
- mf->Field(pos,B);
+ Double_t pos[3]={0.,0.,0.};
+ Double_t B[3]={0.,0.,0.};
+ TGeoGlobalMagField::Instance()->Field(pos,B);
fTanLorAng = TMath::Tan(WeightHole*simpar->LorentzAngleHole(B[2]) +
WeightEle*simpar->LorentzAngleElectron(B[2]));
fTanLorAng*=-1.; // this only for the old geometry
#include <TMath.h>
#include "AliCluster.h"
-#include "AliTracker.h"
#include "AliESDtrack.h"
#include "AliESDVertex.h"
#include "AliITSReconstructor.h"
#include "AliITStrackV2.h"
+#include "AliTracker.h"
const Int_t AliITStrackV2::fgkWARN = 5;
//This function returns a track position in the global system
//------------------------------------------------------------------
Double_t r[3];
- Bool_t rc=GetXYZAt(xloc, AliTracker::GetBz(), r);
+ Bool_t rc=GetXYZAt(xloc, GetBz(), r);
x=r[0]; y=r[1]; z=r[2];
return rc;
}
SetdEdx(dedx);
}
-Double_t AliITStrackV2::GetBz() const {
- //
- // returns Bz component of the magnetic field (kG)
- //
- if (AliTracker::UniformField()) return AliTracker::GetBz();
- Double_t r[3]; GetXYZ(r);
- return AliTracker::GetBz(r);
-}
-
//____________________________________________________________________________
Bool_t AliITStrackV2::
GetPhiZat(Double_t r, Double_t &phi, Double_t &z) const {
class AliESDtrack;
class AliESDVertex;
+class AliTracker;
//_____________________________________________________________________________
class AliITStrackV2 : public AliKalmanTrack {
Int_t GetExtraModule(Int_t ilayer) const {return fModule[AliITSgeomTGeo::kNLayers+ilayer];}
protected:
- Double_t GetBz() const ;
Double_t fdEdx; // dE/dx
static const Int_t fgkWARN; //! used for debugging purposes
AliESDtrack *esdTrack =fTrackToFollow.GetESDtrack();
//printf(" %d\n",esdTrack->GetITSModuleIndex(0));
//esdTrack->UpdateTrackParams(&fTrackToFollow,AliESDtrack::kITSrefit); //original line
- Float_t r[3]={0.,0.,0.};
+ Double_t r[3]={0.,0.,0.};
Double_t maxD=3.;
esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD);
ntrk++;
if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) {//The beam pipe
AliESDtrack *esdTrack =fTrackToFollow.GetESDtrack();
esdTrack->UpdateTrackParams(&fTrackToFollow,AliESDtrack::kITSrefit);
- Float_t r[3]={0.,0.,0.};
+ Double_t r[3]={0.,0.,0.};
Double_t maxD=3.;
esdTrack->RelateToVertex(event->GetVertex(),GetBz(r),maxD);
ntrk++;
itsFreon->SetTemperature(22.0*fgkCelsius);
itsFreon->SetState(TGeoMaterial::kMatStateLiquid);
//
- // Int_t ifield = gAlice->Field()->Integ();
- // Float_t fieldm = gAlice->Field()->Max();
+ // Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ // Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Float_t tmaxfd = 0.1;// 1.0;// Degree
// Float_t stemax = 1.0;// cm
#include <TPolyMarker.h>
// Root Geometry includes
-#include <TGeoVolume.h>
-#include <TGeoTube.h> // contains TGeoTubeSeg
+#include <TGeoCompositeShape.h>
#include <TGeoEltu.h>
-#include <TGeoXtru.h>
-#include <TGeoMatrix.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoMaterial.h>
+#include <TGeoMatrix.h>
#include <TGeoMedium.h>
-#include <TGeoCompositeShape.h>
+#include <TGeoTube.h> // contains TGeoTubeSeg
+#include <TGeoVolume.h>
+#include <TGeoXtru.h>
// AliRoot includes
#include "AliLog.h"
TGeoMixture *mix;
TGeoMedium *med;
//
- Int_t ifield = (gAlice->Field()->Integ());
- Double_t fieldm = (gAlice->Field()->Max());
+ Int_t ifield = (((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ());
+ Double_t fieldm = (((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max());
Double_t params[8] = {8 * 0.0};
params[1] = (Double_t) ifield;
// Updates concerning the geometry: versioning system, new V11hybrid version, bug fixes (B.Nilsend and L. Gaudichet
//
-
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoPhysicalNode.h>
// Return:
// none.
- Int_t ifield = gAlice->Field()->Integ();
- Float_t fieldm = gAlice->Field()->Max();
+ Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t tmaxfd = 0.1; // 1.0; // Degree
Float_t stemax = 1.0; // cm
// Author: mercedes.lopez.noriega@cern.ch //
////////////////////////////////////////////////////////
-#include <TLorentzVector.h>
+#include "AliITS.h"
+#include "AliITSgeom.h"
+#include "AliITShit.h"
+#include "AliITSvBeamTestITS04.h"
+#include "AliMC.h"
+#include "AliMagF.h"
+#include "AliRun.h"
+#include "AliTrackReference.h"
+
+#include <TVirtualMC.h>
+#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
-#include <TGeoVolume.h>
#include <TGeoMatrix.h>
#include <TGeoPcon.h>
-#include "AliRun.h"
-#include "AliITSvBeamTestITS04.h"
-#include <TClonesArray.h>
+#include <TGeoVolume.h>
+#include <TLorentzVector.h>
#include <TString.h>
-#include "AliITS.h"
-#include "AliMagF.h"
-#include "TVirtualMC.h"
-#include "AliMC.h"
-#include "AliTrackReference.h"
-#include "AliITSgeom.h"
-#include "AliITShit.h"
const Int_t AliITSvBeamTestITS04::fgkNumberOfSPD = 4;
const Int_t AliITSvBeamTestITS04::fgkNumberOfSDD = 2;
// Media defined here should correspond to the one defined in galice.cuts
// This file is read in (AliMC*) fMCApp::Init() { ReadTransPar(); }
// Create ITS materials
- Int_t ifield = gAlice->Field()->Integ();
- Float_t fieldm = gAlice->Field()->Max();
+ Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t tmaxfdSi = 0.1;
Float_t stemaxSi = 0.0075;
// See AliITSvPPRasymmFMD::StepManager().
-#include <TClonesArray.h>
-#include <TLorentzVector.h>
-#include <TGeoMatrix.h>
-#include <TGeoPhysicalNode.h>
#include <TArrayD.h>
#include <TArrayF.h>
-#include <TString.h>
+#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
+#include <TGeoMatrix.h>
+#include <TGeoPhysicalNode.h>
#include <TGeoVolume.h>
+#include <TLorentzVector.h>
+#include <TString.h>
#include <TVirtualMC.h>
#include "AliITS.h"
// Return:
// none.
- Int_t ifield = gAlice->Field()->Integ();
- Float_t fieldm = gAlice->Field()->Max();
+ Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t tmaxfd = 0.1; // 1.0; // Degree
Float_t stemax = 1.0; // cm
// //
///////////////////////////////////////////////////////////////////////////////
#include <Riostream.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TMath.h>
#include <TObjArray.h>
#include <TRandom.h>
#include <TVector.h>
#include <TVirtualMC.h>
-#include <TGeoManager.h>
#include "AliMagF.h"
#include "AliConst.h"
Float_t wsteel[4] = { .715,.18,.1,.005 };
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// --- Define the various materials for GEANT ---
// //
/////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
+#include <TGeoMatrix.h>
#include <TLorentzVector.h>
#include <TVirtualMC.h>
-#include <TGeoMatrix.h>
#include "AliMC.h"
#include "AliRun.h"
Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
Float_t epsilAir = 1.0E-4;//
Float_t stminAir = 0.0; // cm "Default value used"
- Int_t ifield = gAlice->Field()->Integ();
- Float_t fieldm = gAlice->Field()->Max();
+ Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
//
// AIR
/* $Id$ */
-#include <TGeoManager.h>
-#include <TLorentzVector.h>
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TGeoMatrix.h>
+#include <TLorentzVector.h>
#include <TVirtualMC.h>
#include "AliRun.h"
Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
Float_t epsilAir = 1.0E-4;//
Float_t stminAir = 0.0; // cm "Default value used"
- Int_t ifield = gAlice->Field()->Integ();
- Float_t fieldm = gAlice->Field()->Max();
+ Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
AliMaterial(1,"AIR$",0.14610E+02,0.73000E+01,0.12050E-02,
0.30423E+05,0.99900E+03);
// Enrico Fragiacomo - 15/03/2004
// Geometry for the June 2003 SSD beam test
-#include <TLorentzVector.h>
#include <TClonesArray.h>
-#include <TVirtualMC.h>
-#include <TGeoMatrix.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
+#include <TGeoMatrix.h>
+#include <TLorentzVector.h>
+#include <TVirtualMC.h>
#include "AliRun.h"
#include "AliMagF.h"
// none.
/////////////////////////////////////////////////////////////////////////
- Int_t ifield = gAlice->Field()->Integ();
- Float_t fieldm = gAlice->Field()->Max();
+ Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Scintillator CH
Float_t ascin[2]={1.01,12.01};
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
#include "STRUCT/AliBODY.h"
-#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
#include "STRUCT/AliDIPOv2.h"
#include "STRUCT/AliHALL.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
#include "STRUCT/AliBODY.h"
-#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
#include "STRUCT/AliDIPOv2.h"
#include "STRUCT/AliHALL.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
#include "STRUCT/AliBODY.h"
-#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
#include "STRUCT/AliDIPOv2.h"
#include "STRUCT/AliHALL.h"
if(!gSystem->AccessPathName(galiceName,kFileExists)) {
galice = new TFile(galiceName);
gAlice = (AliRun*)galice->Get("gAlice");
- AliMagF *fiel = (AliMagF*)gAlice->Field();
+ AliMagF *fiel = TGeoGlobalMagField::Instance()->GetField();
field=(Double_t)fiel->SolenoidField()/10.;
AliKalmanTrack::SetConvConst(100/0.299792458/field);
printf(" B = %3.1f read from gAlice and set\n",field);
new TGeant3("C++ Interface to Geant3");
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k4kG);
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 0;
Int_t iDIPO = 0;
#include <AliKalmanTrack.h>
#include "AliITSgeomTGeo.h"
#include "AliITSgeom.h"
-#include "AliMagF.h"
-#include "AliMagFMaps.h"
#endif
//_____________________________________________________________________________
// Int_t sfield = 0;
// switch ((Int_t)(AliHLTTransform::GetSolenoidField()+0.5)) {
// case 2:
- // sfield = AliMagFMaps::k2kG;
- // break;
- // case 4:
- // sfield = AliMagFMaps::k4kG;
+ // sfield = AliMagF::k2kG;
// break;
// case 5:
- // sfield = AliMagFMaps::k5kG;
+ // sfield = AliMagF::k5kG;
// break;
// default:
// ::Fatal("AliHLTTransform::GetSolenoidField", "Incorrect magnetic field");
// }
- AliMagF* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,kTRUE);
// Init PID
AliPID pid;
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
#include "AliESDVertex.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliLog.h"
#include <TSystem.h>
//-----------------------------------------------------------------------------
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
#include "AliMUONCommonGeometryBuilder.h"
Float_t wbak[3] = {6. , 6. , 1.};
Float_t dbak = 1.4;
- Int_t iSXFLD = gAlice->Field()->PrecInteg();
- Float_t sXMGMX = gAlice->Field()->Max();
+ Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg();
+ Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
//
// --- Define the various materials for GEANT ---
fMUON->AliMaterial(9, "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
#include "AliMagF.h"
#include "AliLog.h"
-#include <TVector2.h>
-#include <TVector3.h>
-#include <TGeoMatrix.h>
-#include <TClonesArray.h>
#include <Riostream.h>
-#include <TSystem.h>
-#include <TVirtualMC.h>
+#include <TClonesArray.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
-#include <TGeoVolume.h>
+#include <TGeoMatrix.h>
#include <TGeoTube.h>
+#include <TGeoVolume.h>
#include <TGeoXtru.h>
-#include <TGeoCompositeShape.h>
+#include <TSystem.h>
+#include <TVector2.h>
+#include <TVector3.h>
+#include <TVirtualMC.h>
#ifdef WITH_STL
#include <vector>
GReal_t maxStepAlu = fMUON->GetMaxStepAlu();
GReal_t maxDestepAlu = fMUON->GetMaxDestepAlu();
// GReal_t maxStepGas = fMUON->GetMaxStepGas();
- Int_t iSXFLD = gAlice->Field()->PrecInteg();
- Float_t sXMGMX = gAlice->Field()->Max();
+ Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg();
+ Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
fMUON->AliMedium(21, "ALU_II$", 41, 0, iSXFLD, sXMGMX,
tmaxfd, maxStepAlu, maxDestepAlu, epsil, stmin);
#include "AliMagF.h"
-#include <TMath.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
+#include <TMath.h>
#include <Riostream.h>
ClassImp(AliMUONTrackExtrap) // Class implementation in ROOT context
/// \endcond
-const AliMagF* AliMUONTrackExtrap::fgkField = 0x0;
const Double_t AliMUONTrackExtrap::fgkSimpleBPosition = 0.5 * (AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ());
const Double_t AliMUONTrackExtrap::fgkSimpleBLength = 0.5 * (AliMUONConstants::CoilL() + AliMUONConstants::YokeL());
Double_t AliMUONTrackExtrap::fgSimpleBValue = 0.;
const Double_t AliMUONTrackExtrap::fgkRungeKuttaMaxResidue = 0.002;
//__________________________________________________________________________
-void AliMUONTrackExtrap::SetField(const AliMagF* magField)
+void AliMUONTrackExtrap::SetField()
{
- /// set magnetic field
-
- // set field map
- fgkField = magField;
- if (!fgkField) {
- cout<<"E-AliMUONTrackExtrap::SetField: fgkField = 0x0"<<endl;
- return;
- }
-
- // set field on/off flag
- fgFieldON = (fgkField->Factor() == 0.) ? kFALSE : kTRUE;
-
+ // set field on/off flag
// set field at the centre of the dipole
- if (fgFieldON) {
- Float_t b[3] = {0.,0.,0.}, x[3] = {50.,50.,(Float_t) fgkSimpleBPosition};
- fgkField->Field(x,b);
- fgSimpleBValue = (Double_t) b[0];
- } else fgSimpleBValue = 0.;
+ const Double_t x[3] = {50.,50.,fgkSimpleBPosition};
+ Double_t b[3] = {0.,0.,0.};
+ TGeoGlobalMagField::Instance()->Field(x,b);
+ fgSimpleBValue = b[0];
+ fgFieldON = fgSimpleBValue ? kTRUE : kFALSE;
}
if (bendingMomentum == 0.) return 1.e10;
- if (!fgkField) {
- cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
- exit(-1);
- }
-
const Double_t kCorrectionFactor = 0.9; // impact parameter is 10% overestimated
return kCorrectionFactor * (-0.0003 * fgSimpleBValue * fgkSimpleBLength * fgkSimpleBPosition / bendingMomentum);
if (impactParam == 0.) return 1.e10;
- if (!fgkField) {
- cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
- exit(-1);
- }
-
const Double_t kCorrectionFactor = 1.1; // bending momentum is 10% underestimated
if (fgFieldON)
xyz[2] = vect[kiz] + 0.5 * step * vect[kipz];
//cmodif: call gufld (xyz, h) changed into:
- GetField (xyz, h);
+ TGeoGlobalMagField::Instance()->Field(xyz,h);
h2xy = h[0]*h[0] + h[1]*h[1];
h[3] = h[2]*h[2]+ h2xy;
rest = step - tl;
if (TMath::Abs(h) > TMath::Abs(rest)) h = rest;
//cmodif: call gufld(vout,f) changed into:
-
- GetField(vout,f);
+ TGeoGlobalMagField::Instance()->Field(vout,f);
// *
// * start of integration
xyzt[2] = zt;
//cmodif: call gufld(xyzt,f) changed into:
- GetField(xyzt,f);
+ TGeoGlobalMagField::Instance()->Field(xyzt,f);
at = a + secxs[0];
bt = b + secys[0];
xyzt[2] = zt;
//cmodif: call gufld(xyzt,f) changed into:
- GetField(xyzt,f);
+ TGeoGlobalMagField::Instance()->Field(xyzt,f);
z = z + (c + (seczs[0] + seczs[1] + seczs[2]) * kthird) * h;
y = y + (b + (secys[0] + secys[1] + secys[2]) * kthird) * h;
return;
}
-//___________________________________________________________
-void AliMUONTrackExtrap::GetField(Double_t *Position, Double_t *Field)
-{
- /// interface for arguments in double precision (Why ? ChF)
- Float_t x[3], b[3];
-
- x[0] = Position[0]; x[1] = Position[1]; x[2] = Position[2];
-
- if (fgkField) fgkField->Field(x,b);
- else {
- cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
- exit(-1);
- }
-
- Field[0] = b[0]; Field[1] = b[1]; Field[2] = b[2];
-
- return;
-}
/// Destructor
virtual ~AliMUONTrackExtrap(){};
- static void SetField(const AliMagF* magField);
+ static void SetField();
/// return kTRUE if the field is switched ON
static Bool_t IsFieldON() {return fgFieldON;}
private:
- static const AliMagF* fgkField; //!< field map
static const Double_t fgkSimpleBPosition; //!< position of the dipole
static const Double_t fgkSimpleBLength; //!< length of the dipole
static Double_t fgSimpleBValue; //!< magnetic field value at the centre
static void ExtrapOneStepHelix(Double_t charge, Double_t step, Double_t *vect, Double_t *vout);
static void ExtrapOneStepHelix3(Double_t field, Double_t step, Double_t *vect, Double_t *vout);
-
- static void GetField(Double_t *Position, Double_t *Field);
ClassDef(AliMUONTrackExtrap, 0) // Tools for track extrapolation in ALICE dimuon spectrometer
};
#include "AliMpConstants.h"
-#include "AliMagF.h"
#include "AliLog.h"
#include "AliTracker.h"
{
/// Default constructor
InitMembers();
-
- // Set magnetic field
- const AliMagF* kField = AliTracker::GetFieldMap();
- if (!kField) AliFatal("No field available");
- AliMUONTrackExtrap::SetField(kField);
+ AliMUONTrackExtrap::SetField();
}
fRecTracksPtr = new TClonesArray("AliMUONTrack", 100);
// set the magnetic field for track extrapolations
- const AliMagF* kField = AliTracker::GetFieldMap();
- if (!kField) AliFatal("No field available");
- AliMUONTrackExtrap::SetField(kField);
+ AliMUONTrackExtrap::SetField();
}
//__________________________________________________________________________
#include "AliTrackReference.h"
#include "AliLog.h"
-#include <TRandom.h>
+#include <TClonesArray.h>
#include <TF1.h>
#include <TF2.h>
-#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoMatrix.h>
+#include <TRandom.h>
#include <TRandom.h>
#include <TVirtualMC.h>
-#include <TGeoMatrix.h>
#include <string>
Float_t thetawires = TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) ;// We use Pi-theta because z is negative
Double_t bField[3] = {0};
fTrackPosition.Vect().GetXYZ(tmp);
- gAlice->Field(tmp,bField);
+ TGeoGlobalMagField::Instance()->Field(tmp,bField);
if (fAngleEffect && !fMagEffect){
thetawires = TMath::Abs(thetawires);
}
//=============================================================
// Field (L3 0.5 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1, 10., AliMagF::k5kG));
//=============================================================
//=================== Alice BODY parameters =============================
AliBODY *BODY = new AliBODY("BODY","Alice envelop");
#include "AliESDVertex.h"
#include "AliMCEventHandler.h"
#include "AliMCEvent.h"
+#include "AliMagF.h"
/*TODO: need to update this with changes made to ITS
#include "AliITSVertexerPPZ.h"
#include "AliITSLoader.h"
*/
#include "AliTracker.h"
-#include "AliMagFMaps.h"
#endif
// set mag field
// waiting for mag field in CDB
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
// set the magnetic field for track extrapolations
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMUONTrackExtrap::SetField();
AliMUONRecoCheck *rc = new AliMUONRecoCheck("AliESDs.root", simdir);
Int_t nev = rc->NumberOfEvents();
class AliDigit {};
class AliHit {};
class AliDisplay {};
- class AliMagFC {};
- class AliMagFCM {};
- class AliMagFMaps {};
- class AliMagFMapsV1 {};
- class AliMagFDM {};
- class AliMagFCheb {};
class AliCheb3DCalc {};
class AliCheb3D {};
class AliMagWrapCheb {};
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliCDBManager.h"
#include "AliCDBMetaData.h"
// set mag field
// waiting for mag field in CDB
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
// set the magnetic field for track extrapolations
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMUONTrackExtrap::SetField();
Double_t parameters[3*156];
Double_t errors[3*156];
#include <TROOT.h>
// STEER includes
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
}
// set mag field
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
// Load mapping
AliCDBManager* man = AliCDBManager::Instance();
#include "AliHeader.h"
#include "AliMC.h"
#include "AliStack.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
// MUON includes
// set mag field
// waiting for mag field in CDB
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
// set the magnetic field for track extrapolations
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
-
+ AliMUONTrackExtrap::SetField();
+
AliMUONRecoCheck rc(esdFileName, pathSim);
Int_t nevents = rc.NumberOfEvents();
#include <TROOT.h>
// STEER includes
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
}
}
- // set mag field
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ // set mag field
+ // waiting for mag field in CDB
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
+ // set the magnetic field for track extrapolations
+ AliMUONTrackExtrap::SetField();
// Load mapping
AliCDBManager* man = AliCDBManager::Instance();
#include "AliLoader.h"
#include "AliTracker.h"
#include "AliStack.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
// MUON includes
//--------------------------------------------------------------------------------------------------------------
//Set mag field; waiting for mag field in CDB
- printf("Loading field map...\n");
- if (!AliTracker::GetFieldMap()) {
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);}
-
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
//--------------------------------------------------------------------------------------------------------------
//Set Field Map for track extrapolation
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMUONTrackExtrap::SetField()
//Creating a MUON data container
//--------------------------------------------------------------------------------------------------------------
//Set mag field; waiting for mag field in CDB
- printf("Loading field map...\n");
- if (!AliTracker::GetFieldMap()) {
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);}
-
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ } printf("Loading field map...\n");
+
//--------------------------------------------------------------------------------------------------------------
//Set Field Map for track extrapolation
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMUONTrackExtrap::SetField();
//Creating a MUON data container
#include "AliHeader.h"
#include "AliLoader.h"
#include "AliStack.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliESDEvent.h"
#include "AliESDVertex.h"
#include "AliTracker.h"
// set mag field
// waiting for mag field in CDB
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
+ // set the magnetic field for track extrapolations
+ AliMUONTrackExtrap::SetField();
+
// open run loader and load gAlice, kinematics and header
AliRunLoader* runLoader = AliRunLoader::Open(filename);
}
// set the magnetic field for track extrapolations
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMUONTrackExtrap::SetField();
// loop over all reconstructed tracks (also first track of combination)
for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
// STEER includes
#include "AliLog.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliESDEvent.h"
#include "AliESDVertex.h"
#include "AliTracker.h"
// set mag field
// waiting for mag field in CDB
- printf("Loading field map...\n");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ if (!TGeoGlobalMagField::Instance()->GetField()) {
+ printf("Loading field map...\n");
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ }
+ // set the magnetic field for track extrapolations
+ AliMUONTrackExtrap::SetField();
+
// open the ESD file
TFile* esdFile = TFile::Open(esdFileName);
// printf("\n Nb of events analysed: %d\r",iEvent);
// cout << " number of tracks: " << nTracks <<endl;
- // set the magnetic field for track extrapolations
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
// loop over all reconstructed tracks (also first track of combination)
for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
#include "AliMUONRecoParam.h"
#include "AliRecoParam.h"
#include "AliCDBManager.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliReconstruction.h"
#include <TRandom.h>
gRandom->SetSeed(seed);
// no magnetic field --> factor (4th parameter) = 0
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 0., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
+ TGeoGlobalMagField::Instance()->GetField()->SetFactorSol(0);
+ TGeoGlobalMagField::Instance()->GetField()->SetFactorDip(0);
+
AliReconstruction *MuonRec = new AliReconstruction();
MuonRec->SetInput(input.Data());
#include "AliMUONRecoParam.h"
#include "AliRecoParam.h"
#include "AliCDBManager.h"
-#include "AliMagFMaps.h"
#include "AliTracker.h"
#include "AliReconstruction.h"
#include <TRandom.h>
gRandom->SetSeed(seed);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
-
AliReconstruction* MuonRec = new AliReconstruction("galice.root");
MuonRec->SetInput(input);
MuonRec->SetRunVertexFinder(kFALSE);
// --- ROOT system ---
class TFile;
+#include <TF1.h>
#include <TFolder.h>
-#include <TTree.h>
-#include <TVirtualMC.h>
+#include <TGeoGlobalMagField.h>
#include <TH1F.h>
-#include <TF1.h>
#include <TRandom.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
// --- Standard library ---
// DEFINITION OF THE TRACKING MEDIA
// for PHOS: idtmed[699->798] equivalent to fIdtmed[0->100]
- Int_t isxfld = gAlice->Field()->Integ() ;
- Float_t sxmgmx = gAlice->Field()->Max() ;
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ() ;
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max() ;
// The scintillator of the calorimeter made of PBW04 -> idtmed[699]
AliMedium(0, "PHOS Xtal $", 0, 1,
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 0;
Int_t iDIPO = 0;
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 0;
Int_t iDIPO = 0;
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
-
// This part for configuration
static PprGeo_t sgeo = kNoHoles;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
// Comment line
static TString comment;
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field (L3 0.4 T)
-// AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
//Zero magnetic field
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., smag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 0., 1., 10., AliMagF::k5kG);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
Int_t iABSO = 0;
Int_t iCRT = 0;
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 0;
Int_t iDIPO = 0;
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 0;
Int_t iDIPO = 0;
Int_t firstEvent = 0;
Int_t lastEvent = 1;
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliTracker::SetFieldMap(field,1);
-
AliReconstruction rec;
rec.SetRunReconstruction("PMD");
rec.SetRunVertexFinder(kFALSE);
///////////////////////////////////////////////////////////////////////////////
////
-#include "Riostream.h"
+#include <Riostream.h>
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
+
#include "AliConst.h"
#include "AliMagF.h"
#include "AliPMDv0.h"
// cout << " Inside create materials " << endl;
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// --- Define the various materials for GEANT ---
///////////////////////////////////////////////////////////////////////////////
////
-#include "Riostream.h"
+#include <Riostream.h>
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
#include "AliConst.h"
//
// cout << " Inside create materials " << endl;
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// --- Define the various materials for GEANT ---
///////////////////////////////////////////////////////////////////////////////
////
-#include "Riostream.h"
+#include <Riostream.h>
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
#include "AliConst.h"
//
// cout << " Inside create materials " << endl;
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// --- Define the various materials for GEANT ---
Float_t wsteel[4] = { .715,.18,.1,.005 };
Int_t *idtmed = fIdtmed->GetArray()-599;
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// --- Define the various materials for GEANT ---
AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
//\r
#include "AliMathBase.h"\r
#include "AliTreeDraw.h" \r
-#include "AliMagFMaps.h" \r
+#include "AliMagF.h" \r
#include "AliESDVertex.h" \r
#include "AliExternalTrackParam.h" \r
#include "AliTracker.h" \r
class TGeoManager;
class TString;
class TStatToolkit;
-class AliMagFMaps;
+class AliMagF;
class AliESDVertex;
#include "TNamed.h"
#include "AliESDEvent.h"\r
#include "AliESDInputHandler.h"\r
#include "AliESDVertex.h"\r
-#include "AliMagFMaps.h"\r
+#include "AliMagF.h"\r
#include "AliTracker.h"\r
#include "AliGeomManager.h"\r
\r
//------------------------------------------------------------------------------
class AliComparisonObject;
-class AliMagFMaps;
+class AliMagF;
class TList;
#include "AliAnalysisTask.h"
fEventNr = nall-firstEvent;
cerr<<"restricted number of events availaible"<<endl;
}
- AliMagF * magf = gAlice->Field();
- AliTracker::SetFieldMap(magf,0);
TGeoManager::Import("geometry.root");
//
// Set mag field map (needed to propagate track to the DCA)
//
- Int_t magField = 2; // 0 - 0.2 T, 1 = 0.4 T, 2 - 0.5 T
- magFMap = new AliMagFMaps("Maps","Maps", 2, 1., 10., magField);
- AliTracker::SetFieldMap(magFMap,kFALSE);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
//
// Create global cuts objects
// Create, add task
task = new AliComparisonTask;
- //task->SetMagField(magField);
-
task->AddComparisonObject( pCompRes );
task->AddComparisonObject( pCompEff );
task->AddComparisonObject( pCompDEdx );
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
#include "AliESDInputHandler.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliAnalysisManager.h"
void AliAnalysisTaskMuonTrackingEff::ConnectInputData(Option_t */*option*/)
{
-//Set mag field; waiting for mag field in CDB
-//-------------------------------------------
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kFALSE);
-
-//Set Field Map for track extrapolation
-//-------------------------------------
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ //Set Field Map for track extrapolation
+ AliMUONTrackExtrap::SetField();
-//Connect input
+ //Connect input
AliESDInputHandler* esdHandler = (AliESDInputHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
if (!esdHandler)
{
#include "TIterator.h"
#include "AliStack.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliAnalysisTask.h"
}
// calculate the filed map in the L3 magnet using the current value
- AliMagFMaps* field = 0x0;
- if (fL3Current == 30000.0) {
- field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
- }
-
- // set the tracker field map
- AliTracker::SetFieldMap(field, kFALSE);
- AliMUONTrackExtrap::SetField(AliTracker::GetFieldMap());
+ AliMUONTrackExtrap::SetField();
}
#include "AliRawReaderRoot.h"
#include <AliMagF.h>
-#include <AliMagFMaps.h>
#include <AliKalmanTrack.h>
#include <AliITSgeom.h>
#include <AliESDVertex.h>
AliError("HLT initialization failed!");
// Init magnetic field
- AliMagF* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
+ AliMagF* field = (AliMagF*)TGeoGlobalMagField::Instance();
AliTracker::SetFieldMap(field,kTRUE);
fPtmin = 0.1*AliHLTTransform::GetSolenoidField();
#include "AliTPCParamSR.h"
#include "AliTracker.h"
#include "AliComplexCluster.h"
-#include "AliMagF.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
#include "AliITStrackMI.h"
fEventNr = nall-firstEvent;
cerr<<"restricted number of events availaible"<<endl;
}
- AliMagF * magf = gAlice->Field();
- AliTracker::SetFieldMap(magf,0);
}
#include <TArrayI.h>
#include <TClonesArray.h>
#include <TFile.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
#include <TParticle.h>
#include <TROOT.h>
AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
}
-//_______________________________________________________________________
-void AliMC::Field(const Double_t* x, Double_t* b) const
-{
- // Calculates field "b" at point "x"
- gAlice->Field(x,b);
-}
-
//_______________________________________________________________________
void AliMC::Init()
{
// Transverse velocity
Double_t vt = p.Pt() / p.E();
- if ((b = gAlice->Field()->SolenoidField()) > 0.) { // [kG]
+ if ((b = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField()) > 0.) { // [kG]
// Radius of helix
virtual void FinishEvent();
virtual Double_t TrackingZmax() const {return fTrZmax;}
virtual Double_t TrackingRmax() const {return fTrRmax;}
- virtual void Field(const Double_t* x, Double_t* b) const;
virtual Int_t DetFromMate(Int_t i) const { return (*fImedia)[i];}
//
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// Constant magnetic field class
-// Used by AliRun class
-// Author:
-//-------------------------------------------------------------------------
-
-#include <stdlib.h>
-
-#include "AliLog.h"
-#include "AliMagFC.h"
-
-ClassImp(AliMagFC)
-
-//________________________________________
-AliMagFC::AliMagFC()
- :AliMagF(),
- fCompensator(kFALSE),
- fBeamType(kBeamTypepp),
- fBeamEnergy(0),
- fQuadGradient(0),
- fDipoleField(0),
- fCCorrField(0),
- fACorr1Field(0),
- fACorr2Field(0)
-{
- //
- // Default constructor
- //
-}
-
-//________________________________________
-AliMagFC::AliMagFC(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax)
- : AliMagF(name,title,integ,factor,fmax),
- fCompensator(kFALSE),
- fBeamType(kBeamTypepp),
- fBeamEnergy(7000.),
- fQuadGradient(0),
- fDipoleField(0),
- fCCorrField(0),
- fACorr1Field(0),
- fACorr2Field(0)
-
-{
- //
- // Standard constructor
- //
- fType = kConst;
- fMap = 1;
-
-}
-
-//________________________________________
-void AliMagFC::Field(const float *x, float *b) const
-{
- //
- // 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;
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
- }
- else {
- ZDCField(x, b);
- }
- }
-
- }
- else {
- AliFatal(Form("Invalid field map for constant field %d",fMap));
- }
-}
-//________________________________________
-void AliMagFC::Field(const double *x, double *b) const
-{
- //
- // 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;
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
- }
- else {
- ZDCField(x, b);
- }
- }
-
- }
- else {
- AliFatal(Form("Invalid field map for constant field %d",fMap));
- }
-}
-
-//___________________________________________________
-void AliMagFC::ZDCField(const float *x, float *b) const
-{
- // ---- This is the ZDC part
-
- float rad2 = x[0] * x[0] + x[1] * x[1];
- static Bool_t init = kFALSE;
-
- if (! init) {
- init = kTRUE;
- //////////////////////////////////////////////////////////////////////
- // ---- Magnetic field values (according to beam type and energy) ----
- if(fBeamType==kBeamTypepp && fBeamEnergy == 5000.){
- // p-p @ 5+5 TeV
- fQuadGradient = 15.7145;
- fDipoleField = 27.0558;
- // SIDE C
- fCCorrField = 9.7017;
- // SIDE A
- fACorr1Field = -13.2143;
- fACorr2Field = -11.9909;
- } else if (fBeamType == kBeamTypepp && fBeamEnergy == 450.) {
- // p-p 0.45+0.45 TeV
- Float_t const kEnergyRatio = fBeamEnergy / 7000.;
-
- fQuadGradient = 22.0002 * kEnergyRatio;
- fDipoleField = 37.8781 * kEnergyRatio;
- // SIDE C
- fCCorrField = 9.6908;
- // SIDE A
- fACorr1Field = -13.2014;
- fACorr2Field = -9.6908;
- } else if ((fBeamType == kBeamTypepp && fBeamEnergy == 7000.) ||
- (fBeamType == kBeamTypeAA))
- {
- // Pb-Pb @ 2.7+2.7 TeV or p-p @ 7+7 TeV
- fQuadGradient = 22.0002;
- fDipoleField = 37.8781;
- // SIDE C
- fCCorrField = 9.6908;
- // SIDE A
- fACorr1Field = -13.2014;
- fACorr2Field = -9.6908;
- }
- }
-
-
- // SIDE C **************************************************
- if(x[2]<0.){
- if(x[2] < kCCorrBegin && x[2] > kCCorrEnd && rad2 < kCCorrSqRadius){
- if (fFactor != 0.) {
- b[0] = fCCorrField;
- b[1] = 0.;
- b[2] = 0.;
- }
- }
- else if(x[2] < kCQ1Begin && x[2] > kCQ1End && rad2 < kCQ1SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCQ2Begin && x[2] > kCQ2End && rad2 < kCQ2SqRadius){
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCQ3Begin && x[2] > kCQ3End && rad2 < kCQ3SqRadius){
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCQ4Begin && x[2] > kCQ4End && rad2 < kCQ4SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCD1Begin && x[2] > kCD1End && rad2 < kCD1SqRadius){
- b[1] = fDipoleField;
- b[2] = 0.;
- b[2] = 0.;
- }
- else if(x[2] < kCD2Begin && x[2] > kCD2End){
- if(((x[0]-kCD2XCentre1)*(x[0]-kCD2XCentre1)+(x[1]*x[1]))<kCD2SqRadius
- || ((x[0]-kCD2XCentre2)*(x[0]-kCD2XCentre2)+(x[1]*x[1]))<kCD2SqRadius){
- b[1] = -fDipoleField;
- b[2] = 0.;
- b[2] = 0.;
- }
- }
- }
-
- // SIDE A **************************************************
- else{
- if(fCompensator && (x[2] > kACorr1Begin && x[2] < kACorr1End) && rad2 < kCCorr1SqRadius) {
- // Compensator magnet at z = 1075 m
- if (fFactor != 0.) {
- b[0] = fACorr1Field;
- b[1] = 0.;
- b[2] = 0.;
- }
- return;
- }
-
- if(x[2] > kACorr2Begin && x[2] < kACorr2End && rad2 < kCCorr2SqRadius){
- if (fFactor != 0.) {
- b[0] = fACorr2Field;
- b[1] = 0.;
- b[2] = 0.;
- }
- }
- else if(x[2] > kAQ1Begin && x[2] < kAQ1End && rad2 < kAQ1SqRadius){
- // First quadrupole of inner triplet de-focussing in x-direction
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAQ2Begin && x[2] < kAQ2End && rad2 < kAQ2SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAQ3Begin && x[2] < kAQ3End && rad2 < kAQ3SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAQ4Begin && x[2] < kAQ4End && rad2 < kAQ4SqRadius){
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAD1Begin && x[2] < kAD1End && rad2 < kAD1SqRadius){
- b[0] = 0.;
- b[1] = -fDipoleField;
- b[2] = 0.;
- }
- else if(x[2] > kAD2Begin && x[2] < kAD2End){
- if(((x[0]-kAD2XCentre1)*(x[0]-kAD2XCentre1)+(x[1]*x[1])) < kAD2SqRadius
- || ((x[0]-kAD2XCentre2)*(x[0]-kAD2XCentre2)+(x[1]*x[1])) < kAD2SqRadius){
- b[1] = fDipoleField;
- }
- }
- }
-}
-
-void AliMagFC::ZDCField(const double *x, double *b) const
-{
- // ---- This is the ZDC part
-
- double rad2 = x[0] * x[0] + x[1] * x[1];
- static Bool_t init = kFALSE;
-
- if (! init) {
- init = kTRUE;
- //////////////////////////////////////////////////////////////////////
- // ---- Magnetic field values (according to beam type and energy) ----
- if(fBeamType==kBeamTypepp && fBeamEnergy == 5000.){
- // p-p @ 5+5 TeV
- fQuadGradient = 15.7145;
- fDipoleField = 27.0558;
- // SIDE C
- fCCorrField = 9.7017;
- // SIDE A
- fACorr1Field = -13.2143;
- fACorr2Field = -11.9909;
- } else if (fBeamType == kBeamTypepp && fBeamEnergy == 450.) {
- // p-p 0.45+0.45 TeV
- Float_t const kEnergyRatio = fBeamEnergy / 7000.;
-
- fQuadGradient = 22.0002 * kEnergyRatio;
- fDipoleField = 37.8781 * kEnergyRatio;
- // SIDE C
- fCCorrField = 9.6908;
- // SIDE A
- fACorr1Field = -13.2014;
- fACorr2Field = -9.6908;
- } else if ((fBeamType == kBeamTypepp && fBeamEnergy == 7000.) ||
- (fBeamType == kBeamTypeAA))
- {
- // Pb-Pb @ 2.7+2.7 TeV or p-p @ 7+7 TeV
- fQuadGradient = 22.0002;
- fDipoleField = 37.8781;
- // SIDE C
- fCCorrField = 9.6908;
- // SIDE A
- fACorr1Field = -13.2014;
- fACorr2Field = -9.6908;
- }
- }
-
-
- // SIDE C **************************************************
- if(x[2]<0.){
- if(x[2] < kCCorrBegin && x[2] > kCCorrEnd && rad2 < kCCorrSqRadius){
- if (fFactor != 0.) {
- b[0] = fCCorrField;
- b[1] = 0.;
- b[2] = 0.;
- }
- }
- else if(x[2] < kCQ1Begin && x[2] > kCQ1End && rad2 < kCQ1SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCQ2Begin && x[2] > kCQ2End && rad2 < kCQ2SqRadius){
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCQ3Begin && x[2] > kCQ3End && rad2 < kCQ3SqRadius){
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCQ4Begin && x[2] > kCQ4End && rad2 < kCQ4SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] < kCD1Begin && x[2] > kCD1End && rad2 < kCD1SqRadius){
- b[1] = fDipoleField;
- b[2] = 0.;
- b[2] = 0.;
- }
- else if(x[2] < kCD2Begin && x[2] > kCD2End){
- if(((x[0]-kCD2XCentre1)*(x[0]-kCD2XCentre1)+(x[1]*x[1]))<kCD2SqRadius
- || ((x[0]-kCD2XCentre2)*(x[0]-kCD2XCentre2)+(x[1]*x[1]))<kCD2SqRadius){
- b[1] = -fDipoleField;
- b[2] = 0.;
- b[2] = 0.;
- }
- }
- }
-
- // SIDE A **************************************************
- else{
- if(fCompensator && (x[2] > kACorr1Begin && x[2] < kACorr1End) && rad2 < kCCorr1SqRadius) {
- // Compensator magnet at z = 1075 m
- if (fFactor != 0.) {
- b[0] = fACorr1Field;
- b[1] = 0.;
- b[2] = 0.;
- }
- return;
- }
-
- if(x[2] > kACorr2Begin && x[2] < kACorr2End && rad2 < kCCorr2SqRadius){
- if (fFactor != 0.) {
- b[0] = fACorr2Field;
- b[1] = 0.;
- b[2] = 0.;
- }
- }
- else if(x[2] > kAQ1Begin && x[2] < kAQ1End && rad2 < kAQ1SqRadius){
- // First quadrupole of inner triplet de-focussing in x-direction
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAQ2Begin && x[2] < kAQ2End && rad2 < kAQ2SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAQ3Begin && x[2] < kAQ3End && rad2 < kAQ3SqRadius){
- b[0] = fQuadGradient*x[1];
- b[1] = fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAQ4Begin && x[2] < kAQ4End && rad2 < kAQ4SqRadius){
- b[0] = -fQuadGradient*x[1];
- b[1] = -fQuadGradient*x[0];
- b[2] = 0.;
- }
- else if(x[2] > kAD1Begin && x[2] < kAD1End && rad2 < kAD1SqRadius){
- b[0] = 0.;
- b[1] = -fDipoleField;
- b[2] = 0.;
- }
- else if(x[2] > kAD2Begin && x[2] < kAD2End){
- if(((x[0]-kAD2XCentre1)*(x[0]-kAD2XCentre1)+(x[1]*x[1])) < kAD2SqRadius
- || ((x[0]-kAD2XCentre2)*(x[0]-kAD2XCentre2)+(x[1]*x[1])) < kAD2SqRadius){
- b[1] = fDipoleField;
- }
- }
- }
-}
-
+++ /dev/null
-#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$ */
-
-//-------------------------------------------------------------------------
-// Constant magnetic field class
-// Used by AliRun class
-// Author:
-//-------------------------------------------------------------------------
-
-#include "AliMagF.h"
-
-enum BeamType_t {kBeamTypeAA, kBeamTypepp};
-class AliMagFC : public AliMagF
-{
- //Alice Constant Magnetic Field
-
-public:
- AliMagFC();
- AliMagFC(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax);
- virtual ~AliMagFC(){}
- virtual void Field(const float *x, float *b) const;
- virtual void Field(const double *x, double *b) const;
- virtual void ReadField() {}
- virtual void ZDCField(const float *x, float *b) const;
- virtual void ZDCField(const double *x, double *b) const;
- virtual void SetBeamType(BeamType_t type) {fBeamType = type;}
- virtual void SetBeamEnergy(Float_t energy) {fBeamEnergy = energy;}
- virtual void SetCompensatorMagnet(Bool_t flag) {fCompensator = flag;}
-
-private:
- Bool_t fCompensator; // Flag for compensator magnetic field (kTrue -> ON)
- BeamType_t fBeamType; // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1)
- Float_t fBeamEnergy; // Beam energy in GeV
- mutable Float_t fQuadGradient;// Gradient field for inner triplet quadrupoles
- mutable Float_t fDipoleField; // Field value for D1 and D2 dipoles
- mutable Float_t fCCorrField; // Side C 2nd compensator field
- mutable Float_t fACorr1Field; // Side A 1st compensator field
- mutable Float_t fACorr2Field; // Side A 2nd compensator field
-
- ClassDef(AliMagFC,3) //Class for all Alice Constant MagField
-};
-
-
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ZDC part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-// ************************ LHC optics v6.5 *****************************
-// ---- Position of the magnetic elements of LHC beam optics ----
-// -> SIDE C
-static const Float_t kCCorrBegin = -1972.5, kCCorrEnd = kCCorrBegin - 153., kCCorrSqRadius = 4.5*4.5;
-//
-static const Float_t kCTripletBegin = -2296.5;
-static const Float_t kCQ1Begin = kCTripletBegin, kCQ1End = kCQ1Begin-637., kCQ1SqRadius = 3.5*3.5;
-static const Float_t kCQ2Begin = kCTripletBegin-908.5, kCQ2End = kCQ2Begin-550., kCQ2SqRadius = 3.5*3.5;
-static const Float_t kCQ3Begin = kCTripletBegin-1558.5, kCQ3End = kCQ3Begin-550., kCQ3SqRadius = 3.5*3.5;
-static const Float_t kCQ4Begin = kCTripletBegin-2400., kCQ4End = kCQ4Begin-637., kCQ4SqRadius = 3.5*3.5;
-//
-static const Float_t kCD1Begin = -5838.3, kCD1End = kCD1Begin-945., kCD1SqRadius = 4.5*4.5;
-static const Float_t kCD2Begin = -12167.8, kCD2End = kCD2Begin-945., kCD2SqRadius = 4.5*4.5;
-static const Float_t kCD2XCentre1 = -9.7;
-static const Float_t kCD2XCentre2 = 9.7;
-//
-// -> SIDE A
-// NB -> kACorr1Begin = 919. to be checked
-static const Float_t kACorr1Begin = 919., kACorr1End = kACorr1Begin+260., kCCorr1SqRadius = 4.*4.;
-static const Float_t kACorr2Begin = 1972.5, kACorr2End = kACorr2Begin+153., kCCorr2SqRadius = 4.5*4.5;
-static const Float_t kATripletBegin = 2296.5;
-static const Float_t kAQ1Begin = kATripletBegin, kAQ1End = kAQ1Begin+637., kAQ1SqRadius = 3.5*3.5;
-static const Float_t kAQ2Begin = kATripletBegin+908.5, kAQ2End = kAQ2Begin+550., kAQ2SqRadius = 3.5*3.5;
-static const Float_t kAQ3Begin = kATripletBegin+1558.5, kAQ3End = kAQ3Begin+550., kAQ3SqRadius = 3.5*3.5;
-static const Float_t kAQ4Begin = kATripletBegin+2400., kAQ4End = kAQ4Begin+637., kAQ4SqRadius = 3.5*3.5;
-//
-static const Float_t kAD1Begin = 5838.3, kAD1End = kAD1Begin+945., kAD1SqRadius = 3.375*3.375;
-static const Float_t kAD2Begin = 12167.8, kAD2End = kAD2Begin+945., kAD2SqRadius = 3.75*3.75;
-static const Float_t kAD2XCentre1 = -9.4;
-static const Float_t kAD2XCentre2 = 9.4;
-
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ZDC part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-#endif
-
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-----------------------------------------------------------------------
-// Class for Alice magnetic field with constant mesh
-// Used in the configuration macros (macros/Config.C, etc.)
-// Author:
-//-----------------------------------------------------------------------
-
-#include "TSystem.h"
-
-#include "TVector.h"
-
-#include "AliLog.h"
-#include "AliMagFCM.h"
-
-ClassImp(AliMagFCM)
-
-//_______________________________________________________________________
-AliMagFCM::AliMagFCM():
- fXbeg(0),
- fYbeg(0),
- fZbeg(0),
- fXdel(0),
- fYdel(0),
- fZdel(0),
- fSolenoid(0),
- fXdeli(0),
- fYdeli(0),
- fZdeli(0),
- fXn(0),
- fYn(0),
- fZn(0),
- fB(0)
-{
- //
- // Standard constructor
- //
- fType = kConMesh;
- fMap = 2;
- SetSolenoidField();
-}
-
-//_______________________________________________________________________
-AliMagFCM::AliMagFCM(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax):
- AliMagFC(name,title,integ,factor,fmax),
- fXbeg(0),
- fYbeg(0),
- fZbeg(0),
- fXdel(0),
- fYdel(0),
- fZdel(0),
- fSolenoid(0),
- fXdeli(0),
- fYdeli(0),
- fZdeli(0),
- fXn(0),
- fYn(0),
- fZn(0),
- fB(0)
-{
- //
- // Standard constructor
- //
- fType = kConMesh;
- fMap = 2;
- SetSolenoidField();
-
- AliDebug(1, Form(
- "Constant Mesh Field %s created: map= %d, factor= %f, file= %s",
- fName.Data(), fMap, factor,fTitle.Data()));
-}
-
-//_______________________________________________________________________
-AliMagFCM::AliMagFCM(const AliMagFCM &magf):
- AliMagFC(magf),
- fXbeg(0),
- fYbeg(0),
- fZbeg(0),
- fXdel(0),
- fYdel(0),
- fZdel(0),
- fSolenoid(0),
- fXdeli(0),
- fYdeli(0),
- fZdeli(0),
- fXn(0),
- fYn(0),
- fZn(0),
- fB(0)
-{
- //
- // Copy constructor
- //
- magf.Copy(*this);
-}
-
-//_______________________________________________________________________
-void AliMagFCM::Field(const float *x, float *b) const
-{
- //
- // Method to calculate the magnetic field
- //
- Float_t ratx, raty, ratz, hix, hiy, hiz, ratx1, raty1, ratz1,
- bhyhz, bhylz, blyhz, blylz, bhz, blz, xl[3];
- const Float_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]= fSolenoid;
- } else {
- // The field map used here was calculated in a coordinate system where the muon arm is at z > 0
- // Transfom x -> -x and z -> -z
- Float_t xm = - x[0];
- Float_t ym = x[1];
- Float_t zm = - x[2];
-
- Bool_t infield=(fZbeg <= zm && zm < fZbeg+fZdel*(fZn-1)
- && ( fXbeg <= TMath::Abs(xm) && TMath::Abs(xm) < fXbeg+fXdel*(fXn-1) )
- && ( fYbeg <= TMath::Abs(ym) && TMath::Abs(ym) < fYbeg+fYdel*(fYn-1) ));
- if(infield) {
- xl[0]=TMath::Abs(xm)-fXbeg;
- xl[1]=TMath::Abs(ym)-fYbeg;
- xl[2]=zm-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 (xm*ym < 0) b[1]=-b[1];
- if (xm<0) b[2]=-b[2];
- b[0] = -b[0];
- b[2] = -b[2];
-
- } else {
- AliError(Form("Invalid field map for constant mesh %d",fMap));
- }
- } else {
-//This is the ZDC part
- ZDCField(x,b);
- }
-
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
- }
-}
-
-//_______________________________________________________________________
-void AliMagFCM::Field(const double *x, double *b) const
-{
- //
- // 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]= fSolenoid;
- } else {
- // The field map used here was calculated in a coordinate system where the muon arm is at z > 0
- // Transfom x -> -x and z -> -z
- Float_t xm = - x[0];
- Float_t ym = x[1];
- Float_t zm = - x[2];
-
- Bool_t infield=(fZbeg <= zm && zm < fZbeg+fZdel*(fZn-1)
- && ( fXbeg <= TMath::Abs(xm) && TMath::Abs(xm) < fXbeg+fXdel*(fXn-1) )
- && ( fYbeg <= TMath::Abs(ym) && TMath::Abs(ym) < fYbeg+fYdel*(fYn-1) ));
- if(infield) {
- xl[0]=TMath::Abs(xm)-fXbeg;
- xl[1]=TMath::Abs(ym)-fYbeg;
- xl[2]=zm-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 (xm*ym < 0) b[1]=-b[1];
- if (xm<0) b[2]=-b[2];
- b[0] = -b[0];
- b[2] = -b[2];
-
- } else {
- AliError(Form("Invalid field map for constant mesh %d",fMap));
- }
- } else {
-//This is the ZDC part
- ZDCField(x,b);
- }
-
- 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;
- AliDebug(1,Form("Reading Magnetic Field %s from file %s",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);
- AliDebug(2,Form("fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f",
- 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 {
- AliFatal(Form("File %s not found !",fTitle.Data()));
- }
-}
-
-//_______________________________________________________________________
-void AliMagFCM::Copy(TObject & /* magf */) const
-{
- //
- // Copy *this onto magf -- Not implemented
- //
- AliFatal("Not implemented!");
-}
-
+++ /dev/null
-#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$ */
-
-//-----------------------------------------------------------------------
-// Class for Alice magnetic field with constant mesh
-// Used in the configuration macros (macros/Config.C, etc.)
-// Author:
-//-----------------------------------------------------------------------
-
-#include "AliMagFC.h"
-#include <TVector.h>
-
-class AliMagFCM : public AliMagFC
-{
- //Alice Magnetic Field with constant mesh
-
-public:
- AliMagFCM();
- AliMagFCM(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax);
- AliMagFCM(const AliMagFCM &mag);
- virtual ~AliMagFCM() {delete fB;}
- virtual void Field(const float *x, float *b) const;
- virtual void Field(const double *x, double *b) const;
- virtual void ReadField();
- virtual void SetSolenoidField(Float_t field = 2.) {fSolenoid = field;}
- virtual Float_t SolenoidField() const {
- return -Factor()*fSolenoid;
- }
-
- void Copy(TObject &magf) const;
- virtual AliMagFCM & operator=(const AliMagFCM &magf)
- {magf.Copy(*this); return *this;}
-
- Float_t Bx(Int_t ix, Int_t iy, Int_t iz) const {
- return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix));
- }
- Float_t By(Int_t ix, Int_t iy, Int_t iz) const {
- return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+1);
- }
- Float_t Bz(Int_t ix, Int_t iy, Int_t iz) const {
- 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
- Float_t fSolenoid; // Solenoid Field Strength
- 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
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-
-#include <TClass.h>
-#include <TFile.h>
-#include <TSystem.h>
-
-#include "AliMagFCheb.h"
-#include "AliMagWrapCheb.h"
-#include "AliLog.h"
-
-ClassImp(AliMagFCheb)
-
-
-//_______________________________________________________________________
-AliMagFCheb::AliMagFCheb():
- AliMagFC(),
- fMeasuredMap(0),
- fSolenoid(5.)
-{
- // Default constructor
- //
-}
-
-//_______________________________________________________________________
-AliMagFCheb::AliMagFCheb(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax, Int_t map,
- Bool_t dipoleON,const char* path):
- AliMagFC(name, title, integ, factor, fmax),
- fMeasuredMap(0),
- fSolenoid(5.)
-{
- //
- fMap = map;
- char* fname = gSystem->ExpandPathName(path);
- TFile* file = TFile::Open(fname);
- if (!file) {
- AliError(Form("Failed to open magnetic field data file %s\n",fname));
- return;
- }
- const char* parname = 0;
- if (fMap == k2kG) {
- fSolenoid = 2.;
- parname = dipoleON ? "Sol12_Dip6_Hole":"Sol12_Dip0_Hole";
- } else if (fMap == k5kG) {
- fSolenoid = 5.;
- parname = dipoleON ? "Sol30_Dip6_Hole":"Sol30_Dip0_Hole";
- } else {
- AliError(Form("Unknown field identifier %d is requested\n",fMap));
- return;
- }
- //
- fMeasuredMap = dynamic_cast<AliMagWrapCheb*>(file->Get(parname));
- if (!fMeasuredMap) {
- AliError(Form("Did not find field %s in %s\n",parname,fname));
- return;
- }
- file->Close();
- delete file;
-}
-
-
-//_______________________________________________________________________
-AliMagFCheb::AliMagFCheb(const AliMagFCheb &src):
- AliMagFC(src),
- fMeasuredMap(0),
- fSolenoid(src.fSolenoid)
-{
- if (src.fMeasuredMap) fMeasuredMap = new AliMagWrapCheb(*src.fMeasuredMap);
-}
-
-//_______________________________________________________________________
-AliMagFCheb::~AliMagFCheb()
-{
- delete fMeasuredMap;
-}
-
-//_______________________________________________________________________
-void AliMagFCheb::GetTPCInt(const Float_t *xyz, Float_t *b) const
-{
- // Method to calculate the integral of magnetic integral from xyz to nearest cathode plane
- //
- b[0]=b[1]=b[2]=0.0;
- if (fMeasuredMap) fMeasuredMap->GetTPCInt(xyz,b);
- for (int i=3;i--;) b[i] *= fFactor;
-}
-
-//_______________________________________________________________________
-void AliMagFCheb::GetTPCIntCyl(const Float_t *rphiz, Float_t *b) const
-{
- // Method to calculate the integral of magnetic integral from point to nearest cathode plane
- // in cylindrical coordiates ( -pi<phi<pi convention )
- b[0]=b[1]=b[2]=0.0;
- if (fMeasuredMap) fMeasuredMap->GetTPCIntCyl(rphiz,b);
- for (int i=3;i--;) b[i] *= fFactor;
-}
-
-//_______________________________________________________________________
-void AliMagFCheb::Field(const Float_t *xyz, Float_t *b) const
-{
- // Method to calculate the field at point xyz
- //
- b[0]=b[1]=b[2]=0.0;
- if (xyz[2] > 919. || xyz[2] < -1972.) {
- ZDCField(xyz, b);
- } else {
- if (fMeasuredMap && fFactor !=0.) {
- fMeasuredMap->Field(xyz,b);
- for (int i=3;i--;) b[i] *= fFactor;
- }
- }
-}
-
-//_______________________________________________________________________
-void AliMagFCheb::Field(const Double_t *xyz, Double_t *b) const
-{
- // Method to calculate the field at point xyz
- //
- b[0]=b[1]=b[2]=0.0;
- if (xyz[2] > 919. || xyz[2] < -1972.) {
- ZDCField(xyz, b);
- }
- else {
- if (fMeasuredMap && fFactor !=0.) {
- fMeasuredMap->Field(xyz,b);
- for (int i=3;i--;) b[i] *= fFactor;
- }
- }
-}
-
-//_______________________________________________________________________
-AliMagFCheb& AliMagFCheb::operator=(const AliMagFCheb& maps)
-{
- fSolenoid=maps.fSolenoid;
- if (this != &maps && maps.fMeasuredMap) {
- if (fMeasuredMap) delete fMeasuredMap;
- fMeasuredMap = new AliMagWrapCheb(*maps.fMeasuredMap);
- }
- return *this;
-}
-
-//_______________________________________________________________________
-void AliMagFCheb::SetMeasuredMap(AliMagWrapCheb* parm)
-{
- if (fMeasuredMap) delete fMeasuredMap;
- fMeasuredMap = parm;
-}
+++ /dev/null
-#ifndef ALIMAGFCHEB_H
-#define ALIMAGFCHEB_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-//
-// Interface between the AliMagWrapCheb and AliMagF: set of magnetic field data + Tosca
-// parameterization by Chebyshev polynomials
-//
-// Author: ruben.shahoyan@cern.ch
-//
-
-#include "AliMagFC.h"
-class AliMagWrapCheb;
-
-
-class AliMagFCheb : public AliMagFC
-{
-public:
- enum constants {k2kG, k4kG, k5kG};
- AliMagFCheb();
- AliMagFCheb(const char *name, const char *title, Int_t integ,
- Float_t factor=1, Float_t fmax=15, Int_t map = k2kG,
- Bool_t dipoleON = kTRUE,
- const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
- AliMagFCheb(const AliMagFCheb& maps);
- AliMagFCheb& operator=(const AliMagFCheb& maps);
- virtual ~AliMagFCheb();
- //
- virtual void Field(const Float_t *x, Float_t *b) const;
- virtual void Field(const Double_t *x, Double_t *b) const;
- virtual void GetTPCInt(const Float_t *xyz, Float_t *b) const;
- virtual void GetTPCIntCyl(const Float_t *rphiz, Float_t *b) const;
- //
- AliMagWrapCheb* GetMeasuredMap() const {return fMeasuredMap;}
- void SetMeasuredMap(AliMagWrapCheb* parm);
- virtual Float_t SolenoidField() const {return -Factor()*fSolenoid;}
- //
- protected:
- AliMagWrapCheb* fMeasuredMap; // Measured part of the field map
- Float_t fSolenoid; // Solenoid field setting
- //
- ClassDef(AliMagFCheb, 2) // Class for all Alice MagField wrapper for measured data + Tosca parameterization
-};
-
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// Field with Magnetic Field map
-// Used by AliRun class
-// Author:
-//-------------------------------------------------------------------------
-
-#include <TMath.h>
-#include <TSystem.h>
-
-#include "AliLog.h"
-#include "AliMagFDM.h"
-
-ClassImp(AliMagFDM)
-
-//_______________________________________________________________________
-AliMagFDM::AliMagFDM():
- fSolenoid(0),
- fInd(0),
- fZmin(0),
- fZmax(0),
- fYmax(0),
- fYmin(0),
- fZpmx(0),
- fZpmn(0),
- fRmax(0),
- fRmin(0),
- fXdel(0),
- fYdel(0),
- fZdel(0),
- fRdel(0),
- fPhid(0),
- fZpdl(0),
- fCx1(0),
- fCx2(0),
- fAx1(0),
- fAx2(0),
- fXl(0),
- fYl(0),
- fZl(0),
- fRn(0),
- fPhin(0),
- fZpl(0)
-{
- //
- // Default constructor for the Dipole field
- //
-}
-
-//_______________________________________________________________________
-AliMagFDM::AliMagFDM(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax):
- AliMagFC(name,title,integ,factor,fmax),
- fSolenoid(0),
- fInd(0),
- fZmin(0),
- fZmax(0),
- fYmax(0),
- fYmin(0),
- fZpmx(0),
- fZpmn(0),
- fRmax(0),
- fRmin(0),
- fXdel(0),
- fYdel(0),
- fZdel(0),
- fRdel(0),
- fPhid(0),
- fZpdl(0),
- fCx1(0),
- fCx2(0),
- fAx1(0),
- fAx2(0),
- fXl(0),
- fYl(0),
- fZl(0),
- fRn(0),
- fPhin(0),
- fZpl(0)
-{
- //
- // Standard constructor for the Dipole field
- //
- fType = kDipoMap;
- fMap = 3;
- SetSolenoidField();
-
- AliDebug(1, Form(
- "Field Map for Muon Arm from IP till muon filter %s created: map= %d, integ= %d, factor= %f, file=%s",
- fName.Data(), fMap ,integ,factor,fTitle.Data()));
-
-}
-
-//_______________________________________________________________________
-void AliMagFDM::Field(const float *xfi, float *b) const
-{
- //
- // Main routine to compute the field in a point
- //
- const Double_t keps=0.1E-06;
- const Double_t kPI2=2.*TMath::Pi();
- const Double_t kone=1;
-
- const Int_t kiip=33;
- const Int_t kmiip=0;
- const Int_t kliip=0;
-
- const Int_t kiic=0;
- const Int_t kmiic=0;
- const Int_t kliic=0;
-
- const Double_t kfZbg=502.92; // Start of Map using in z
- const Double_t kfZL3=600; // Beginning of L3 door in z
-
- Double_t x[3];
- Double_t xL3[3];
- Double_t bint[3];
-
- Double_t r0;
- 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 ---
-//
-// This map has been calculated in a coordinate system in which the muon spectrometer sits at z > 0
-// Transfor correspondingly.
-
- 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=fRmax;
- if ( (-700<x[2] && x[2]<=kfZbg &&
- (x[0]*x[0]+(x[1]+30)*(x[1]+30))< 560*560)
- || (kfZbg<x[2] && x[2]<=kfZL3 && (rr>rPmax*100 && rr< 560)) )
- {
- b[0]=b[1]=0;
- b[2]=fSolenoid;
- }
-
- xL3[0]=x[0]/100;
- xL3[1]=(x[1]+30)/100;
- xL3[2]=x[2]/100;
-
-
- if (TMath::Abs(xL3[0])<=0.1E-06) xL3[0]=TMath::Sign(0.1E-05,xL3[0]);
- if (TMath::Abs(xL3[1])<=0.1E-06) xL3[1]=TMath::Sign(0.1E-05,xL3[1]);
-
- Double_t xminn=xL3[2]*fAx1+fCx1;
- Double_t xmaxx=xL3[2]*fAx2+fCx2;
- Double_t zCmin,zCmax,yCmin,yCmax;
-
- zCmin=fZmin;
- zCmax=fZmax;
- yCmin=fYmin;
- yCmax=fYmax;
-if ((kfZbg/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 (kfZbg/100<xL3[2] && 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];
- kp0=FZ(zpz, fZp ,fZpdl,kpi,fZpl) ;
- zp2=(zpz-fZp[kp0])/(fZp[kp0+1]-fZp[kp0]);
- zp1= kone-zp2;
- yyp=xL3[1]- 0.3;
- cphi=TMath::Abs(yyp/r0);
- Int_t kcphi=0;
- if (cphi > kone) {
- AliDebug(2,Form("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, cphi %e",xL3[0],xL3[1],xL3[2],yyp,r0,cphi));
- cphi =kone;
- kcphi=777;
- }
- ph0=TMath::ACos(cphi);
- if (xL3[0] < 0 && yyp > 0 ) {ph0=kPI2/2 - ph0;}
- if (xL3[0] < 0 && yyp < 0 ) {ph0=kPI2/2 + ph0;}
- if (xL3[0] > 0 && yyp < 0 ) {ph0=kPI2 - ph0;}
- if (ph0 > kPI2) { ph0=ph0 - kPI2;}
- if (kcphi==777) {
- AliDebug(2,Form("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, ph0 %e",xL3[0],xL3[1],xL3[2],yyp,r0,ph0));
- }
- fip=ph0;
- mp0=FZ(fip,fPhi,fPhid ,mpi,fPhin);
- xp2=(fip-fPhi[mp0])/(fPhi[mp0+1]-fPhi[mp0]);
- xp1=kone-xp2;
-
- Double_t rDel;
- rDel=fRdel;
-
- if (r0<= fRdel)
- {
-
- if(r0< keps)
- {
-
- bint[0]=(zp1*fBpx[kp0][0][0] + zp2*fBpx[kp0+1][0][0])*10;
- bint[1]=(zp1*fBpy[kp0][0][0] + zp2*fBpy[kp0+1][0][0])*10;
- bint[2]=(zp1*fBpz[kp0][0][0] + zp2*fBpz[kp0+1][0][0])*10;
-
- } else {
-
- alp2= fB[0][0][mp0]*yyp + fB[0][1][mp0]*xL3[0];
- alp3= fB[1][0][mp0]*yyp + fB[1][1][mp0]*xL3[0];
- alp1= kone - alp2 - alp3;
-
- for (jb=0; jb<3 ; jb++)
- {
- iKvar=jb;
- bint[jb] = Ba(iKvar,zp1,zp2,alp1,alp2,alp3, kp0,mp0)*10 ;
- }
- } // end of keps <=r0
- }
- else
- {
- rp=r0;
-
- lp0=FZ(rp,fR ,fRdel,lpi,fRn);
- yp2=(rp-fR[lp0])/(fR[lp0+1]-fR[lp0]);
- yp1=kone-yp2;
-
- for (jb=0; jb<3 ; jb++)
- {
- iKvar=jb;
- bint[jb] = Bb(zp1,zp2,yp1,yp2,xp1,xp2,iKvar,kp0,lp0,mp0)*10 ;
- }
- }
-
- b[0]=-bint[0];
- b[1]=bint[1];
- b[2]=-bint[2];
-
- }
- 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 = fAx1*xL3[2] + fCx1;
- xx2 = fAx2*xL3[2] + fCx2;
-
- zzc=xL3[2];
- k0=FZ(zzc, fZc ,fZdel, kci, fZl);
- zz2=(zzc-fZc[k0])/(fZc[k0+1]-fZc[k0]);
- zz1=kone - zz2;;
-
- yyc=xL3[1];
- l0=FZ(yyc, fY , fYdel,lci,fYl);
- yy2=(yyc-fY[l0])/(fY[l0+1]-fY[l0]);;
- yy1=kone - yy2;
- xXl = fXl-kone;
- dx = (xx2-xx1)/xXl;
- xxx= xL3[0]-xx1;
- m0 = int(xxx/dx);
-
- if(xL3[0]<(xx1+m0*dx) || xL3[0] >(xx1+(m0+1)*dx))
- {
- m0=m0+1;
- AliDebug(2,Form(" 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;
- bint[jb-3] = Bb(zz1,zz2,yy1,yy2,x1,x2,iKvar,k0, l0, m0)*10 ;
- }
-
- b[0]=-bint[0];
- b[1]=bint[1];
- b[2]=-bint[2];
-
- }
-
-
- } else {
- AliError(Form("Unknown map of Dipole region %d",fMap));
- }
-
-} else {
- ZDCField(xfi,b);
-
- }
-
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
-}
-
-//_______________________________________________________________________
-void AliMagFDM::Field(const double *xfi, double *b) const
-{
- //
- // Main routine to compute the field in a point
- //
- const Double_t keps=0.1E-06;
- const Double_t kPI2=2.*TMath::Pi();
- const Double_t kone=1;
-
- const Int_t kiip=33;
- const Int_t kmiip=0;
- const Int_t kliip=0;
-
- const Int_t kiic=0;
- const Int_t kmiic=0;
- const Int_t kliic=0;
-
- const Double_t kfZbg=502.92; // Start of Map using in z
- const Double_t kfZL3=600; // Beginning of L3 door in z
-
- Double_t x[3];
- Double_t xL3[3];
- Double_t bint[3];
-
- Double_t r0;
- 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 ---
-//
-// This map has been calculated in a coordinate system in which the muon spectrometer sits at z > 0
-// Transfor correspondingly.
-
- 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=fRmax;
- if ( (-700<x[2] && x[2]<=kfZbg &&
- (x[0]*x[0]+(x[1]+30)*(x[1]+30))< 560*560)
- || (kfZbg<x[2] && x[2]<=kfZL3 && (rr>rPmax*100 && rr< 560)) )
- {
- b[0]=b[1]=0;
- b[2]=fSolenoid;
- }
-
- xL3[0]=x[0]/100;
- xL3[1]=(x[1]+30)/100;
- xL3[2]=x[2]/100;
-
-
- if (TMath::Abs(xL3[0])<=0.1E-06) xL3[0]=TMath::Sign(0.1E-05,xL3[0]);
- if (TMath::Abs(xL3[1])<=0.1E-06) xL3[1]=TMath::Sign(0.1E-05,xL3[1]);
-
- Double_t xminn=xL3[2]*fAx1+fCx1;
- Double_t xmaxx=xL3[2]*fAx2+fCx2;
- Double_t zCmin,zCmax,yCmin,yCmax;
-
- zCmin=fZmin;
- zCmax=fZmax;
- yCmin=fYmin;
- yCmax=fYmax;
-if ((kfZbg/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 (kfZbg/100<xL3[2] && 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];
- kp0=FZ(zpz, fZp ,fZpdl,kpi,fZpl) ;
- zp2=(zpz-fZp[kp0])/(fZp[kp0+1]-fZp[kp0]);
- zp1= kone-zp2;
- yyp=xL3[1]- 0.3;
- cphi=TMath::Abs(yyp/r0);
- Int_t kcphi=0;
- if (cphi > kone) {
- AliDebug(2,Form("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, cphi %e",xL3[0],xL3[1],xL3[2],yyp,r0,cphi));
- cphi =kone;
- kcphi=777;
- }
- ph0=TMath::ACos(cphi);
- if (xL3[0] < 0 && yyp > 0 ) {ph0=kPI2/2 - ph0;}
- if (xL3[0] < 0 && yyp < 0 ) {ph0=kPI2/2 + ph0;}
- if (xL3[0] > 0 && yyp < 0 ) {ph0=kPI2 - ph0;}
- if (ph0 > kPI2) { ph0=ph0 - kPI2;}
- if (kcphi==777) {
- AliDebug(2,Form("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, ph0 %e",xL3[0],xL3[1],xL3[2],yyp,r0,ph0));
- }
- fip=ph0;
- mp0=FZ(fip,fPhi,fPhid ,mpi,fPhin);
- xp2=(fip-fPhi[mp0])/(fPhi[mp0+1]-fPhi[mp0]);
- xp1=kone-xp2;
-
- Double_t rDel;
- rDel=fRdel;
-
- if (r0<= fRdel)
- {
-
- if(r0< keps)
- {
-
- bint[0]=(zp1*fBpx[kp0][0][0] + zp2*fBpx[kp0+1][0][0])*10;
- bint[1]=(zp1*fBpy[kp0][0][0] + zp2*fBpy[kp0+1][0][0])*10;
- bint[2]=(zp1*fBpz[kp0][0][0] + zp2*fBpz[kp0+1][0][0])*10;
-
- } else {
-
- alp2= fB[0][0][mp0]*yyp + fB[0][1][mp0]*xL3[0];
- alp3= fB[1][0][mp0]*yyp + fB[1][1][mp0]*xL3[0];
- alp1= kone - alp2 - alp3;
-
- for (jb=0; jb<3 ; jb++)
- {
- iKvar=jb;
- bint[jb] = Ba(iKvar,zp1,zp2,alp1,alp2,alp3, kp0,mp0)*10 ;
- }
- } // end of keps <=r0
- }
- else
- {
- rp=r0;
-
- lp0=FZ(rp,fR ,fRdel,lpi,fRn);
- yp2=(rp-fR[lp0])/(fR[lp0+1]-fR[lp0]);
- yp1=kone-yp2;
-
- for (jb=0; jb<3 ; jb++)
- {
- iKvar=jb;
- bint[jb] = Bb(zp1,zp2,yp1,yp2,xp1,xp2,iKvar,kp0,lp0,mp0)*10 ;
- }
- }
-
- b[0]=-bint[0];
- b[1]=bint[1];
- b[2]=-bint[2];
-
- }
- 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 = fAx1*xL3[2] + fCx1;
- xx2 = fAx2*xL3[2] + fCx2;
-
- zzc=xL3[2];
- k0=FZ(zzc, fZc ,fZdel, kci, fZl);
- zz2=(zzc-fZc[k0])/(fZc[k0+1]-fZc[k0]);
- zz1=kone - zz2;;
-
- yyc=xL3[1];
- l0=FZ(yyc, fY , fYdel,lci,fYl);
- yy2=(yyc-fY[l0])/(fY[l0+1]-fY[l0]);;
- yy1=kone - yy2;
- xXl = fXl-kone;
- dx = (xx2-xx1)/xXl;
- xxx= xL3[0]-xx1;
- m0 = int(xxx/dx);
-
- if(xL3[0]<(xx1+m0*dx) || xL3[0] >(xx1+(m0+1)*dx))
- {
- m0=m0+1;
- AliDebug(2,Form(" 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;
- bint[jb-3] = Bb(zz1,zz2,yy1,yy2,x1,x2,iKvar,k0, l0, m0)*10 ;
- }
-
- b[0]=-bint[0];
- b[1]=bint[1];
- b[2]=-bint[2];
-
- }
-
-
- } else {
- AliError(Form("Unknown map of Dipole region %d",fMap));
- }
-
-} else {
- ZDCField(xfi,b);
-
- }
-
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
-}
-
-
-//_______________________________________________________________________
-Int_t AliMagFDM::FZ(Double_t temp, const Float_t *Ar,
- Float_t delu, Int_t ik, Int_t nk) const
-{
- //
- // Quest of a point position at x,y,z (Cartensian) and R,Phi,z (Polar) axises
- //
- Int_t l,ikj;
- Double_t ddu,ar;
-
- Int_t ku,kf;
- kf=0;
- ar=Ar[ik];
- ddu=temp-ar;
-
- ku=int(ddu/delu);
- ikj=ik+ku+1;
- if (ddu<=0) ikj=0;
-
- for(l=ikj; l<nk; l++)
- {
-
- if(temp <= Ar[l])
- {
-
- kf=l-1;
- break;
- }
- }
- return kf;
- }
-
-//_______________________________________________________________________
-Double_t AliMagFDM::Ba(Int_t kaai,Double_t zaa1, Double_t zaa2,
- Double_t alf1, Double_t alf2, Double_t alf3,
- Int_t kaa, Int_t maa) const
-{
- //
- // Calculation of field componet for case (keps <r0<= fRdel) at a given axis
- //
- Double_t fa11=0,fa12=0,fa13=0;
- Double_t fa21=0,fa22=0,fa23=0;
- Double_t faY1=0,faY2=0;
- Double_t bba=0;
-
- switch (kaai) {
- case 0:
- fa11 = fBpx[kaa][0][0];
- fa12 = fBpx[kaa][0][maa];
- fa13 = fBpx[kaa][0][maa+1];
- fa21 = fBpx[kaa+1][0][0];
- fa22 = fBpx[kaa+1][0][maa];
- fa23 = fBpx[kaa+1][0][maa+1];
- break;
- case 1:
- fa11 = fBpy[kaa][0][0];
- fa12 = fBpy[kaa][0][maa];
- fa13 = fBpy[kaa][0][maa+1];
- fa21 = fBpy[kaa+1][0][0];
- fa22 = fBpy[kaa+1][0][maa];
- fa23 = fBpy[kaa+1][0][maa+1];
- break;
- case 2:
- fa11 = fBpz[kaa][0][0];
- fa12 = fBpz[kaa][0][maa];
- fa13 = fBpz[kaa][0][maa+1];
- fa21 = fBpz[kaa+1][0][0];
- fa22 = fBpz[kaa+1][0][maa];
- fa23 = fBpz[kaa+1][0][maa+1];
- break;
- default:
- AliFatal(Form("Invalid value of kaai %d",kaai));
- }
- faY1=alf1*fa11+alf2*fa12+alf3*fa13;
- faY2=alf1*fa21+alf2*fa22+alf3*fa23;
- bba = zaa1*faY1+zaa2*faY2;
- return bba;
-}
-
-
-//_______________________________________________________________________
-Double_t AliMagFDM::Bb(Double_t z1,Double_t z2, Double_t y1,Double_t y2,
- Double_t x1,Double_t x2, Int_t kv, Int_t k, Int_t l, Int_t m) const
-{
- //
- // Calculation of field componet at a given axis (general case)
- //
- Double_t fy1=0,fy2=0,ffy=0;
- Double_t gy1=0,gy2=0,ggy=0;
- Double_t bbi=0;
- Double_t bf11=0,bf12=0,bf21=0,bf22=0;
- Double_t bg11=0,bg12=0,bg21=0,bg22=0;
-
-
- /*-----------------Polar part ------------------*/
-
- switch (kv) {
- case 0:
- bf11=fBpx[k][l][m];
- bf12=fBpx[k+1][l][m];
- bf21=fBpx[k+1][l+1][m];
- bf22=fBpx[k][l+1][m];
-
- bg11=fBpx[k][l][m+1];
- bg12=fBpx[k+1][l][m+1];
- bg21=fBpx[k+1][l+1][m+1];
- bg22=fBpx[k][l+1][m+1];
- break;
-
- case 1:
- bf11=fBpy[k][l][m];
- bf12=fBpy[k+1][l][m];
- bf21=fBpy[k+1][l+1][m];
- bf22=fBpy[k][l+1][m];
-
- bg11=fBpy[k][l][m+1];
- bg12=fBpy[k+1][l][m+1];
- bg21=fBpy[k+1][l+1][m+1];
- bg22=fBpy[k][l+1][m+1];
- break;
-
- case 2:
- bf11=fBpz[k][l][m];
- bf12=fBpz[k+1][l][m];
- bf21=fBpz[k+1][l+1][m];
- bf22=fBpz[k][l+1][m];
-
- bg11=fBpz[k][l][m+1];
- bg12=fBpz[k+1][l][m+1];
- bg21=fBpz[k+1][l+1][m+1];
- bg22=fBpz[k][l+1][m+1];
- break;
- /*-----------------Cartensian part ---------------*/
-
- case 3:
- bf11=fBcx[k][l][m];
- bf12=fBcx[k+1][l][m];
- bf21=fBcx[k+1][l+1][m];
- bf22=fBcx[k][l+1][m];
-
- bg11=fBcx[k][l][m+1];
- bg12=fBcx[k+1][l][m+1];
- bg21=fBcx[k+1][l+1][m+1];
- bg22=fBcx[k][l+1][m+1];
- break;
-
- case 4:
- bf11=fBcy[k][l][m];
- bf12=fBcy[k+1][l][m];
- bf21=fBcy[k+1][l+1][m];
- bf22=fBcy[k][l+1][m];
-
- bg11=fBcy[k][l][m+1];
- bg12=fBcy[k+1][l][m+1];
- bg21=fBcy[k+1][l+1][m+1];
- bg22=fBcy[k][l+1][m+1];
- break;
-
- case 5:
- bf11=fBcz[k][l][m];
- bf12=fBcz[k+1][l][m];
- bf21=fBcz[k+1][l+1][m];
- bf22=fBcz[k][l+1][m];
-
- bg11=fBcz[k][l][m+1];
- bg12=fBcz[k+1][l][m+1];
- bg21=fBcz[k+1][l+1][m+1];
- bg22=fBcz[k][l+1][m+1];
- break;
-
- default:
- AliFatal(Form("Invalid value of kv %d",kv));
- }
-
-
-
- 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;
-
- return 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;
- AliDebug(1,Form("Reading Magnetic Field %s from file %s",fName.Data(),fTitle.Data()));
- fname = gSystem->ExpandPathName(fTitle.Data());
- magfile=fopen(fname,"r");
- delete [] fname;
-
- AliDebug(2,"Cartensian part");
-
- if (magfile) {
-
-// Cartensian part
-
- fscanf(magfile,"%d %d %d ",&fYl, &fXl, &fZl);
-
- AliDebug(3,Form("fYl %d, fXl %d, fZl %d",fYl, fXl, fZl));
-
- for (ik=0; ik<fZl; ik++)
- {
-
- fscanf(magfile, " %e ", &zz);
- fZc[ik]=zz;
-
- }
-
- for (ik=0; ik<fYl; ik++)
- {
- fscanf(magfile, " %e ", &yy);
- fY[ik]=yy;
-
- }
- for (ik=0; ik<81; ik++)
- {
- AliDebug(4,Form("fZc %e,fY %e", fZc[ik],fY[ik]));
- }
-
- fscanf(magfile," %e %e %e %e %e %e %e %e %e %e %e ", &fYdel,&fXdel,&fZdel,&fZmax,&fZmin,&fYmax,&fYmin,&fAx1,&fCx1,&fAx2,&fCx2);
-
-AliDebug(3,Form("fYdel %e, fXdel %e, fZdel %e",fYdel,fXdel,fZdel));
-AliDebug(3,Form("fZmax %e, fZmin %e, fYmax %e,fYmin %e",fZmax,fZmin,fYmax,fYmin));
-AliDebug(3,Form("fAx1 %e, fCx1 %e, fAx2 %e, fCx %e",fAx1,fCx1,fAx2,fCx2));
-
- for (il=0; il<44; il++) {
- for (im=0; im<81; im++) {
- for (ik=0; ik<81; ik++) {
-
- fscanf(magfile, " %e ", &by);
- fBcy[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);
- fBcx[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);
- fBcz[ik][im][il]=bz;
- }
- }
- }
-//---------------------- Polar part ---------------------------------
-
- AliDebug(2,"Polar part");
- fscanf(magfile,"%d %d %d ", &fZpl, &fRn, &fPhin);
- AliDebug(3,Form("fZpl %d, fRn %d, fPhin %d",fZpl,fRn,fPhin));
-
- AliDebug(4," fZp array");
-
- for (ik=0; ik<51; ik++)
- {
- fscanf(magfile, " %e ", &zzp);
- fZp[ik]=zzp;
- AliDebug(4,Form(" %e",fZp[ik]));
- }
-
- AliDebug(4," fR array");
-
- for (ik=0; ik<10; ik++)
- {
- fscanf(magfile, " %e ", &rr);
- fR[ik]=rr;
- AliDebug(4,Form(" %e",fR[ik]));
- }
-
-// AliDebug(4,"fPhi array");
-
- for (il=0; il<33; il++)
- {
- fscanf(magfile, " %e ", &phii);
- fPhi[il]=phii;
-// AliDebug(4,Form(" %e",fPhi[il]));
- }
-
- fscanf(magfile," %e %e %e %e %e %e %e ",&fZpdl,&fPhid,&fRdel,&fZpmx,&fZpmn,&fRmax, &fRmin);
-
-AliDebug(3,Form("fZpdl %e, fPhid %e, fRdel %e, fZpmx %e, fZpmn %e,fRmax %e,fRmin %e", fZpdl,fPhid, fRdel,fZpmx, fZpmn,fRmax, fRmin));
-
-
- for (il=0; il<33; il++) {
- for (im=0; im<10; im++) {
- for (ik=0; ik<51; ik++) {
- fscanf(magfile, " %e ", &by);
- fBpy[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);
- fBpx[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);
- fBpz[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);
- fB[ik][im][il]=bb;
- }
- }
- }
-//
- } else {
- AliFatal(Form("File %s not found !",fTitle.Data()));
- }
-}
+++ /dev/null
-#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$ */
-
-//-------------------------------------------------------------------------
-// Field with Magnetic Field map
-// Used by AliRun class
-// Author:
-//-------------------------------------------------------------------------
-
-#include "AliMagFC.h"
-//
-class AliMagFDM : public AliMagFC
-{
-//Alice Magnetic Field:Magnetic field map from IP to muon filter for Muon arm
-
-public:
- AliMagFDM();
- AliMagFDM(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax);
- virtual ~AliMagFDM(){}
- virtual void Field(const float *x, float *b) const;
- virtual void Field(const double *x, double *b) const;
- virtual void ReadField();
- virtual void SetSolenoidField(Float_t field = 2.) {fSolenoid = field;}
- virtual Float_t SolenoidField() const {
- return -Factor()*fSolenoid;
- }
- Int_t FZ(Double_t u, const Float_t *Ar, Float_t du, Int_t ki, Int_t nu) const;
- Double_t Ba(Int_t kai, Double_t za1, Double_t za2, Double_t al1, Double_t al2, Double_t al3, Int_t ka, Int_t ma) const;
- Double_t Bb(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) const;
-
-
-protected:
-
-//
- Float_t fSolenoid; // Solenoid Field Strength
- Int_t fInd; // Character number of validity Map region
-
- Float_t fZmin; // Start of the cartesian part of MAP in z
- Float_t fZmax; // End of Map in z
- Float_t fYmax; // Start of the cartesian part of MAP in y
- Float_t fYmin; // End of the cartesian part of MAP in y
- Float_t fZpmx; // End of the polar part of MAP in z
- Float_t fZpmn; // Start of the polar part of MAP in z
- Float_t fRmax; // Maximal radius of the polar part of MAP
- Float_t fRmin; // Minimal radius of the polar part of MAP
-
-
- Float_t fXdel; // step in x - cartesian part of MAP
- Float_t fYdel; // step in y - cartesian part of MAP
- Float_t fZdel; // step in z - cartesian part of MAP
-
- Float_t fRdel; // step in r - polar part of MAP
- Float_t fPhid; // step in Phi - polar part of MAP
- Float_t fZpdl; // step in z - polar part of MAP
-
- Float_t fCx1; // Field constant
- Float_t fCx2; // Field constant
- Float_t fAx1; // Field constant
- Float_t fAx2; // Field constant
-
- Float_t fZc[81]; // z coordinates in cartesian part
- Float_t fY[81]; // y coordinates in cartesian part
- Float_t fBcx[81][81][44]; // Bx array for cartesian part
- Float_t fBcy[81][81][44]; // By array for cartesian part
- Float_t fBcz[81][81][44]; // Bz array for cartesian part
-
- Float_t fZp[51]; // z coordinates in polar part
- Float_t fR[10]; // r coordinates in polar part
- Float_t fPhi[33]; // Phi coordinates in polar part
-
- Float_t fBpx[51][10][33]; // Bx array for polar part
- Float_t fBpy[51][10][33]; // By array for polar part
- Float_t fBpz[51][10][33]; // Bx array for polar part
- Float_t fB[2][2][32]; // Limits of field
-
- Int_t fXl; // Number steps in x for cartesian part
- Int_t fYl; // Number steps in y for cartesian par
- Int_t fZl; // Number steps in z for cartesian part
-
- Int_t fRn; // Number steps in r for polar part
- Int_t fPhin; // Number steps in Phi for polar part
- Int_t fZpl; // Number steps in z for polar part
-
-
- ClassDef(AliMagFDM,1) //Class Magnetic field map from IP till muon filter
-};
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//------------------------------------------------------------------------
-// Magnetic field composed by 3 maps: the L3 magnet, extended region, and
-// dipole magnet
-// Used in the configuration macros (macros/Config.C, etc.)
-// Author: Andreas Morsch <andreas.morsch@cern.ch>
-//------------------------------------------------------------------------
-
-#include <TClass.h>
-#include <TFile.h>
-#include <TMath.h>
-#include <TSystem.h>
-
-#include "AliLog.h"
-#include "AliFieldMap.h"
-#include "AliMagFMaps.h"
-
-ClassImp(AliMagFMaps)
-
-
-//_______________________________________________________________________
-AliMagFMaps::AliMagFMaps():
- fSolenoid(0),
- fSolenoidUser(0.),
- fL3Option(0)
-{
- //
- // Default constructor
- //
- //
- // Don't replicate field information in gAlice
- fFieldMap[0] = fFieldMap[1] = fFieldMap[2] = 0;
-}
-
-//_______________________________________________________________________
-AliMagFMaps::AliMagFMaps(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax, Int_t map,
- Int_t l3):
- AliMagFC(name,title,integ,factor,fmax),
- fSolenoid(0),
- fSolenoidUser(0),
- fL3Option(l3)
-{
- //
- // Standard constructor
- //
- fType = kConMesh;
- fFieldMap[0] = 0;
- fMap = map;
- fL3Option = l3;
- ReadField();
- //
- // Don't replicate field information in gAlice
- for (Int_t i = 0; i < 3; i++) fFieldMap[i]->SetWriteEnable(0);
- //
-}
-
-//_______________________________________________________________________
-AliMagFMaps::AliMagFMaps(const AliMagFMaps &magf):
- AliMagFC(magf),
- fSolenoid(0),
- fSolenoidUser(0),
- fL3Option(0)
-{
- //
- // Copy constructor
- //
- magf.Copy(*this);
-}
-
-//_______________________________________________________________________
-AliMagFMaps::~AliMagFMaps()
-{
- //
- // Destructor
- //
- delete fFieldMap[0];
- delete fFieldMap[1];
- delete fFieldMap[2];
-}
-
-//_______________________________________________________________________
-void AliMagFMaps::ReadField()
-{
- // Read Field Map from file
- //
- // don't read twice
- //
- if (!fReadField) return;
- fReadField = kFALSE;
- //
-
-
- char* fname = 0;
- TFile* file = 0;
- if (fMap == k2kG) {
- fSolenoid = 2.;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B02.root");
- file = new TFile(fname);
- fFieldMap[0] = dynamic_cast<AliFieldMap*>(file->Get("L3B02"));
- file->Close();
- delete file;
- delete [] fname; // see documentation to expand filenam
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB02.root");
- file = new TFile(fname);
- fFieldMap[1] = dynamic_cast<AliFieldMap*>(file->Get("DipB02"));
- file->Close();
- delete file;;
- delete [] fname;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB02.root");
- file = new TFile(fname);
- fFieldMap[2] = dynamic_cast<AliFieldMap*>(file->Get("ExtB02"));
- file->Close();
- delete file;
- delete [] fname;
- } else if (fMap == k4kG) {
- fSolenoid = 4.;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B04.root");
- file = new TFile(fname);
- fFieldMap[0] = dynamic_cast<AliFieldMap*>(file->Get("L3B04"));
- file->Close();
- delete file;
- delete [] fname;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB04.root");
- file = new TFile(fname);
- fFieldMap[1] = dynamic_cast<AliFieldMap*>(file->Get("DipB04"));
- file->Close();
- delete [] fname;
- delete file;
-
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB04.root");
- file = new TFile(fname);
- fFieldMap[2] = dynamic_cast<AliFieldMap*>(file->Get("ExtB04"));
- file->Close();
- delete [] fname;
- delete file;
- } else if (fMap == k5kG) {
- fSolenoid = 5.;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/L3B05.root");
- file = new TFile(fname);
- fFieldMap[0] = dynamic_cast<AliFieldMap*>(file->Get("L3B05"));
- file->Close();
- delete file;
- delete [] fname;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/DipB05.root");
- file = new TFile(fname);
- fFieldMap[1] = dynamic_cast<AliFieldMap*>(file->Get("DipB05"));
- file->Close();
- delete file;
- delete [] fname;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/ExtB05.root");
- file = new TFile(fname);
- fFieldMap[2] = dynamic_cast<AliFieldMap*>(file->Get("ExtB05"));
- file->Close();
- delete file;
- delete [] fname;
- }
-
- if (!fL3Option) fSolenoidUser = fSolenoid;
-
-}
-
-//_______________________________________________________________________
-Float_t AliMagFMaps::SolenoidField() const
-{
- //
- // Returns max. L3 (solenoid) field strength
- // according to field map setting
- //
- return -Factor()*fSolenoid;
-}
-
-//_______________________________________________________________________
-void AliMagFMaps::Field(const float *x, float *b) const
-{
- //
- // Method to calculate the magnetic field
- //
- // --- find the position in the grid ---
-
-
-
- // if (!fFieldRead) ReadField();
-
- //
- // Field Maps have been calculated for the coordinate system in which
- // the Muon Spectrometer is placed at z > 0
- // Transform coordinates corresponingly
- //
-
- b[0]=b[1]=b[2]=0;
- Float_t xm[3];
- xm[0] = - x[0];
- xm[1] = x[1];
- xm[2] = - x[2];
-
- AliFieldMap* map = 0;
- if (fFieldMap[0]->Inside(xm[0], xm[1], xm[2])) {
- map = fFieldMap[0];
- Float_t r = TMath::Sqrt(xm[0] * xm[0] + xm[1] * xm[1]);
-
- if (!fL3Option && TMath::Abs(xm[2]) < 370. && r < 550.) {
- //
- // Constant L3 field , if this option was selected
- //
- b[2] = (- fSolenoid)*fFactor;
- return;
- }
- } else if (fFieldMap[1]->Inside(xm[0], xm[1], xm[2])) {
- map = fFieldMap[1];
- } else if (fFieldMap[2]->Inside(xm[0], xm[1], xm[2])) {
- map = fFieldMap[2];
- }
-
- if(map){
- map->Field(xm,b);
- b[0] = - b[0];
- b[2] = - b[2];
-
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
- } else {
- //This is the ZDC part
- ZDCField(x, b);
- }
-}
-
-//_______________________________________________________________________
-void AliMagFMaps::Field(const double *x, double *b) const
-{
- //
- // Method to calculate the magnetic field
- //
- // --- find the position in the grid ---
-
- // if (!fFieldRead) ReadField();
-
- //
- // Field Maps have been calculated for the coordinate system in which
- // the Muon Spectrometer is placed at z > 0
- // Transform coordinates corresponingly
- //
-
- b[0]=b[1]=b[2]=0;
- double xm[3];
- xm[0] = - x[0];
- xm[1] = x[1];
- xm[2] = - x[2];
-
- AliFieldMap* map = 0;
- if (fFieldMap[0]->Inside(xm[0], xm[1], xm[2])) {
- map = fFieldMap[0];
- Float_t r = TMath::Sqrt(xm[0] * xm[0] + xm[1] * xm[1]);
-
- if (!fL3Option && TMath::Abs(xm[2]) < 370. && r < 550.) {
- //
- // Constant L3 field , if this option was selected
- //
- b[2] = (- fSolenoid)*fFactor;
- return;
- }
- } else if (fFieldMap[1]->Inside(xm[0], xm[1], xm[2])) {
- map = fFieldMap[1];
- } else if (fFieldMap[2]->Inside(xm[0], xm[1], xm[2])) {
- map = fFieldMap[2];
- }
-
- if(map){
- map->Field(xm,b);
- b[0] = - b[0];
- b[2] = - b[2];
-
- if(fFactor!=1) {
- b[0]*=fFactor;
- b[1]*=fFactor;
- b[2]*=fFactor;
- }
- } else {
- //This is the ZDC part
- ZDCField(x, b);
- }
-}
-
-//_______________________________________________________________________
-void AliMagFMaps::Copy(TObject & /* magf */) const
-{
- //
- // Copy *this onto magf -- Not implemented
- //
- AliFatal("Not implemented!");
-}
-
-//_______________________________________________________________________
-void AliMagFMaps::Streamer(TBuffer &R__b)
-{
- // Stream an object of class AliMagFMaps.
- if (R__b.IsReading()) {
- R__b.ReadClassBuffer(AliMagFMaps::Class(), this);
- //
- fReadField = kTRUE;
- ReadField();
- } else {
- R__b.WriteClassBuffer(AliMagFMaps::Class(), this);
- }
-}
+++ /dev/null
-#ifndef ALIMAGFMAPS_H
-#define ALIMAGFMAPS_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//
-// Magnetic field composed by 3 maps: the L3 magnet, extended region, and
-// dipole magnet
-// Author: Andreas Morsch <andreas.morsch@cern.ch>
-//
-
-#include "AliMagFC.h"
-class AliFieldMap;
-
-class AliMagFMaps : public AliMagFC
-{
- //Alice Magnetic Field with constant mesh
-
-public:
- enum constants {k2kG, k4kG, k5kG};
- AliMagFMaps();
- AliMagFMaps(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax, Int_t map = k2kG,
- Int_t l3 = 1);
- AliMagFMaps(const AliMagFMaps &mag);
- virtual ~AliMagFMaps();
- virtual void Field(const float *x, float *b) const;
- virtual void Field(const double *x, double *b) const;
- AliFieldMap* FieldMap(Int_t i) {return fFieldMap[i];}
- virtual void ReadField();
- virtual Float_t SolenoidField() const;
- virtual void SetL3ConstField(Int_t flag = 0) {fL3Option = flag;}
- virtual void SetL3ConstField(Float_t bsol, Int_t flag = 0)
- {fL3Option = flag; fSolenoidUser = bsol;}
-
- AliMagFMaps & operator=(const AliMagFMaps &magf)
- {magf.Copy(*this); return *this;}
-
-protected:
- void Copy(TObject &magf) const;
-
- AliFieldMap* fFieldMap[3]; // Field maps
- Float_t fSolenoid; // Solenoid field setting
- Float_t fSolenoidUser; // User set solenoid field setting
- Int_t fL3Option; // Option for field inside L3
- ClassDef(AliMagFMaps,4) // Class for all Alice MagField using three Maps with Constant Mesh
-};
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//------------------------------------------------------------------------
-// Magnetic field composed by 4 maps: the L3 magnet (inside and outside measured region),
-// extended region, and dipole magnet.
-// Used in the configuration macros (macros/Config.C, etc.)
-// Author: Andreas Morsch <andreas.morsch@cern.ch>
-//------------------------------------------------------------------------
-
-#include <TClass.h>
-#include <TFile.h>
-#include <TMath.h>
-#include <TSystem.h>
-
-#include "AliLog.h"
-#include "AliFieldMap.h"
-#include "AliMagFMapsV1.h"
-
-ClassImp(AliMagFMapsV1)
-
-
-//_______________________________________________________________________
-AliMagFMapsV1::AliMagFMapsV1():
- AliMagFMaps(),
- fMeasuredMap(0)
-{
- //
- // Default constructor
- //
-}
-
-//_______________________________________________________________________
-AliMagFMapsV1::AliMagFMapsV1(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax, Int_t map,
- Int_t l3):
- AliMagFMaps(name, title, integ, factor, fmax, map, l3),
- fMeasuredMap(0)
-{
- //
- // Constructor
- //
- char* fname;
- fname = gSystem->ExpandPathName("$(ALICE_ROOT)/data/maps/mfcheb.root");
- TFile* file = new TFile(fname);
- if (fMap == k2kG) {
- fMeasuredMap = dynamic_cast<AliMagFCheb*>(file->Get("Sol12_Dip6_Hole"));
- fSolenoid = 0.2; // T
- } else if (fMap == k5kG) {
- fMeasuredMap = dynamic_cast<AliMagFCheb*>(file->Get("Sol30_Dip6_Hole"));
- fSolenoid = 0.5; // T
- } else if (fMap == k4kG){
- fMeasuredMap = 0;
- fSolenoid = 0.4; // T
- }
-
-
-
- file->Close();
- delete file;
-}
-
-
-//_______________________________________________________________________
-AliMagFMapsV1::AliMagFMapsV1(const AliMagFMapsV1 &magf):
- AliMagFMaps(magf),
- fMeasuredMap(0)
-{
- //
- // Copy constructor
- //
- magf.Copy(*this);
-}
-
-//_______________________________________________________________________
-AliMagFMapsV1::~AliMagFMapsV1()
-{
- // Destructor
- delete fMeasuredMap;
-}
-
-//_______________________________________________________________________
-void AliMagFMapsV1::Field(const float *x, float *b) const
-{
- //
- // Method to calculate the magnetic field at position x
- //
- const float kRmax2 = 500. * 500.;
- const float kZmax = 550.;
- const float kTeslaTokG = 10.;
- const float kScale = 0.98838; // matching factor
-
- // Check if position inside measured map
- float r2 = x[0] * x[0] + x[1] * x[1];
- if (fMeasuredMap &&
- r2 < kRmax2 &&
- TMath::Abs(x[2]) < kZmax
- )
- {
- fMeasuredMap->Field(x, b);
- b[0] *= kTeslaTokG;
- b[1] *= kTeslaTokG;
- b[2] *= kTeslaTokG;
- } else {
- AliMagFMaps::Field(x, b);
- // Match to measure map
- b[0] = - b[0] * kScale;
- b[2] = - b[2] * kScale;
- b[1] = - b[1] * kScale;
- }
-}
-
-//_______________________________________________________________________
-void AliMagFMapsV1::Field(const double *x, double *b) const
-{
- //
- // Method to calculate the magnetic field at position x
- //
- const double kRmax2 = 500. * 500.;
- const double kZmax = 550.;
- const double kTeslaTokG = 10.;
- const double kScale = 0.98838; // matching factor
-
- // Check if position inside measured map
- double r2 = x[0] * x[0] + x[1] * x[1];
- if (fMeasuredMap &&
- r2 < kRmax2 &&
- TMath::Abs(x[2]) < kZmax
- )
- {
- fMeasuredMap->Field(x, b);
- b[0] *= kTeslaTokG;
- b[1] *= kTeslaTokG;
- b[2] *= kTeslaTokG;
- } else {
- AliMagFMaps::Field(x, b);
- // Match to measure map
- b[0] = - b[0] * kScale;
- b[2] = - b[2] * kScale;
- b[1] = - b[1] * kScale;
- }
-}
-
-
-Float_t AliMagFMapsV1::SolenoidField() const
-{
- //
- // Returns max. L3 (solenoid) field strength
- // according to field map setting
- //
- return fSolenoid;
-}
-
-void AliMagFMapsV1::Copy(TObject &fm) const
-{
- // dummy since the base class constructor is dummy
- AliMagFMaps::Copy(fm);
- AliMagFMapsV1* fmp = (AliMagFMapsV1*) &fm;
- fmp->SetMeasuredMap(fMeasuredMap);
-}
+++ /dev/null
-#ifndef ALIMAGFMAPSV1_H
-#define ALIMAGFMAPSV1_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//
-// Magnetic field composed by 4 maps: the L3 magnet (inside and outside measured region), extended region, and
-// dipole magnet
-// Author: Andreas Morsch <andreas.morsch@cern.ch>
-//
-
-#include "AliMagFMaps.h"
-#include "AliMagFCheb.h"
-
-
-class AliMagFMapsV1 : public AliMagFMaps
-{
-public:
- AliMagFMapsV1();
- AliMagFMapsV1(const char *name, const char *title, Int_t integ,
- Float_t factor, Float_t fmax, Int_t map = k2kG,
- Int_t l3 = 1);
- AliMagFMapsV1(const AliMagFMapsV1& maps);
- AliMagFMapsV1& operator=(const AliMagFMapsV1& maps) {maps.Copy(*this); return *this;}
- virtual ~AliMagFMapsV1();
- virtual void Field(const float *x, float *b) const;
- virtual void Field(const double *x, double *b) const;
- virtual Float_t SolenoidField() const;
- AliMagFCheb* GetMeasuredMap() const {return fMeasuredMap;}
- void SetMeasuredMap(AliMagFCheb* parm) {if (parm) delete parm; fMeasuredMap = parm;}
- protected:
- void Copy(TObject &magf) const;
- AliMagFCheb* fMeasuredMap; //! Measured part of the field map
- ClassDef(AliMagFMapsV1, 0) // Class for all Alice MagField using three Maps with Constant Mesh + measured L3 region
-};
-
-#endif
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TArrayD.h>
#include <TArrayF.h>
+#include <TArrayS.h>
+#include <TChain.h>
#include <TFile.h>
-#include <TList.h>
-#include <TSystem.h>
-#include <TROOT.h>
-#include <TPluginManager.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
+#include <TList.h>
#include <TLorentzVector.h>
-#include <TArrayS.h>
-#include <TArrayD.h>
-#include <TObjArray.h>
#include <TMap.h>
-#include <TChain.h>
+#include <TObjArray.h>
+#include <TPRegexp.h>
+#include <TParameter.h>
+#include <TPluginManager.h>
#include <TProof.h>
#include <TProofOutputFile.h>
-#include <TParameter.h>
+#include <TROOT.h>
+#include <TSystem.h>
-#include "AliReconstruction.h"
+#include "AliAlignObj.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#include "AliCTPRawStream.h"
+#include "AliCascadeVertexer.h"
+#include "AliCentralTrigger.h"
#include "AliCodeTimer.h"
-#include "AliReconstructor.h"
-#include "AliLog.h"
-#include "AliRunLoader.h"
-#include "AliRun.h"
-#include "AliRawReaderFile.h"
-#include "AliRawReaderDate.h"
-#include "AliRawReaderRoot.h"
-#include "AliRawEventHeaderBase.h"
-#include "AliRawEvent.h"
+#include "AliDAQ.h"
+#include "AliDetectorRecoParam.h"
+#include "AliESDCaloCells.h"
+#include "AliESDCaloCluster.h"
#include "AliESDEvent.h"
#include "AliESDMuonTrack.h"
-#include "AliESDfriend.h"
+#include "AliESDPmdTrack.h"
+#include "AliESDTagCreator.h"
#include "AliESDVertex.h"
#include "AliESDcascade.h"
+#include "AliESDfriend.h"
#include "AliESDkink.h"
-#include "AliESDtrack.h"
-#include "AliESDCaloCluster.h"
-#include "AliESDCaloCells.h"
-#include "AliMultiplicity.h"
-#include "AliTracker.h"
-#include "AliVertexer.h"
-#include "AliVertexerTracks.h"
-#include "AliV0vertexer.h"
-#include "AliCascadeVertexer.h"
-#include "AliHeader.h"
-#include "AliGenEventHeader.h"
-#include "AliPID.h"
#include "AliESDpid.h"
#include "AliESDtrack.h"
-#include "AliESDPmdTrack.h"
-
-#include "AliESDTagCreator.h"
-
+#include "AliESDtrack.h"
+#include "AliEventInfo.h"
+#include "AliGRPObject.h"
+#include "AliGRPRecoParam.h"
+#include "AliGenEventHeader.h"
#include "AliGeomManager.h"
-#include "AliTrackPointArray.h"
-#include "AliCDBManager.h"
-#include "AliCDBStorage.h"
-#include "AliCDBEntry.h"
-#include "AliAlignObj.h"
-
-#include "AliCentralTrigger.h"
-#include "AliTriggerConfiguration.h"
-#include "AliTriggerClass.h"
-#include "AliTriggerCluster.h"
-#include "AliCTPRawStream.h"
-
-#include "AliQADataMakerRec.h"
#include "AliGlobalQADataMaker.h"
+#include "AliHeader.h"
+#include "AliLog.h"
+#include "AliMagF.h"
+#include "AliMultiplicity.h"
+#include "AliPID.h"
+#include "AliPlaneEff.h"
#include "AliQA.h"
+#include "AliQADataMakerRec.h"
#include "AliQADataMakerSteer.h"
-
-#include "AliPlaneEff.h"
-
-#include "AliSysInfo.h" // memory snapshots
+#include "AliRawEvent.h"
+#include "AliRawEventHeaderBase.h"
#include "AliRawHLTManager.h"
-
-#include "AliMagFCheb.h"
-
-#include "AliDetectorRecoParam.h"
-#include "AliGRPRecoParam.h"
+#include "AliRawReaderDate.h"
+#include "AliRawReaderFile.h"
+#include "AliRawReaderRoot.h"
+#include "AliReconstruction.h"
+#include "AliReconstructor.h"
+#include "AliRun.h"
#include "AliRunInfo.h"
-#include "AliEventInfo.h"
-
-#include "AliDAQ.h"
-
-#include "AliGRPObject.h"
+#include "AliRunLoader.h"
+#include "AliSysInfo.h" // memory snapshots
+#include "AliTrackPointArray.h"
+#include "AliTracker.h"
+#include "AliTriggerClass.h"
+#include "AliTriggerCluster.h"
+#include "AliTriggerConfiguration.h"
+#include "AliV0vertexer.h"
+#include "AliVertexer.h"
+#include "AliVertexerTracks.h"
ClassImp(AliReconstruction)
AliReconstruction::AliReconstruction(const char* gAliceFilename) :
TSelector(),
fUniformField(kFALSE),
- fForcedFieldMap(NULL),
fRunVertexFinder(kTRUE),
fRunVertexFinderTracks(kTRUE),
fRunHLTTracking(kFALSE),
AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
TSelector(),
fUniformField(rec.fUniformField),
- fForcedFieldMap(NULL),
fRunVertexFinder(rec.fRunVertexFinder),
fRunVertexFinderTracks(rec.fRunVertexFinderTracks),
fRunHLTTracking(rec.fRunHLTTracking),
if(&rec == this) return *this;
fUniformField = rec.fUniformField;
- fForcedFieldMap = NULL;
fRunVertexFinder = rec.fRunVertexFinder;
fRunVertexFinderTracks = rec.fRunVertexFinderTracks;
fRunHLTTracking = rec.fRunHLTTracking;
CleanUp();
delete fGRPData;
- delete fForcedFieldMap;
fOptions.Delete();
if (fAlignObjArray) {
fAlignObjArray->Delete();
}
//_____________________________________________________________________________
-Bool_t AliReconstruction::SetFieldMap(Float_t l3Current, Float_t diCurrent, Float_t factor, const char *path) {
+Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, Float_t diPol,
+ Float_t beamenergy, Char_t *beamtype,const char *path) {
//------------------------------------------------
// The magnetic field map, defined externally...
// L3 current 30000 A -> 0.5 T
const Float_t tolerance=0.03; // relative current tolerance
const Float_t zero=77.; // "zero" current (A)
-
- Int_t map=0;
- Bool_t dipoleON=kFALSE;
-
- TString s=(factor < 0) ? "L3: -" : "L3: +";
-
- l3Current = TMath::Abs(l3Current);
- if (TMath::Abs(l3Current-l3NominalCurrent1)/l3NominalCurrent1 < tolerance) {
- map=AliMagFCheb::k5kG;
- s+="0.5 T; ";
- } else
- if (TMath::Abs(l3Current-l3NominalCurrent2)/l3NominalCurrent2 < tolerance) {
- map=AliMagFCheb::k2kG;
- s+="0.2 T; ";
- } else
- if (l3Current < zero) {
- map=AliMagFCheb::k2kG;
- s+="0.0 T; ";
- factor=0.; // in fact, this is a global factor...
+ //
+ TString s=(l3Pol < 0) ? "L3: -" : "L3: +";
+ //
+ AliMagF::BMap_t map = AliMagF::k5kG;
+ //
+ double fcL3,fcDip;
+ //
+ l3Cur = TMath::Abs(l3Cur);
+ if (TMath::Abs(l3Cur-l3NominalCurrent1)/l3NominalCurrent1 < tolerance) {
+ fcL3 = l3Cur/l3NominalCurrent1;
+ map = AliMagF::k5kG;
+ s += "0.5 T; ";
+ } else if (TMath::Abs(l3Cur-l3NominalCurrent2)/l3NominalCurrent2 < tolerance) {
+ fcL3 = l3Cur/l3NominalCurrent2;
+ map = AliMagF::k2kG;
+ s += "0.2 T; ";
+ } else if (l3Cur <= zero) {
+ fcL3 = 0;
+ map = AliMagF::k5kGUniform;
+ s += "0.0 T; ";
fUniformField=kTRUE; // track with the uniform (zero) B field
} else {
- AliError(Form("Wrong L3 current (%f A)!",l3Current));
+ AliError(Form("Wrong L3 current (%f A)!",l3Cur));
return kFALSE;
}
-
- diCurrent = TMath::Abs(diCurrent);
- if (TMath::Abs(diCurrent-diNominalCurrent)/diNominalCurrent < tolerance) {
+ //
+ diCur = TMath::Abs(diCur);
+ if (TMath::Abs(diCur-diNominalCurrent)/diNominalCurrent < tolerance) {
// 3% current tolerance...
- dipoleON=kTRUE;
- s+="Dipole ON";
- } else
- if (diCurrent < zero) { // some small current..
- dipoleON=kFALSE;
- s+="Dipole OFF";
+ fcDip = diCur/diNominalCurrent;
+ s += "Dipole ON";
+ } else if (diCur <= zero) { // some small current..
+ fcDip = 0.;
+ s += "Dipole OFF";
} else {
- AliError(Form("Wrong dipole current (%f A)!",diCurrent));
+ AliError(Form("Wrong dipole current (%f A)!",diCur));
return kFALSE;
}
-
- delete fForcedFieldMap;
- fForcedFieldMap=
- new AliMagFCheb("B field map ",s,2,factor,10.,map,dipoleON,path);
-
- fForcedFieldMap->Print();
-
- AliTracker::SetFieldMap(fForcedFieldMap,fUniformField);
-
+ //
+ if (l3Pol!=diPol && (map==AliMagF::k5kG || map==AliMagF::k2kG) && fcDip!=0) {
+ AliError("L3 and Dipole polarities must be the same");
+ return kFALSE;
+ }
+ //
+ if (l3Pol<0) fcL3 = -fcL3;
+ if (diPol<0) fcDip = -fcDip;
+ //
+ AliMagF::BeamType_t btype = AliMagF::kNoBeamField;
+ TString btypestr = beamtype;
+ btypestr.ToLower();
+ TPRegexp protonBeam("(proton|p)\\s*-?\\s*\\1");
+ TPRegexp ionBeam("(lead|pb|ion|a)\\s*-?\\s*\\1");
+ if (btypestr.Contains(ionBeam)) btype = AliMagF::kBeamTypeAA;
+ else if (btypestr.Contains(protonBeam)) btype = AliMagF::kBeamTypepp;
+ else {
+ AliInfo(Form("Cannot determine the beam type from %s, assume no LHC magnet field",beamtype));
+ }
+
+ AliMagF* fld = new AliMagF("MagneticFieldMap", s.Data(), 2, fcL3, fcDip, 10., map, path,
+ btype,beamenergy,kTRUE);
+ TGeoGlobalMagField::Instance()->SetField( fld );
+ TGeoGlobalMagField::Instance()->Lock();
+ //
return kTRUE;
}
AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0");
beamEnergy = 0;
}
+ // energy is provided in MeV*120
+ beamEnergy /= 120E3;
TString runType = fGRPData->GetRunType();
if (runType==AliGRPObject::GetInvalidString()) {
AliInfo("===================================================================================");
//*** Dealing with the magnetic field map
- if (AliTracker::GetFieldMap()) {
- AliInfo("Running with the externally set B field !");
- } else {
+ if ( TGeoGlobalMagField::Instance()->IsLocked() ) {AliInfo("Running with the externally locked B field !");}
+ else {
// Construct the field map out of the information retrieved from GRP.
-
Bool_t ok = kTRUE;
-
// L3
Float_t l3Current = fGRPData->GetL3Current((AliGRPObject::Stats)0);
if (l3Current == AliGRPObject::GetInvalidFloat()) {
AliError("GRP/GRP/Data entry: missing value for the L3 current !");
ok = kFALSE;
}
-
+
Char_t l3Polarity = fGRPData->GetL3Polarity();
if (l3Polarity == AliGRPObject::GetInvalidChar()) {
AliError("GRP/GRP/Data entry: missing value for the L3 polarity !");
*/
if (ok) {
- Float_t l3Cur=TMath::Abs(l3Current);
- Float_t diCur=TMath::Abs(diCurrent);
- Float_t l3Pol=l3Polarity;
- // Float_t l3Cur=TMath::Abs(atof(l3Current->GetName()));
- //Float_t diCur=TMath::Abs(atof(diCurrent->GetName()));
- //Float_t l3Pol=atof(l3Polarity->GetName());
- Float_t factor=1.;
- if (l3Pol != 0.) factor=-1.;
-
-
- if (!SetFieldMap(l3Cur, diCur, factor)) {
- AliFatal("Failed to creat a B field map ! Exiting...");
- }
+ if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1) )
+ AliFatal("Failed to creat a B field map ! Exiting...");
AliInfo("Running with the B field constructed out of GRP !");
}
- else {
- AliFatal("B field is neither set nor constructed from GRP ! Exitig...");
- }
-
+ else AliFatal("B field is neither set nor constructed from GRP ! Exitig...");
+
}
-
+
//*** Get the diamond profiles from OCDB
entry = AliCDBManager::Instance()->Get("GRP/Calib/MeanVertexSPD");
if (entry) {
gGeoManager = NULL;
fInput->Add(const_cast<TMap*>(AliCDBManager::Instance()->GetEntryCache()));
fInput->Add(new TParameter<Int_t>("RunNumber",AliCDBManager::Instance()->GetRun()));
- AliMagF *magFieldMap = (AliMagF*)AliTracker::GetFieldMap();
+ AliMagF *magFieldMap = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
magFieldMap->SetName("MagneticFieldMap");
fInput->Add(magFieldMap);
}
}
}
if (AliMagF *map = (AliMagF*)fInput->FindObject("MagneticFieldMap")) {
- AliTracker::SetFieldMap(map,fUniformField);
+ TGeoGlobalMagField::Instance()->SetField(map);
}
if (TNamed *outputFileName = (TNamed *) fInput->FindObject("PROOF_OUTPUTFILE")) {
outProofFile = new TProofOutputFile(gSystem->BaseName(TUrl(outputFileName->GetTitle()).GetFile()));
//*** Magnetic field setters
void SetUniformFieldTracking(Bool_t flag=kTRUE){fUniformField=flag;}
- Bool_t
- SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000.,
- Float_t factor=1.,
- const char *path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+ Bool_t SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000.,
+ Float_t l3Pol=1., Float_t dipPol=1., Float_t benergy=7000., char* btype="pp",
+ const char *path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
//*** Global reconstruction flag setters
void SetRunVertexFinder(Bool_t flag=kTRUE) {fRunVertexFinder=flag;};
//*** Magnetic field map settings *******************
Bool_t fUniformField; // uniform field tracking flag
- AliMagF *fForcedFieldMap; //! independent, not GRP, field map
//*** Global reconstruction flags *******************
Bool_t fRunVertexFinder; // run the vertex finder
#include "AliDetector.h"
#include "AliHeader.h"
#include "AliMC.h"
-#include "AliMagFC.h"
-#include "AliMagFCM.h"
-#include "AliMagFDM.h"
#include "AliPDG.h"
#include "AliRun.h"
#include "AliStack.h"
fEventNrInRun(-1),
fModules(0),
fMCApp(0),
- fField(0),
fNdets(0),
fConfigFunction(""),
fRandom(0),
fEventNrInRun(-1),
fModules(new TObjArray(77)), // Support list for the Detectors
fMCApp(new AliMC(GetName(),GetTitle())),
- fField(0),
fNdets(0),
fConfigFunction("Config();"),
fRandom(new TRandom3()),
// Add to list of browsable
gROOT->GetListOfBrowsables()->Add(this,name);
- // Create default mag field
- fField = new AliMagFC("Map1"," ",2.,1.,10.);
-
}
}
}
- delete fField;
delete fMCApp;
delete gMC; gMC=0;
if (fModules) {
}
-//_______________________________________________________________________
-void AliRun::SetField(AliMagF* magField)
-{
- //
- // Set Magnetic Field Map
- //
- fField = magField;
- fField->ReadField();
-}
//_______________________________________________________________________
void AliRun::SetRootGeometry(Bool_t flag)
}
}
-//
-// MC Application
-//
-
-//_______________________________________________________________________
-void AliRun::Field(const Double_t* x, Double_t *b) const
-{
- //
- // Return the value of the magnetic field
- //
-
- if (Field()) Field()->Field(x,b);
-
- else {
- AliError("No mag field defined!");
- b[0]=b[1]=b[2]=0.;
- }
-
-
-}
-
-//
-// End of MC Application
-//
//_______________________________________________________________________
void AliRun::Streamer(TBuffer &R__b)
TObjArray *Detectors() const {return fModules;}
TObjArray *Modules() const {return fModules;}
- virtual AliMagF *Field() const {return fField;}
void AddModule(AliModule* mod);
Int_t GetEvNumber() const;
Int_t GetRunNumber() const {return fRun;}
const char* GetTriggerDescriptor() const {return fTriggerDescriptor.Data();}
void SetTriggerDescriptor(const char *name) {fTriggerDescriptor = name;}
virtual void SetBaseFile(const char *filename="galice.root");
- virtual void SetField(AliMagF* magField);
-
- virtual void Field(const Double_t* x, Double_t* b) const;
-
//
// End of MC Application
Int_t fEventNrInRun; //! Current unique event number in run
TObjArray *fModules; // List of Detectors
AliMC *fMCApp; // Pointer to virtual MC Application
- AliMagF *fField; // Magnetic Field Map
Int_t fNdets; // Number of detectors
TString fConfigFunction; // Configuration file to be executed
TRandom *fRandom; // Pointer to the random number generator
AliRun(const AliRun&); // Not implemented
AliRun& operator = (const AliRun&); // Not implemented
- ClassDef(AliRun,12) //Supervisor class for all Alice detectors
+ ClassDef(AliRun,13) //Supervisor class for all Alice detectors
};
R__EXTERN AliRun *gAlice;
#include <TCint.h>
#include <TFile.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
#include <TObjString.h>
#include <TROOT.h>
#include "AliGeomManager.h"
#include "AliHLTSimulation.h"
#include "AliHeader.h"
+#include "AliLego.h"
+#include "AliLegoGenerator.h"
#include "AliLog.h"
#include "AliMC.h"
#include "AliMagF.h"
#include "AliSimulation.h"
#include "AliSysInfo.h"
#include "AliVertexGenFile.h"
-#include "AliLegoGenerator.h"
-#include "AliLego.h"
ClassImp(AliSimulation)
} else {
AliWarning("Run number not initialized!!");
}
-
+
AliRunLoader::GetRunLoader()->CdGAFile();
AliPDG::AddParticlesToPdgDataBase();
gAlice->GetMCApp()->Init();
+ gMC->SetMagField(TGeoGlobalMagField::Instance()->GetField());
+
+
//Must be here because some MCs (G4) adds detectors here and not in Config.C
gAlice->InitLoaders();
AliRunLoader::GetRunLoader()->MakeTree("E");
AliPDG::AddParticlesToPdgDataBase();
gAlice->GetMCApp()->Init();
+
+ gMC->SetMagField(TGeoGlobalMagField::Instance()->GetField());
//Must be here because some MCs (G4) adds detectors here and not in Config.C
gAlice->InitLoaders();
AliPDG::AddParticlesToPdgDataBase();
gAlice->GetMCApp()->Init();
+
+ gMC->SetMagField(TGeoGlobalMagField::Instance()->GetField());
//Must be here because some MCs (G4) adds detectors here and not in Config.C
gAlice->InitLoaders();
grpObj->SetLHCLuminosity(0,(AliGRPObject::Stats)0);
grpObj->SetBeamIntensity(0,(AliGRPObject::Stats)0);
- AliMagF *field = gAlice->Field();
- Float_t solenoidField = TMath::Abs(field->SolenoidField());
- Float_t factor = field->Factor();
+ AliMagF *field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ Float_t solenoidField = field ? TMath::Abs(field->SolenoidField()) : 0;
+ Float_t factor = field ? field->Factor() : 0;
Float_t l3current = TMath::Abs(factor)*solenoidField*30000./5.;
grpObj->SetL3Current(l3current,(AliGRPObject::Stats)0);
class AliRunLoader;
class AliLegoGenerator;
class AliLego;
+class AliMagF;
class AliSimulation: public TNamed {
public:
p.SetVolumeID(fVolumeID[i]);
p.SetCharge(fCharge[i]);
p.SetDriftTime(fDriftTime[i]);
- p.SetExtra(fIsExtra[i]);
+ p.SetExtra(fIsExtra ? fIsExtra[i] : kFALSE);
return kTRUE;
}
extern TGeoManager *gGeoManager;
-Bool_t AliTracker::fgUniformField=kTRUE;
-Double_t AliTracker::fgBz=kAlmost0Field;
-const AliMagF *AliTracker::fgkFieldMap=0;
Bool_t AliTracker::fFillResiduals=kFALSE;
TObjArray **AliTracker::fResiduals=NULL;
AliRecoParam::EventSpecie_t AliTracker::fEventSpecie=AliRecoParam::kDefault;
//--------------------------------------------------------------------
// The default constructor.
//--------------------------------------------------------------------
- if (!fgkFieldMap) AliWarning("Field map is not set. Call AliTracker::SetFieldMap before creating a tracker!");
+ if (!TGeoGlobalMagField::Instance()->GetField())
+ AliWarning("Field map is not set.");
}
//__________________________________________________________________________
//--------------------------------------------------------------------
// The default constructor.
//--------------------------------------------------------------------
- if (!fgkFieldMap) AliWarning("Field map is not set. Call AliTracker::SetFieldMap before creating a tracker!");
+ if (!TGeoGlobalMagField::Instance()->GetField())
+ AliWarning("Field map is not set.");
}
//__________________________________________________________________________
-void AliTracker::SetFieldMap(const AliMagF* map, Bool_t uni) {
- //--------------------------------------------------------------------
- //This passes the field map to the reconstruction.
- //--------------------------------------------------------------------
- if (map==0) AliFatalClass("Can't access the field map !");
-
- if (fgkFieldMap) {
- AliWarningClass("The magnetic field map has been already set !");
- return;
- }
-
- fgUniformField=uni;
- fgkFieldMap=map;
-
- //Float_t r[3]={0.,0.,0.},b[3]; map->Field(r,b);
- //Double_t bz=-b[2];
-
- Double_t bz=-map->SolenoidField();
- fgBz=TMath::Sign(kAlmost0Field,bz) + bz;
+Double_t AliTracker::GetBz()
+{
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ if (!fld) return kAlmost0Field;
+ Double_t bz = -fld->SolenoidField();
+ return TMath::Sign(kAlmost0Field,bz) + bz;
+}
+//__________________________________________________________________________
+Double_t AliTracker::GetBz(const Double_t *r) {
+ //------------------------------------------------------------------
+ // Returns Bz (kG) at the point "r" .
+ //------------------------------------------------------------------
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ if (!fld) return kAlmost0Field;
+ Double_t bz = -fld->GetBz(r);
+ return TMath::Sign(kAlmost0Field,bz) + bz;
}
//__________________________________________________________________________
}
}
-Double_t AliTracker::GetBz(const Float_t *r) {
- //------------------------------------------------------------------
- // Returns Bz (kG) at the point "r" .
- //------------------------------------------------------------------
- Float_t b[3]; fgkFieldMap->Field(r,b);
- Double_t bz=-Double_t(b[2]);
- return (TMath::Sign(kAlmost0Field,bz) + bz);
-}
-
-Double_t
-AliTracker::MeanMaterialBudget(const Double_t *start, const Double_t *end, Double_t *mparam)
+Double_t AliTracker::MeanMaterialBudget(const Double_t *start, const Double_t *end, Double_t *mparam)
{
//
// Calculate mean material budget and material properties between
// that is the base for AliTPCtracker, AliITStrackerV2 and AliTRDtracker
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
+
+#include <TGeoGlobalMagField.h>
#include <TObject.h>
-#include <AliPlaneEff.h>
-#include "AliRecoParam.h"
+#include "AliMagF.h"
+#include "AliRecoParam.h"
+#include "AliPlaneEff.h"
class TTree;
-class AliMagF;
class AliCluster;
-class AliKalmanTrack;
class AliESDEvent;
class AliESDtrack;
class AliExternalTrackParam;
class AliTrackPoint;
-
+class AliKalmanTrack;
class AliTracker : public TObject {
public:
AliTracker();
static
Bool_t PropagateTrackTo(AliExternalTrackParam *track, Double_t x, Double_t m,
Double_t maxStep, Bool_t rotateTo=kTRUE, Double_t maxSnp=0.8);
-
- static void SetFieldMap(const AliMagF* map, Bool_t uni);
- static const AliMagF *GetFieldMap() {return fgkFieldMap;}
- static Double_t GetBz(const Float_t *r);
- static Double_t GetBz(const Double_t *r) {
- Float_t rr[]={r[0],r[1],r[2]};
- return GetBz(rr);
- }
- static Double_t GetBz() {return fgBz;}
- static Bool_t UniformField() {return fgUniformField;}
-
+ //
+ static Double_t GetBz(const Double_t *r);
+ static Double_t GetBz();
+ static Bool_t UniformField();
+ //
static void FillResiduals(const AliExternalTrackParam *t,
Double_t *p, Double_t *cov,
UShort_t id, Bool_t updated=kTRUE);
AliTracker(const AliTracker &atr);
private:
AliTracker & operator=(const AliTracker & atr);
-
- static Bool_t fgUniformField; // uniform field flag
- static const AliMagF *fgkFieldMap; //! field map
- static Double_t fgBz; // Nominal Bz (kG)
-
static Bool_t fFillResiduals; // Fill residuals flag
static TObjArray **fResiduals; //! Array of histograms with residuals
ClassDef(AliTracker,4) //abstract tracker
};
-#endif
-
+//__________________________________________________________________________
+inline Bool_t AliTracker::UniformField()
+{
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ return fld ? fld->IsUniform():kTRUE;
+}
+#endif
// Author: A. Dainese
//-------------------------------------------------------------------------
+#include <TGeoGlobalMagField.h>
+
+#include "AliMagF.h"
#include "AliVTrack.h"
ClassImp(AliVTrack)
return *this;
}
+Double_t AliVTrack::GetBz() const
+{
+ // returns Bz component of the magnetic field (kG)
+ AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+ if (!fld) return kAlmost0Field;
+ double bz;
+ if (fld->IsUniform()) bz = -fld->SolenoidField();
+ else {
+ Double_t r[3];
+ GetXYZ(r);
+ bz = -fld->GetBz(r);
+ }
+ return TMath::Sign(kAlmost0Field,bz) + bz;
+}
virtual UChar_t GetITSClusterMap() const = 0;
virtual ULong_t GetStatus() const = 0;
virtual Bool_t GetXYZ(Double_t *p) const = 0;
+ virtual Double_t GetBz() const;
virtual Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const = 0;
ClassDef(AliVTrack,0) // base class for tracks
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
+
#include "AliABSO.h"
#include "AliRun.h"
#include "AliMagF.h"
//
// Define materials for muon absorber
//
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
//
// Air
//
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
#include "AliBODY.h"
void AliBODY::CreateMaterials()
{
// Create materials and media
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// AIR
// //
// //
-#include <TVirtualMC.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoVolume.h>
+#include <TVirtualMC.h>
#include "AliConst.h"
#include "AliDIPOv2.h"
// Create Materials for Magnetic Dipole version 2
//
- Int_t isxfld1 = gAlice->Field()->Integ();
- Int_t isxfld2 = gAlice->Field()->PrecInteg();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld1 = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Int_t isxfld2 = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
// Author: A.Morsch
//------------------------------------------------------------------------
-#include <TSystem.h>
-#include <TVirtualMC.h>
-#include <TString.h>
-#include <TGeoManager.h>
#include <TGeoBBox.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoPgon.h>
-#include <TGeoCompositeShape.h>
+#include <TString.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+
#include "AliFRAMEv2.h"
#include "AliMagF.h"
#include "AliRun.h"
tmaxfd = -20.; // Maximum angle due to field deflection
deemax = -.3; // Maximum fractional energy loss, DLS
stmin = -.8;
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
#include "AliConst.h"
//
Int_t isxfld = 0;
- Float_t sxmgmx = gAlice->Field()->Max();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
// //
///////////////////////////////////////////////////////////////////////////////
-#include <TVirtualMC.h>
-#include <TGeoMedium.h>
-#include <TGeoVolume.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TGeoMatrix.h>
+#include <TGeoMedium.h>
#include <TGeoPgon.h>
+#include <TGeoVolume.h>
#include <TGeoXtru.h>
-#include <TGeoCompositeShape.h>
-#include <TGeoManager.h>
+#include <TVirtualMC.h>
#include "AliMAG.h"
#include "AliMagF.h"
// Create materials for L3 magnet
//
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t epsil, stmin, deemax, tmaxfd, stemax;
#include <Riostream.h>
+#include <TGeoGlobalMagField.h>
#include <TSystem.h>
#include <TVirtualMC.h>
//
AliDebugClass(1,"Create PIPEv0 materials");
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Steel (Inox)
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
Float_t zsteel[4] = { 26.,24.,28.,14. };
// Create materials for beam pipe
//
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
Float_t zsteel[4] = { 26.,24.,28.,14. };
#include <Riostream.h>
-#include <TSystem.h>
-#include <TVirtualMC.h>
+#include <TGeoBBox.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoCone.h>
+#include <TGeoGlobalMagField.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
-#include <TGeoVolume.h>
+#include <TGeoPcon.h>
#include <TGeoTorus.h>
#include <TGeoTube.h>
-#include <TGeoCone.h>
-#include <TGeoPcon.h>
-#include <TGeoBBox.h>
+#include <TGeoVolume.h>
#include <TGeoXtru.h>
-#include <TGeoCompositeShape.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
#include "AliConst.h"
#include "AliMagF.h"
//
AliDebugClass(1,"Create PIPEv3 materials");
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Steel (Inox)
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
Float_t zsteel[4] = { 26.,24.,28.,14. };
//
if(fDebug) printf("%s: Create PIPEvTemp materials \n",ClassName());
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Steel (Inox)
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
Float_t zsteel[4] = { 26.,24.,28.,14. };
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
+
#include "AliSHIL.h"
#include "AliRun.h"
#include "AliMagF.h"
//
// Defines materials for the muon shield
//
- Int_t isxfld1 = gAlice->Field()->Integ();
- Int_t isxfld2 = gAlice->Field()->PrecInteg();
+ Int_t isxfld1 = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Int_t isxfld2 = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Steel
Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
Float_t zsteel[4] = { 26.,24.,28.,14. };
#include <Riostream.h>
#include <stdlib.h>
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>
#include <TMath.h>
#include <TVirtualMC.h>
//------------------------------------------------------------------------
void AliT0v0::CreateMaterials()
{
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t a,z,d,radl,absl,buf[1];
Int_t nbuf;
#include <Riostream.h>
#include <stdlib.h>
-#include <TLorentzVector.h>
-#include <TMath.h>
-#include <TVirtualMC.h>
+#include "TGeoCompositeShape.h"
#include "TGeoManager.h"
#include "TGeoMatrix.h"
#include "TGeoPcon.h"
#include "TGeoTube.h"
-#include "TGeoCompositeShape.h"
+#include <TGeoGlobalMagField.h>
#include <TGraph.h>
+#include <TLorentzVector.h>
+#include <TMath.h>
+#include <TVirtualMC.h>
#include "AliLog.h"
#include "AliMagF.h"
//------------------------------------------------------------------------
void AliT0v1::CreateMaterials()
{
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// Float_t a,z,d,radl,absl,buf[1];
// Int_t nbuf;
// AIR
//////////////////////////////////////////////////////////////////////
void AliT0v2::CreateMaterials()
{
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t a, z, d, radl, absl, buf[1];
Int_t nbuf;
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
-
// This part for configuration
static PprGeo_t sgeo = kHoles;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
// Comment line
static TString comment;
// Functions
Float_t EtaToTheta(Float_t arg);
-
void Config()
{
cout << "==> Config.C..." << endl;
//
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
+ AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
Int_t iABSO = 0;
Int_t iACORDE = 0;
#include "EVGEN/AliGenSlowNucleons.h"
#include "EVGEN/AliSlowNucleonModelExp.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
-
// This part for configuration
static PprRun_t srun = test50;
//static PprRun_t srun = kPythia6;
static PprGeo_t sgeo = kNoHoles;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static BMap_t smag = AliMagF::k5kG;
// Comment line
static TString comment;
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
+ TGeoGlobalMagField::Instance()->SetField(field);
field->SetL3ConstField(0); //Using const. field in the barrel
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 0;
Int_t iDIPO = 0;
return 0;
}
-//_____________________________________________________________________________
-Double_t AliTOFtrack::GetBz() const {
- //
- // returns Bz component of the magnetic field (kG)
- //
- if (AliTracker::UniformField()) return AliTracker::GetBz();
- Double_t r[3]; GetXYZ(r);
- return AliTracker::GetBz(r);
-}
//_____________________________________________________________________________
void AliTOFtrack::GetPropagationParameters(Double_t *param) {
}
protected:
- Double_t GetBz() const;
Bool_t Update(const AliCluster */*c*/, Double_t /*chi2*/, Int_t /*idx*/) {
return 0;
}
// Revision: F. Pierella 18-VI-2002
//
- AliMagF *magneticField = (AliMagF*)gAlice->Field();
+ AliMagF *magneticField = (AliMagF*)((AliMagF*)TGeoGlobalMagField::Instance()->GetField());
Int_t isxfld = magneticField->Integ();
Float_t sxmgmx = magneticField->Max();
// //
///////////////////////////////////////////////////////////////////////////////
-#include "TDirectory.h"
-#include "TLorentzVector.h"
-#include "TVirtualMC.h"
-#include "TGeoManager.h"
+#include <TDirectory.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoPhysicalNode.h>
#include <TGeoVolume.h>
+#include <TLorentzVector.h>
+#include <TVirtualMC.h>
#include "AliConst.h"
#include "AliGeomManager.h"
//AliTOF::CreateMaterials();
- AliMagF *magneticField = (AliMagF*)gAlice->Field();
+ AliMagF *magneticField = (AliMagF*)((AliMagF*)TGeoGlobalMagField::Instance()->GetField());
Int_t isxfld = magneticField->Integ();
Float_t sxmgmx = magneticField->Max();
// //
///////////////////////////////////////////////////////////////////////////////
-#include "TDirectory.h"
-#include "TLorentzVector.h"
-#include "TVirtualMC.h"
-#include "TGeoManager.h"
+#include <TDirectory.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoPhysicalNode.h>
#include <TGeoVolume.h>
+#include <TLorentzVector.h>
+#include <TVirtualMC.h>
#include "AliConst.h"
#include "AliGeomManager.h"
//AliTOF::CreateMaterials();
- AliMagF *magneticField = (AliMagF*)gAlice->Field();
+ AliMagF *magneticField = (AliMagF*)((AliMagF*)TGeoGlobalMagField::Instance()->GetField());
Int_t isxfld = magneticField->Integ();
Float_t sxmgmx = magneticField->Max();
#include "AliESD.h"
#include "AliTracker.h"
#include "AliTPCParam.h"
- #include "AliMagFMaps.h"
+ #include "AliMagF.h"
#include "AliITStrackV2.h"
#endif
gAlice = rl->GetAliRun();
// Set magnetic field
- AliMagF* field = gAlice->Field();
- AliTracker::SetFieldMap(field,kTRUE);
- AliExternalTrackParam::SetFieldMap(field);
+ AliMagF* field = TGeoGlobalMagField::Instance()->GetField();
AliExternalTrackParam::SetNonuniformFieldTracking();
const Float_t sfield = field->SolenoidField();
#include <Riostream.h>
#include <stdlib.h>
+#include <TF2.h>
#include <TFile.h>
+#include <TGeoGlobalMagField.h>
#include <TInterpreter.h>
#include <TMath.h>
#include <TMatrixF.h>
-#include <TVector.h>
#include <TObjectTable.h>
#include <TParticle.h>
#include <TROOT.h>
#include <TRandom.h>
+#include <TStopwatch.h>
+#include <TString.h>
#include <TSystem.h>
#include <TTree.h>
+#include <TVector.h>
#include <TVirtualMC.h>
-#include <TString.h>
-#include <TF2.h>
-#include <TStopwatch.h>
#include "AliDigits.h"
#include "AliMagF.h"
// Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
//-----------------------------------------------------------------
- Int_t iSXFLD=gAlice->Field()->Integ();
- Float_t sXMGMX=gAlice->Field()->Max();
+ Int_t iSXFLD=((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sXMGMX=((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t amat[5]; // atomic numbers
Float_t zmat[5]; // z
//-----------------------------------------------------------------
AliTPCcalibDB* const calib=AliTPCcalibDB::Instance();
if (gAlice){ // Set correctly the magnetic field in the ExB calculation
- AliMagF * field = gAlice->Field();
+ AliMagF * field = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField());
if (field) {
calib->SetExBField(field->SolenoidField());
}
//
AliMagF *mag = (AliMagF*)fgArray.At(index);
if (!mag) return 0;
- Float_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
+ Double_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
// xyz[1]+=30;
- Float_t bxyz[3];
+ Double_t bxyz[3];
mag->Field(xyz,bxyz);
return bxyz[0];
}
//
AliMagF *mag = (AliMagF*)fgArray.At(index);
if (!mag) return 0;
- Float_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
+ Double_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
// xyz[1]+=30;
- Float_t bxyz[3];
+ Double_t bxyz[3];
mag->Field(xyz,bxyz);
return bxyz[1];
}
//
AliMagF *mag = (AliMagF*)fgArray.At(index);
if (!mag) return 0;
- Float_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
+ Double_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
// xyz[1]+=30;
- Float_t bxyz[3];
+ Double_t bxyz[3];
mag->Field(xyz,bxyz);
return bxyz[2];
}
//
AliMagF *mag = (AliMagF*)fgArray.At(index);
if (!mag) return 0;
- Float_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
+ Double_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
//xyz[1]+=30;
- Float_t bxyz[3];
+ Double_t bxyz[3];
mag->Field(xyz,bxyz);
if (r==0) return 0;
- Float_t br = (bxyz[0]*xyz[0]+bxyz[1]*xyz[1])/r;
+ Double_t br = (bxyz[0]*xyz[0]+bxyz[1]*xyz[1])/r;
return br;
}
//
AliMagF *mag = (AliMagF*)fgArray.At(index);
if (!mag) return 0;
- Float_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
+ Double_t xyz[3]={r*TMath::Cos(phi),r*TMath::Sin(phi),z};
//xyz[1]+=30;
- Float_t bxyz[3];
+ Double_t bxyz[3];
mag->Field(xyz,bxyz);
if (r==0) return 0;
- Float_t br = (-bxyz[0]*xyz[1]+bxyz[1]*xyz[0])/r;
+ Double_t br = (-bxyz[0]*xyz[1]+bxyz[1]*xyz[0])/r;
return br;
}
#include "TMath.h"
#include "TTreeStream.h"
-#include "AliFieldMap.h"
#include "AliMagF.h"
#include "AliTPCExBExact.h"
AliTPCExBExact::AliTPCExBExact()
: fDriftVelocity(0),
- fkMap(0),fkField(0),fkN(0),
+ //fkMap(0),
+ fkField(0),fkN(0),
fkNX(0),fkNY(0),fkNZ(0),
fkXMin(-250.),fkXMax(250.),fkYMin(-250.),fkYMax(250.),
fkZMin(-250.),fkZMax(250.),
Double_t driftVelocity,
Int_t nx,Int_t ny,Int_t nz,Int_t n)
: fDriftVelocity(driftVelocity),
- fkMap(0),fkField(bField),fkN(n),
+ //fkMap(0),
+ fkField(bField),fkN(n),
fkNX(nx),fkNY(ny),fkNZ(nz),
fkXMin(-250.),fkXMax(250.),fkYMin(-250.),fkYMax(250.),
fkZMin(-250.),fkZMax(250.),
CreateLookupTable();
}
+/*
AliTPCExBExact::AliTPCExBExact(const AliFieldMap *bFieldMap,
Double_t driftVelocity,Int_t n)
: fDriftVelocity(driftVelocity),
CreateLookupTable();
}
+*/
AliTPCExBExact::~AliTPCExBExact() {
//
// corrected[2]=position[2];
}
+/*
void AliTPCExBExact::TestThisBeautifulObject(const AliFieldMap *bFieldMap,
const char* fileName) {
//
fkField=0;
TestThisBeautifulObjectGeneric(fileName);
}
+*/
void AliTPCExBExact::TestThisBeautifulObject(const AliMagF *bField,
const char* fileName) {
// Have a look at the common part "TestThisBeautifulObjectGeneric".
//
fkField=bField;
- fkMap=0;
+ //fkMap=0;
TestThisBeautifulObjectGeneric(fileName);
}
//
// Helper function returning the B field in SI units (T).
//
- Float_t xm[3];
+ Double_t xm[3];
// the beautiful m to cm (and the ugly "const_cast") and Double_t
// to Float_t read the NRs introduction!:
for (int i=0;i<3;++i) xm[i]=x[i]*100.;
- Float_t bf[3];
- if (fkMap!=0)
- fkMap->Field(xm,bf);
- else
- fkField->Field(xm,bf);
+ Double_t bf[3];
+ //if (fkMap!=0)
+ // fkMap->Field(xm,bf);
+ //else
+ ((AliMagF*)fkField)->Field(xm,bf);
for (int i=0;i<3;++i) b[i]=bf[i]/10.;
}
#include "AliTPCExB.h"
-class AliFieldMap;
class AliMagF;
class AliTPCExBExact:public AliTPCExB {
public:
AliTPCExBExact(); // just for the I/O stuff
- AliTPCExBExact(const AliFieldMap *bFieldMap,Double_t driftVelocity,
- Int_t n=100);
+ //AliTPCExBExact(const AliMagF *bFieldMap,Double_t driftVelocity,Int_t n=100);
AliTPCExBExact(const AliMagF *bField,Double_t driftVelocity,Int_t n=100,
Int_t nx=30,Int_t ny=30,Int_t nz=100);
virtual ~AliTPCExBExact();
virtual void Correct(const Double_t *position,Double_t *corrected);
- void TestThisBeautifulObject(const AliFieldMap *bFieldMap,
- const char* fileName);
+ //void TestThisBeautifulObject(const AliFieldMap *bFieldMap,const char* fileName);
void TestThisBeautifulObject(const AliMagF *bField,const char* fileName);
protected:
Double_t fDriftVelocity; // The electron drift velocity.
void Motion(const Double_t *x,Double_t t,Double_t *dxdt) const;
void CalculateDistortion(const Double_t *x,Double_t *dist) const;
void DGLStep(Double_t *x,Double_t t,Double_t h) const;
- const AliFieldMap *fkMap; //! the magnetic field map as supplied by the user
+ //const AliFieldMap *fkMap; //! the magnetic field map as supplied by the user
const AliMagF *fkField; //! the magnetic field as supplied by the user
Int_t fkN; // max number of integration steps
Int_t fkNX; // field mesh points in x direction
#include "TMath.h"
-#include "AliFieldMap.h"
+//#include "AliFieldMap.h"
#include "AliMagF.h"
#include "TTreeStream.h"
#include "AliTPCExBFirst.h"
// drift velocity. Since some kind of lookuptable is created the
// number of its meshpoints can be supplied.
//
- ConstructCommon(0,bField);
+ // ConstructCommon(0,bField);
+ ConstructCommon(bField);
SetInstance(this);
}
+/*
AliTPCExBFirst::AliTPCExBFirst(const AliFieldMap *bFieldMap,
Double_t driftVelocity)
: fDriftVelocity(driftVelocity),
ConstructCommon(bFieldMap,0);
}
+*/
AliTPCExBFirst::~AliTPCExBFirst() {
//
}
}
-void AliTPCExBFirst::ConstructCommon(const AliFieldMap *bFieldMap,
+
+void AliTPCExBFirst::ConstructCommon(//const AliFieldMap *bFieldMap,
const AliMagF *bField) {
//
// THIS IS PRIVATE! (a helper for the constructor)
Double_t bx=0.,by=0.;
for (int k=0;k<fkNZ;++k) {
x[2]=fkZMin+k*(fkZMax-fkZMin)/(fkNZ-1);
- Float_t b[3];
+ Double_t b[3];
// the x is not const in the Field function...
- Float_t xt[3];
+ Double_t xt[3];
for (int l=0;l<3;++l) xt[l]=x[l];
// that happens due to the lack of a sophisticated class design:
- if (bFieldMap!=0)
- bFieldMap->Field(xt,b);
- else
- bField->Field(xt,b);
+ // if (bFieldMap!=0)
+ // bFieldMap->Field(xt,b);
+ // else
+ ((AliMagF*)bField)->Field(xt,b);
bx+=b[0]/10.;
by+=b[1]/10.;
fkMeanBx[(k*fkNY+j)*fkNX+i]=bx;
fkMeanBz/=nBz;
}
+
void AliTPCExBFirst::GetMeanFields(Double_t rx,Double_t ry,Double_t rz,
Double_t *Bx,Double_t *By) const {
//
#define ALITPCEXBFIRST_H
#include "AliTPCExB.h"
-class AliFieldMap;
+//class AliFieldMap;
class AliMagF;
class AliTPCExBFirst:public AliTPCExB {
public:
AliTPCExBFirst();
- AliTPCExBFirst(const AliFieldMap *bFieldMap,Double_t driftVelocity);
+ // AliTPCExBFirst(const AliFieldMap *bFieldMap,Double_t driftVelocity);
AliTPCExBFirst(const AliMagF *bField,Double_t driftVelocity,
Int_t nx=100,Int_t ny=100,Int_t nz=100);
virtual ~AliTPCExBFirst();
private:
AliTPCExBFirst& operator=(const AliTPCExBFirst&); // don't assign me
AliTPCExBFirst(const AliTPCExBFirst&); // don't copy me
- void ConstructCommon(const AliFieldMap *bFieldMap,const AliMagF *bField);
+ // void ConstructCommon(const AliFieldMap *bFieldMap,const AliMagF *bField);
+ void ConstructCommon(const AliMagF *bField);
void GetMeanFields(Double_t rx,Double_t ry,Double_t rz,
Double_t *Bx,Double_t *By) const;
Int_t fkNX; // field mesh points in x direction
#include "AliTPCtracker.h"
#include "AliTPCtrackerMI.h"
#include "AliRun.h"
- #include "AliMagF.h"
#include "AliRunLoader.h"
#include "AliTPCLoader.h"
#include "AliESD.h"
#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliLoader.h"
- #include "AliMagF.h"
#include "AliTPCtracker.h"
#include "AliITS.h"
#include "AliITSgeom.h"
//
//
AliTPCcalibDB * calib = AliTPCcalibDB::Instance();
- const AliMagF * field = AliTracker::GetFieldMap();
- if (field) { // Set correctly the magnetic field in the ExB calculation
- calib->SetExBField(field->SolenoidField());
- }
+ const AliMagF * field = (AliMagF*)TGeoGlobalMagField::Instance();
+ calib->SetExBField(field->SolenoidField());
AliTPCParam* param = GetTPCParam();
if (!param) {
AliWarning("Loading default TPC parameters !");
return t1m&&t2m;
}
-double AliTPCTracklet::GetBz(Double_t *xyz) {
- if (AliTracker::UniformField())
- return AliTracker::GetBz();
- else
- return AliTracker::GetBz(xyz);
+double AliTPCTracklet::GetBz(Double_t *xyz)
+{
+ return AliTracker::GetBz(xyz);
}
void AliTPCTracklet::RandomND(Int_t ndim,const Double_t *p,const Double_t *c,
#include "AliAnalysisManager.h"
#include "AliTracker.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTPCCalROC.h"
#include "AliLog.h"
#include <AliCDBEntry.h>
#include <AliLog.h>
#include <AliMagF.h>
-#include <AliMagFCheb.h>
#include "AliTPCcalibDB.h"
#include "AliTPCAltroMapping.h"
Float_t factor = bz/(-5.); // default b filed in Cheb with minus sign
- AliMagF* bmap = new AliMagFCheb("MapsExB","MapsExB", 2, factor, 10., AliMagFCheb::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+ AliMagF* bmap = new AliMagF("MapsExB","MapsExB", 2,factor,1., 10.,AliMagF::k5kG,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
AliTPCExBFirst *exb = new AliTPCExBFirst(bmap,0.88*2.6400e+04,50,50,50);
AliTPCExB::SetInstance(exb);
#include "AliAnalysisManager.h"
#include "AliTracker.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTPCCalROC.h"
#include "AliLog.h"
#include "AliESDInputHandler.h"
#include "AliAnalysisManager.h"
#include "AliTracker.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliTPCCalROC.h"
#include "AliLog.h"
//
}
-Double_t AliTPCtrack::GetBz() const {
- //
- // returns Bz component of the magnetic field (kG)
- //
- if (AliTracker::UniformField()) return AliTracker::GetBz();
- Double_t r[3]; GetXYZ(r);
- return AliTracker::GetBz(r);
-}
-
Int_t GetNFoundable() const {return fNFoundable;}
protected:
- Double_t GetBz() const;
Double_t fdEdx; // dE/dx
Int_t fIndex[kMaxRow]; // indices of associated clusters
} else printf("\n ! Creating ALL TRUE tracks at TPC inner radius !\n\n");
-
- // Check if value in the galice file is equal to selected one (fBz)
- AliMagF *fiel = (AliMagF*)gAlice->Field();
+ AliMagF *fiel = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
Double_t fieval=TMath::Abs((Double_t)fiel->SolenoidField()/10.);
printf("Magnetic field is %6.2f Tesla\n",fieval);
if(fBz!=fieval) {
return 1;
}
- // Set the conversion constant between curvature and Pt
- AliTracker::SetFieldMap(fiel,kTRUE);
-
return 0;
}
//-----------------------------------------------------------------------------
TDatabasePDG *DataBase = TDatabasePDG::Instance();
// Get field from galice.root
- AliMagF *fiel = (AliMagF*)gAlice->Field();
+ AliMagF *fiel = TGeoGlobalMagField::Instance()->GetField();
Double_t fieval=TMath::Abs((Double_t)fiel->SolenoidField()/10.);
- // Set the conversion constant between curvature and Pt
- AliTracker::SetFieldMap(fiel,kTRUE);
/**** The TPC corner ********************/
TTreeSRedirector * pcstream = new TTreeSRedirector("TPCtracks.root");
TTreeSRedirector &cstream = *pcstream;
//
- // dummy magnetic field
- AliMagF mag("aaa","aaa",1,1,10);
- AliTracker::SetFieldMap(&mag,kTRUE);
TFile f("AliESDs.root");
TTree * tree =(TTree*)f.Get("esdTree");
AliESD * esd =0;
// currently scaling factor 0 used - no magnetic field
//
metaData = CreateMetaObject("AliTPCExB");
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 1);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kG));
AliTPCExBFirst *exbfirst = new AliTPCExBFirst(field,2.83000000000000000e+04,50,50,50);
StoreObject("TPC/Calib/ExB", exbfirst, metaData);
//
// Initialize
//
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
AliTPCExB::RegisterField(0,field);
- AliMagF* fieldC0 = new AliMagWrapCheb("Maps","Maps", 2, 1, 10., AliMagWrapCheb::k5kG);
+ AliMagF* fieldC0 = new AliMagF("Maps","Maps", 2, 1, 1, 10., AliMagF::k5kG);
AliTPCExB::RegisterField(1,fieldC0);
- AliMagF* fieldC1 = new AliMagWrapCheb("Maps","Maps", 2, 1, 10., AliMagWrapCheb::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+ AliMagF* fieldC1 = new AliMagF("Maps","Maps", 2, 1, 1, 10., AliMagF::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
AliTPCExB::RegisterField(2,fieldC1);
gSystem->Load("libSTAT.so");
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
gener->Init();
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
// detectors - only the TPC is relevant
//
// Setup magnetic field
//
- AliMagF* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field,0);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
//
//
//
TStopwatch stopwatch;
stopwatch.Start();
//
- // set magnetic field form the cosmos - it should be provided by framework
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 2);
- AliTracker::SetFieldMap(field,0);
- //
AliAnalysisManager *mgr=new AliAnalysisManager("TestManager");
AliESDInputHandler* esdH=new AliESDInputHandler;
AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);
// Tracking settings
- // AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliMagF* field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG);
- AliTracker::SetFieldMap(field,1);
Double_t mostProbPt=0.35;
AliExternalTrackParam::SetMostProbablePt(mostProbPt);
//
AliTPCReconstructor::SetRecoParam(tpcRecoParam);
AliTPCReconstructor::SetStreamLevel(100);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliTracker::SetFieldMap(field,1);
- //
//
AliReconstruction rec;
rec.SetDefaultStorage("alien://folder=/alice/data/2007/LHC07w/OCDB/");
// MUON settings
AliLog::SetClassDebugLevel("AliMUONRawStreamTracker",3);
- // Tracking settings
- // AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., 2);
- AliTracker::SetFieldMap(field,1);
-
// AliReconstruction settings
AliReconstruction rec;
rec.SetUniformFieldTracking(kFALSE);
rec.SetFillESD("TPC");
rec.SetFillTriggerESD(kFALSE);
rec.SetRunVertexFinder(kFALSE);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliTracker::SetFieldMap(field,1);
rec.SetWriteAlignmentData(kTRUE);
rec.Run();
}
rec.SetFillESD("TPC");
rec.SetFillTriggerESD(kFALSE);
rec.SetRunVertexFinder(kFALSE);
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- AliTracker::SetFieldMap(field,1);
rec.SetWriteAlignmentData(kTRUE);
rec.Run(0);
}
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
static PprRun_t srun = test50;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
static Int_t sseed = 0; //Set 0 to use the current time
static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field
- AliMagF* field = new AliMagWrapCheb("MapsSimCheb","MapsSimCheb", 2, 1., 10., AliMagWrapCheb::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
rl->CdGAFile();
- gAlice->SetField(field);
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
// Field
- AliMagF* field = new AliMagWrapCheb("MapsSimCheb","MapsSimCheb", 2, 1., 10., AliMagWrapCheb::k5kG);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
rl->CdGAFile();
- gAlice->SetField(field);
-
-
//
Int_t iABSO = 1;
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
gAlice->SetField(field);
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
static PprRun_t srun = kPythia6;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
static Int_t sseed = 0; //Set 0 to use the current time
static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
if (smag == k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
} else if (smag == k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field
- AliMagF* field = new AliMagWrapCheb("Maps","Maps", 2, 1, 10., AliMagWrapCheb::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 1;
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenCosmicsParam.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
Float_t EtaToTheta(Float_t arg);
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
// MAGNETIC FIELD IN THE BARREL
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag); // FIELD
- // field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., mag));
+ // TGeoGlobalMagField::Instance()->GetField()->SetL3ConstField(0); //Using const. field in the barrel
rl->CdGAFile();
- gAlice->SetField(field);
Int_t iABSO = 1;
//
rec.SetEventRange(0,20);
- AliMagWrapCheb* field = 0x0;
- AliMagF* field = new AliMagWrapCheb("Maps","Maps", 2, 1, 10., AliMagWrapCheb::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
- Bool_t uniform=kFALSE;
- AliTracker::SetFieldMap(field,uniform); // tracking with the real map
//
//
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
rootfile->cd();
- gAlice->SetField(field);
Int_t iABSO = 0;
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
#include <TVirtualMC.h>
#include "AliMC.h"
// Create the materials for the TRD
//
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
// For polyethilene (CH2)
Float_t ape[2] = { 12.011 , 1.0079 };
// //
////////////////////////////////////////////////////////////////////////////
-#include <TMath.h>
-#include <TVector.h>
-#include <TRandom.h>
-#include <TROOT.h>
-#include <TTree.h>
-#include <TFile.h>
#include <TF1.h>
+#include <TFile.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
#include <TList.h>
+#include <TMath.h>
+#include <TROOT.h>
+#include <TRandom.h>
#include <TTask.h>
-#include <TGeoManager.h>
+#include <TTree.h>
+#include <TVector.h>
#include "AliRun.h"
#include "AliMC.h"
// The magnetic field strength
Double_t x[3] = { 0.0, 0.0, 0.0 };
- Double_t b[3];
- gAlice->Field(x,b); // b[] is in kilo Gauss
+ Double_t b[3] = {0.,0.,0.};
+ TGeoGlobalMagField::Instance()->Field(x,b); // b[] is in kilo Gauss
Float_t field = b[2] * 0.1; // Tesla
return kTRUE;
}
-//_____________________________________________________________________________
-Double_t AliTRDtrackV1::GetBz() const
-{
- //
- // Returns Bz component of the magnetic field (kG)
- //
-
- if (AliTracker::UniformField()) return AliTracker::GetBz();
-
- Double_t r[3];
- GetXYZ(r);
- return AliTracker::GetBz(r);
-}
-
//_______________________________________________________________
AliTRDcluster* AliTRDtrackV1::GetCluster(Int_t id)
{
Bool_t CookLabel(Float_t wrong);
AliTRDtrackV1* GetBackupTrack() const {return fBackupTrack;}
Double_t GetBudget(Int_t i) const { return fBudget[i];}
- Double_t GetBz() const;
AliTRDcluster* GetCluster(Int_t id);
Int_t GetClusterIndex(Int_t id) const;
Float_t GetEdep() const {return fDE;}
#include "STEER/AliConfig.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
{
kFull, kBarrel, kMuonArm
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
+
//--- Functions ---
AliGenPythia *PythiaHVQ(PDC06Proc_t proc);
AliGenerator *MbCocktail();
// This part for configuration
static DecayHvFl_t decHvFl = kNature;
static YCut_t ycut = kBarrel;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = k5kG;
//========================//
// Set Random Number seed //
//========================//
// FIELD
//
- if (mag == k2kG) {
+ if (mag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (mag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (mag == k5kG) {
+ } else if (mag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
printf("\n \n Comment: %s \n \n", comment.Data());
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
Int_t iABSO = 1;
Int_t iACORDE = 0;
#include "AliTrackReference.h"
#include "AliExternalTrackParam.h"
#include "AliTracker.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliAnalysisManager.h"
#include "Cal/AliTRDCalPID.h"
#include <TCanvas.h>
#include "TTreeStream.h"
-#include "AliMagFMaps.h"
+#include "AliMagF.h"
#include "AliPID.h"
#include "AliTracker.h"
#include "AliTrackReference.h"
#include "TGridCollection.h"
#include "TGridResult.h"
-#include "AliMagFCheb.h"
+#include "AliMagF.h"
#include "AliTracker.h"
#include "AliLog.h"
#include "AliCDBManager.h"
cdbManager->SetRun(0);
cdbManager->SetCacheFlag(kFALSE);
- // initialize magnetic field. TODO We should use the GRP !
- AliMagFCheb *field = 0x0;
- field = new AliMagFCheb("Maps","Maps", 2, 1., 10., AliMagFCheb::k5kG, kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
- //field = new AliMagFCheb("Maps","Maps", 2, 0., 10., AliMagFCheb::k2kG);
- AliTracker::SetFieldMap(field, kTRUE);
-
// initialize TRD settings
AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
AliTRDtrackerV1::SetNTimeBins(cal->GetNumberOfTimeBins());
// --- ROOT libraries ---
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>
#include <TMath.h>
#include <TObjectTable.h>
-#include <TVirtualMC.h>
#include <TParticle.h>
+#include <TVirtualMC.h>
// --- AliRoot header files ---
#include "AliRun.h"
AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
- Int_t iSXFLD = gAlice->Field()->Integ();
- Float_t sXMGMX = gAlice->Field()->Max();
+ Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Float_t tmaxfd, stemax, deemax, epsil, stmin;
// --- ROOT libraries ---
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>
#include <TMath.h>
#include <TObjectTable.h>
-#include <TVirtualMC.h>
#include <TParticle.h>
+#include <TVirtualMC.h>
// --- AliRoot header files ---
#include "AliConst.h"
AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
-
-
- Int_t iSXFLD = gAlice->Field()->Integ();
- Float_t sXMGMX = gAlice->Field()->Max();
+
+ Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Float_t tmaxfd, stemax, deemax, epsil, stmin;
// --- ROOT libraries ---
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>
#include <TMath.h>
#include <TObjectTable.h>
-#include <TVirtualMC.h>
#include <TParticle.h>
+#include <TVirtualMC.h>
// --- AliRoot header files ---
#include "AliRun.h"
AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
- Int_t iSXFLD = gAlice->Field()->Integ();
- Float_t sXMGMX = gAlice->Field()->Max();
+ Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Float_t tmaxfd, stemax, deemax, epsil, stmin;
// --- ROOT libraries ---
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>
#include <TMath.h>
#include <TObjectTable.h>
-#include <TVirtualMC.h>
#include <TParticle.h>
+#include <TVirtualMC.h>
// --- AliRoot header files ---
#include "AliRun.h"
AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
- Int_t iSXFLD = gAlice->Field()->Integ();
- Float_t sXMGMX = gAlice->Field()->Max();
+ Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Float_t tmaxfd, stemax, deemax, epsil, stmin;
// //
//////////////////////////////////////////////////////////////////////
+#include <TGeoGlobalMagField.h>
+
#include "AliVZEROv6.h"
ClassImp(AliVZEROv6)
// Int_t *idtmed = fIdtmed->GetArray()-2999;
- Int_t fieldType = gAlice->Field()->Integ(); // Field type
- Double_t maxField = gAlice->Field()->Max(); // Field max.
+ Int_t fieldType = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Double_t maxField = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Double_t maxBending = 0; // Max Angle
Double_t maxStepSize = 0.001; // Max step size
Double_t maxEnergyLoss = 1; // Max Delta E
// --- ROOT libraries ---
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
#include <TMath.h>
-#include <TVirtualMC.h>
#include <TParticle.h>
+#include <TVirtualMC.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
AliDebug(2,"Create materials");
// Parameters for simulation scope
- Int_t fieldType = gAlice->Field()->Integ(); // Field type
- Double_t maxField = gAlice->Field()->Max(); // Field max.
+ Int_t fieldType = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
+ Double_t maxField = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
Double_t maxBending = 10; // Max Angle
Double_t maxStepSize = 0.01; // Max step size
Double_t maxEnergyLoss = 1; // Max Delta E
// --- Tracking media parameters
Float_t epsil = .01, stmin=0.01, stemax = 1.;
-// Int_t isxfld = gAlice->Field()->Integ();
-// Float_t fieldm = gAlice->Field()->Max();
+// Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+// Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
Float_t fieldm = 0., tmaxfd = 0.;
Int_t ifield = 0, isvolActive = 1, isvol = 0, inofld = 0;
//
//gener->SetVertexSmear(perTrack);
// Magnetic field
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
Int_t iABSO = 1;
Int_t iDIPO = 1;
gener->Init(); // Initialization of the coctail generator
// Field (the last parameter is 1 => L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
// Make sure the current ROOT directory is in galice.root
rl->CdGAFile();
#include "PYTHIA6/AliDecayerPythia.h"
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
//static PprRun_t srun = test50;
static PprRun_t srun = kHIJINGplus;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
static Int_t sseed = 12345; //Set 0 to use the current time
//static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
static PprTrigConf_t strig = kDefaultPbPbTrig; // default PbPb trigger configuration
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "EVGEN/AliGenCocktail.h"
#include "EVGEN/AliGenCosmicsParam.h"
#include "EVGEN/AliGenHIJINGpara.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv0.h"
#include "VZERO/AliVZEROv7.h"
#endif
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
-
Float_t EtaToTheta(Float_t arg);
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
void Config()
{
gGener = gener;
// MAGNETIC FIELD IN THE BARREL
- // AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag); // FIELD
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 0., 10., mag); // NO FIELD
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,mag);
field->SetL3ConstField(0); //Using const. field in the barrel
- rl->CdGAFile();
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ rl->CdGAFile();
Int_t iABSO = 1;
Int_t iDIPO = 0;
#include "STEER/AliConfig.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
{
kFull, kBarrel, kMuonArm
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
-
//--- Trigger config ---
enum TrigConf_t
{
static PDC06Proc_t proc = kPyMbNoHvq;
static DecayHvFl_t decHvFl = kNature;
static YCut_t ycut = kFull;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static TrigConf_t trig = kDefaultPPTrig; // default pp trigger configuration
//========================//
// Set Random Number seed //
//
if (mag == k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (mag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
} else if (mag == k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
printf("\n \n Comment: %s \n \n", comment.Data());
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,mag);
field->SetL3ConstField(0); //Using const. field in the barrel
- rl->CdGAFile();
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(field);
+ rl->CdGAFile();
Int_t iABSO = 1;
Int_t iACORDE = 0;
}
//=============================================================
// Field (L3 0.5 T) outside dimuon spectrometer
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
+ AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
field->SetL3ConstField(0); // Using const. field in the barrel
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(field);
Int_t iITS = 1;
Int_t iZDC = 1;
}
//=============================================================
// Field (L3 0.5 T) outside dimuon spectrometer
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 10., AliMagF::k5kG);
field->SetL3ConstField(0); // Using const. field in the barrel
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(field);
Int_t iITS = 1;
Int_t iFMD = 1;
#include "STEER/AliConfig.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
{
kFull, kBarrel, kMuonArm
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
//--- Trigger config ---
enum TrigConf_t
{
static ProcessHvFl_t procHvFl = kCharmpp14000wmi;
static DecayHvFl_t decHvFl = kNature;
static YCut_t ycut = kFull;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static TrigConf_t trig = kDefaultPbPbTrig; // default PbPb trigger configuration
// nEvts = -1 : you get 1 QQbar pair and all the fragmentation and
// decay chain
// FIELD
//
- if (mag == k2kG) {
+ if (mag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (mag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (mag == k5kG) {
+ } else if (mag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
printf("\n \n Comment: %s \n \n", comment.Data());
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag);
field->SetL3ConstField(0); //Using const. field in the barrel
- rl->CdGAFile();
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(field);
+ rl->CdGAFile();
// By default all ALICE is switched off
Int_t iABSO=0;
// =============================
// Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- gAlice->SetField(field);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 1;
Int_t iDIPO = 1;
void plotField(Int_t iField = 0)
{
//
-// iField = 0 2 kG solenoid
-// 1 4 kG solenoid
-// 2 5 kG solenoid
//
// load necessary libraries
gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libminicern");
//
// create field map
- AliMagFMaps* field = new AliMagFMaps(
- "Maps","Maps",
- 2, 1., 10., iField);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
// field-SetL3ConstField(1);
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
static PprRun_t srun = kHijing_per2;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
static Int_t sseed = 12345; //Set 0 to use the current time
static PprTrigConf_t strig = kDefaultPbPbTrig; // default pp trigger configuration
if (smag == k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
} else if (smag == k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., smag);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "STEER/AliConfig.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
{
kNature, kHadr, kSemiEl, kSemiMu
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
-
//--- Trigger config ---
enum TrigConf_t
{
// This part for configuration
static DecayHvFl_t decHvFl = kNature;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static TrigConf_t trig = kDefaultPPTrig; // default pp trigger configuration
static Int_t runNumber= 0;
static Int_t eventNumber= 0;
}
// FIELD
- if (mag == k2kG) {
+ if (mag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (mag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (mag == k5kG) {
+ } else if (mag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
printf("\n \n Comment: %s \n \n", comment.Data());
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag);
field->SetL3ConstField(0); //Using const. field in the barrel
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
-
Int_t iABSO = 1;
Int_t iACORDE= 1;
rec.SetRecoParam("MUON",muonRecoParam);\r
\r
// Tracking settings\r
- AliMagWrapCheb* field;\r
+ AliMagF* field;\r
if (mfield)\r
- field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG);\r
+ field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);\r
else\r
- field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG);\r
- AliTracker::SetFieldMap(field,1);\r
+ field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG);\r
+\r
Double_t mostProbPt=0.35;\r
AliExternalTrackParam::SetMostProbablePt(mostProbPt);\r
\r
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
#include "TDPMjet/AliGenDPMjet.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
// FIELD
//
- AliMagFCheb* field = 0x0;
+ AliMagF* field = 0x0;
if (mag == kNoField) {
comment = comment.Append(" | L3 field 0.0 T");
- field = new AliMagFCheb("Maps","Maps", 2, 0., 10., AliMagFCheb::k2kG);
+ field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG);
} else if (mag == k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
- field = new AliMagFCheb("Maps","Maps", 2, 1., 10., AliMagFCheb::k5kG);
+ field = new AliMagFCheb("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
}
printf("\n \n Comment: %s \n \n", comment.Data());
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
-
-
-
+
Int_t iABSO = 1;
Int_t iACORDE= 0;
Int_t iDIPO = 1;
"kPythia6", "kPhojet"
};
-//--- Magnetic Field ---
enum Mag_t
{
kNoField, k5kG, kFieldMax
// FIELD
//
- AliMagFCheb* field = 0x0;
+ AliMagF* field = 0x0;
if (mag == kNoField) {
comment = comment.Append(" | L3 field 0.0 T");
- field = new AliMagFCheb("Maps","Maps", 2, 0., 10., AliMagFCheb::k2kG);
+ field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG);
} else if (mag == k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
- field = new AliMagFCheb("Maps","Maps", 2, 1., 10., AliMagFCheb::k5kG);
+ field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
}
printf("\n \n Comment: %s \n \n", comment.Data());
+
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
-
-
-
+
Int_t iABSO = 1;
Int_t iACORDE= 0;
Int_t iDIPO = 1;
#!/bin/sh
rm -rf */*.root */*.log */*.dat
cd ./gen
-aliroot -b -q rungen.C\(5\) 2>&1 | tee gen.log
+aliroot -b -q rungen.C\(1\) 2>&1 | tee gen.log
chmod a-w *.root
cd ../sim
-aliroot -b -q sim.C\(5\) 2>&1 | tee sim.log
-aliroot -b -q rec.C 2>&1 | tee rec.log
+aliroot -b -q sim.C\(1\) 2>&1 | tee sim.log
+#aliroot -b -q rec.C 2>&1 | tee rec.log
aliroot -b -q ${ALICE_ROOT}/STEER/CheckESD.C 2>&1 | tee check.log
aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
// This part for configuration
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
static Int_t sseed = 12345; //Set 0 to use the current time
static PprTrigConf_t strig = kDefaultPPTrig; // default PbPb trigger configuration
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field (L3 0.4 T)
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., smag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag);
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
-//
+ //
Int_t iABSO = 1;
Int_t iDIPO = 1;
Int_t iFMD = 1;
#include "EVGEN/AliGenHIJINGpara.h"
#include "EVGEN/AliGenFixed.h"
#include "EVGEN/AliGenBox.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
//
//gener->SetVertexSmear(perTrack);
// Field (L3 0.5 T)
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., AliMagFCheb::k5kG);
-
- gAlice->SetField(field);
-
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
//static PprRun_t srun = test50;
static PprRun_t srun = kHijing_per4;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
TDatime dat;
static Int_t sseed = dat.Get(); //Set 0 to use the current time
//static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
AliRunLoader* rl=0x0;
- AliLog::Message(AliLog::kInfo, "Creating Run Loader", "", "", "Config()"," ConfigPPR.C", __LINE__);
+ AliLog::Message(AliLog::kInfo, "Creating Run Loader",
+ "", "", "Config()"," Config.C", __LINE__);
rl = AliRunLoader::Open("galice.root",
AliConfig::GetDefaultEventFolderName(),
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
- }
+ } else AliLog::Message(AliLog::kFatal, "Invalid Mag Field",
+ "", "", "Config()"," Config.C", __LINE__);
if (srad == kGluonRadiation)
// Field (L3 0.4 T)
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., smag);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
//static PprRun_t srun = test50;
static PprRun_t srun = kPythia6;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
TDatime dat;
static Int_t sseed = dat.Get(); //Set 0 to use the current time
//static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
- }
+ } else AliLog::Message(AliLog::kFatal, "Invalid Mag Field",
+ "", "", "Config()"," Config.C", __LINE__);
if (srad == kGluonRadiation)
// Field (L3 0.4 T)
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., smag);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag));
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
#include "TDPMjet/AliGenDPMjet.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
"kPythia6", "kPhojet"
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- kNoField, k5kG, kFieldMax
-};
-
const char * pprField[] = {
"kNoField", "k5kG"
};
// Geterator, field, beam energy
static PDC06Proc_t proc = kPhojet;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static Float_t energy = 10000; // energy in CMS
//========================//
// Set Random Number seed //
// FIELD
//
- AliMagFCheb* field = 0x0;
+ AliMagF* field = 0x0;
if (mag == kNoField) {
comment = comment.Append(" | L3 field 0.0 T");
- field = new AliMagFCheb("Maps","Maps", 2, 0., 10., AliMagFCheb::k2kG);
- } else if (mag == k5kG) {
+ field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG);
+ } else if (mag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
- field = new AliMagFCheb("Maps","Maps", 2, 1., 10., AliMagFCheb::k5kG);
+ field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG);
}
printf("\n \n Comment: %s \n \n", comment.Data());
+ TGeoGlobalMagField::Instance()->SetField(field);
rl->CdGAFile();
- gAlice->SetField(field);
-
-
Int_t iABSO = 1;
Int_t iACORDE= 0;
#include "EVGEN/AliGenGeVSim.h"
#include "EVGEN/AliGeVSimParticle.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
kGluonRadiation, kNoGluonRadiation
};
-enum PprMag_t
-{
- k2kG, k4kG, k5kG
-};
-
enum PprTrigConf_t
{
kDefaultPPTrig, kDefaultPbPbTrig
static PprRun_t srun = kPythia6;
static PprRad_t srad = kGluonRadiation;
-static PprMag_t smag = k5kG;
+static AliMagF::BMap_t smag = AliMagF::k5kG;
static Int_t sseed = 12345; //Set 0 to use the current time
static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
gener->SetTrackingFlag(1);
gener->Init();
- if (smag == k2kG) {
+ if (smag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (smag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (smag == k5kG) {
+ } else if (smag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
// Field
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., smag);
+ TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG));
+
rl->CdGAFile();
- gAlice->SetField(field);
//
Int_t iABSO = 1;
Int_t iDIPO = 1;
#include "STEER/AliConfig.h"
#include "PYTHIA6/AliDecayerPythia.h"
#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFCheb.h"
+#include "STEER/AliMagF.h"
#include "STRUCT/AliBODY.h"
#include "STRUCT/AliMAG.h"
#include "STRUCT/AliABSOv3.h"
{
kFull, kBarrel, kMuonArm
};
-//--- Magnetic Field ---
-enum Mag_t
-{
- k2kG, k4kG, k5kG
-};
-
//--- Trigger config ---
enum TrigConf_t
{
static PDC06Proc_t proc = kPyMbNoHvq;
static DecayHvFl_t decHvFl = kNature;
static YCut_t ycut = kFull;
-static Mag_t mag = k5kG;
+static AliMagF::BMap_t mag = AliMagF::k5kG;
static TrigConf_t trig = kDefaultPPTrig; // default pp trigger configuration
//========================//
// Set Random Number seed //
// FIELD
//
- if (mag == k2kG) {
+ if (mag == AliMagF::k2kG) {
comment = comment.Append(" | L3 field 0.2 T");
- } else if (mag == k4kG) {
- comment = comment.Append(" | L3 field 0.4 T");
- } else if (mag == k5kG) {
+ } else if (mag == AliMagF::k5kG) {
comment = comment.Append(" | L3 field 0.5 T");
}
printf("\n \n Comment: %s \n \n", comment.Data());
- AliMagFCheb* field = new AliMagFCheb("Maps","Maps", 2, 1., 10., mag);
+ AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag);
+ TGeoGlobalMagField::Instance()->SetField(field);
+
rl->CdGAFile();
- gAlice->SetField(field);
-
-
Int_t iABSO = 1;
Int_t iACORDE = 0;