Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NuDEXPSF Class Reference

#include <G4NuDEXPSF.hh>

Public Member Functions

 G4NuDEXPSF (G4int aZ, G4int aA)
 
 ~G4NuDEXPSF ()
 
G4int Init (const char *dirname, G4NuDEXLevelDensity *aLD, const char *inputfname=0, const char *defaultinputfname=0, G4int PSFflag=0)
 
G4double GetE1 (G4double Eg, G4double ExcitationEnergy)
 
G4double GetM1 (G4double Eg, G4double ExcitationEnergy)
 
G4double GetE2 (G4double Eg, G4double ExcitationEnergy)
 
void PrintPSFParameters (std::ostream &out)
 
void PrintPSFParametersInInputFileFormat (std::ostream &out)
 

Detailed Description

Definition at line 86 of file G4NuDEXPSF.hh.

Constructor & Destructor Documentation

◆ G4NuDEXPSF()

G4NuDEXPSF::G4NuDEXPSF ( G4int aZ,
G4int aA )

Definition at line 47 of file G4NuDEXPSF.cc.

47 {
48 Z_Int=aZ;
49 A_Int=aA;
50 nR_E1= nR_M1= nR_E2=0;
51 np_E1= np_M1= np_E2=0;
52 x_E1= y_E1=nullptr;
53 x_M1= y_M1=nullptr;
54 x_E2= y_E2=nullptr;
55 E1_normFac=-1; M1_normFac=-1; E2_normFac=-1;
56 NormEmin=0; NormEmax=6; //Integral between 0 and 6 MeV
57 ScaleFactor_E1=1;
58 ScaleFactor_M1=1;
59 ScaleFactor_E2=1;
60 theLD=nullptr;
61}

◆ ~G4NuDEXPSF()

G4NuDEXPSF::~G4NuDEXPSF ( )

Definition at line 63 of file G4NuDEXPSF.cc.

63 {
64 delete [] x_E1;
65 delete [] y_E1;
66 delete [] x_M1;
67 delete [] y_M1;
68 delete [] x_E2;
69 delete [] y_E2;
70}

Member Function Documentation

◆ GetE1()

G4double G4NuDEXPSF::GetE1 ( G4double Eg,
G4double ExcitationEnergy )

Definition at line 463 of file G4NuDEXPSF.cc.

463 {
464
465 G4double result=0;
466 for(G4int i=0;i<nR_E1;i++){
467 if(PSFType_E1[i]==0){
468 result+=8.674E-8*SLO(Eg,E_E1[i],G_E1[i],s_E1[i]);
469 }
470 else if(PSFType_E1[i]==1){
471 result+=8.674E-8*EGLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
472 }
473 else if(PSFType_E1[i]==2){
474 result+=8.674E-8*SMLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
475 }
476 else if(PSFType_E1[i]==3){
477 result+=8.674E-8*GLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
478 }
479 else if(PSFType_E1[i]==4){
480 result+=8.674E-8*MGLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
481 }
482 else if(PSFType_E1[i]==5){
483 result+=8.674E-8*KMF(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
484 }
485 else if(PSFType_E1[i]==6){
486 result+=8.674E-8*GH(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
487 }
488 else if(PSFType_E1[i]==7){
489 result+=8.674E-8*MEGLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy,p1_E1[i],p1_E1[i]);
490 }
491 else if(PSFType_E1[i]==8){
492 result+=8.674E-8*MEGLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy,p1_E1[i],p2_E1[i]);
493 }
494 else if(PSFType_E1[i]==9){
495 result+=8.674E-8*MEGLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy,p1_E1[i],p1_E1[i],p2_E1[i]);
496 }
497 else if(PSFType_E1[i]==10){
498 result+=8.674E-8*MEGLO(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy,p1_E1[i],p2_E1[i],p3_E1[i]);
499 }
500 else if(PSFType_E1[i]==11){
501 result+=8.674E-8*SMLO_v2(Eg,E_E1[i],G_E1[i],s_E1[i],ExcitationEnergy);
502 }
503 else if(PSFType_E1[i]==20){
504 result+=8.674E-8*Gauss(Eg,E_E1[i],G_E1[i],s_E1[i]);
505 }
506 else if(PSFType_E1[i]==21){
507 result+=8.674E-8*Expo(Eg,E_E1[i],G_E1[i]);
508 }
509 else if(PSFType_E1[i]==40){
510 result+=EvaluateFunction(Eg,np_E1,x_E1,y_E1);
511 }
512 else if(PSFType_E1[i]==41){
513 result+=std::pow(10.,EvaluateFunction(Eg,np_E1,x_E1,y_E1));
514 }
515 else{
516 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
517 }
518 }
519
520 if(result!=result){ // nan
521 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
522 }
523
524 return result*ScaleFactor_E1;
525}
void NuDEXException(const char *originOfException, const char *exceptionCode, const char *description)
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85

