From e86708b38d14eeb9425f9cf0492023802b241e9d Mon Sep 17 00:00:00 2001 From: shahoian Date: Thu, 3 Sep 2009 14:43:46 +0000 Subject: [PATCH] Corrected dipole field sign for DCS convention. Temporarily suppressed abort of field init in case of wrong beamenergy in AliGRPManager --- STEER/AliGRPManager.cxx | 18 +++++++++--------- STEER/AliMagF.cxx | 4 ++-- STEER/AliReconstruction.cxx | 24 +++++++++++++----------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/STEER/AliGRPManager.cxx b/STEER/AliGRPManager.cxx index 91557e4f699..cc56130afe2 100644 --- a/STEER/AliGRPManager.cxx +++ b/STEER/AliGRPManager.cxx @@ -149,10 +149,9 @@ Bool_t AliGRPManager::SetMagField() if (beamEnergy==AliGRPObject::GetInvalidFloat()) { AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0"); beamEnergy = 0; - ok = kFALSE; + //ok = kFALSE; // temprorary suppressed to make read cosmics data } - // LHC: "multiply by 120 to get the energy in MeV" - beamEnergy *= 0.120; + 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; @@ -285,12 +284,13 @@ Bool_t AliGRPManager::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Pol, 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)); - } - 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":""); + else AliInfo(Form("Assume no LHC magnet field for the beam type %s, ",beamtype)); + char ttl[80]; + sprintf(ttl,"L3: %+5d Dip: %+4d kA; %s | Polarities in %s convention",(int)TMath::Sign(l3Cur,float(sclL3)), + (int)TMath::Sign(diCur,float(sclDip)),uniform ? " Constant":"", + convention==AliMagF::kConvLHC ? "LHC":"DCS2008"); + // LHC and DCS08 conventions have opposite dipole polarities + if ( AliMagF::GetPolarityConvention() != convention) sclDip = -sclDip; AliMagF* fld = new AliMagF("MagneticFieldMap", ttl, 2, sclL3, sclDip, 10., map, path, btype,beamenergy); TGeoGlobalMagField::Instance()->SetField( fld ); diff --git a/STEER/AliMagF.cxx b/STEER/AliMagF.cxx index 0eff772f8fd..8697aad1cf5 100644 --- a/STEER/AliMagF.cxx +++ b/STEER/AliMagF.cxx @@ -124,8 +124,8 @@ AliMagF::AliMagF(const char *name, const char* title, Int_t integ, fSolenoid = GetBz(xyz); SetFactorSol(factorSol); SetFactorDip(factorDip); - AliInfo(Form("Alice B fields: Solenoid %.0f kG (factor %+.2f), Dipole %s (factor %+.2f) %s", - (fMapType==k5kG||fMapType==k5kGUniform)?5.:2.,factorSol, + AliInfo(Form("Alice B fields: Solenoid (%+.2f*)%.0f kG, Dipole %s (%+.2f) %s", + factorSol,(fMapType==k5kG||fMapType==k5kGUniform)?5.:2., fDipoleOFF ? "OFF":"ON",factorDip,fMapType==k5kGUniform?" |Constant Field!":"")); AliInfo(Form("Machine B fields for %s beam (%.0f GeV): QGrad: %.4f Dipole: %.4f", bt==kBeamTypeAA ? "A-A":(bt==kBeamTypepp ? "p-p":"OFF"),be,fQuadGradient,fDipoleField)); diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index b52ee3313ae..ca1a5b1981b 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -958,8 +958,8 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po 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())); + AliError(Form("Wrong combination for L3/Dipole polarities (%c/%c) in %s convention", + l3Pol>0?'+':'-',diPol>0?'+':'-',convention==AliMagF::kConvDCS2008?"DCS2008":"LHC")); return kFALSE; } // @@ -973,12 +973,15 @@ Bool_t AliReconstruction::SetFieldMap(Float_t l3Cur, Float_t diCur, Float_t l3Po 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)); - } - 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":""); + else AliInfo(Form("Assume no LHC magnet field for the beam type %s, ",beamtype)); + // + char ttl[80]; + sprintf(ttl,"L3: %+5d Dip: %+4d kA; %s | Polarities in %s convention",(int)TMath::Sign(l3Cur,float(sclL3)), + (int)TMath::Sign(diCur,float(sclDip)),uniform ? " Constant":"", + convention==AliMagF::kConvLHC ? "LHC":"DCS2008"); + // LHC and DCS08 conventions have opposite dipole polarities + if ( AliMagF::GetPolarityConvention() != convention) sclDip = -sclDip; + // AliMagF* fld = new AliMagF("MagneticFieldMap", ttl, 2, sclL3, sclDip, 10., map, path, btype,beamenergy); TGeoGlobalMagField::Instance()->SetField( fld ); @@ -1039,8 +1042,8 @@ Bool_t AliReconstruction::InitGRP() { AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0"); beamEnergy = 0; } - // LHC: "multiply by 120 to get the energy in MeV" - beamEnergy *= 0.120; + // energy is provided in MeV*120 + beamEnergy /= 120E3; TString runType = fGRPData->GetRunType(); if (runType==AliGRPObject::GetInvalidString()) { @@ -2763,7 +2766,6 @@ AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet) if (reconstructor) { TObject* obj = fOptions.FindObject(detName.Data()); if (obj) reconstructor->SetOption(obj->GetTitle()); - reconstructor->SetRunInfo(fRunInfo); reconstructor->Init(); fReconstructor[iDet] = reconstructor; } -- 2.39.3