Skip to content
Snippets Groups Projects
Commit 8f77d761 authored by Viktor's avatar Viktor
Browse files

add flag to exe

parent 28719439
No related branches found
No related tags found
No related merge requests found
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
const TString dir = "../build/"; const TString dir = "../build/";
gSystem-> gSystem->
Load( dir Load( dir
+ "libCentrality.so"); +"libCentrality.so");
} }
...@@ -16,33 +16,35 @@ ...@@ -16,33 +16,35 @@
#include "TH2.h" #include "TH2.h"
int main(int argc, char **argv) { int main(int argc, char **argv) {
auto start = std::chrono::system_clock::now(); auto start = std::chrono::system_clock::now();
ROOT::EnableImplicitMT(2); ROOT::EnableImplicitMT(2);
if(argc <= 3) if(argc <= 4) {
{
std::cout << "Not enough arguments! Please use:" << std::endl; std::cout << "Not enough arguments! Please use:" << std::endl;
std::cout << " ./main filename histoname is2d" << std::endl; std::cout << " ./main filename histoname is_spectator is2d" << std::endl;
return -1; return - 1;
} }
std::unique_ptr <TFile> fIn {TFile::Open(argv[1], "read")}; const char* filename{argv[1]};
const char* histoname{argv[2]};
const bool is_spectator = strcmp(argv[3], "true") == 0;
const bool is_2d = strcmp(argv[4], "true") == 0;
std::unique_ptr<TFile> fIn{TFile::Open(filename, "read")};
std::string outfilename = "test.root"; std::string outfilename = "test.root";
if ( strcmp( argv[3], "false") == 0 ) if(! is_2d) {
{ std::unique_ptr<TH1F> histo{(TH1F*) (fIn->Get(histoname))};
std::unique_ptr <TH1F> histo {(TH1F*) (fIn->Get(argv[2]))};
Centrality::BordersFinder bf; Centrality::BordersFinder bf;
bf.SetHisto(*histo); bf.SetHisto(*histo);
bf.SetRanges( 20,0,100 ); // number of bins, min, max value bf.SetRanges(20, 0, 100); // number of bins, min, max value
// bf.SetRanges( {0,10,30,60,100} ); // centrality bins borders with array // bf.SetRanges( {0,10,30,60,100} ); // centrality bins borders with array
bf.IsSpectator(true); // true if impact parameter b correlated with estimator (spectators eneggy), bf.IsSpectator(is_spectator); // true if impact parameter b correlated with estimator (spectators eneggy),
// false - anticorrelated (multiplicity of produced particles) // false - anticorrelated (multiplicity of produced particles)
bf.FindBorders(); bf.FindBorders();
bf.SaveBorders(outfilename, "centr_getter_1d"); bf.SaveBorders(outfilename, "centr_getter_1d");
} } else
else if ( strcmp( argv[3], "true") == 0 )
{ {
std::unique_ptr <TH2F> histo2d {(TH2F*) (fIn->Get(argv[2]))}; std::unique_ptr <TH2F> histo2d {(TH2F*) (fIn->Get(argv[2]))};
Centrality::BordersFinder2D bf; Centrality::BordersFinder2D bf;
......
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