◆ GetE2()

G4double G4NuDEXPSF::GetE2 ( G4double Eg,
G4double ExcitationEnergy )

Definition at line 591 of file G4NuDEXPSF.cc.

591 {
592
593 G4double result=0;
594 for(G4int i=0;i<nR_E2;i++){
595 if(PSFType_E2[i]==0){
596 result+=5.22E-8*SLO(Eg,E_E2[i],G_E2[i],s_E2[i]);
597 }
598 else if(PSFType_E2[i]==1){
599 result+=5.22E-8*EGLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
600 }
601 else if(PSFType_E2[i]==2){
602 result+=5.22E-8*SMLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
603 }
604 else if(PSFType_E2[i]==3){
605 result+=5.22E-8*GLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
606 }
607 else if(PSFType_E2[i]==4){
608 result+=5.22E-8*MGLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
609 }
610 else if(PSFType_E2[i]==5){
611 result+=5.22E-8*KMF(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
612 }
613 else if(PSFType_E2[i]==6){
614 result+=5.22E-8*GH(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
615 }
616 else if(PSFType_E2[i]==7){
617 result+=5.22E-8*MEGLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy,p1_E2[i],p1_E2[i]);
618 }
619 else if(PSFType_E2[i]==8){
620 result+=5.22E-8*MEGLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy,p1_E2[i],p2_E2[i]);
621 }
622 else if(PSFType_E2[i]==9){
623 result+=5.22E-8*MEGLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy,p1_E2[i],p1_E2[i],p2_E2[i]);
624 }
625 else if(PSFType_E2[i]==10){
626 result+=5.22E-8*MEGLO(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy,p1_E2[i],p2_E2[i],p3_E2[i]);
627 }
628 else if(PSFType_E2[i]==11){
629 result+=5.22E-8*SMLO_v2(Eg,E_E2[i],G_E2[i],s_E2[i],ExcitationEnergy);
630 }
631 else if(PSFType_E2[i]==20){
632 result+=5.22E-8*Gauss(Eg,E_E2[i],G_E2[i],s_E2[i]);
633 }
634 else if(PSFType_E2[i]==21){
635 result+=5.22E-8*Expo(Eg,E_E2[i],G_E2[i]);
636 }
637 else if(PSFType_E2[i]==40){
638 result+=EvaluateFunction(Eg,np_E2,x_E2,y_E2);
639 }
640 else if(PSFType_E2[i]==41){
641 result+=std::pow(10.,EvaluateFunction(Eg,np_E2,x_E2,y_E2));
642 }
643 else{
644 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
645 }
646 }
647
648 if(result!=result){ // nan
649 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
650 }
651
652 return result*ScaleFactor_E2;
653}

◆ GetM1()

G4double G4NuDEXPSF::GetM1 ( G4double Eg,
G4double ExcitationEnergy )

Definition at line 527 of file G4NuDEXPSF.cc.

