From: mkrzewic Date: Mon, 3 Feb 2014 17:16:48 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/master' into TPCdev X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=0659d2e0b3292cf57fc627a68eb08bfc011b8aa6;p=u%2Fmrichter%2FAliRoot.git Merge remote-tracking branch 'origin/master' into TPCdev Conflicts: TPC/Sim/AliTPCv2.cxx --- 0659d2e0b3292cf57fc627a68eb08bfc011b8aa6 diff --cc TPC/Sim/AliTPCv2.cxx index a81688eac14,a66ef5f0e3c..18337b67319 --- a/TPC/Sim/AliTPCv2.cxx +++ b/TPC/Sim/AliTPCv2.cxx @@@ -56,10 -56,6 +56,9 @@@ using std::ifstream; using std::ios_base; - +extern "C"{ + Gas gaspar_; +}; ClassImp(AliTPCv2) //_____________________________________________________________________________ @@@ -75,15 -71,10 +74,14 @@@ AliTPCv2::AliTPCv2(const char *name, co SetBufferSize(128000); + if(!fTPCParam) {AliFatal("TPC parameters not set"); + return; + } + gaspar_.fpot=fTPCParam->GetFpot(); + gaspar_.eend=fTPCParam->GetEend(); + gaspar_.eexpo=fTPCParam->GetExp(); - -// if (fTPCParam) -// fTPCParam->Write(fTPCParam->GetTitle()); } //_____________________________________________________________________________ @@@ -2143,14 -2134,12 +2141,15 @@@ void AliTPCv2::StepManager( // // parameters used for the energy loss calculations // - const Float_t kprim = 14.35; // number of primary collisions per 1 cm - const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2 - const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation + //const Float_t kprim = 14.35; // number of primary collisions per 1 cm + //const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2 + //const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation + const Float_t kScalewIonG4 = 0.85; // scale factor to tune kwIon for Geant4 + const Float_t kFanoFactorG4 = 0.7; // parameter for smearing the number of ionizations (nel) using Geant4 const Int_t kMaxDistRef =15; // maximal difference between 2 stored references - + Float_t prim = fTPCParam->GetNprim(); + Float_t poti = fTPCParam->GetFpot(); + Float_t wIon = fTPCParam->GetWmean(); const Float_t kbig = 1.e10; @@@ -2274,17 -2263,24 +2273,24 @@@ if(gMC->TrackStep() > 0) { Int_t nel=0; if (!fPrimaryIonisation) { - nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; + nel = (Int_t)(((gMC->Edep())-poti)/wIon) + 1; } else { + + /* static Double_t deForNextStep = 0.; // Geant4 (the meaning of Edep as in Geant3) - wrong - //nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; + //nel = (Int_t)(((gMC->Edep())-poti)/wIon) + 1; // Geant4 (the meaning of Edep as in Geant3) - NEW Double_t eAvailable = gMC->Edep() + deForNextStep; - nel = (Int_t)(eAvailable/kwIon); - deForNextStep = eAvailable - nel*kwIon; + nel = (Int_t)(eAvailable/wIon); + deForNextStep = eAvailable - nel*wIon; + */ + + //new Geant4-approach - Double_t meanIon = gMC->Edep()/(kwIon*kScalewIonG4); ++ Double_t meanIon = gMC->Edep()/(wIon*kScalewIonG4); + nel = (Int_t) ( kFanoFactorG4*AliMathBase::Gamma(meanIon/kFanoFactorG4)); // smear nel using gamma distr w mean = meanIon and variance = meanIon/kFanoFactorG4 } nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV //