X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCv2.cxx;h=194c24dd9e5e607b81a91ea58761fd6913a45756;hb=596afefb94feef7d6d1ab731428fefc13fe9dbdd;hp=d2d23e491f83aacdf2e1a635593cee65a41d31d8;hpb=1bae4c82f25af0416beefd80b031952ba8fee2a9;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCv2.cxx b/TPC/AliTPCv2.cxx index d2d23e491f8..194c24dd9e5 100644 --- a/TPC/AliTPCv2.cxx +++ b/TPC/AliTPCv2.cxx @@ -1144,9 +1144,17 @@ void AliTPCv2::Init() fIDrift=gMC->VolId("TPC_Drift"); fSecOld=-100; // fake number - gMC->SetMaxNStep(30000); // max. number of steps increased + gMC->SetMaxNStep(-30000); // max. number of steps increased + + if (fPrimaryIonisation) { + gMC->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential + + gMC->Gstpar(idtmed[2],"PRIMIO_N", 14.35); + gMC->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss + } else { + gMC->Gstpar(idtmed[2],"LOSS", 5); // specific energy loss + } - gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss AliInfo("*** TPC version 2 initialized ***"); AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep())); @@ -1179,7 +1187,7 @@ void AliTPCv2::StepManager() vol[1]=0; // preset row number to 0 // - gMC->SetMaxStep(kbig); + if (fPrimaryIonisation) gMC->SetMaxStep(kbig); if(!gMC->IsTrackAlive()) return; // particle has disappeared @@ -1274,8 +1282,14 @@ void AliTPCv2::StepManager() // charged particle is in the sensitive drift volume //----------------------------------------------------------------- if(gMC->TrackStep() > 0) { - - Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; + Int_t nel=0; + if (!fPrimaryIonisation) { + nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1; + } + else { + Float_t edep = gMC->Edep(); + if (edep > 0.) nel = (Int_t)((gMC->Edep()*1.5)/kwIon) + 1; + } nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV // gMC->TrackPosition(p); @@ -1304,28 +1318,30 @@ void AliTPCv2::StepManager() Float_t pp; TLorentzVector mom; - gMC->TrackMomentum(mom); - Float_t ptot=mom.Rho(); - Float_t betaGamma = ptot/gMC->TrackMass(); - - Int_t pid=gMC->TrackPid(); - if((pid==kElectron || pid==kPositron) && ptot > 0.002) - { - pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau! - } - else - { + // below is valid only for Geant3 (fPromaryIonisation not set) + if(!fPrimaryIonisation){ + gMC->TrackMomentum(mom); + Float_t ptot=mom.Rho(); + Float_t betaGamma = ptot/gMC->TrackMass(); + + Int_t pid=gMC->TrackPid(); + if((pid==kElectron || pid==kPositron) && ptot > 0.002) + { + pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau! + } + else + { - betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg - pp=kprim*BetheBloch(betaGamma); + betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg + pp=kprim*BetheBloch(betaGamma); - if(TMath::Abs(charge) > 1.) pp *= (charge*charge); + if(TMath::Abs(charge) > 1.) pp *= (charge*charge); } - Double_t rnd = gMC->GetRandom()->Rndm(); - - gMC->SetMaxStep(-TMath::Log(rnd)/pp); + Double_t rnd = gMC->GetRandom()->Rndm(); + gMC->SetMaxStep(-TMath::Log(rnd)/pp); + } }