]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ATO-98 Possibility to scale ExBBShpae correction - needed for fitting and test purposes
authormivanov <marian.ivanov@cern.ch>
Mon, 15 Dec 2014 23:08:46 +0000 (00:08 +0100)
committermivanov <marian.ivanov@cern.ch>
Mon, 15 Dec 2014 23:12:04 +0000 (00:12 +0100)
TPC/TPCbase/AliTPCExBBShape.cxx
TPC/TPCbase/AliTPCExBBShape.h

index 9f95e82321c1a69fd663394e65d0a248c9078a8a..bf1dafafd8830430e4179dd89ca8b7e0b251d23d 100644 (file)
@@ -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<AliTPCExBBShape *>(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;
index fde0c6da41a9c2fdb165dfa9b12d9bfecc142601..2e3db4478fd1505c731c766f593eb8a0fbf079b8 100644 (file)
@@ -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