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()));
vol[1]=0; // preset row number to 0
//
- gMC->SetMaxStep(kbig);
+ if (fPrimaryIonisation) gMC->SetMaxStep(kbig);
if(!gMC->IsTrackAlive()) return; // particle has disappeared
// 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);
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);
+ }
}