From 127548477b48fa85ecb86d1830c5111dc73218c7 Mon Sep 17 00:00:00 2001 From: Vratislav Chudoba Date: Thu, 7 Mar 2024 11:19:06 +0300 Subject: [PATCH] Macros testing work of TELoss.so functionality added. --- macros/rootlogon.C | 9 +++++++++ macros/testOfTELoss.cxx | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 macros/rootlogon.C create mode 100644 macros/testOfTELoss.cxx diff --git a/macros/rootlogon.C b/macros/rootlogon.C new file mode 100644 index 0000000..c93c330 --- /dev/null +++ b/macros/rootlogon.C @@ -0,0 +1,9 @@ +{ + + TString pathToTELoss = "../build/TELoss/libTELoss.so"; + + Int_t teloss = gSystem->Load(pathToTELoss); + if (teloss==0) Info("rootlogon.C", "Library %s was successfully loaded.", pathToTELoss.Data()); + else Error("rootlogon.C", "Some error with %s loading", pathToTELoss.Data()); + +} \ No newline at end of file diff --git a/macros/testOfTELoss.cxx b/macros/testOfTELoss.cxx new file mode 100644 index 0000000..a5f1278 --- /dev/null +++ b/macros/testOfTELoss.cxx @@ -0,0 +1,37 @@ +#include "TSystem.h" + +#include "../TELoss/TELoss.h" + +void testOfTELoss() { + + //creating two object for combination particle-material + TELoss mSi_4He; + TELoss mSi_1H; + + //setting tables for alphas in silicon + mSi_4He.SetEL(1, 2.321); //general properties of material (silicon) + mSi_4He.AddEL(14., 28.086, 1); //add Si element to material + mSi_4He.SetZP(2., 4.); //set 4He particles + mSi_4He.SetEtab(100000, 200.); //set table with ranges + mSi_4He.SetDeltaEtab(300); //some other table + + //setting tables for protons in silicon + mSi_1H.SetEL(1, 2.321); //general properties of material (silicon) + mSi_1H.AddEL(14., 28.086, 1); //add Si element to material + mSi_1H.SetZP(1., 1.); //set 4He particles + mSi_1H.SetEtab(100000, 200.); //set table with ranges + mSi_1H.SetDeltaEtab(300); //some other table + + cout << "Remaining energy of proton with energy of 20 MeV after penetration 1 mm of silicon is:" << endl; + cout << "expected (according to LISE++):\t14.604 MeV" << endl; + cout << "calculated:\t\t\t" << mSi_1H.GetE(20, 1000) << " MeV" << endl << endl; + + cout << "Remaining energy of alpha with energy of 50 MeV after penetration 1 mm of silicon is:" << endl << endl; + cout << "expected (according to LISE++):\t5.447 MeV" << endl; + cout << "calculated:\t\t\t" << mSi_4He.GetE(50, 1000) << " MeV" << endl << endl; + + cout << "Remaining energy of alpha with energy of 70 MeV after penetration 1 mm of silicon is:" << endl << endl; + cout << "expected (according to LISE++):\t45.076 MeV" << endl; + cout << "calculated:\t\t\t" << mSi_4He.GetE(70, 1000) << " MeV" << endl << endl; + +} \ No newline at end of file -- 2.18.1