#include #include #include #include #include #include #include "fmcTypes.h" #include "fmcFunctions.cxx" int main(int argc, char **argv) { TString inFileName, outFileName; if (argc < 5) { std::cerr << "./calcMult -i input -o output" << std::endl; return 10; } for (int i = 1; i < argc; i++) { if (std::string(argv[i]) != "-i" && std::string(argv[i]) != "-o") { std::cerr << "\ncalcMult: Unknown parameter " << i << ": " << argv[i] << std::endl; return 11; } else { if (std::string(argv[i]) == "-i" && i != argc - 1) { inFileName = argv[++i]; } if (std::string(argv[i]) == "-i" && i == argc - 1) { std::cerr << "\ncalcMult: Input file name was not specified!" << std::endl; return 20; } if (std::string(argv[i]) == "-o" && i != argc - 1) { outFileName = argv[++i]; } if (std::string(argv[i]) == "-o" && i == argc - 1) { std::cerr << "\ncalcMult: Output file name was not specified!" << std::endl; return 21; } } } TFile *fi = new TFile(inFileName.Data(),"read"); if (fi->IsZombie()) return 1; TH1I *histSTAR = (TH1I*) fi->Get("hRefMultSTAR"); TH1I *histPHENIX = (TH1I*) fi->Get("hRefMultPHENIX"); if (!histSTAR || !histPHENIX){ std::cerr << "Error: histogram was not found!" << std::endl; return 2; } std::cout << std::endl; std::cout << "STAR-like refMult" << std::endl; fmc::Lim limSTAR = fmc::CentralityBorders(histSTAR,1.); std::cout << std::endl; std::cout << "PHENIX-like refMult" << std::endl; fmc::Lim limPHENIX = fmc::CentralityBorders(histPHENIX,0.93); std::ofstream file(outFileName.Data()); file << "STAR" << std::endl; for (int i=0; i