]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Merge remote-tracking branch 'origin/master' into TPCdev
authormkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 3 Feb 2014 17:16:48 +0000 (18:16 +0100)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 3 Feb 2014 17:16:48 +0000 (18:16 +0100)
Conflicts:
TPC/Sim/AliTPCv2.cxx

1  2 
TPC/Sim/AliTPCv2.cxx

index a81688eac14322d59b7964348e0f76fb7a6fc661,a66ef5f0e3c866ef58e0f4e65bc53da90697a609..18337b67319adbb4519e0044aa5b02b73c74b23d
  
  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;
  
    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
      //