527 {
528
529 G4double result=0;
530 for(G4int i=0;i<nR_M1;i++){
531 if(PSFType_M1[i]==0){
532 result+=8.674E-8*SLO(Eg,E_M1[i],G_M1[i],s_M1[i]);
533 }
534 else if(PSFType_M1[i]==1){
535 result+=8.674E-8*EGLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
536 }
537 else if(PSFType_M1[i]==2){
538 result+=8.674E-8*SMLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
539 }
540 else if(PSFType_M1[i]==3){
541 result+=8.674E-8*GLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
542 }
543 else if(PSFType_M1[i]==4){
544 result+=8.674E-8*MGLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
545 }
546 else if(PSFType_M1[i]==5){
547 result+=8.674E-8*KMF(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
548 }
549 else if(PSFType_M1[i]==6){
550 result+=8.674E-8*GH(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
551 }
552 else if(PSFType_M1[i]==7){
553 result+=8.674E-8*MEGLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy,p1_M1[i],p1_M1[i]);
554 }
555 else if(PSFType_M1[i]==8){
556 result+=8.674E-8*MEGLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy,p1_M1[i],p2_M1[i]);
557 }
558 else if(PSFType_M1[i]==9){
559 result+=8.674E-8*MEGLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy,p1_M1[i],p1_M1[i],p2_M1[i]);
560 }
561 else if(PSFType_M1[i]==10){
562 result+=8.674E-8*MEGLO(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy,p1_M1[i],p2_M1[i],p3_M1[i]);
563 }
564 else if(PSFType_M1[i]==11){
565 result+=8.674E-8*SMLO_v2(Eg,E_M1[i],G_M1[i],s_M1[i],ExcitationEnergy);
566 }
567 else if(PSFType_M1[i]==20){
568 result+=8.674E-8*Gauss(Eg,E_M1[i],G_M1[i],s_M1[i]);
569 }
570 else if(PSFType_M1[i]==21){
571 result+=8.674E-8*Expo(Eg,E_M1[i],G_M1[i]);
572 }
573 else if(PSFType_M1[i]==40){
574 result+=EvaluateFunction(Eg,np_M1,x_M1,y_M1);
575 }
576 else if(PSFType_M1[i]==41){
577 result+=std::pow(10.,EvaluateFunction(Eg,np_M1,x_M1,y_M1));
578 }
579 else{
580 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
581 }
582 }
583
584 if(result!=result){ // nan
585 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
586 }
587
588 return result*ScaleFactor_M1;
589}

◆ Init()

G4int G4NuDEXPSF::Init ( const char * dirname,
G4NuDEXLevelDensity * aLD,
const char * inputfname = 0,
const char * defaultinputfname = 0,
G4int PSFflag = 0 )

Definition at line 74 of file G4NuDEXPSF.cc.

74 {
75
76 theLD=aLD;
77
78 //Three options: very detailed model, if not --> gdr-parameters&errors-exp-MLO.dat (RIPL-3), if not --> theorethical values
79
80 char fname[500];
81 G4bool IsDone=false;
82
83 //input:
84 if(inputfname!=0){
85 IsDone=TakePSFFromInputFile(inputfname);
86 if(IsDone){return 0;}
87 }
88
89 //default input:
90 if(defaultinputfname!=0){
91 IsDone=TakePSFFromInputFile(defaultinputfname);
92 if(IsDone){return 0;}
93 }
94
95 //Detailed model
96 snprintf(fname,500,"%s/PSF/PSF_param.dat",dirname);
97 IsDone=TakePSFFromDetailedParFile(fname);
98 if(IsDone){return 0;}
99
100 //IAEA - 2019 values:
101 if(PSFflag==0){
102 snprintf(fname,500,"%s/PSF/CRP_IAEA_SMLO_E1_v01.dat",dirname);
103 IsDone=TakePSFFromIAEA01(fname);
104 if(IsDone){return 0;}
105 }
106 else if(PSFflag!=1){
107 NuDEXException(__FILE__,std::to_string(__LINE__).c_str(),"##### Error in NuDEX #####");
108 }
109
110 //RIPL-MLO values:
111 snprintf(fname,500,"%s/PSF/gdr-parameters&errors-exp-MLO.dat",dirname);
112 IsDone=TakePSFFromRIPL01(fname);
113 if(IsDone){return 0;}
114
115 //RIPL-Theorethical values:
116 snprintf(fname,500,"%s/PSF/gdr-parameters-theor.dat",dirname);
117 IsDone=TakePSFFromRIPL02(fname);
118 if(IsDone){return 0;}
119
120 //Theorethical values:
121 // E1 for spherical nucleus:
122 nR_E1=0;
123 PSFType_E1[nR_E1]=2;
124 //G4double a=31.2,b=20.6,c=0.026,d=1.05; //SLO-old (RIPL-2)
125 //G4double a=27.47,b=22.063,c=0.0277,d=1.222;//SLO (RIPL-3)
126 G4double a=28.69,b=21.731,c=0.0285,d=1.267;//MLO (RIPL-3)
127
128 E_E1[nR_E1]=a*std::pow(A_Int,-1./3.)+b*std::pow(A_Int,-1./6.);
129 G_E1[nR_E1]=c*std::pow(E_E1[nR_E1],1.9);
130 s_E1[nR_E1]=120/3.141592*d*(A_Int-Z_Int)*Z_Int/(G4double)A_Int/G_E1[nR_E1];
131 nR_E1++;
132 GenerateM1AndE2FromE1();
133
134 return 0;
135}
bool G4bool
Definition G4Types.hh:86

