From 77c9a262494321a864ec08575026e1470b9bd018 Mon Sep 17 00:00:00 2001 From: shahoian Date: Tue, 27 Apr 2010 11:44:07 +0000 Subject: [PATCH] Added Print (short and detailed options) method --- STEER/AliMagF.cxx | 22 +++++++++++++++++----- STEER/AliMagF.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/STEER/AliMagF.cxx b/STEER/AliMagF.cxx index 2e5d7e507fa..8d9c252cdb9 100644 --- a/STEER/AliMagF.cxx +++ b/STEER/AliMagF.cxx @@ -146,11 +146,7 @@ AliMagF::AliMagF(const char *name, const char* title, Double_t factorSol, Double fSolenoid = GetBz(xyz); SetFactorSol(factorSol); SetFactorDip(factorDip); - 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)); + Print("a"); } //_______________________________________________________________________ @@ -558,3 +554,19 @@ const char* AliMagF::GetBeamTypeText() const } } +//_____________________________________________________________________________ +void AliMagF::Print(Option_t *opt) const +{ + // print short or long info + TString opts = opt; opts.ToLower(); + AliInfo(Form("%s:%s",GetName(),GetTitle())); + AliInfo(Form("Solenoid (%+.2f*)%.0f kG, Dipole %s (%+.2f) %s", + GetFactorSol(),(fMapType==k5kG||fMapType==k5kGUniform)?5.:2., + fDipoleOFF ? "OFF":"ON",GetFactorDip(),fMapType==k5kGUniform?" |Constant Field!":"")); + if (opts.Contains("a")) { + AliInfo(Form("Machine B fields for %s beam (%.0f GeV): QGrad: %.4f Dipole: %.4f", + fBeamType==kBeamTypeAA ? "A-A":(fBeamType==kBeamTypepp ? "p-p":"OFF"), + fBeamEnergy,fQuadGradient,fDipoleField)); + AliInfo(Form("Uses %s of %s",GetParamName(),GetDataFileName())); + } +} diff --git a/STEER/AliMagF.h b/STEER/AliMagF.h index b2ed8e0e798..1f714a3b8a7 100644 --- a/STEER/AliMagF.h +++ b/STEER/AliMagF.h @@ -64,6 +64,7 @@ class AliMagF : public TVirtualMagField Char_t* GetParamName() const {return (Char_t*)fParNames.GetTitle();} void SetDataFileName(const Char_t* nm) {fParNames.SetName(nm);} void SetParamName(const Char_t* nm) {fParNames.SetTitle(nm);} + virtual void Print(Option_t *opt) const; // Bool_t LoadParameterization(); static Int_t GetPolarityConvention() {return Int_t(fgkPolarityConvention);} -- 2.43.0