320 G4int pdg_nb =theAdjointSimManager
338 G4AnaH2* electron_current_rmatrix =0;
339 G4AnaH2* gamma_current_rmatrix =0;
340 G4AnaH2* proton_current_rmatrix =0;
345 electron_current_rmatrix =
368 for (i=0;i<edepCollection->
entries();i++)
369 totEdep+=(*edepCollection)[i]->GetValue()*
370 (*edepCollection)[i]->GetWeight();
372 G4bool new_mean_computed=
false;
374 if (normalised_weight>0.){
386 if ( new_error >0) new_relative_error = new_error/ new_mean;
388 G4cout<<
"Potential wrong adjoint weight!"<<std::endl;
389 G4cout<<
"The results of this event will not be registered!" 392 G4cout<<
"previous relative error "<< fRelative_error<<std::endl;
393 G4cout<<
"new rejected mean edep [MeV] "<< new_mean<<std::endl;
394 G4cout<<
"new rejected relative error "<< new_relative_error
404 fRelative_error =new_relative_error;
405 new_mean_computed=
true;
413 edep_rmatrix->fill(prim_ekin,totEdep*adj_weight/
cm2);
415 if (!new_mean_computed){
424 for (i=0;i<electronCurrentCollection->
entries();i++) {
425 G4double ekin =(*electronCurrentCollection)[i]->GetValue();
428 electron_current_rmatrix->fill(prim_ekin,ekin,weight*adj_weight/
cm2);
431 for (i=0;i<protonCurrentCollection->
entries();i++) {
432 G4double ekin =(*protonCurrentCollection)[i]->GetValue();
433 G4double weight=(*protonCurrentCollection)[i]->GetWeight();
435 proton_current_rmatrix->fill(prim_ekin,ekin,weight*adj_weight/
cm2);
438 for (i=0;i<gammaCurrentCollection->
entries();i++) {
439 G4double ekin =(*gammaCurrentCollection)[i]->GetValue();
440 G4double weight=(*gammaCurrentCollection)[i]->GetWeight();
442 gamma_current_rmatrix->fill(prim_ekin,ekin,weight*adj_weight/
cm2);
G4AnaH1 * fEdep_rmatrix_vs_proton_prim_energy
static G4AdjointSimManager * GetInstance()
G4double fEmax_prim_spectrum
G4AnaH1 * fEdep_rmatrix_vs_electron_prim_energy
G4VHitsCollection * GetHC(G4int i)
G4int GetCollectionID(G4String colName)
G4double fError_mean_edep
G4AnaH2 * fGamma_current_rmatrix_vs_proton_prim_energy
G4AnaH2 * fElectron_current_rmatrix_vs_electron_prim_energy
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack()
G4AnaH2 * fElectron_current_rmatrix_vs_gamma_prim_energy
G4AnaH2 * fProton_current_rmatrix_vs_proton_prim_energy
G4AnaH1 * fElectron_current
G4double GetEkinAtEndOfLastAdjointTrack()
G4GLOB_DLL std::ostream G4cout
G4AnaH1 * fEdep_vs_prim_ekin
static G4Proton * Proton()
G4AnaH1 * fProton_current
G4double PrimDiffAndDirFluxForAdjointSim(G4double prim_energy)
void ComputeMeanEdepAndError(const G4Event *anEvent, G4double &mean, G4double &error)
G4double fAccumulated_edep
G4AnaH2 * fGamma_current_rmatrix_vs_electron_prim_energy
G4AnaH2 * fElectron_current_rmatrix_vs_proton_prim_energy
static G4SDManager * GetSDMpointer()
G4HCofThisEvent * GetHCofThisEvent() const
G4double GetWeightAtEndOfLastAdjointTrack()
static G4Electron * Electron()
tools::histo::h1d G4AnaH1
G4double fEmin_prim_spectrum
tools::histo::h2d G4AnaH2
G4AnaH2 * fGamma_current_rmatrix_vs_gamma_prim_energy
G4double fAccumulated_edep2
G4AnaH1 * fEdep_rmatrix_vs_gamma_prim_energy