Float_t x=(fLx > 66.6)? fLx-66.6:fLx; //sagita is for PC (0-64) and not for chamber
Float_t qdcEle=34.06311+0.2337070*x+5.807476e-3*x*x-2.956471e-04*x*x*x+2.310001e-06*x*x*x*x; //reparametrised from DiMauro
- Int_t iNele=Int_t(e/26e-9); if(iNele<1) iNele=1; //number of electrons created by hit
+ Int_t iNele=Int_t(e/26e-9); if(iNele<1) return 0; //number of electrons created by hit
fQ=0;
for(Int_t i=1;i<=iNele;i++){
Double_t rnd=gRandom->Rndm(); if(rnd==0) rnd=1e-12; //1e-12 is a protection against 0 from rndm
out[2]=0.5*(out[2]+in[2]);
TString tmpname = volname; tmpname.Remove(0,4); Int_t idch = tmpname.Atoi(); //retrieve the chamber number
Float_t xl,yl;AliHMPIDParam::Instance()->Mars2Lors(idch,out,xl,yl); //take LORS position
- new((*fHits)[fNhits++])AliHMPIDHit(idch,eloss,pid,tid,xl,yl,out); //HIT for MIP, position near anod plane, eloss will be set to Q
- if(fDoFeed) GenFee(eloss); //generate feedback photons
+ if(eloss>0) {
+ new((*fHits)[fNhits++])AliHMPIDHit(idch,eloss,pid,tid,xl,yl,out); //HIT for MIP, position near anod plane, eloss will be set to Q
+ if(fDoFeed) GenFee(eloss); //generate feedback photons
+ }
}else //just going inside
eloss += gMC->Edep(); //collect this step eloss
}//MIP in GAP