bug fix; ClassTransfer can set reaction from ClassReaction
This commit is contained in:
parent
d01d26988d
commit
95bff19bb4
|
@ -213,13 +213,13 @@ inline bool ReactionConfig::LoadReactionConfig(TMacro * macro){
|
|||
targetA = target.A;
|
||||
targetZ = target.Z;
|
||||
}
|
||||
if( recoilLine == 10 ) isTargetScattering = str[0].compare("true") == 0 ? true: false;
|
||||
if( recoilLine == 11 ) targetDensity = atof(str[0].c_str());
|
||||
if( recoilLine == 12 ) targetThickness = atof(str[0].c_str());
|
||||
if( recoilLine == 13 ) beamStoppingPowerFile = str[0];
|
||||
if( recoilLine == 9 ) isTargetScattering = str[0].compare("true") == 0 ? true: false;
|
||||
if( recoilLine == 10 ) targetDensity = atof(str[0].c_str());
|
||||
if( recoilLine == 11 ) targetThickness = atof(str[0].c_str());
|
||||
if( recoilLine == 12 ) beamStoppingPowerFile = str[0];
|
||||
|
||||
if( recoilLine == 14 ) numEvents = atoi(str[0].c_str());
|
||||
if( recoilLine == 15 ) isRedo = str[0].compare("true" ) == 0 ? true : false;
|
||||
if( recoilLine == 13 ) numEvents = atoi(str[0].c_str());
|
||||
if( recoilLine == 14 ) isRedo = str[0].compare("true" ) == 0 ? true : false;
|
||||
}
|
||||
|
||||
if( recoilFlag > 0 ){
|
||||
|
|
|
@ -490,10 +490,11 @@ std::vector<double> Plotter::FindRange(TString branch){
|
|||
TH1F * temp1 = (TH1F *) gROOT->FindObjectAny("temp1");
|
||||
|
||||
std::vector<double> output;
|
||||
if( temp1 != nullptr){
|
||||
output.push_back( temp1->GetXaxis()->GetXmax() );
|
||||
output.push_back( temp1->GetXaxis()->GetXmin() );
|
||||
|
||||
delete temp1;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
void SetB(int A, int Z);
|
||||
void SetIncidentEnergyAngle(double KEA, double theta, double phi);
|
||||
|
||||
void SetReactionFromReactionConfigClass(ReactionConfig reactConfigClassObject, unsigned short ID = 0);
|
||||
void SetReactionFromFile(std::string configFile, unsigned short ID = 0);
|
||||
void SetReactionFromTMacro(TMacro configMacro, unsigned short ID = 0);
|
||||
void SetReactionSimple(int beamA, int beamZ,
|
||||
|
@ -283,6 +284,30 @@ void TransferReaction::SetExB(double Ex){
|
|||
isReady = false;
|
||||
}
|
||||
|
||||
void TransferReaction::SetReactionFromReactionConfigClass(ReactionConfig reactConfigClassObject, unsigned short ID){
|
||||
|
||||
config = reactConfigClassObject;
|
||||
SetA(config.beamA, config.beamZ);
|
||||
Seta(config.targetA, config.targetZ);
|
||||
|
||||
SetExA(config.beamEx);
|
||||
|
||||
if( ID > config.recoil.size() ){
|
||||
printf("Reaction Config only has %zu recoil settings. input is %u. Abort.\n", config.recoil.size(), ID);
|
||||
return;
|
||||
}
|
||||
|
||||
recoil = config.recoil[ID];
|
||||
exList = config.exList[ID];
|
||||
|
||||
Setb(recoil.lightA, recoil.lightZ);
|
||||
SetB(recoil.heavyA, recoil.heavyZ);
|
||||
SetIncidentEnergyAngle(config.beamEnergy, 0, 0);
|
||||
|
||||
CalReactionConstant();
|
||||
|
||||
}
|
||||
|
||||
void TransferReaction::SetReactionFromFile(std::string configFile, unsigned short ID){
|
||||
|
||||
if( config.LoadReactionConfig(configFile) ){
|
||||
|
|
|
@ -72,7 +72,7 @@ void Transfer(
|
|||
int count = 0;
|
||||
for( unsigned short i = 0 ; i < numDetGeo; i++){
|
||||
if( detGeoConfig.array[i].enable ){
|
||||
transfer[count].SetReactionFromFile(basicConfig, i);
|
||||
transfer[count].SetReactionFromReactionConfigClass(reactionConfig, i);
|
||||
if(transfer[count].GetRecoil().isDecay) {
|
||||
decay[count].SetMotherDaugther(transfer[count].GetRecoil());
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ false //isDacay
|
|||
#0.000 1.0 1.0 0.01
|
||||
#1.000 1.0 1.0 0.01
|
||||
#2.000 1.0 1.0 0.01
|
||||
12.000 1.0 1.0 0.01
|
||||
1.000 1.0 1.0 0.01
|
||||
IAEA + 10 0.01
|
||||
|
||||
#==================_reaction_for_2nd_Array_use_ony_when_2nd_array_used
|
||||
|
|
Loading…
Reference in New Issue
Block a user