◆ PrintPSFParameters()

void G4NuDEXPSF::PrintPSFParameters ( std::ostream & out)

Definition at line 852 of file G4NuDEXPSF.cc.

852 {
853
854 out<<" ###################################################################################### "<<std::endl;
855 out<<" PSF_PARAMS"<<std::endl;
856 out<<" E1: nRes = "<<nR_E1<<std::endl;
857 for(G4int i=0;i<nR_E1;i++){
858 out<<" "<<PSFType_E1[i]<<" "<<E_E1[i]<<" "<<G_E1[i]<<" "<<s_E1[i]<<std::endl;
859 if(PSFType_E1[i]==7){out<<" "<<p1_E1[i]<<std::endl;}
860 if(PSFType_E1[i]==8){out<<" "<<p1_E1[i]<<" "<<p2_E1[i]<<std::endl;}
861 if(PSFType_E1[i]==9){out<<" "<<p1_E1[i]<<" "<<p2_E1[i]<<std::endl;}
862 if(PSFType_E1[i]==10){out<<" "<<p1_E1[i]<<" "<<p2_E1[i]<<" "<<p3_E1[i]<<std::endl;}
863 if(PSFType_E1[i]==40 || PSFType_E1[i]==41){out<<np_E1; for(G4int j=0;j<np_E1;j++){out<<" "<<x_E1[j]<<" "<<y_E1[j];} out<<std::endl;}
864 }
865 out<<" M1: nRes = "<<nR_M1<<std::endl;
866 for(G4int i=0;i<nR_M1;i++){
867 out<<" "<<PSFType_M1[i]<<" "<<E_M1[i]<<" "<<G_M1[i]<<" "<<s_M1[i]<<std::endl;
868 if(PSFType_M1[i]==7){out<<" "<<p1_M1[i]<<std::endl;}
869 if(PSFType_M1[i]==8){out<<" "<<p1_M1[i]<<" "<<p2_M1[i]<<std::endl;}
870 if(PSFType_M1[i]==9){out<<" "<<p1_M1[i]<<" "<<p2_M1[i]<<std::endl;}
871 if(PSFType_M1[i]==10){out<<" "<<p1_M1[i]<<" "<<p2_M1[i]<<" "<<p3_M1[i]<<std::endl;}
872 if(PSFType_M1[i]==40 || PSFType_M1[i]==41){out<<np_M1; for(G4int j=0;j<np_M1;j++){out<<" "<<x_M1[j]<<" "<<y_M1[j];} out<<std::endl;}
873 }
874 out<<" E2: nRes = "<<nR_E2<<std::endl;
875 for(G4int i=0;i<nR_E2;i++){
876 out<<" "<<PSFType_E2[i]<<" "<<E_E2[i]<<" "<<G_E2[i]<<" "<<s_E2[i]<<std::endl;
877 if(PSFType_E2[i]==7){out<<" "<<p1_E2[i]<<std::endl;}
878 if(PSFType_E2[i]==8){out<<" "<<p1_E2[i]<<" "<<p2_E2[i]<<std::endl;}
879 if(PSFType_E2[i]==9){out<<" "<<p1_E2[i]<<" "<<p2_E2[i]<<std::endl;}
880 if(PSFType_E2[i]==10){out<<" "<<p1_E2[i]<<" "<<p2_E2[i]<<" "<<p3_E2[i]<<std::endl;}
881 if(PSFType_E2[i]==40 || PSFType_E2[i]==41){out<<np_E2; for(G4int j=0;j<np_E2;j++){out<<" "<<x_E2[j]<<" "<<y_E2[j];} out<<std::endl;}
882 }
883 out<<" ###################################################################################### "<<std::endl;
884
885}

