// <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)
#include "AliTPCParam.h"
#include "AliLog.h"
#include "TMatrixD.h"
+#include "TH2.h"
#include "TMath.h"
#include "AliTPCROC.h"
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)
{
//
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
#include "AliTPCCorrection.h"
+class TH2;
+
class AliTPCSpaceCharge : public AliTPCCorrection {
public:
AliTPCSpaceCharge();
// 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
// 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.