change reactionConfig.txt, inlcude upstreama and downstream reaction

This commit is contained in:
Ryan Tang 2024-02-15 14:09:29 -05:00
parent 80a23ee689
commit 3a0dba08da
11 changed files with 244 additions and 208 deletions

View File

@ -53,6 +53,18 @@ TGraph * TrapezoidFilter(TGraph * trace, int baseLineEnd = 80, int riseTime = 10
return trapezoid; return trapezoid;
} }
bool isEmptyOrSpaces(const std::string& str) {
if (str.empty()) {
return true;
}
for (char c : str) {
if (!std::isspace(c)) {
return false;
}
}
return true;
}
std::vector<std::string> SplitStr(std::string tempLine, std::string splitter, int shift = 0){ std::vector<std::string> SplitStr(std::string tempLine, std::string splitter, int shift = 0){
std::vector<std::string> output; std::vector<std::string> output;

View File

@ -97,7 +97,7 @@ public:
bool LoadDetectorGeo(TString fileName, bool verbose = true); bool LoadDetectorGeo(TString fileName, bool verbose = true);
bool LoadDetectorGeo(TMacro * macro, bool verbose = true); bool LoadDetectorGeo(TMacro * macro, bool verbose = true);
void PrintDetGeo( bool printAll = true) const; void Print( bool printAll = true) const;
private: private:
@ -138,7 +138,11 @@ inline bool DetGeo::LoadDetectorGeo(TMacro * macro, bool verbose){
for( int i = 0 ; i < numLine; i++){ for( int i = 0 ; i < numLine; i++){
std::vector<std::string> str = AnalysisLib::SplitStr(macro->GetListOfLines()->At(i)->GetName(), " "); std::string line = macro->GetListOfLines()->At(i)->GetName();
if( AnalysisLib::isEmptyOrSpaces(line) ) continue;
std::vector<std::string> str = AnalysisLib::SplitStr(line, " ");
// printf("%3d | %s\n", i, str[0].c_str()); // printf("%3d | %s\n", i, str[0].c_str());
@ -150,20 +154,20 @@ inline bool DetGeo::LoadDetectorGeo(TMacro * macro, bool verbose){
} }
if( detFlag == 0 ){ if( detFlag == 0 ){
if ( i == 0 ) { if ( detLine == 0 ) {
Bfield = atof(str[0].c_str()); Bfield = atof(str[0].c_str());
BfieldSign = Bfield > 0 ? 1: -1; BfieldSign = Bfield > 0 ? 1: -1;
} }
if ( i == 1 ) BfieldTheta = atof(str[0].c_str()); if ( detLine == 1 ) BfieldTheta = atof(str[0].c_str());
if ( i == 2 ) bore = atof(str[0].c_str()); if ( detLine == 2 ) bore = atof(str[0].c_str());
if ( i == 3 ) recoilPos = atof(str[0].c_str()); if ( detLine == 3 ) recoilPos = atof(str[0].c_str());
if ( i == 4 ) recoilInnerRadius = atof(str[0].c_str()); if ( detLine == 4 ) recoilInnerRadius = atof(str[0].c_str());
if ( i == 5 ) recoilOuterRadius = atof(str[0].c_str()); if ( detLine == 5 ) recoilOuterRadius = atof(str[0].c_str());
if ( i == 6 ) isCoincidentWithRecoil = str[0] == "false" ? false: true; if ( detLine == 6 ) isCoincidentWithRecoil = str[0] == "false" ? false: true;
if ( i == 7 ) recoilPos1 = atof(str[0].c_str()); if ( detLine == 7 ) recoilPos1 = atof(str[0].c_str());
if ( i == 8 ) recoilPos2 = atof(str[0].c_str()); if ( detLine == 8 ) recoilPos2 = atof(str[0].c_str());
if ( i == 9 ) elumPos1 = atof(str[0].c_str()); if ( detLine == 9 ) elumPos1 = atof(str[0].c_str());
if ( i == 10 ) elumPos2 = atof(str[0].c_str()); if ( detLine == 10 ) elumPos2 = atof(str[0].c_str());
} }
if( detFlag == 1){ if( detFlag == 1){
@ -177,7 +181,6 @@ inline bool DetGeo::LoadDetectorGeo(TMacro * macro, bool verbose){
if ( detLine == 7 ) array1.detFaceOut = str[0] == "Out" ? true : false; if ( detLine == 7 ) array1.detFaceOut = str[0] == "Out" ? true : false;
if ( detLine == 8 ) array1.mDet = atoi(str[0].c_str()); if ( detLine == 8 ) array1.mDet = atoi(str[0].c_str());
if ( detLine >= 9 ) array1.pos.push_back(atof(str[0].c_str())); if ( detLine >= 9 ) array1.pos.push_back(atof(str[0].c_str()));
detLine ++;
} }
if( detFlag == 2){ if( detFlag == 2){
@ -192,30 +195,29 @@ inline bool DetGeo::LoadDetectorGeo(TMacro * macro, bool verbose){
if ( detLine == 8 ) array2.detFaceOut = str[0] == "Out" ? true : false; if ( detLine == 8 ) array2.detFaceOut = str[0] == "Out" ? true : false;
if ( detLine == 9 ) array2.mDet = atoi(str[0].c_str()); if ( detLine == 9 ) array2.mDet = atoi(str[0].c_str());
if ( detLine >= 10 ) array2.pos.push_back(atof(str[0].c_str())); if ( detLine >= 10 ) array2.pos.push_back(atof(str[0].c_str()));
detLine ++;
} }
detLine ++;
} }
array1.DeduceAbsolutePos(); array1.DeduceAbsolutePos();
array2.DeduceAbsolutePos();
zMin = array1.zMin; zMin = array1.zMin;
zMax = array1.zMax; zMax = array1.zMax;
if( use2ndArray) { if( use2ndArray) {
array2.DeduceAbsolutePos();
zMax = TMath::Min(array1.zMax, array2.zMax); zMax = TMath::Min(array1.zMax, array2.zMax);
zMin = TMath::Min(array1.zMin, array2.zMin); zMin = TMath::Min(array1.zMin, array2.zMin);
} }
if( verbose ) PrintDetGeo(false); if( verbose ) Print(false);
return true; return true;
} }
inline void DetGeo::PrintDetGeo(bool printAll) const{ inline void DetGeo::Print(bool printAll) const{
printf("=====================================================\n"); printf("=====================================================\n");
printf(" B-field: %8.2f T, Theta : %6.2f deg \n", Bfield, BfieldTheta); printf(" B-field: %8.2f T, Theta : %6.2f deg \n", Bfield, BfieldTheta);
@ -223,22 +225,13 @@ inline void DetGeo::PrintDetGeo(bool printAll) const{
printf(" +---- field angle != 0 is not supported!!! \n"); printf(" +---- field angle != 0 is not supported!!! \n");
} }
printf(" Recoil detector pos: %8.2f mm, radius: %6.2f - %6.2f mm \n", recoilPos, recoilInnerRadius, recoilOuterRadius); printf(" Recoil detector pos: %8.2f mm, radius: %6.2f - %6.2f mm \n", recoilPos, recoilInnerRadius, recoilOuterRadius);
if( printAll ){
printf("------------------------------------- Detector Position \n");
array1.PrintArray();
if( use2ndArray){ printf("------------------------------------- Detector Position \n");
printf("--------------------------------- 2nd Detector Position \n"); array1.PrintArray();
array2.PrintArray();
} if( printAll || use2ndArray){
}else{ printf("--------------------------------- 2nd Detector Position \n");
if( use2ndArray){ array2.PrintArray();
printf("--------------------------------- 2nd Detector Position \n");
array2.PrintArray();
}else{
printf("------------------------------------- Detector Position \n");
array1.PrintArray();
}
} }
if( elumPos1 != 0 || elumPos2 != 0 || recoilPos1 != 0 || recoilPos2 != 0){ if( elumPos1 != 0 || elumPos2 != 0 || recoilPos1 != 0 || recoilPos2 != 0){

View File

@ -13,6 +13,33 @@
#include "AnalysisLib.h" #include "AnalysisLib.h"
struct Recoil {
unsigned short lightA, lightZ;
unsigned short heavyA, heavyZ;
std::string lightStoppingPowerFile = ""; ///stopping_power_for_light_recoil
std::string heavyStoppingPowerFile = ""; ///stopping_power_for_heavy_recoil
bool isDecay = false; ///isDacay
unsigned short decayA = 0; ///decayNucleus_A
unsigned short decayZ = 0; ///decayNucleus_Z
void Print() const {
printf(" light : A = %3d, Z = %2d \n", lightA, lightZ);
printf(" heavy : A = %3d, Z = %2d \n", heavyA, heavyZ);
printf(" light stopping file : %s \n", lightStoppingPowerFile.c_str());
printf(" heavy stopping file : %s \n", heavyStoppingPowerFile.c_str());
printf(" is simulate decay : %s \n", isDecay ? "Yes" : "No");
if( isDecay ){
printf(" heavy decay : A = %d, Z = %d \n", decayA, decayZ);
}
}
};
class ReactionConfig { class ReactionConfig {
public: public:
@ -21,11 +48,8 @@ public:
ReactionConfig(TMacro * macro){ LoadReactionConfig(macro);} ReactionConfig(TMacro * macro){ LoadReactionConfig(macro);}
~ReactionConfig(){} ~ReactionConfig(){}
int beamA, beamZ; unsigned short beamA, beamZ;
int targetA, targetZ; float beamEx; ///excitation_energy_of_A[MeV]
int recoilLightA, recoilLightZ;
int recoilHeavyA, recoilHeavyZ;
float beamEnergy; ///MeV/u float beamEnergy; ///MeV/u
float beamEnergySigma; ///beam-energy_sigma_in_MeV/u float beamEnergySigma; ///beam-energy_sigma_in_MeV/u
float beamAngle; ///beam-angle_in_mrad float beamAngle; ///beam-angle_in_mrad
@ -33,18 +57,16 @@ public:
float beamX; ///x_offset_of_Beam_in_mm float beamX; ///x_offset_of_Beam_in_mm
float beamY; ///y_offset_of_Beam_in_mm float beamY; ///y_offset_of_Beam_in_mm
int numEvents; ///number_of_Event_being_generated unsigned short targetA, targetZ;
bool isTargetScattering; ///isTargetScattering bool isTargetScattering; ///isTargetScattering
float targetDensity; ///target_density_in_g/cm3 float targetDensity; ///target_density_in_g/cm3
float targetThickness; ///targetThickness_in_cm float targetThickness; ///targetThickness_in_cm
std::string beamStoppingPowerFile; ///stopping_power_for_beam std::string beamStoppingPowerFile; ///stopping_power_for_beam
std::string recoilLightStoppingPowerFile; ///stopping_power_for_light_recoil
std::string recoilHeavyStoppingPowerFile; ///stopping_power_for_heavy_recoil Recoil recoil1, recoil2;
bool isDecay; ///isDacay
int heavyDecayA; ///decayNucleus_A int numEvents; ///number_of_Event_being_generated
int heavyDecayZ; ///decayNucleus_Z
bool isRedo; ///isReDo bool isRedo; ///isReDo
std::vector<float> beamEx; ///excitation_energy_of_A[MeV]
void SetReactionSimple(int beamA, int beamZ, void SetReactionSimple(int beamA, int beamZ,
int targetA, int targetZ, int targetA, int targetZ,
@ -53,7 +75,7 @@ public:
bool LoadReactionConfig(TString fileName); bool LoadReactionConfig(TString fileName);
bool LoadReactionConfig(TMacro * macro); bool LoadReactionConfig(TMacro * macro);
void PrintReactionConfig() const; void Print() const;
private: private:
@ -67,10 +89,11 @@ inline void ReactionConfig::SetReactionSimple(int beamA, int beamZ,
this->beamZ = beamZ; this->beamZ = beamZ;
this->targetA = targetA; this->targetA = targetA;
this->targetZ = targetZ; this->targetZ = targetZ;
this->recoilLightA = recoilA;
this->recoilLightZ = recoilZ; this->recoil1.lightA = recoilA;
recoilHeavyA = this->beamA + this->targetA - recoilLightA; this->recoil1.lightZ = recoilZ;
recoilHeavyZ = this->beamZ + this->targetZ - recoilLightZ; recoil1.heavyA = this->beamA + this->targetA - recoil1.lightA;
recoil1.heavyZ = this->beamZ + this->targetZ - recoil1.lightZ;
beamEnergy = beamEnergy_AMeV; beamEnergy = beamEnergy_AMeV;
beamEnergySigma = 0; beamEnergySigma = 0;
@ -101,93 +124,113 @@ inline bool ReactionConfig::LoadReactionConfig(TMacro * macro){
if( macro == NULL ) return false; if( macro == NULL ) return false;
int recoilFlag = 0;
int recoilLine = 0;
int numLine = macro->GetListOfLines()->GetSize(); int numLine = macro->GetListOfLines()->GetSize();
for( int i = 0; i < numLine; i ++){ for( int i = 0; i < numLine; i ++){
std::vector<std::string> str =AnalysisLib::SplitStr(macro->GetListOfLines()->At(i)->GetName(), " "); std::string line = macro->GetListOfLines()->At(i)->GetName();
if( AnalysisLib::isEmptyOrSpaces(line) ) continue;
///printf("%d | %s\n", i, str[0].c_str()); std::vector<std::string> str =AnalysisLib::SplitStr(line, " ");
// printf("%d |%s|%d|%d\n", i, str[0].c_str(), recoilFlag, recoilLine);
if( str[0].find_first_of("#") == 0 ) break; if( str[0].find("####") != std::string::npos ) break;
if( str[0].find("#===") != std::string::npos ) {
recoilFlag ++;
recoilLine = 0;
continue;
}
if( i == 0 ) beamA = atoi(str[0].c_str()); if( recoilFlag == 0 ){
if( i == 1 ) beamZ = atoi(str[0].c_str()); if( recoilLine == 0 ) beamA = atoi(str[0].c_str());
if( i == 2 ) targetA = atoi(str[0].c_str()); if( recoilLine == 1 ) beamZ = atoi(str[0].c_str());
if( i == 3 ) targetZ = atoi(str[0].c_str()); if( recoilLine == 2 ) beamEx = atoi(str[0].c_str());
if( i == 4 ) recoilLightA = atoi(str[0].c_str());
if( i == 5 ) recoilLightZ = atoi(str[0].c_str()); if( recoilLine == 3 ) beamEnergy = atof(str[0].c_str());
if( i == 6 ) beamEnergy = atof(str[0].c_str()); if( recoilLine == 4 ) beamEnergySigma = atof(str[0].c_str());
if( i == 7 ) beamEnergySigma = atof(str[0].c_str()); if( recoilLine == 5 ) beamAngle = atof(str[0].c_str());
if( i == 8 ) beamAngle = atof(str[0].c_str()); if( recoilLine == 6 ) beamAngleSigma = atof(str[0].c_str());
if( i == 9 ) beamAngleSigma = atof(str[0].c_str()); if( recoilLine == 7 ) beamX = atof(str[0].c_str());
if( i == 10 ) beamX = atof(str[0].c_str()); if( recoilLine == 8 ) beamY = atof(str[0].c_str());
if( i == 11 ) beamY = atof(str[0].c_str());
if( i == 12 ) numEvents = atoi(str[0].c_str()); if( recoilLine == 9 ) targetA = atoi(str[0].c_str());
if( i == 13 ) { if( recoilLine == 10 ) targetZ = atoi(str[0].c_str());
if( str[0].compare("false") == 0 ) isTargetScattering = false;
if( str[0].compare("true") == 0 ) isTargetScattering = true; if( recoilLine == 11 ) isTargetScattering = str[0].compare("true") == 0 ? true: false;
if( recoilLine == 12 ) targetDensity = atof(str[0].c_str());
if( recoilLine == 13 ) targetThickness = atof(str[0].c_str());
if( recoilLine == 14 ) beamStoppingPowerFile = str[0];
if( recoilLine == 15 ) numEvents = atoi(str[0].c_str());
if( recoilLine == 16 ) isRedo = str[0].compare("true" ) == 0 ? true : false;
} }
if( i == 14 ) targetDensity = atof(str[0].c_str());
if( i == 15 ) targetThickness = atof(str[0].c_str()); if( recoilFlag == 1 ){
if( i == 16 ) beamStoppingPowerFile = str[0];
if( i == 17 ) recoilLightStoppingPowerFile = str[0]; if( recoilLine == 0 ) recoil1.lightA = atoi(str[0].c_str());
if( i == 18 ) recoilHeavyStoppingPowerFile = str[0]; if( recoilLine == 1 ) recoil1.lightZ = atoi(str[0].c_str());
if( i == 19 ) { if( recoilLine == 2 ) recoil1.lightStoppingPowerFile = str[0];
if( str[0].compare("false") == 0 ) isDecay = false; if( recoilLine == 3 ) recoil1.heavyStoppingPowerFile = str[0];
if( str[0].compare("true") == 0 ) isDecay = true; if( recoilLine == 4 ) recoil1.isDecay = str[0].compare("true") == 0 ? true : false;
if( recoilLine == 5 ) recoil1.decayA = atoi(str[0].c_str());
if( recoilLine == 6 ) recoil1.decayZ = atoi(str[0].c_str());
} }
if( i == 20 ) heavyDecayA = atoi(str[0].c_str());
if( i == 21 ) heavyDecayZ = atoi(str[0].c_str()); if( recoilFlag == 2 ){
if( i == 22 ) {
if( str[0].compare("false") == 0 ) isRedo = false; if( recoilLine == 0 ) recoil2.lightA = atoi(str[0].c_str());
if( str[0].compare("true" ) == 0 ) isRedo = true; if( recoilLine == 1 ) recoil2.lightZ = atoi(str[0].c_str());
if( recoilLine == 2 ) recoil2.lightStoppingPowerFile = str[0];
if( recoilLine == 3 ) recoil2.heavyStoppingPowerFile = str[0];
if( recoilLine == 4 ) recoil2.isDecay = str[0].compare("true") == 0 ? true : false;
if( recoilLine == 5 ) recoil2.decayA = atoi(str[0].c_str());
if( recoilLine == 6 ) recoil2.decayZ = atoi(str[0].c_str());
} }
recoilLine ++;
if( i >= 23) {
beamEx.push_back( atof(str[0].c_str()) );
}
} }
recoilHeavyA = beamA + targetA - recoilLightA; recoil1.heavyA = beamA + targetA - recoil1.lightA;
recoilHeavyZ = beamZ + targetZ - recoilLightZ; recoil1.heavyZ = beamZ + targetZ - recoil1.lightZ;
recoil2.heavyA = beamA + targetA - recoil2.lightA;
recoil2.heavyZ = beamZ + targetZ - recoil2.lightZ;
return true; return true;
} }
inline void ReactionConfig::PrintReactionConfig() const{ inline void ReactionConfig::Print() const{
printf("=====================================================\n"); printf("=====================================================\n");
printf(" beam : A = %3d, Z = %2d \n", beamA, beamZ);
printf(" target : A = %3d, Z = %2d \n", targetA, targetZ);
printf(" light : A = %3d, Z = %2d \n", recoilLightA, recoilLightZ);
printf("number of Simulation Events : %d \n", numEvents);
printf(" is Redo until hit array : %s \n", isRedo ? "Yes" : "No");
printf("------------------------------ Beam\n");
printf(" beam : A = %3d, Z = %2d, Ex = %.2f MeV\n", beamA, beamZ, beamEx);
printf(" beam Energy : %.2f +- %.2f MeV/u, dE/E = %5.2f %%\n", beamEnergy, beamEnergySigma, beamEnergySigma/beamEnergy); printf(" beam Energy : %.2f +- %.2f MeV/u, dE/E = %5.2f %%\n", beamEnergy, beamEnergySigma, beamEnergySigma/beamEnergy);
printf(" Angle : %.2f +- %.2f mrad\n", beamAngle, beamAngleSigma); printf(" Angle : %.2f +- %.2f mrad\n", beamAngle, beamAngleSigma);
printf(" offset : (x,y) = (%.2f, %.2f) mmm \n", beamX, beamY); printf(" offset : (x,y) = (%.2f, %.2f) mmm \n", beamX, beamY);
printf("##### number of Simulation Events : %d \n", numEvents); printf("------------------------------ Target\n");
printf(" target : A = %3d, Z = %2d \n", targetA, targetZ);
printf(" is target scattering : %s \n", isTargetScattering ? "Yes" : "No"); printf(" is target scattering : %s \n", isTargetScattering ? "Yes" : "No");
if(isTargetScattering){ if(isTargetScattering){
printf(" target density : %.f g/cm3\n", targetDensity); printf(" target density : %.f g/cm3\n", targetDensity);
printf(" thickness : %.f cm\n", targetThickness); printf(" thickness : %.f cm\n", targetThickness);
printf(" beam stopping file : %s \n", beamStoppingPowerFile.c_str()); printf(" beam stopping file : %s \n", beamStoppingPowerFile.c_str());
printf(" recoil light stopping file : %s \n", recoilLightStoppingPowerFile.c_str());
printf(" recoil heavy stopping file : %s \n", recoilHeavyStoppingPowerFile.c_str());
} }
printf(" is simulate decay : %s \n", isDecay ? "Yes" : "No"); printf("------------------------------ Recoil-1\n"); recoil1.Print();
if( isDecay ){
printf(" heavy decay : A = %d, Z = %d \n", heavyDecayA, heavyDecayZ);
}
printf(" is Redo until hit array : %s \n", isRedo ? "Yes" : "No");
printf(" beam Ex : %.2f MeV \n", beamEx[0]); printf("------------------------------ Recoil-2\n"); recoil2.Print();
for( int i = 1; i < (int) beamEx.size(); i++){
printf(" %.2f MeV \n", beamEx[i]);
}
printf("=====================================================\n"); printf("=====================================================\n");
} }

View File

@ -30,9 +30,9 @@ public:
targetA, targetZ, targetA, targetZ,
recoilA, recoilZ, beamEnergy_AMeV); recoilA, recoilZ, beamEnergy_AMeV);
} }
TransferReaction(string reactionConfigFile){ TransferReaction(string configFile){
Inititization(); Inititization();
SetReactionFromFile(reactionConfigFile); SetReactionFromFile(configFile);
} }
~TransferReaction(); ~TransferReaction();
@ -49,12 +49,12 @@ public:
void SetExA(double Ex); void SetExA(double Ex);
void SetExB(double Ex); void SetExB(double Ex);
void SetReactionFromFile(string reactionConfigFile); void SetReactionFromFile(string configFile);
TString GetReactionName(); TString GetReactionName();
TString GetReactionName_Latex(); TString GetReactionName_Latex();
ReactionConfig GetRectionConfig() { return reactionConfig;} ReactionConfig GetRectionConfig() { return config;}
double GetMass_A() const {return mA + ExA;} double GetMass_A() const {return mA + ExA;}
double GetMass_a() const {return ma;} double GetMass_a() const {return ma;}
@ -85,7 +85,7 @@ public:
private: private:
ReactionConfig reactionConfig; ReactionConfig config;
string nameA, namea, nameb, nameB; string nameA, namea, nameb, nameB;
double thetaIN, phiIN; double thetaIN, phiIN;
@ -119,7 +119,7 @@ void TransferReaction::Inititization(){
Setb(1,1); Setb(1,1);
SetB(13,6); SetB(13,6);
TA = 6; TA = 6;
T = TA * reactionConfig.beamA; T = TA * config.beamA;
ExA = 0; ExA = 0;
ExB = 0; ExB = 0;
@ -141,8 +141,8 @@ TransferReaction::~TransferReaction(){
void TransferReaction::SetA(int A, int Z, double Ex = 0){ void TransferReaction::SetA(int A, int Z, double Ex = 0){
Isotope temp (A, Z); Isotope temp (A, Z);
mA = temp.Mass; mA = temp.Mass;
reactionConfig.beamA = A; config.beamA = A;
reactionConfig.beamZ = Z; config.beamZ = Z;
ExA = Ex; ExA = Ex;
nameA = temp.Name; nameA = temp.Name;
isReady = false; isReady = false;
@ -152,8 +152,8 @@ void TransferReaction::SetA(int A, int Z, double Ex = 0){
void TransferReaction::Seta(int A, int Z){ void TransferReaction::Seta(int A, int Z){
Isotope temp (A, Z); Isotope temp (A, Z);
ma = temp.Mass; ma = temp.Mass;
reactionConfig.targetA = A; config.targetA = A;
reactionConfig.targetZ = Z; config.targetZ = Z;
namea = temp.Name; namea = temp.Name;
isReady = false; isReady = false;
isBSet = false; isBSet = false;
@ -161,8 +161,8 @@ void TransferReaction::Seta(int A, int Z){
void TransferReaction::Setb(int A, int Z){ void TransferReaction::Setb(int A, int Z){
Isotope temp (A, Z); Isotope temp (A, Z);
mb = temp.Mass; mb = temp.Mass;
reactionConfig.recoilLightA = A; config.recoil1.lightA = A;
reactionConfig.recoilLightZ = Z; config.recoil1.lightZ = Z;
nameb = temp.Name; nameb = temp.Name;
isReady = false; isReady = false;
isBSet = false; isBSet = false;
@ -170,8 +170,8 @@ void TransferReaction::Setb(int A, int Z){
void TransferReaction::SetB(int A, int Z){ void TransferReaction::SetB(int A, int Z){
Isotope temp (A, Z); Isotope temp (A, Z);
mB = temp.Mass; mB = temp.Mass;
reactionConfig.recoilHeavyA = A; config.recoil1.heavyA = A;
reactionConfig.recoilHeavyZ = Z; config.recoil1.heavyZ = Z;
nameB = temp.Name; nameB = temp.Name;
isReady = false; isReady = false;
isBSet = true; isBSet = true;
@ -179,7 +179,7 @@ void TransferReaction::SetB(int A, int Z){
void TransferReaction::SetIncidentEnergyAngle(double KEA, double theta, double phi){ void TransferReaction::SetIncidentEnergyAngle(double KEA, double theta, double phi){
this->TA = KEA; this->TA = KEA;
this->T = TA * reactionConfig.beamA; this->T = TA * config.beamA;
this->thetaIN = theta; this->thetaIN = theta;
this->phiIN = phi; this->phiIN = phi;
isReady = false; isReady = false;
@ -189,15 +189,15 @@ void TransferReaction::SetReactionSimple(int beamA, int beamZ,
int targetA, int targetZ, int targetA, int targetZ,
int recoilA, int recoilZ, float beamEnergy_AMeV){ int recoilA, int recoilZ, float beamEnergy_AMeV){
reactionConfig.SetReactionSimple(beamA, beamZ, config.SetReactionSimple(beamA, beamZ,
targetA, targetZ, targetA, targetZ,
recoilA, recoilZ, beamEnergy_AMeV); recoilA, recoilZ, beamEnergy_AMeV);
SetA(reactionConfig.beamA, reactionConfig.beamZ); SetA(config.beamA, config.beamZ);
Seta(reactionConfig.targetA, reactionConfig.targetZ); Seta(config.targetA, config.targetZ);
Setb(reactionConfig.recoilLightA, reactionConfig.recoilLightZ); Setb(config.recoil1.lightA, config.recoil1.lightZ);
SetB(reactionConfig.recoilHeavyA, reactionConfig.recoilHeavyZ); SetB(config.recoil1.heavyA, config.recoil1.heavyZ);
SetIncidentEnergyAngle(reactionConfig.beamEnergy, 0, 0); SetIncidentEnergyAngle(config.beamEnergy, 0, 0);
CalReactionConstant(); CalReactionConstant();
@ -213,20 +213,20 @@ void TransferReaction::SetExB(double Ex){
isReady = false; isReady = false;
} }
void TransferReaction::SetReactionFromFile(string reactionConfigFile){ void TransferReaction::SetReactionFromFile(string configFile){
if( reactionConfig.LoadReactionConfig(reactionConfigFile) ){ if( config.LoadReactionConfig(configFile) ){
SetA(reactionConfig.beamA, reactionConfig.beamZ); SetA(config.beamA, config.beamZ);
Seta(reactionConfig.targetA, reactionConfig.targetZ); Seta(config.targetA, config.targetZ);
Setb(reactionConfig.recoilLightA, reactionConfig.recoilLightZ); Setb(config.recoil1.lightA, config.recoil1.lightZ);
SetB(reactionConfig.recoilHeavyA, reactionConfig.recoilHeavyZ); SetB(config.recoil1.heavyA, config.recoil1.heavyZ);
SetIncidentEnergyAngle(reactionConfig.beamEnergy, 0, 0); SetIncidentEnergyAngle(config.beamEnergy, 0, 0);
CalReactionConstant(); CalReactionConstant();
}else{ }else{
printf("cannot read file %s.\n", reactionConfigFile.c_str()); printf("cannot read file %s.\n", configFile.c_str());
isReady = false; isReady = false;
} }
@ -260,9 +260,9 @@ TString TransferReaction::GetReactionName_Latex(){
void TransferReaction::CalReactionConstant(){ void TransferReaction::CalReactionConstant(){
if( !isBSet){ if( !isBSet){
reactionConfig.recoilHeavyA = reactionConfig.beamA + reactionConfig.targetA - reactionConfig.recoilLightA; config.recoil1.heavyA = config.beamA + config.targetA - config.recoil1.lightA;
reactionConfig.recoilHeavyZ = reactionConfig.beamZ + reactionConfig.targetZ - reactionConfig.recoilLightZ; config.recoil1.heavyZ = config.beamZ + config.targetZ - config.recoil1.lightZ;
Isotope temp (reactionConfig.recoilHeavyA, reactionConfig.recoilHeavyZ); Isotope temp (config.recoil1.heavyA, config.recoil1.heavyZ);
mB = temp.Mass; mB = temp.Mass;
isBSet = true; isBSet = true;
} }
@ -355,7 +355,7 @@ std::pair<double, double> TransferReaction::CalExThetaCM(double e, double z, dou
double mass = mb; double mass = mb;
double massB = mB; double massB = mB;
double y = e + mass; double y = e + mass;
double slope = 299.792458 * reactionConfig.recoilLightZ * abs(Bfield) / TMath::TwoPi() * beta / 1000.; // MeV/mm; double slope = 299.792458 * config.recoil1.lightZ * abs(Bfield) / TMath::TwoPi() * beta / 1000.; // MeV/mm;
double alpha = slope/beta; double alpha = slope/beta;
double G = alpha * gamma * beta * perpDist ; double G = alpha * gamma * beta * perpDist ;
double Z = alpha * gamma * beta * z; double Z = alpha * gamma * beta * z;

View File

@ -381,12 +381,12 @@ void MyMainFrame::OpenFile(int ID){
if ( ID == 6 ) fileName = "../working/DWBA2.out"; if ( ID == 6 ) fileName = "../working/DWBA2.out";
if ( ID == 7 ) fileName = "../working/DWBA2.Xsec.txt"; if ( ID == 7 ) fileName = "../working/DWBA2.Xsec.txt";
}else{ }else{
if ( ID == 1 ) fileName = "../working/reactionConfig1.txt"; if ( ID == 1 ) fileName = "../working/reactionConfig.txt";
if ( ID == 2 ) fileName = "../working/Ex1.txt"; if ( ID == 2 ) fileName = "../working/Ex.txt";
if ( ID == 3 ) fileName = "../working/DWBA1"; if ( ID == 3 ) fileName = "../working/DWBA";
if ( ID == 5 ) fileName = "../working/DWBA1.in"; if ( ID == 5 ) fileName = "../working/DWBA.in";
if ( ID == 6 ) fileName = "../working/DWBA1.out"; if ( ID == 6 ) fileName = "../working/DWBA.out";
if ( ID == 7 ) fileName = "../working/DWBA1.Xsec.txt"; if ( ID == 7 ) fileName = "../working/DWBA.Xsec.txt";
} }
if ( ID == 4 ) fileName = "../working/Check_Simulation_Config.txt"; if ( ID == 4 ) fileName = "../working/Check_Simulation_Config.txt";
if ( ID == 8 ) fileName = isoFileName; if ( ID == 8 ) fileName = isoFileName;
@ -494,12 +494,12 @@ void MyMainFrame::Command(int ID) {
if( ID == 1 ){ if( ID == 1 ){
string basicConfig = "reactionConfig1.txt"; string basicConfig = "reactionConfig.txt";
string heliosDetGeoFile = "detectorGeo.txt"; string heliosDetGeoFile = "detectorGeo.txt";
string excitationFile = "Ex1.txt"; //when no file, only ground state string excitationFile = "Ex.txt"; //when no file, only ground state
TString ptolemyRoot = ""; // when no file, use isotropic distribution of thetaCM TString ptolemyRoot = ""; // when no file, use isotropic distribution of thetaCM
TString saveFileName = "transfer1.root"; TString saveFileName = "transfer.root";
TString filename = "reaction1.dat"; //when no file, no output TString filename = "reaction.dat"; //when no file, no output
if( withDWBA->GetState() ) { if( withDWBA->GetState() ) {
ptolemyRoot = "DWBA1.root"; ptolemyRoot = "DWBA1.root";
@ -538,7 +538,7 @@ void MyMainFrame::Command(int ID) {
if( isUse2ndArray ){ if( isUse2ndArray ){
Check_Simulation("transfer2.root"); Check_Simulation("transfer2.root");
}else{ }else{
Check_Simulation("transfer1.root"); Check_Simulation("transfer.root");
} }
statusLabel->SetText(" Run Simulation first."); statusLabel->SetText(" Run Simulation first.");
} }

View File

@ -1,6 +0,0 @@
//Ex relative_xsec SF sigma_in_MeV
//<--- use "//" for line comment
0.000 1.0 1.0 0.0100
//4.400 1.0 1.0 0.0100
//4.600 1.0 1.0 0.0100
#============_End_of_file

View File

@ -1,6 +1,8 @@
-3.00 //Bfield_[T] -3.00 //Bfield_[T]
0.00 //Bfield_direction_to_z-axis_[deg]_should_not_use 0.00 //Bfield_direction_to_z-axis_[deg]_should_not_use
462.5 //bore_[mm] 462.5 //bore_[mm]
1000 //recoil_position_+_for_downstream_[mm] 1000 //recoil_position_+_for_downstream_[mm]
10.0 //inner_radius_of_recoil_detector_[mm] 10.0 //inner_radius_of_recoil_detector_[mm]
40.2 //outter_radius_of_recoil_detector_[mm] 40.2 //outter_radius_of_recoil_detector_[mm]
@ -9,6 +11,7 @@ false //is_coincident_with_recoil
0 //Recoil_2_position_[mm] 0 //Recoil_2_position_[mm]
0.00 //Elum_1_position_[mm]_(just_another_recoil_detector_but_for_light_recoil) 0.00 //Elum_1_position_[mm]_(just_another_recoil_detector_but_for_light_recoil)
0.00 //Elum_2_position_[mm]_when_Elum=0_disable_tree_branch 0.00 //Elum_2_position_[mm]_when_Elum=0_disable_tree_branch
#===============1st_Array #===============1st_Array
11.5 //distance_from_axis_[mm] 11.5 //distance_from_axis_[mm]
10.0 //width_of_detector_[mm] 10.0 //width_of_detector_[mm]
@ -24,7 +27,8 @@ Out //detector_facing_Out_or_In
117.9 117.9
176.8 176.8
235.8 //5th_det 235.8 //5th_det
290.0 294.0
#===============2nd_Array #===============2nd_Array
false //is_2nd_array_exist_is_use_for_Simulation false //is_2nd_array_exist_is_use_for_Simulation
11.5 //distance_from_axis_[mm] 11.5 //distance_from_axis_[mm]
@ -42,4 +46,5 @@ Out //detector_facing_Out_or_In
176.8 176.8
235.8 //5th_det 235.8 //5th_det
290.0 290.0
################## end of file
################## end of file

View File

@ -0,0 +1,39 @@
32 //beam_A
14 //beam_Z
0.0 //excitation_energy_of_beam[MeV]
8.8 //beam-energy_in_MeV/u
0.000 //beam-energy_sigma_in_MeV/u
0.000 //beam-angle_in_mrad
0.000 //beam-emittance_in_mrad
0.00 //x_offset_of_Beam_in_mm
0.00 //y_offset_of_Beam_in_mm
2 //target_A
1 //target_Z
false //isTargetScattering
0.913 //target_density_in_g/cm3
2.2e-4 //targetThickness_in_cm
../SRIM/20F_in_CD2.txt //stopping_power_for_beam
100000 //number_of_Event_being_generated
false //Redo_until_hit_array=all_events_hit_array
#=====reaction_for_1st_Array
1 //recoil_light_A
1 //recoil-light_Z
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
../SRIM/19F_in_CD2.txt //stopping_power_for_heavy_recoil
false //isDacay
32 //decayNucleus_A
14 //decayNucleus_Z
#=====_reaction_for_2nd_Array_use_ony_when_2nd_array_used
3 //recoil_light_A
2 //recoil-light_Z
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
../SRIM/19F_in_CD2.txt //stopping_power_for_heavy_recoil
false //isDacay
32 //decayNucleus_A
14 //decayNucleus_Z
################## end of file

View File

@ -1,25 +0,0 @@
32 //beam_A
14 //beam_Z
2 //target_A
1 //target_Z
1 //recoil_light_A
1 //recoil-light_Z
8.8 //beam-energy_in_MeV/u
0.000 //beam-energy_sigma_in_MeV/u
0.000 //beam-angle_in_mrad
0.000 //beam-emittance_in_mrad
0.00 //x_offset_of_Beam_in_mm
0.00 //y_offset_of_Beam_in_mm
10000 //number_of_Event_being_generated
false //isTargetScattering
0.913 //target_density_in_g/cm3
2.2e-4 //targetThickness_in_cm
../SRIM/20F_in_CD2.txt //stopping_power_for_beam
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
../SRIM19F_in_CD2.txt //stopping_power_for_heavy_recoil
false //isDacay
32 //decayNucleus_A
14 //decayNucleus_Z
false //isReDo
0.0 //List_of_excitation_energy_of_A[MeV]
#===== end of file

View File

@ -1,25 +0,0 @@
16 //beam_A
8 //beam_Z
2 //target_A
1 //target_Z
1 //recoil_light_A
1 //recoil-light_Z
10.0 //beam-energy_in_MeV/u
0.000 //beam-energy_sigma_in_MeV/u
0.000 //beam-angle_in_mrad
0.000 //beam-emittance_in_mrad
0.00 //x_offset_of_Beam_in_mm
0.00 //y_offset_of_Beam_in_mm
100000 //number_of_Event_being_generated
false //isTargetScattering
0.913 //target_density_in_g/cm3
2.2e-4 //targetThickness_in_cm
../SRIM/20F_in_CD2.txt //stopping_power_for_beam
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
../SRIM19F_in_CD2.txt //stopping_power_for_heavy_recoil
false //isDacay
32 //decayNucleus_A
14 //decayNucleus_Z
false //isReDo
0.0 //List_of_excitation_energy_of_A[MeV]
#===== end of file