From cc2d58b1254a86e004b8a3d5693c692e231dff3a Mon Sep 17 00:00:00 2001 From: Seiya Hayakawa Date: Fri, 29 Sep 2023 18:02:29 +0900 Subject: [PATCH] minor change for parameter file treatment --- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim001.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim002.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim003.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim004.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim005.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim006.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim007.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim008.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim009.C | 14 +++---- c11li6n14pd/prm/prm_reac.c11li6n14pd_sim010.C | 14 +++---- n14dc11an/prm/prm_reac.n14dc11an_sim001.C | 14 +++---- n14dc11an/prm/prm_reac.n14dc11an_sim002.C | 14 +++---- n14dc11an/prm/prm_reac.n14dc11an_sim003.C | 14 +++---- n14dc11an/prm/prm_reac.n14dc11an_sim004.C | 14 +++---- n14dc11an/prm/prm_reac.n14dc11an_sim005.C | 12 +++--- simthm.C | 41 +++++++++++++++++-- 16 files changed, 141 insertions(+), 108 deletions(-) diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim001.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim001.C index ccaed6d..9344656 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim001.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim001.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim002.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim002.C index 692714a..504d695 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim002.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim002.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim003.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim003.C index a4302d2..7c09a3e 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim003.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim003.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim004.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim004.C index 772b066..edb8fbe 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim004.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim004.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim005.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim005.C index a09bf3b..d5aead3 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim005.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim005.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim006.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim006.C index 73fa6e0..ba8a6dd 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim006.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim006.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim007.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim007.C index 6521225..73e6b3c 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim007.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim007.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim008.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim008.C index 4955394..d849f48 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim008.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim008.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim009.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim009.C index 56efe87..c1e8aaa 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim009.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim009.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim010.C b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim010.C index c6c56e5..c6c1e19 100644 --- a/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim010.C +++ b/c11li6n14pd/prm/prm_reac.c11li6n14pd_sim010.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -//const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* //const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/n14dc11an/prm/prm_reac.n14dc11an_sim001.C b/n14dc11an/prm/prm_reac.n14dc11an_sim001.C index 2e26178..7744bc4 100644 --- a/n14dc11an/prm/prm_reac.n14dc11an_sim001.C +++ b/n14dc11an/prm/prm_reac.n14dc11an_sim001.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/n14dc11an/prm/prm_reac.n14dc11an_sim002.C b/n14dc11an/prm/prm_reac.n14dc11an_sim002.C index b33b3e5..ecaea70 100644 --- a/n14dc11an/prm/prm_reac.n14dc11an_sim002.C +++ b/n14dc11an/prm/prm_reac.n14dc11an_sim002.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/n14dc11an/prm/prm_reac.n14dc11an_sim003.C b/n14dc11an/prm/prm_reac.n14dc11an_sim003.C index 92d6332..0a72d36 100644 --- a/n14dc11an/prm/prm_reac.n14dc11an_sim003.C +++ b/n14dc11an/prm/prm_reac.n14dc11an_sim003.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/n14dc11an/prm/prm_reac.n14dc11an_sim004.C b/n14dc11an/prm/prm_reac.n14dc11an_sim004.C index ce3e135..127b4b4 100644 --- a/n14dc11an/prm/prm_reac.n14dc11an_sim004.C +++ b/n14dc11an/prm/prm_reac.n14dc11an_sim004.C @@ -1,10 +1,10 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; -////////////////////////// +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ +/* ////////////////////////// */ /* Event information */ //Long64_t ntot = 2.e9; // number of events diff --git a/n14dc11an/prm/prm_reac.n14dc11an_sim005.C b/n14dc11an/prm/prm_reac.n14dc11an_sim005.C index 4ef0429..b033b1b 100644 --- a/n14dc11an/prm/prm_reac.n14dc11an_sim005.C +++ b/n14dc11an/prm/prm_reac.n14dc11an_sim005.C @@ -1,9 +1,9 @@ -/* Common constants */ -const Double_t u = 931.49432/1000.; // GeV -const Double_t c = 299.7924; // speed of light, mm/ns -const Double_t pi = 4.*atan(1.); -const Double_t d2r = pi/180.; -const Double_t dummy = -1000.; +/* /\* Common constants *\/ */ +/* const Double_t u = 931.49432/1000.; // GeV */ +/* const Double_t c = 299.7924; // speed of light, mm/ns */ +/* const Double_t pi = 4.*atan(1.); */ +/* const Double_t d2r = pi/180.; */ +/* const Double_t dummy = -1000.; */ ////////////////////////// /* Event information */ diff --git a/simthm.C b/simthm.C index 91693ac..a32a695 100644 --- a/simthm.C +++ b/simthm.C @@ -46,10 +46,22 @@ //#include "Math/InterpolationTypes.h" //#include "Math/Types.h" -#include "prm_reac.C" // parameter file +//#include "prm_reac.C" // parameter file +/* Common constants */ +const Double_t u = 931.49432/1000.; // GeV +const Double_t c = 299.7924; // speed of light, mm/ns +const Double_t pi = 4.*atan(1.); +const Double_t d2r = pi/180.; +const Double_t dummy = -1000.; +////////////////////////// using namespace std; +/* #include */ +/* Bool_t FileExists(const std::string& name) { */ +/* return std::filesystem::is_regular_file(name); */ +/* } */ + extern "C" { void enewzsub_etot_(int *z1, float *m1, float *bfr_ene, char matter1[33], int *unit_pressure, float *pressure, float *temperature, @@ -64,7 +76,7 @@ extern "C" { /* float *density); */ } -Double_t sgm_ppac_ab(Double_t z){ +Double_t sgm_ppac_ab(Double_t z, Double_t za, Double_t zb, Double_t sgm_ppac_a, Double_t sgm_ppac_b){ Double_t sgm = sqrt(pow((zb-z)/(zb-za),2)*sgm_ppac_a + pow((za-z)/(zb-za),2)*sgm_ppac_b); return sgm; @@ -107,8 +119,20 @@ Double_t strip_position(Double_t x, Int_t n_strip, Double_t psd_half){ return x_strip; } +//int main(int argc, char **argv) { int main() { + #include "prm_reac.C" // parameter file + /* cout << Form("%s/prm/prm_reac.%s_%s.C",argv[1],argv[1],argv[2]) << endl; */ + /* cout << FileExists(Form("%s/prm/prm_reac.%s_%s.C", */ + /* argv[1],argv[1],argv[2])) << endl; */ + /* getchar(); */ + + /* gRoot->ProcessLine(Form(".L %s/prm/prm_reac.%s_%s.C", */ + /* argv[1],argv[1],argv[2])); */ + +//#include "Form("%s/prm/prm_reac.%s_%s.C",argv[1],argv[1],argv[2])" TApplication theApp("App", NULL, NULL); + //TApplication theApp("App", &argc, argv); // For enewz for(Int_t ichar=0;ichar<33;ichar++){ @@ -200,8 +224,17 @@ int main() { TString fname; //sprintf(fname,"%s/root/%s_%s.root",dir,label,simnum); fname = Form("%s/root/%s_%s.root",dir,label,simnum); + /* cout << "label: " << argv[1] << endl; */ + /* cout << "sim number: " << argv[2] << endl; */ + cout << endl; + cout << "Directory: "<< dir << endl; + cout << "Label: "<< label << endl; + cout << "Sim number: "<< simnum << endl; + cout << "Parameter file name: " + << Form("%s/prm/prm_reac.%s_%s.C",dir,label,simnum) << endl; cout << "Output file name: " << fname.Data() << endl; - cout << "OK to run?" << endl; getchar(); + cout << "OK to run?" << endl; + getchar(); // to store the parameter file gSystem->Exec(Form("mkdir -vp %s/prm",dir)); // Creates prm/ directory if there is not @@ -370,7 +403,7 @@ int main() { // pos.xtar -> pos.xtar_MC // pos.ytar -> pos.ytar_MC // -> pos.rtar_MC - Double_t sgm_track = sgm_ppac_ab(pos.ztar); + Double_t sgm_track = sgm_ppac_ab(pos.ztar, za, zb, sgm_ppac_a, sgm_ppac_b); pos.xtar_MC = ran->Gaus(pos.xtar,sgm_track); pos.ytar_MC = ran->Gaus(pos.ytar,sgm_track); pos.rtar_MC = sqrt(pos.xtar_MC*pos.xtar_MC + pos.ytar_MC*pos.ytar_MC); -- GitLab