tested SimHelper.C

This commit is contained in:
Ryan@Home 2024-07-05 22:09:47 -04:00
parent 67c5eb34ca
commit 1495ac858f
3 changed files with 14 additions and 22 deletions

View File

@ -19,7 +19,7 @@
#include "../Cleopatra/PlotTGraphTObjArray.h" #include "../Cleopatra/PlotTGraphTObjArray.h"
#include "../Armory/AutoFit.C" #include "../Armory/AutoFit.C"
#include "../Armory/AnalysisLib.h" #include "../Armory/AnalysisLib.h"
#include "../Cleopatra/Check_Simulation.C" #include "../Cleopatra/SimChecker.C"
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
@ -43,8 +43,6 @@ private:
TGTextEdit * editor; TGTextEdit * editor;
TString fileName; TString fileName;
TGComboBox * detGeoSelector;
TGLabel * fileLabel; TGLabel * fileLabel;
TGLabel * statusLabel; TGLabel * statusLabel;
@ -86,7 +84,7 @@ MyMainFrame::MyMainFrame(const TGWindow *p,UInt_t w,UInt_t h) {
TGVerticalFrame *hframe1 = new TGVerticalFrame(fMain,600,600 ); TGVerticalFrame *hframe1 = new TGVerticalFrame(fMain,600,600 );
hframe->AddFrame(hframe1); hframe->AddFrame(hframe1);
TGVerticalFrame *hframe2 = new TGVerticalFrame(fMain,600,800 ); TGVerticalFrame *hframe2 = new TGVerticalFrame(fMain,600,1000 );
hframe->AddFrame(hframe2,new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 2,2,2,2)); hframe->AddFrame(hframe2,new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 2,2,2,2));
fileName = "../working/detectorGeo.txt"; fileName = "../working/detectorGeo.txt";
@ -146,15 +144,7 @@ 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); withDWBA = new TGCheckButton(simFrame, "Sim with DWBA");
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->SetWidth(140); withDWBA->SetWidth(140);
withDWBA->ChangeOptions(kFixedSize ); withDWBA->ChangeOptions(kFixedSize );
simFrame->AddFrame(withDWBA, new TGLayoutHints(kLHintsRight, 5,5,3,4)); simFrame->AddFrame(withDWBA, new TGLayoutHints(kLHintsRight, 5,5,3,4));
@ -372,7 +362,7 @@ void MyMainFrame::OpenFile(int ID){
if ( ID == 6 ) fileName = "../working/DWBA.out"; if ( ID == 6 ) fileName = "../working/DWBA.out";
if ( ID == 7 ) fileName = "../working/DWBA.Xsec.txt"; if ( ID == 7 ) fileName = "../working/DWBA.Xsec.txt";
if ( ID == 4 ) fileName = "../working/Check_Simulation_Config.txt"; if ( ID == 4 ) fileName = "../working/SimChecker_Config.txt";
if ( ID == 8 ) fileName = isoFileName; if ( ID == 8 ) fileName = isoFileName;
//test if file exist //test if file exist
@ -496,17 +486,17 @@ void MyMainFrame::Command(int ID) {
statusLabel->SetText("Running simulation......."); statusLabel->SetText("Running simulation.......");
Transfer( basicConfig, heliosDetGeoFile, detGeoSelector->GetSelected(), ptolemyRoot, saveFileName); Transfer( basicConfig, heliosDetGeoFile, ptolemyRoot, saveFileName);
statusLabel->SetText("Plotting simulation......."); statusLabel->SetText("Plotting simulation.......");
Check_Simulation("transfer.root"); SimChecker("transfer.root");
statusLabel->SetText("Plotted Simulation result"); statusLabel->SetText("Plotted Simulation result");
} }
if( ID == 2 ){ if( ID == 2 ){
Check_Simulation("transfer.root"); SimChecker("transfer.root");
statusLabel->SetText(" Run Simulation first."); statusLabel->SetText(" Run Simulation first.");
} }
@ -580,13 +570,14 @@ void MyMainFrame::Command(int ID) {
if( ID == 5) { if( ID == 5) {
TH1F * temp = (TH1F*) gROOT->FindObjectAny("hExCal"); //TODO fit all hExCal
TH1F * temp = (TH1F*) gROOT->FindObjectAny("hExCal0");
if( temp != NULL ){ if( temp != NULL ){
AutoFit::fitAuto(temp, -1); AutoFit::fitAuto(temp, -1);
statusLabel->SetText("Auto Fit hExCal"); statusLabel->SetText("Auto Fit hExCal");
}else{ }else{
statusLabel->SetText("Cannot find historgram hExCal. Please Run Plot Simulation first."); statusLabel->SetText("Cannot find historgram hExCal0. Please Run Plot Simulation first.");
} }
//gROOT->ProcessLine("fitAuto(hExCal, -1)"); //gROOT->ProcessLine("fitAuto(hExCal, -1)");
@ -602,7 +593,7 @@ MyMainFrame::~MyMainFrame() {
} }
void Simulation_Helper() { void SimHelper() {
new MyMainFrame(gClient->GetRoot(),800,600); new MyMainFrame(gClient->GetRoot(),800,1000);
} }

1
working/SimHelper.C Symbolic link
View File

@ -0,0 +1 @@
../Cleopatra/SimHelper.C

View File

@ -28,7 +28,7 @@ Out //detector_facing_Out_or_In
294.0 294.0
#===============2nd_Array + Recoil #===============2nd_Array + Recoil
true //is_this_array_exist_or_use_for_Simulation false //is_this_array_exist_or_use_for_Simulation
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]