◆ PrintPSFParametersInInputFileFormat()

void G4NuDEXPSF::PrintPSFParametersInInputFileFormat ( std::ostream & out)

Definition at line 888 of file G4NuDEXPSF.cc.

888 {
889
890 out<<" PSF"<<std::endl;
891 G4long oldprc = out.precision(15);
892 out<<nR_E1<<std::endl;
893 for(G4int i=0;i<nR_E1;i++){
894 out<<" "<<PSFType_E1[i]<<" "<<E_E1[i]<<" "<<G_E1[i]<<" "<<s_E1[i];
895 if(PSFType_E1[i]==7){out<<" "<<p1_E1[i];}
896 if(PSFType_E1[i]==8){out<<" "<<p1_E1[i]<<" "<<p2_E1[i];}
897 if(PSFType_E1[i]==9){out<<" "<<p1_E1[i]<<" "<<p2_E1[i];}
898 if(PSFType_E1[i]==10){out<<" "<<p1_E1[i]<<" "<<p2_E1[i]<<" "<<p3_E1[i];}
899 if(PSFType_E1[i]==40 || PSFType_E1[i]==41){out<<np_E1; for(G4int j=0;j<np_E1;j++){out<<" "<<x_E1[j]<<" "<<y_E1[j];} }
900 out<<std::endl;
901 }
902 out<<nR_M1<<std::endl;
903 for(G4int i=0;i<nR_M1;i++){
904 out<<" "<<PSFType_M1[i]<<" "<<E_M1[i]<<" "<<G_M1[i]<<" "<<s_M1[i];
905 if(PSFType_M1[i]==7){out<<" "<<p1_M1[i];}
906 if(PSFType_M1[i]==8){out<<" "<<p1_M1[i]<<" "<<p2_M1[i];}
907 if(PSFType_M1[i]==9){out<<" "<<p1_M1[i]<<" "<<p2_M1[i];}
908 if(PSFType_M1[i]==10){out<<" "<<p1_M1[i]<<" "<<p2_M1[i]<<" "<<p3_M1[i];}
909 if(PSFType_M1[i]==40 || PSFType_M1[i]==41){out<<np_M1; for(G4int j=0;j<np_M1;j++){out<<" "<<x_M1[j]<<" "<<y_M1[j];}}
910 out<<std::endl;
911 }
912 out<<nR_E2<<std::endl;
913 for(G4int i=0;i<nR_E2;i++){
914 out<<" "<<PSFType_E2[i]<<" "<<E_E2[i]<<" "<<G_E2[i]<<" "<<s_E2[i];
915 if(PSFType_E2[i]==7){out<<" "<<p1_E2[i];}
916 if(PSFType_E2[i]==8){out<<" "<<p1_E2[i]<<" "<<p2_E2[i];}
917 if(PSFType_E2[i]==9){out<<" "<<p1_E2[i]<<" "<<p2_E2[i];}
918 if(PSFType_E2[i]==10){out<<" "<<p1_E2[i]<<" "<<p2_E2[i]<<" "<<p3_E2[i];}
919 if(PSFType_E2[i]==40 || PSFType_E2[i]==41){out<<np_E2; for(G4int j=0;j<np_E2;j++){out<<" "<<x_E2[j]<<" "<<y_E2[j];}}
920 out<<std::endl;
921 }
922 out.precision(oldprc);
923}
long G4long
Definition G4Types.hh:87

The documentation for this class was generated from the following files: