From: mivanov Date: Mon, 15 Dec 2014 23:08:46 +0000 (+0100) Subject: ATO-98 Possibility to scale ExBBShpae correction - needed for fitting and test purposes X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=b3abc26218cb5b4ff27a377c0af3433c71cf3e5b;p=u%2Fmrichter%2FAliRoot.git ATO-98 Possibility to scale ExBBShpae correction - needed for fitting and test purposes --- diff --git a/TPC/TPCbase/AliTPCExBBShape.cxx b/TPC/TPCbase/AliTPCExBBShape.cxx index 9f95e82321c..bf1dafafd88 100644 --- a/TPC/TPCbase/AliTPCExBBShape.cxx +++ b/TPC/TPCbase/AliTPCExBBShape.cxx @@ -28,6 +28,7 @@ AliTPCExBBShape::AliTPCExBBShape() : AliTPCCorrection("exb_bshape","ExB B-shape"), fC1(0.),fC2(0.), + fScaling(1.), fBField(0) { // @@ -41,6 +42,30 @@ AliTPCExBBShape::~AliTPCExBBShape() { // } + + + +Bool_t AliTPCExBBShape::AddCorrectionCompact(AliTPCCorrection* corr, Double_t weight){ + // + // Add correction and make them compact + // Assumptions: + // - origin of distortion/correction are additive + // - only correction ot the same type supported () + if (corr==NULL) { + AliError("Zerro pointer - correction"); + return kFALSE; + } + AliTPCExBBShape* corrC = dynamic_cast(corr); + if (corrC == NULL) { + AliError(TString::Format("Inconsistent class types: %s\%s",IsA()->GetName(),corr->IsA()->GetName()).Data()); + return kFALSE; + } + fScaling= weight; + // + return kTRUE; +} + + void AliTPCExBBShape::Init() { // // Initialization funtion @@ -101,8 +126,8 @@ void AliTPCExBBShape::GetCorrection(const Float_t x[],const Short_t roc,Float_t fBField->GetTPCRatInt(xStart,intBStart); fBField->GetTPCRatInt(xEnd, intBEnd ); - const Float_t intBxOverBz=(intBEnd[0]-intBStart[0]); - const Float_t intByOverBz=(intBEnd[1]-intBStart[1]); + const Float_t intBxOverBz=fScaling*(intBEnd[0]-intBStart[0]); + const Float_t intByOverBz=fScaling*(intBEnd[1]-intBStart[1]); dx[0]=fC2*intBxOverBz-fC1*intByOverBz; dx[1]=fC1*intBxOverBz+fC2*intByOverBz; @@ -131,8 +156,8 @@ void AliTPCExBBShape::GetBxAndByOverBz(const Float_t x[],const Short_t roc,Float fBField->GetTPCRatInt(xStart,intBStart); fBField->GetTPCRatInt(xEnd, intBEnd ); - const Float_t intBxOverBz=(intBEnd[0]-intBStart[0]); - const Float_t intByOverBz=(intBEnd[1]-intBStart[1]); + const Float_t intBxOverBz=fScaling*(intBEnd[0]-intBStart[0]); + const Float_t intByOverBz=fScaling*(intBEnd[1]-intBStart[1]); BxByOverBz[0]=intBxOverBz; BxByOverBz[1]=intByOverBz; diff --git a/TPC/TPCbase/AliTPCExBBShape.h b/TPC/TPCbase/AliTPCExBBShape.h index fde0c6da41a..2e3db4478fd 100644 --- a/TPC/TPCbase/AliTPCExBBShape.h +++ b/TPC/TPCbase/AliTPCExBBShape.h @@ -41,7 +41,8 @@ class AliMagF; class AliTPCExBBShape : public AliTPCCorrection { public: AliTPCExBBShape(); - virtual ~AliTPCExBBShape(); + virtual ~AliTPCExBBShape(); + virtual Bool_t AddCorrectionCompact(AliTPCCorrection* corr, Double_t weight); // initialization and update functions virtual void Init(); @@ -66,11 +67,11 @@ public: virtual void Print(Option_t* option="") const; static Double_t GetBFieldXYZ(Double_t gx, Double_t gy, Double_t gz, Int_t axisType); - + Double_t GetScaling() const {return fScaling;} private: Float_t fC1; // coefficient C1 (compare Jim Thomas's notes for definitions) Float_t fC2; // coefficient C2 (compare Jim Thomas's notes for definitions) - + Float_t fScaling; // scaling factor to rescale distortion - for tests purposes only AliMagF *fBField; // pointer to magnetic field AliTPCExBBShape & operator =(const AliTPCExBBShape &); // dummy assignment operator