Skip to content
Snippets Groups Projects
Commit 3f3fac1e authored by de Séréville Nicolas's avatar de Séréville Nicolas
Browse files

+ remove old code in NPFunction.cxx

parent ef9672e6
No related branches found
No related tags found
No related merge requests found
...@@ -48,21 +48,6 @@ TH1F* Read1DProfile(string filename,string HistName) ...@@ -48,21 +48,6 @@ TH1F* Read1DProfile(string filename,string HistName)
// variable buffer // variable buffer
double xb, wb; double xb, wb;
// Read the file
/* while(!ASCII.eof()){
getline(ASCII,LineBuffer);
stringstream LineStream(LineBuffer);
// ignore comment lines
if (LineBuffer.compare(0,1,"%")!=0 &&
LineBuffer.compare(0,1,"#")!=0 &&
LineBuffer.compare(0,1,"@")!=0) {
LineStream >> xb >> wb ;
cout << xb << "\t" << wb << endl;
x.push_back(xb);
w.push_back(wb);
}
}
*/
// read the file // read the file
Double_t xmin = 200; Double_t xmin = 200;
Double_t xmax = -200; Double_t xmax = -200;
...@@ -80,12 +65,10 @@ TH1F* Read1DProfile(string filename,string HistName) ...@@ -80,12 +65,10 @@ TH1F* Read1DProfile(string filename,string HistName)
mysize++; mysize++;
} }
Double_t dx = (xmax - xmin) / (mysize); Double_t dx = (xmax - xmin) / (mysize);
// cout << xmin << "\t" << xmax << "\t" << size << "\t" << dx << endl; // cout << xmin << "\t" << xmax << "\t" << mysize << "\t" << dx << endl;
// fill histo // fill histo
// h = new TH1F(HistName.c_str(), HistName.c_str(), size, xmin-dx/2, xmax+dx/2);
h = new TH1F(HistName.c_str(), HistName.c_str(), mysize, xmin, xmax+dx); h = new TH1F(HistName.c_str(), HistName.c_str(), mysize, xmin, xmax+dx);
// h = new TH1F(HistName.c_str(), HistName.c_str(), size, xmin, xmax);
for (unsigned int i = 0; i < mysize; i++) { for (unsigned int i = 0; i < mysize; i++) {
int bin = h->FindBin(x[i]); int bin = h->FindBin(x[i]);
h->SetBinContent(bin,w[i]); h->SetBinContent(bin,w[i]);
......
...@@ -52,7 +52,6 @@ void Analysis::Init() { ...@@ -52,7 +52,6 @@ void Analysis::Init() {
// get reaction information // get reaction information
myReaction = new NPL::Reaction(); myReaction = new NPL::Reaction();
myReaction->ReadConfigurationFile(NPOptionManager::getInstance()->GetReactionFile()); myReaction->ReadConfigurationFile(NPOptionManager::getInstance()->GetReactionFile());
TargetThickness = m_DetectorManager->GetTargetThickness()*micrometer;
OriginalBeamEnergy = myReaction->GetBeamEnergy(); OriginalBeamEnergy = myReaction->GetBeamEnergy();
// target thickness // target thickness
......
...@@ -48,6 +48,7 @@ using namespace std; ...@@ -48,6 +48,7 @@ using namespace std;
// nptool headers // nptool headers
#include "TInitialConditions.h" #include "TInitialConditions.h"
#include "TInteractionCoordinates.h" #include "TInteractionCoordinates.h"
//#include "NPDetectorManager.h"
#include "Reaction.h" #include "Reaction.h"
using namespace NPL; using namespace NPL;
...@@ -78,14 +79,22 @@ void ShowResults() ...@@ -78,14 +79,22 @@ void ShowResults()
} }
void CountingRates(Double_t ibeam, Double_t ubt) void CountingRates(Double_t ibeam = 1e5, Double_t ubt = 30)
{ {
// load event generator file // load event generator file
NPL::Reaction *reaction = new NPL::Reaction(); NPL::Reaction *reaction = new NPL::Reaction();
Reaction *reaction = new Reaction();
reaction->ReadConfigurationFile("30Pdp.reaction"); reaction->ReadConfigurationFile("30Pdp.reaction");
// reaction->ReadConfigurationFile("11Be_d3He.reaction"); // reaction->ReadConfigurationFile("11Be_d3He.reaction");
// get angular distribution // get angular distribution
TH1F *dsig = reaction->GetCrossSectionHist(); TH1F *dsig = reaction->GetCrossSectionHist();
dsig->Draw(); dsig->Draw();
// calculate total cross section
Double_t stot = reaction->GetTotalCrossSection();
cout << "total cross section = " << reaction->GetTotalCrossSection() << " mb" << endl; cout << "total cross section = " << reaction->GetTotalCrossSection() << " mb" << endl;
// get target thickness
// NPL::DetectorManager* myDetector = new NPL::DetectorManager();
// myDetector->ReadConfigurationFile("MUGAST_Manu.detector");
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment