29 if (
fn %100000==0) {LOG(INFO)<<
"heartbeat event "<<
fn;}
30 Double_t Ekin = TMath::Power(10,gRandom->Uniform(-13.,-1.));
31 Double_t P = TMath::Sqrt( Ekin*Ekin+2*Ekin*
neutronMass);
32 Double_t phi = gRandom->Uniform(0,2*TMath::Pi());
33 Double_t theta = TMath::ACos(gRandom->Uniform(-1,1));
34 Double_t px = P*TMath::Sin(theta)*TMath::Cos(phi);
35 Double_t py = P*TMath::Sin(theta)*TMath::Sin(phi);
36 Double_t pz = P*TMath::Cos(theta);
37 LOG(DEBUG) <<
"NeutronGenerator_FLUKA: " << Ekin <<
" " << P <<
" " << px<<
" "<<py<<
" "<<pz;
40 phi = gRandom->Uniform(0,2*TMath::Pi());
41 theta = TMath::ACos(gRandom->Uniform(-1,1));
42 Double_t x = R*TMath::Sin(theta)*TMath::Cos(phi);
43 Double_t y = R*TMath::Sin(theta)*TMath::Sin(phi);
44 Double_t z = R*TMath::Cos(theta);
46 cpg->AddTrack(2112,px,py,pz,x,y,z,-1,
true,Ekin+
neutronMass,0.,1.,(TMCProcess)0);