]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the histogram as an optional input:
authormivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 May 2013 17:21:23 +0000 (17:21 +0000)
committermivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 May 2013 17:21:23 +0000 (17:21 +0000)
https://indico.cern.ch/conferenceDisplay.py?confId=241928

TPC/Base/AliTPCSpaceCharge.cxx
TPC/Base/AliTPCSpaceCharge.h

index 67f06af2cb0b1d218b9e058803d160d2fb01ba4b..ff697e5340f521c8803cd04ac4a3e932d511f258 100644 (file)
 //   <p>
 //   The scaling factor can be set via the function SetCorrectionFactor. An example of 
 //   the shape of the distortions is given below.
+//
+//   MI modification - 22.05.2013
+//   As an optional input the Space charge histogram RZ is used in case it is provided 
+//     - using the SetInputSpaceCharge function
+//
 // End_Html
 //
 // Begin_Macro(source)
@@ -60,6 +65,7 @@
 #include "AliTPCParam.h"
 #include "AliLog.h"
 #include "TMatrixD.h"
+#include "TH2.h"
 
 #include "TMath.h"
 #include "AliTPCROC.h"
@@ -69,7 +75,7 @@ ClassImp(AliTPCSpaceCharge)
 
 AliTPCSpaceCharge::AliTPCSpaceCharge()
   : AliTPCCorrection("SpaceCharge2D","Space Charge 2D"),
-    fC0(0.),fC1(0.),fCorrectionFactor(0.001),
+    fC0(0.),fC1(0.),fCorrectionFactor(0.001),fSpaceChargeHistogram(0),
     fInitLookUp(kFALSE)
 {
   //
@@ -221,6 +227,19 @@ void AliTPCSpaceCharge::InitSpaceChargeDistortion() {
       chargeDensity(i,j) = zterm / ( TMath::Log(fgkOFCRadius/fgkIFCRadius) * ( radius*radius ) ) ;              
     }
   }
+  // Fill the initial space charge in case histogram exist
+  if (fSpaceChargeHistogram){
+    for ( Int_t j = 1 ; j < kColumns-1 ; j++ ) {
+      Double_t zed = j*gridSizeZ ;
+      for ( Int_t i = 1 ; i < kRows-1 ; i++ ) { 
+       Double_t radius = fgkIFCRadius + i*gridSizeR ;
+       
+       Double_t zterm = (fgkTPCZ0-zed) * (fgkOFCRadius*fgkOFCRadius - fgkIFCRadius*fgkIFCRadius) / fgkTPCZ0 ;
+       // for 1/R**2 charge density in the TPC; then integrated in Z due to drifting ions
+       chargeDensity(i,j) = fSpaceChargeHistogram->Interpolate(radius,zed);
+      }
+    }
+  }
 
 
   // Solve the electrosatic problem in 2D 
index a263953d93f0ad912b8bd07f058eab2882219cd7..6426263e640b54b0ac3d8cebc4acffe08d597703 100644 (file)
@@ -12,6 +12,8 @@
 #include "AliTPCCorrection.h"
 
 
+class TH2; 
+
 class AliTPCSpaceCharge : public AliTPCCorrection {
 public:
   AliTPCSpaceCharge();
@@ -20,6 +22,8 @@ public:
   // initialization and update functions
   virtual void Init();
   virtual void Update(const TTimeStamp &timeStamp);
+  void    SetInputSpaceCharge(TH2 * hisSpaceCharge){fSpaceChargeHistogram = hisSpaceCharge;}  // MI add
+  const TH2 *   GetInputSpaceCharge(){return fSpaceChargeHistogram;}       // MI add 
 
 
   // common setters and getters for tangled ExB effect
@@ -50,11 +54,11 @@ private:
                                    // look up table which was created for M_mb = 900 and IR = 3000
                                    // compare Internal Note Nr: ???
 
+  TH2 *    fSpaceChargeHistogram;      // Histogram with the input space charge histogram - used as an optional input 
   Bool_t fInitLookUp;                  // flag to check it the Look Up table was created
 
   Double_t fLookUpErOverEz[kNZ][kNR];  // Array to store electric field integral (int Er/Ez)
   Double_t fLookUpDeltaEz[kNZ][kNR];   // Array to store electric field integral (int Delta Ez)
-
   // basic numbers for the poisson relaxation //can be set individually in each class
   enum {kRows   =257}; // grid size in r direction used in the poisson relaxation // ( 2**n + 1 ) eg. 65, 129, 257 etc.
   enum {kColumns=129}; // grid size in z direction used in the poisson relaxation // ( 2**m + 1 ) eg. 65, 129, 257 etc.