fix Check_Simulation.C

This commit is contained in:
Ryan Tang 2024-02-21 17:17:35 -05:00
parent 016ba85389
commit 7e26d60fe8
5 changed files with 25 additions and 14 deletions

View File

@ -178,7 +178,7 @@ void Check_Simulation(TString filename = "transfer.root",
}else{ }else{
numEx = exListTxt->GetListOfLines()->GetSize(); numEx = exListTxt->GetListOfLines()->GetSize()-1;
for( int i = 0 ; i < numEx ; i++){ for( int i = 0 ; i < numEx ; i++){
double ex = atof(exListTxt->GetListOfLines()->At(i)->GetName()); double ex = atof(exListTxt->GetListOfLines()->At(i)->GetName());
if( ex < ExRange[0] ) ExRange[0] = ex; if( ex < ExRange[0] ) ExRange[0] = ex;
@ -187,6 +187,8 @@ void Check_Simulation(TString filename = "transfer.root",
} }
} }
exList.Print();
double dExRange = ExRange[1] - ExRange[0]; double dExRange = ExRange[1] - ExRange[0];
ExRange[0] = ExRange[0] - dExRange * 0.1; ExRange[0] = ExRange[0] - dExRange * 0.1;

View File

@ -5,6 +5,7 @@
#include <TGButton.h> #include <TGButton.h>
#include <TGLabel.h> #include <TGLabel.h>
#include <TGFrame.h> #include <TGFrame.h>
#include <TGComboBox.h>
#include <TGTextEditor.h> #include <TGTextEditor.h>
#include <TGNumberEntry.h> #include <TGNumberEntry.h>
#include <TGComboBox.h> #include <TGComboBox.h>
@ -42,6 +43,8 @@ private:
TGTextEdit * editor; TGTextEdit * editor;
TString fileName; TString fileName;
TGComboBox * detGeoSelector;
TGLabel * fileLabel; TGLabel * fileLabel;
TGLabel * statusLabel; TGLabel * statusLabel;
@ -143,10 +146,18 @@ MyMainFrame::MyMainFrame(const TGWindow *p,UInt_t w,UInt_t h) {
openRec->Connect("Clicked()","MyMainFrame",this, "OpenFile(=1)"); openRec->Connect("Clicked()","MyMainFrame",this, "OpenFile(=1)");
simFrame->AddFrame(openRec,new TGLayoutHints(kLHintsRight, 5,5,3,4)); simFrame->AddFrame(openRec,new TGLayoutHints(kLHintsRight, 5,5,3,4));
detGeoSelector = new TGComboBox(simFrame);
detGeoSelector->SetHeight(20);
detGeoSelector->SetWidth(150);
detGeoSelector->AddEntry("Array 1", 0);
detGeoSelector->AddEntry("Array 2", 1);
detGeoSelector->Select(0);
simFrame->AddFrame(detGeoSelector, new TGLayoutHints(kLHintsRight, 5, 5, 3, 4));
withDWBA = new TGCheckButton(simFrame, "Sim with DWBA\n+DWBA.root\n+DWBA.Ex.txt"); withDWBA = new TGCheckButton(simFrame, "Sim with DWBA\n+DWBA.root\n+DWBA.Ex.txt");
withDWBA->SetWidth(140); withDWBA->SetWidth(140);
withDWBA->ChangeOptions(kFixedSize ); withDWBA->ChangeOptions(kFixedSize );
simFrame->AddFrame(withDWBA, new TGLayoutHints(kLHintsLeft, 5,5,3,4)); simFrame->AddFrame(withDWBA, new TGLayoutHints(kLHintsRight, 5,5,3,4));
TGTextButton *Sim = new TGTextButton(simFrame,"Simulate"); TGTextButton *Sim = new TGTextButton(simFrame,"Simulate");
Sim->SetWidth(150); Sim->SetWidth(150);
@ -485,7 +496,7 @@ void MyMainFrame::Command(int ID) {
statusLabel->SetText("Running simulation......."); statusLabel->SetText("Running simulation.......");
Transfer( basicConfig, heliosDetGeoFile, 0, ptolemyRoot, saveFileName); Transfer( basicConfig, heliosDetGeoFile, detGeoSelector->GetSelected(), ptolemyRoot, saveFileName);
statusLabel->SetText("Plotting simulation......."); statusLabel->SetText("Plotting simulation.......");

View File

@ -45,5 +45,5 @@
#36Ar(d,a)34Cl 0 4L=2 3+ 0.000 8MeV/u As # (d,a) reaction #36Ar(d,a)34Cl 0 4L=2 3+ 0.000 8MeV/u As # (d,a) reaction
20F(d,t)19F 2 1s1/2 3/2+ 0.000 10MeV/u Vl 32Si(d,p)33Si 0 1s1/2 1/2+ 0.000 10MeV/u Vl
20F(d,t)19F 2 0d5/2 5/2+ 0.197 10MeV/u Vl 32Si(d,p)33Si 0 0d5/2 5/2+ 0.197 10MeV/u Vl

View File

@ -48,4 +48,4 @@ Out //detector_facing_Out_or_In
235.8 //5th_det 235.8 //5th_det
290.0 290.0
################## end of file ################## end of file

View File

@ -1,5 +1,5 @@
#--- '#---' comment line identifier #--- '#---' comment line identifier
#--- beam #------------- beam
32 //beam_A 32 //beam_A
14 //beam_Z 14 //beam_Z
0.0 //excitation_energy_of_beam[MeV] 0.0 //excitation_energy_of_beam[MeV]
@ -10,7 +10,7 @@
0.00 //x_offset_of_Beam_in_mm 0.00 //x_offset_of_Beam_in_mm
0.00 //y_offset_of_Beam_in_mm 0.00 //y_offset_of_Beam_in_mm
#--- target #------------- target
2 //target_A 2 //target_A
1 //target_Z 1 //target_Z
false //isTargetScattering false //isTargetScattering
@ -18,11 +18,11 @@ false //isTargetScattering
2.2e-4 //targetThickness_in_cm 2.2e-4 //targetThickness_in_cm
../SRIM/20F_in_CD2.txt //stopping_power_for_beam ../SRIM/20F_in_CD2.txt //stopping_power_for_beam
#--- Monte Carlo Setting #------------- Monte Carlo Setting
1000000 //number_of_Event_being_generated 1000000 //number_of_Event_being_generated
false //Redo_until_hit_array=all_events_hit_array false //Redo_until_hit_array=all_events_hit_array
#=====reaction_for_1st_Array #=================reaction_for_1st_Array
1 //recoil_light_A 1 //recoil_light_A
1 //recoil-light_Z 1 //recoil-light_Z
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil ../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
@ -36,7 +36,7 @@ false //isDacay
1.000 1.0 1.0 0.01 1.000 1.0 1.0 0.01
2.000 1.0 1.0 0.01 2.000 1.0 1.0 0.01
#=====_reaction_for_2nd_Array_use_ony_when_2nd_array_used #==================_reaction_for_2nd_Array_use_ony_when_2nd_array_used
3 //recoil_light_A 3 //recoil_light_A
2 //recoil-light_Z 2 //recoil-light_Z
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil ../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
@ -45,12 +45,10 @@ false //isDacay
32 //decayNucleus_A 32 //decayNucleus_A
14 //decayNucleus_Z 14 //decayNucleus_Z
#--- List of Ex of heavy recoil
#---Ex relative_xsec SF sigma_in_MeV #---Ex relative_xsec SF sigma_in_MeV
0.000 1.0 1.0 0.01 0.000 1.0 1.0 0.01
1.000 1.0 1.0 0.01 1.000 1.0 1.0 0.01
2.000 1.0 1.0 0.01 2.000 1.0 1.0 0.01
################## end of file ################## end of file