From 99c7d4955868923607f3b8344f93cfd54e6eb400 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 2 Sep 2009 11:32:23 +0000 Subject: [PATCH] Fixes for bug #52499: Field polarities inconsistiency --- ACORDE/macros/Config.C | 3 +- EMCAL/macros/Config.C | 4 +- FMD/Config.C | 3 +- MUON/Config.C | 2 +- PHOS/macros/AlignmentDB/Config.C | 4 +- PHOS/macros/Embed/Config.C | 4 +- STEER/AliGRPManager.cxx | 102 +++++++++++++----------- STEER/AliGRPManager.h | 7 +- STEER/AliGRPObject.h | 6 ++ STEER/AliMagF.h | 2 +- STEER/AliReconstruction.cxx | 116 ++++++++++------------------ STEER/AliReconstruction.h | 5 +- STEER/AliSimulation.cxx | 33 ++++---- doc/aliroot-primer/scripts/Config.C | 2 +- macros/Config.C | 2 +- prod/LHC08d10/Config.C | 12 +-- prod/LHC08d11/Config.C | 10 +-- prod/LHC08d12/Config.C | 13 ++-- prod/LHC08d13/Config.C | 13 ++-- prod/LHC08d14/Config.C | 13 ++-- prod/LHC08d15/Config.C | 14 ++-- prod/LHC08d16/Config.C | 11 +-- prod/LHC08d17/Config.C | 29 +++---- prod/LHC08d5/Config.C | 2 +- prod/LHC08d6/Config.C | 2 +- prod/LHC08d8/Config.C | 11 +-- prod/LHC08d9/Config.C | 10 +-- prod/LHC09a1/Config.C | 10 +-- prod/LHC09a10/Config.C | 2 +- prod/LHC09a11/Config.C | 2 +- prod/LHC09a12/Config.C | 2 +- prod/LHC09a13/Config.C | 2 +- prod/LHC09a14/Config.C | 2 +- prod/LHC09a16/Config.C | 2 +- test/PbPbbench/Config.C | 2 +- test/QA/Config.C | 6 +- test/embedding/Config.C | 6 +- test/fpprod/Config.C | 4 +- test/genkine/sim/Config.C | 2 +- test/gun/Config.C | 2 +- test/merge/backgr/Config.C | 2 +- test/merge/signal/Config.C | 2 +- test/pileup/Config.C | 4 +- test/ppbench/Config.C | 2 +- test/pploadlibs/Config.C | 2 +- 45 files changed, 241 insertions(+), 250 deletions(-) diff --git a/ACORDE/macros/Config.C b/ACORDE/macros/Config.C index 463459f027f..d2e11a6aca7 100644 --- a/ACORDE/macros/Config.C +++ b/ACORDE/macros/Config.C @@ -184,8 +184,7 @@ void Config() } printf("\n \n Comment: %s \n \n", comment.Data()); - AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,mag); - field->SetL3ConstField(0); //Using const. field in the barrel + AliMagF* field = new AliMagF("Maps","Maps",2, -1.,-1., 10.,mag); TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); diff --git a/EMCAL/macros/Config.C b/EMCAL/macros/Config.C index 4868042b625..494bde41a6e 100755 --- a/EMCAL/macros/Config.C +++ b/EMCAL/macros/Config.C @@ -151,8 +151,8 @@ void Config() // track by track // //gener->SetVertexSmear(perTrack); - // Field (L3 0.4 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + // Field (L3 0.5 T) + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG)); Int_t iABSO = 0; Int_t iDIPO = 0; diff --git a/FMD/Config.C b/FMD/Config.C index efbf03da3ec..adeb9498151 100644 --- a/FMD/Config.C +++ b/FMD/Config.C @@ -361,8 +361,7 @@ Config() //__________________________________________________________________ // Field (L3 0.4 T) - AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG); - // field->SetL3ConstField(0); //Using const. field in the barrel + AliMagF* field = new AliMagF("Maps","Maps",2, -1., -1., 10.,mag); TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); diff --git a/MUON/Config.C b/MUON/Config.C index beb66e478ab..5413b1d6186 100644 --- a/MUON/Config.C +++ b/MUON/Config.C @@ -187,7 +187,7 @@ void Config(char directory[100]="", char option[6]="param", const char* digitsto } //============================================================= // Field (L3 0.5 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1, 10., AliMagF::k5kG)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1, 10., AliMagF::k5kG)); //============================================================= //=================== Alice BODY parameters ============================= AliBODY *BODY = new AliBODY("BODY","Alice envelop"); diff --git a/PHOS/macros/AlignmentDB/Config.C b/PHOS/macros/AlignmentDB/Config.C index e775cb06c12..c9b744e56d0 100644 --- a/PHOS/macros/AlignmentDB/Config.C +++ b/PHOS/macros/AlignmentDB/Config.C @@ -157,8 +157,8 @@ void Config() // track by track // //gener->SetVertexSmear(perTrack); - // Field (L3 0.4 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + // Field (L3 0.5 T) + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG)); Int_t iABSO = 0; Int_t iDIPO = 0; diff --git a/PHOS/macros/Embed/Config.C b/PHOS/macros/Embed/Config.C index 5c856cbdcb4..5da8fa447aa 100644 --- a/PHOS/macros/Embed/Config.C +++ b/PHOS/macros/Embed/Config.C @@ -168,8 +168,8 @@ void Config() // Field (L3 0.4 T) //Zero magnetic field - AliMagF* field = new AliMagF("Maps","Maps", 2, 0., 1., 10., AliMagF::k5kG); - field->SetL3ConstField(0); //Using const. field in the barrel + AliMagF* field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); + // AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., smag); TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); diff --git a/STEER/AliGRPManager.cxx b/STEER/AliGRPManager.cxx index b8b9fc3bfad..5a2affdf40d 100644 --- a/STEER/AliGRPManager.cxx +++ b/STEER/AliGRPManager.cxx @@ -138,8 +138,28 @@ Bool_t AliGRPManager::SetMagField() ok = kFALSE; } + TString beamType = fGRPData->GetBeamType(); + if (beamType==AliGRPObject::GetInvalidString()) { + AliError("GRP/GRP/Data entry: missing value for the beam type ! Using UNKNOWN"); + beamType = "UNKNOWN"; + ok = kFALSE; + } + + Float_t beamEnergy = fGRPData->GetBeamEnergy(); + if (beamEnergy==AliGRPObject::GetInvalidFloat()) { + AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0"); + beamEnergy = 0; + ok = kFALSE; + } + beamEnergy /= 120E3; // energy is provided in MeV*120 + + // read special bits for the polarity convention and map type + Int_t polConvention = fGRPData->IsPolarityConventionLHC() ? AliMagF::kConvLHC : AliMagF::kConvDCS2008; + Bool_t uniformB = fGRPData->IsUniformBMap(); + if (ok) { - if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1) ) { + if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1, + polConvention,uniformB,beamEnergy, beamType.Data())) { AliError("Failed to create a B field map !"); ok = kFALSE; } @@ -198,15 +218,16 @@ AliRunInfo* AliGRPManager::GetRunInfo() //_____________________________________________________________________________ Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, - Float_t diPol, Float_t beamenergy, - const Char_t *beamtype, const Char_t *path) + Float_t diPol, Int_t convention, Bool_t uniform, + Float_t beamenergy, const Char_t *beamtype, const Char_t *path) { //------------------------------------------------ // The magnetic field map, defined externally... // L3 current 30000 A -> 0.5 T // L3 current 12000 A -> 0.2 T // dipole current 6000 A - // The polarities must be the same + // The polarities must match the convention (LHC or DCS2008) + // unless the special uniform map was used for MC //------------------------------------------------ const Float_t l3NominalCurrent1=30000.; // (A) const Float_t l3NominalCurrent2=12000.; // (A) @@ -215,55 +236,46 @@ Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, const Float_t tolerance=0.03; // relative current tolerance const Float_t zero=77.; // "zero" current (A) // - TString s=(l3Pol < 0) ? "L3: -" : "L3: +"; - // - AliMagF::BMap_t map = AliMagF::k5kG; - // - double fcL3,fcDip; + AliMagF::BMap_t map; + double sclL3,sclDip; // 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)!",l3Cur)); - return kFALSE; + diCur = TMath::Abs(diCur); + // + if (TMath::Abs((sclDip=diCur/diNominalCurrent)-1.) > tolerance && !uniform) { + if (diCur <= zero) sclDip = 0.; // some small current.. -> Dipole OFF + else { + AliError(Form("Wrong dipole current (%f A)!",diCur)); + return kFALSE; + } } // - diCur = TMath::Abs(diCur); - if (TMath::Abs(diCur-diNominalCurrent)/diNominalCurrent < tolerance) { - // 3% current tolerance... - 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)!",diCur)); - return kFALSE; + if (uniform) { + // special treatment of special MC with uniform mag field (normalized to 0.5 T) + // no check for scaling/polarities are done + map = AliMagF::k5kGUniform; + sclL3 = l3Cur/l3NominalCurrent1; + } + else { + if (TMath::Abs((sclL3=l3Cur/l3NominalCurrent1)-1.) < tolerance) map = AliMagF::k5kG; + else if (TMath::Abs((sclL3=l3Cur/l3NominalCurrent2)-1.) < tolerance) map = AliMagF::k2kG; + else if (l3Cur <= zero) { sclL3 = 0; map = AliMagF::k5kGUniform;} + else { + AliError(Form("Wrong L3 current (%f A)!",l3Cur)); + return kFALSE; + } } // - if (fcDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) && - ((AliMagF::GetPolarityConvention()==AliMagF::kConvMap2005 && l3Pol!=diPol) || - (AliMagF::GetPolarityConvention()==AliMagF::kConvDCS2008 && l3Pol==diPol) || - (AliMagF::GetPolarityConvention()==AliMagF::kConvLHC && l3Pol!=diPol)) ) { + if (sclDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) && + ((convention==AliMagF::kConvLHC && l3Pol!=diPol) || + (convention==AliMagF::kConvDCS2008 && l3Pol==diPol)) ) { AliError(Form("Wrong combination for L3/Dipole polarities (%c/%c) for convention %d", l3Pol>0?'+':'-',diPol>0?'+':'-',AliMagF::GetPolarityConvention())); return kFALSE; } // - if (l3Pol<0) fcL3 = -fcL3; - if (diPol<0) fcDip = -fcDip; + if (l3Pol<0) sclL3 = -sclL3; + if (diPol<0) sclDip = -sclDip; // AliMagF::BeamType_t btype = AliMagF::kNoBeamField; TString btypestr = beamtype; @@ -275,8 +287,10 @@ Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, 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, + char ttl[50]; + sprintf(ttl,"L3: %+5d Dip: %+4d kA; %s",(int)TMath::Sign(l3Cur,float(sclL3)), + (int)TMath::Sign(diCur,float(sclDip)),uniform ? " Constant":""); + AliMagF* fld = new AliMagF("MagneticFieldMap", ttl, 2, sclL3, sclDip, 10., map, path, btype,beamenergy); TGeoGlobalMagField::Instance()->SetField( fld ); TGeoGlobalMagField::Instance()->Lock(); diff --git a/STEER/AliGRPManager.h b/STEER/AliGRPManager.h index 9a2ac45a72b..66aa653d946 100644 --- a/STEER/AliGRPManager.h +++ b/STEER/AliGRPManager.h @@ -33,10 +33,11 @@ public: private: Bool_t SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000., - Float_t l3Pol=1., Float_t dipPol=1., Float_t benergy=7000., - const Char_t* btype="pp", + Float_t l3Pol=-1., Float_t dipPol=-1., + Int_t convention=0, Bool_t uniform = kFALSE, + Float_t benergy=7000., const Char_t* btype="pp", const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); - + AliGRPObject* fGRPData; // Data from the GRP/GRP/Data CDB folder AliGRPManager(const AliGRPManager& man); diff --git a/STEER/AliGRPObject.h b/STEER/AliGRPObject.h index 9f8f2c65b77..8e79c12e4e1 100644 --- a/STEER/AliGRPObject.h +++ b/STEER/AliGRPObject.h @@ -24,6 +24,8 @@ class AliGRPObject : public TObject { public: enum Stats {kMean = 0, kTruncMean = 1, kMedian = 2, kSDMean = 3, kSDMedian = 4}; + + enum StatusBits {kPolConvLHC = BIT(14), kUniformBMap = BIT(15)}; enum DP_HallProbes { khpL3bsf17H1= 0 , khpL3bsf17H2, khpL3bsf17H3, khpL3bsf17Temperature, @@ -45,6 +47,8 @@ class AliGRPObject : public TObject { // getters + Bool_t IsPolarityConventionLHC() const {return TestBit(kPolConvLHC);} + Bool_t IsUniformBMap() const {return TestBit(kUniformBMap);} time_t GetTimeStart() const {return fTimeStart;} time_t GetTimeEnd() const {return fTimeEnd;} Float_t GetBeamEnergy() const {return fBeamEnergy;} @@ -80,6 +84,8 @@ class AliGRPObject : public TObject { // setters + void SetPolarityConventionLHC(Bool_t v=kTRUE) {return SetBit(kPolConvLHC,v);} + void SetUniformBMap(Bool_t v=kTRUE) {return SetBit(kUniformBMap,v);} void SetTimeStart(time_t timeStart) {fTimeStart = timeStart;} void SetTimeEnd(time_t timeEnd) {fTimeEnd = timeEnd;} void SetBeamEnergy(Float_t beamEnergy) {fBeamEnergy = beamEnergy;} diff --git a/STEER/AliMagF.h b/STEER/AliMagF.h index b875756ce73..1085a3498ba 100644 --- a/STEER/AliMagF.h +++ b/STEER/AliMagF.h @@ -20,7 +20,7 @@ class AliMagF : public TVirtualMagField public: enum BMap_t {k2kG, k5kG, k5kGUniform}; enum BeamType_t {kBeamTypeAA, kBeamTypepp, kNoBeamField}; - enum PolarityConvention_t {kConvMap2005,kConvDCS2008,kConvLHC}; + enum PolarityConvention_t {kConvLHC,kConvDCS2008,kConvMap2005}; // AliMagF(); AliMagF(const char *name, const char* title, Int_t integ, diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 8896667171a..19ddd855a87 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -907,15 +907,16 @@ void AliReconstruction::SetRecoParam(const char* detector, AliDetectorRecoParam //_____________________________________________________________________________ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, - Float_t diPol, Float_t beamenergy, - const Char_t *beamtype, const Char_t *path) + Float_t diPol, Int_t convention, Bool_t uniform, + Float_t beamenergy, const Char_t *beamtype, const Char_t *path) { //------------------------------------------------ // The magnetic field map, defined externally... // L3 current 30000 A -> 0.5 T // L3 current 12000 A -> 0.2 T // dipole current 6000 A - // The polarities must be the same + // The polarities must match the convention (LHC or DCS2008) + // unless the special uniform map was used for MC //------------------------------------------------ const Float_t l3NominalCurrent1=30000.; // (A) const Float_t l3NominalCurrent2=12000.; // (A) @@ -924,55 +925,46 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po const Float_t tolerance=0.03; // relative current tolerance const Float_t zero=77.; // "zero" current (A) // - TString s=(l3Pol < 0) ? "L3: -" : "L3: +"; - // - AliMagF::BMap_t map = AliMagF::k5kG; - // - double fcL3,fcDip; + AliMagF::BMap_t map; + double sclL3,sclDip; // 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; "; - } else { - AliError(Form("Wrong L3 current (%f A)!",l3Cur)); - return kFALSE; - } - // diCur = TMath::Abs(diCur); - if (TMath::Abs(diCur-diNominalCurrent)/diNominalCurrent < tolerance) { - // 3% current tolerance... - 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)!",diCur)); - return kFALSE; + // + if (TMath::Abs((sclDip=diCur/diNominalCurrent)-1.) > tolerance && !uniform) { + if (diCur <= zero) sclDip = 0.; // some small current.. -> Dipole OFF + else { + AliError(Form("Wrong dipole current (%f A)!",diCur)); + return kFALSE; + } } // + if (uniform) { + // special treatment of special MC with uniform mag field (normalized to 0.5 T) + // no check for scaling/polarities are done + map = AliMagF::k5kGUniform; + sclL3 = l3Cur/l3NominalCurrent1; + } + else { + if (TMath::Abs((sclL3=l3Cur/l3NominalCurrent1)-1.) < tolerance) map = AliMagF::k5kG; + else if (TMath::Abs((sclL3=l3Cur/l3NominalCurrent2)-1.) < tolerance) map = AliMagF::k2kG; + else if (l3Cur <= zero) { sclL3 = 0; map = AliMagF::k5kGUniform;} + else { + AliError(Form("Wrong L3 current (%f A)!",l3Cur)); + return kFALSE; + } + } // - if (fcDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) && - ((AliMagF::GetPolarityConvention()==AliMagF::kConvMap2005 && l3Pol!=diPol) || - (AliMagF::GetPolarityConvention()==AliMagF::kConvDCS2008 && l3Pol==diPol) || - (AliMagF::GetPolarityConvention()==AliMagF::kConvLHC && l3Pol!=diPol)) ) { + if (sclDip!=0 && (map==AliMagF::k5kG || map==AliMagF::k2kG) && + ((convention==AliMagF::kConvLHC && l3Pol!=diPol) || + (convention==AliMagF::kConvDCS2008 && l3Pol==diPol)) ) { AliError(Form("Wrong combination for L3/Dipole polarities (%c/%c) for convention %d", l3Pol>0?'+':'-',diPol>0?'+':'-',AliMagF::GetPolarityConvention())); return kFALSE; } // - if (l3Pol<0) fcL3 = -fcL3; - if (diPol<0) fcDip = -fcDip; + if (l3Pol<0) sclL3 = -sclL3; + if (diPol<0) sclDip = -sclDip; // AliMagF::BeamType_t btype = AliMagF::kNoBeamField; TString btypestr = beamtype; @@ -984,8 +976,10 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po 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, + char ttl[50]; + sprintf(ttl,"L3: %+5d Dip: %+4d kA; %s",(int)TMath::Sign(l3Cur,float(sclL3)), + (int)TMath::Sign(diCur,float(sclDip)),uniform ? " Constant":""); + AliMagF* fld = new AliMagF("MagneticFieldMap", ttl, 2, sclL3, sclDip, 10., map, path, btype,beamenergy); TGeoGlobalMagField::Instance()->SetField( fld ); TGeoGlobalMagField::Instance()->Lock(); @@ -993,7 +987,6 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po return kTRUE; } - Bool_t AliReconstruction::InitGRP() { //------------------------------------ // Initialization of the GRP entry @@ -1131,42 +1124,17 @@ Bool_t AliReconstruction::InitGRP() { ok = kFALSE; } - /* - TObjString *l3Current= - dynamic_cast(fGRPData->GetValue("fL3Current")); - if (!l3Current) { - AliError("GRP/GRP/Data entry: missing value for the L3 current !"); - ok = kFALSE; - } - TObjString *l3Polarity= - dynamic_cast(fGRPData->GetValue("fL3Polarity")); - if (!l3Polarity) { - AliError("GRP/GRP/Data entry: missing value for the L3 polarity !"); - ok = kFALSE; - } - - // Dipole - TObjString *diCurrent= - dynamic_cast(fGRPData->GetValue("fDipoleCurrent")); - if (!diCurrent) { - AliError("GRP/GRP/Data entry: missing value for the dipole current !"); - ok = kFALSE; - } - TObjString *diPolarity= - dynamic_cast(fGRPData->GetValue("fDipolePolarity")); - if (!diPolarity) { - AliError("GRP/GRP/Data entry: missing value for the dipole polarity !"); - ok = kFALSE; - } - */ + // read special bits for the polarity convention and map type + Int_t polConvention = fGRPData->IsPolarityConventionLHC() ? AliMagF::kConvLHC : AliMagF::kConvDCS2008; + Bool_t uniformB = fGRPData->IsUniformBMap(); if (ok) { - if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1) ) + if ( !SetFieldMap(l3Current, diCurrent, l3Polarity ? -1:1, diPolarity ? -1:1, + polConvention,uniformB,beamEnergy, beamType.Data())) 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..."); - } //*** Get the diamond profiles from OCDB diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index e8724ba5579..308658cd153 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -83,8 +83,9 @@ public: //*** Magnetic field setters Bool_t SetFieldMap(Float_t l3Current=30000., Float_t diCurrent=6000., - Float_t l3Pol=1., Float_t dipPol=1., Float_t benergy=7000., - const Char_t* btype="pp", + Float_t l3Pol=-1., Float_t dipPol=-1., + Int_t convention=0, Bool_t uniform = kFALSE, + Float_t benergy=7000., const Char_t* btype="pp", const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); //*** Global reconstruction flag setters diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index 0181e1cd2e3..d017b446624 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -2262,27 +2262,24 @@ void AliSimulation::WriteGRPEntry() grpObj->SetLHCState("STABLE_BEAMS"); grpObj->SetLHCLuminosity(0,(AliGRPObject::Stats)0); grpObj->SetBeamIntensity(0,(AliGRPObject::Stats)0); - + // 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); - - if (factor > 0) { - grpObj->SetL3Polarity(0); - grpObj->SetDipolePolarity(0); - } - else { - grpObj->SetL3Polarity(1); - grpObj->SetDipolePolarity(1); - } - - if (TMath::Abs(factor) != 0) - grpObj->SetDipoleCurrent(6000,(AliGRPObject::Stats)0); - else - grpObj->SetDipoleCurrent(0,(AliGRPObject::Stats)0); + Float_t factorSol = field ? field->GetFactorSol() : 0; + Float_t currentSol = TMath::Abs(factorSol)>1E-6 ? + TMath::Nint(TMath::Abs(solenoidField/factorSol))/5.*30000.*TMath::Abs(factorSol) : 0; + // + Float_t factorDip = field ? field->GetFactorDip() : 0; + Float_t currentDip = 6000.*TMath::Abs(factorDip); + // + grpObj->SetL3Current(currentSol,(AliGRPObject::Stats)0); + grpObj->SetDipoleCurrent(currentDip,(AliGRPObject::Stats)0); + grpObj->SetL3Polarity(factorSol>0 ? 0:1); + grpObj->SetDipolePolarity(factorDip>0 ? 0:1); + grpObj->SetUniformBMap(field->IsUniform()); // for special MC with k5kGUniform map + grpObj->SetPolarityConventionLHC(); // LHC convention +/+ current -> -/- field main components + // grpObj->SetCavernTemperature(0,(AliGRPObject::Stats)0); //grpMap->Add(new TObjString("fCavernPressure"),new TObjString("0")); ---> not inserted in simulation with the new object, since it is now an AliDCSSensor diff --git a/doc/aliroot-primer/scripts/Config.C b/doc/aliroot-primer/scripts/Config.C index 95ad2a45be6..850a212761c 100644 --- a/doc/aliroot-primer/scripts/Config.C +++ b/doc/aliroot-primer/scripts/Config.C @@ -112,7 +112,7 @@ void Config() gener->Init(); // Initialization of the coctail generator // Field (the last parameter is 1 => L3 0.4 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + 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(); diff --git a/macros/Config.C b/macros/Config.C index cd133ce572f..455a674489d 100644 --- a/macros/Config.C +++ b/macros/Config.C @@ -190,7 +190,7 @@ void Config() // //gener->SetVertexSmear(perTrack); // Field (L3 0.4 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG)); Int_t iABSO = 1; Int_t iDIPO = 1; diff --git a/prod/LHC08d10/Config.C b/prod/LHC08d10/Config.C index 0cba2f78828..165e9aaa998 100644 --- a/prod/LHC08d10/Config.C +++ b/prod/LHC08d10/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -381,17 +381,17 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d11/Config.C b/prod/LHC08d11/Config.C index 0cba2f78828..60fff7c8ec7 100644 --- a/prod/LHC08d11/Config.C +++ b/prod/LHC08d11/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -381,16 +381,16 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d12/Config.C b/prod/LHC08d12/Config.C index a49246d47c6..62d06c35bd0 100644 --- a/prod/LHC08d12/Config.C +++ b/prod/LHC08d12/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -383,17 +383,18 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d13/Config.C b/prod/LHC08d13/Config.C index a49246d47c6..62d06c35bd0 100644 --- a/prod/LHC08d13/Config.C +++ b/prod/LHC08d13/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -383,17 +383,18 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d14/Config.C b/prod/LHC08d14/Config.C index a49246d47c6..62d06c35bd0 100644 --- a/prod/LHC08d14/Config.C +++ b/prod/LHC08d14/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -383,17 +383,18 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d15/Config.C b/prod/LHC08d15/Config.C index a49246d47c6..52f4a59e123 100644 --- a/prod/LHC08d15/Config.C +++ b/prod/LHC08d15/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -383,17 +383,19 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + + AliMagWrapCheb* field = 0x0; + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d16/Config.C b/prod/LHC08d16/Config.C index a49246d47c6..c81da8a59b7 100644 --- a/prod/LHC08d16/Config.C +++ b/prod/LHC08d16/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -383,16 +383,17 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d17/Config.C b/prod/LHC08d17/Config.C index a49246d47c6..fad5ca80486 100644 --- a/prod/LHC08d17/Config.C +++ b/prod/LHC08d17/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -383,19 +383,20 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; - if (mag == kNoField) { - comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); - } else if (mag == k5kG) { - comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); - } - printf("\n \n Comment: %s \n \n", comment.Data()); - - rl->CdGAFile(); - gAlice->SetField(field); + + AliMagF* field = 0x0; + if (mag == kNoField) { + comment = comment.Append(" | L3 field 0.0 T"); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); + } else if (mag == k5kG) { + comment = comment.Append(" | L3 field 0.5 T"); + 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; diff --git a/prod/LHC08d5/Config.C b/prod/LHC08d5/Config.C index a1d1be42a90..92f9c909d5d 100644 --- a/prod/LHC08d5/Config.C +++ b/prod/LHC08d5/Config.C @@ -357,7 +357,7 @@ void Config() // FIELD // - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 10., mag)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., mag)); printf("\n \n Comment: %s \n \n", comment.Data()); diff --git a/prod/LHC08d6/Config.C b/prod/LHC08d6/Config.C index 9997ff484e4..17a14d2b43c 100644 --- a/prod/LHC08d6/Config.C +++ b/prod/LHC08d6/Config.C @@ -260,7 +260,7 @@ void Config() gener->Init(); // Field (L3 0.5 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 10., mag)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., mag)); Int_t iABSO = 1; Int_t iDIPO = 1; diff --git a/prod/LHC08d8/Config.C b/prod/LHC08d8/Config.C index 0cba2f78828..fed5b871a7c 100644 --- a/prod/LHC08d8/Config.C +++ b/prod/LHC08d8/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -381,16 +381,17 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC08d9/Config.C b/prod/LHC08d9/Config.C index 0cba2f78828..60fff7c8ec7 100644 --- a/prod/LHC08d9/Config.C +++ b/prod/LHC08d9/Config.C @@ -19,7 +19,7 @@ #include "STEER/AliConfig.h" #include "PYTHIA6/AliDecayerPythia.h" #include "PYTHIA6/AliGenPythia.h" -#include "STEER/AliMagWrapCheb.h" +#include "STEER/AliMagF.h" #include "STRUCT/AliBODY.h" #include "STRUCT/AliMAG.h" #include "STRUCT/AliABSOv3.h" @@ -381,16 +381,16 @@ void Config() // FIELD // - AliMagWrapCheb* field = 0x0; + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG, - kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC09a1/Config.C b/prod/LHC09a1/Config.C index 5e108b7503f..cdc355fbb3c 100644 --- a/prod/LHC09a1/Config.C +++ b/prod/LHC09a1/Config.C @@ -45,7 +45,7 @@ class AliGenPythia; #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" @@ -542,19 +542,19 @@ void Config() } // FIELD - printf("\n \n Comment: %s \n \n", comment.Data()); + AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagWrapCheb("Maps","Maps", 2, 0., 10., AliMagWrapCheb::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); // field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG); - field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., AliMagWrapCheb::k5kG,kTRUE,"$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + 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); diff --git a/prod/LHC09a10/Config.C b/prod/LHC09a10/Config.C index a211c6e3003..a775f1a6f8d 100644 --- a/prod/LHC09a10/Config.C +++ b/prod/LHC09a10/Config.C @@ -193,7 +193,7 @@ void Config() //============================================================= // Field (L3 0.5 T) outside dimuon spectrometer - AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG); TGeoGlobalMagField::Instance()->SetField(field); Int_t iITS = 1; diff --git a/prod/LHC09a11/Config.C b/prod/LHC09a11/Config.C index a211c6e3003..a775f1a6f8d 100644 --- a/prod/LHC09a11/Config.C +++ b/prod/LHC09a11/Config.C @@ -193,7 +193,7 @@ void Config() //============================================================= // Field (L3 0.5 T) outside dimuon spectrometer - AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG); TGeoGlobalMagField::Instance()->SetField(field); Int_t iITS = 1; diff --git a/prod/LHC09a12/Config.C b/prod/LHC09a12/Config.C index a211c6e3003..a775f1a6f8d 100644 --- a/prod/LHC09a12/Config.C +++ b/prod/LHC09a12/Config.C @@ -193,7 +193,7 @@ void Config() //============================================================= // Field (L3 0.5 T) outside dimuon spectrometer - AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG); TGeoGlobalMagField::Instance()->SetField(field); Int_t iITS = 1; diff --git a/prod/LHC09a13/Config.C b/prod/LHC09a13/Config.C index a211c6e3003..a775f1a6f8d 100644 --- a/prod/LHC09a13/Config.C +++ b/prod/LHC09a13/Config.C @@ -193,7 +193,7 @@ void Config() //============================================================= // Field (L3 0.5 T) outside dimuon spectrometer - AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG); TGeoGlobalMagField::Instance()->SetField(field); Int_t iITS = 1; diff --git a/prod/LHC09a14/Config.C b/prod/LHC09a14/Config.C index a211c6e3003..a775f1a6f8d 100644 --- a/prod/LHC09a14/Config.C +++ b/prod/LHC09a14/Config.C @@ -193,7 +193,7 @@ void Config() //============================================================= // Field (L3 0.5 T) outside dimuon spectrometer - AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG); TGeoGlobalMagField::Instance()->SetField(field); Int_t iITS = 1; diff --git a/prod/LHC09a16/Config.C b/prod/LHC09a16/Config.C index a211c6e3003..a775f1a6f8d 100644 --- a/prod/LHC09a16/Config.C +++ b/prod/LHC09a16/Config.C @@ -193,7 +193,7 @@ void Config() //============================================================= // Field (L3 0.5 T) outside dimuon spectrometer - AliMagF *field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + AliMagF *field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG); TGeoGlobalMagField::Instance()->SetField(field); Int_t iITS = 1; diff --git a/test/PbPbbench/Config.C b/test/PbPbbench/Config.C index c7ef761611d..b7244385605 100644 --- a/test/PbPbbench/Config.C +++ b/test/PbPbbench/Config.C @@ -267,7 +267,7 @@ void Config() // Field - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag)); rl->CdGAFile(); // Int_t iABSO = 1; diff --git a/test/QA/Config.C b/test/QA/Config.C index efc14d635b4..85cff004ad5 100644 --- a/test/QA/Config.C +++ b/test/QA/Config.C @@ -401,9 +401,9 @@ void Config() comment = comment.Append(" | L3 field 0.5 T"); } printf("\n \n Comment: %s \n \n", comment.Data()); - - AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag); - field->SetL3ConstField(0); //Using const. field in the barrel + // to use constant field in the barrel use: + // AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kGUniform); + AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., mag); TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); diff --git a/test/embedding/Config.C b/test/embedding/Config.C index e96e7813bfd..b192988fd09 100644 --- a/test/embedding/Config.C +++ b/test/embedding/Config.C @@ -284,12 +284,10 @@ void Config() // AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - // field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG); - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform)); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::kNoField)); -// field = new AliMagFCheb("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG)); } printf("\n \n Comment: %s \n \n", comment.Data()); // TGeoGlobalMagField::Instance()->SetField(field); diff --git a/test/fpprod/Config.C b/test/fpprod/Config.C index 692f6feba76..328bbe421f1 100644 --- a/test/fpprod/Config.C +++ b/test/fpprod/Config.C @@ -221,12 +221,12 @@ void Config() AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG, + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform, "$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root", AliMagF::kBeamTypepp, energy/2.0); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG, + field = new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG, "$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root", AliMagF::kBeamTypepp, energy/2.0); } diff --git a/test/genkine/sim/Config.C b/test/genkine/sim/Config.C index 5e0972e41ea..a9b99b8816c 100644 --- a/test/genkine/sim/Config.C +++ b/test/genkine/sim/Config.C @@ -224,7 +224,7 @@ void Config() // Field (L3 0.4 T) - AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag); + AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., smag); TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); diff --git a/test/gun/Config.C b/test/gun/Config.C index 0a72ff20bc7..c9c8476deff 100644 --- a/test/gun/Config.C +++ b/test/gun/Config.C @@ -314,7 +314,7 @@ void Config() // //gener->SetVertexSmear(perTrack); // Field (L3 0.5 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., AliMagF::k5kG)); Int_t iABSO = 1; Int_t iDIPO = 1; diff --git a/test/merge/backgr/Config.C b/test/merge/backgr/Config.C index 97603bbb62b..f5a3e179f9d 100644 --- a/test/merge/backgr/Config.C +++ b/test/merge/backgr/Config.C @@ -273,7 +273,7 @@ void Config() // Field (L3 0.4 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag)); rl->CdGAFile(); // Int_t iABSO = 1; diff --git a/test/merge/signal/Config.C b/test/merge/signal/Config.C index 0ceb5f42d28..f4d0609bf24 100644 --- a/test/merge/signal/Config.C +++ b/test/merge/signal/Config.C @@ -272,7 +272,7 @@ void Config() // Field (L3 0.4 T) - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., smag)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag)); rl->CdGAFile(); // Int_t iABSO = 1; diff --git a/test/pileup/Config.C b/test/pileup/Config.C index f729028a552..0cf43e492e8 100644 --- a/test/pileup/Config.C +++ b/test/pileup/Config.C @@ -241,10 +241,10 @@ void Config() AliMagF* field = 0x0; if (mag == kNoField) { comment = comment.Append(" | L3 field 0.0 T"); - field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k2kG); + field = new AliMagF("Maps","Maps", 2, 0., 0., 10., AliMagF::k5kGUniform); } else if (mag == k5kG) { comment = comment.Append(" | L3 field 0.5 T"); - field = new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::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); diff --git a/test/ppbench/Config.C b/test/ppbench/Config.C index 47f2345030a..579bac6ee62 100644 --- a/test/ppbench/Config.C +++ b/test/ppbench/Config.C @@ -267,7 +267,7 @@ void Config() // Field - TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, 1., 1., 10., AliMagF::k5kG)); + TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 2, -1., -1., 10., smag)); rl->CdGAFile(); // diff --git a/test/pploadlibs/Config.C b/test/pploadlibs/Config.C index 40ca712509e..9971bce7205 100644 --- a/test/pploadlibs/Config.C +++ b/test/pploadlibs/Config.C @@ -334,7 +334,7 @@ void Config() } printf("\n \n Comment: %s \n \n", comment.Data()); - AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., mag); + AliMagF* field = new AliMagF("Maps","Maps", 2, -1., -1., 10., mag); TGeoGlobalMagField::Instance()->SetField(field); rl->CdGAFile(); -- 2.39.3