Commit b41006c8 authored by Lubynets's avatar Lubynets
Browse files

consistent with lustre

parent feb2a6a5
......@@ -44,6 +44,14 @@ add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(macro)
add_executable(run_kfps_qa macro/run_kfps_qa.cpp)
add_dependencies(run_kfps_qa AnalysisTreeQA)
target_link_libraries(run_kfps_qa AnalysisTreeQA ${ROOT_LIBRARIES})
add_executable(run_kfps_corrs macro/run_kfps_corrs.cpp)
add_dependencies(run_kfps_corrs AnalysisTreeQA)
target_link_libraries(run_kfps_corrs AnalysisTreeQA ${ROOT_LIBRARIES})
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/AnalysisTreeQA/AnalysisTreeQAConfigVersion.cmake"
......@@ -83,3 +91,7 @@ install(FILES
Devel
)
install (TARGETS cbm_qa RUNTIME DESTINATION bin)
install (TARGETS run_kfps_qa RUNTIME DESTINATION bin)
install (TARGETS run_kfps_corrs RUNTIME DESTINATION bin)
#include "TFile.h"
#include "TH1.h"
#include "TCanvas.h"
#include "TDirectoryFile.h"
#include "TString.h"
void qa2()
{
std::vector<string> histoname = {"chi2primpos",
"chi2primneg",
"distance",
"cosinepos",
"cosineneg",
"chi2geo",
"l",
"isfrompv",
"cosinetopo",
"ldl",
"chi2topo",
"mass"};
TFile* fileSignal = TFile::Open("/home/user/cbmdir/analysis_tree_qa/macro/out.nomvd.nocuts.sgnl.root");
TFile* fileBackground = TFile::Open("/home/user/cbmdir/analysis_tree_qa/macro/out.nomvd.nocuts.bckgr.root");
TDirectoryFile* dirSignal = (TDirectoryFile*)fileSignal -> Get("LambdaCandidates");
TDirectoryFile* dirBackground = (TDirectoryFile*)fileBackground -> Get("LambdaCandidates");
TH1F* histoSignal;
TH1F* histoBackground;
TFile fileOut("Distributions_output.root", "recreate");
for(int i=0; i<histoname.size(); i++)
{
string histoFullName = "LambdaCandidates_" + histoname.at(i);
histoSignal = (TH1F*) dirSignal -> Get(histoFullName.c_str());
histoBackground = (TH1F*) dirBackground -> Get(histoFullName.c_str());
histoBackground -> Scale(1. * histoSignal->GetEntries() / histoBackground->GetEntries());
const float maxSignal = histoSignal -> GetBinContent(histoSignal -> GetMaximumBin());
const float maxBackground = histoBackground -> GetBinContent(histoBackground -> GetMaximumBin());
const float maxGeneral = std::max(maxSignal, maxBackground);
histoSignal -> SetLineColor(kRed);
histoSignal -> SetLineWidth(2);
histoSignal -> GetYaxis() -> SetRangeUser(0.1, 1.1*maxGeneral);
histoBackground -> SetLineColor(kBlue);
histoBackground -> SetLineWidth(2);
histoBackground -> GetYaxis() -> SetRangeUser(0.1, 1.1*maxGeneral);
TCanvas* c1 = new TCanvas(histoname.at(i).c_str(), "C1", 1500, 900);
c1 -> cd();
histoSignal -> Draw();
histoBackground -> Draw("same");
c1 -> Write();
delete c1;
}
fileOut.Close();
}
{
const TString dir="../install/lib/";
const TString AT_dir="../../analysis_tree/install-cpp17/lib/";
const TString AT_dir="../../AnalysisTree/install_c++17/lib/";
gSystem->Load( AT_dir + "libAnalysisTreeBase.so");
gSystem->Load( AT_dir + "libAnalysisTreeInfra.so");
gSystem->Load( dir + "libAnalysisTreeQA.so");
......
#include "TTree.h"
#include "TFile.h"
#include "TMath.h"
#include "AnalysisTree/Cuts.h"
#include "AnalysisTree/SimpleCut.h"
#include "AnalysisTree/TreeReader.h"
#include "src/Manager.h"
const int nbins = 1000;
const int nbinsmass = 100;
const float HugeValue = 1e9;
using namespace AnalysisTree;
void LambdaCandidatesQA(QA::Manager& man);
int main(int argc, char** argv)
{
const std::string filelist = argv[1];
QA::Manager man(filelist.c_str(), "aTree");
//************** optimized cuts **********************************
Cuts selection_cuts("selection", "LambdaCandidates");
SimpleCut signalcut("issignal", 0, 0);
selection_cuts.AddCuts({signalcut});
man.AddCut(selection_cuts);
// // **********************************************************
LambdaCandidatesQA(man);
man.Run();
}
void LambdaCandidatesQA(QA::Manager& man)
{
// man.AddEntry("LambdaCandidates", "mass", nbinsmass, 1., 2.);
//
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "chi2primpos"}, {nbinsmass, nbins}, {1., 0.}, {2., 100.} );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "chi2primneg"}, {nbinsmass, nbins}, {1., 0.}, {2., 100.} );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "distance"}, {nbinsmass, nbins}, {1., 0.}, {2., 5. } );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "cosinepos"}, {nbinsmass, nbins}, {1., -1.}, {2., 1. } );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "chi2geo"}, {nbinsmass, nbins}, {1., 0.}, {2., 30. } );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "ldl"}, {nbinsmass, nbins}, {1., 0.}, {2., 200.} );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"mass", "chi2topo"}, {nbinsmass, nbins}, {1., 0.}, {2., 100.} );
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"chi2primpos", "chi2primneg"}, {nbins, nbins}, {0., 0.}, {1000., 1000.});
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"chi2primpos", "chi2geo" }, {nbins, nbins}, {0., 0.}, {1000., 30. });
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"chi2primneg", "chi2geo" }, {nbins, nbins}, {0., 0.}, {1000., 30. });
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"chi2geo", "distance" }, {nbins, nbins}, {0., 0.}, {30., 20. });
// man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"chi2geo", "chi2topo" }, {nbins, nbins}, {0., 0.}, {30., 100. });
}
\ No newline at end of file
......@@ -2,6 +2,12 @@
#include "TFile.h"
#include "TMath.h"
#include "AnalysisTree/Cuts.h"
#include "AnalysisTree/SimpleCut.h"
#include "AnalysisTree/TreeReader.h"
#include "src/Manager.h"
const int nbins = 1000;
const float HugeValue = 1e9;
......@@ -21,11 +27,10 @@ void LambdaCandidatesQA(QA::Manager& man);
void LambdaSimulatedQA(QA::Manager& man);
void LambdaCandVsSimQA(QA::Manager& man);
void run_kfps_qa(string filename)
int main(int argc, char** argv)
{
QA::Manager man(filename.c_str(), "aTree");
const std::string filelist = argv[1];
QA::Manager man(filelist.c_str(), "aTree");
// // // ****** standard default cuts use in FC-finder ***********
// Cuts selection_cuts;
......@@ -38,9 +43,9 @@ void run_kfps_qa(string filename)
// SimpleCut l_cut("l", -5., 200.);
// SimpleCut isfrompv_cut("isfrompv", 1, 1);
// SimpleCut ldl_cut("ldl", 5, HugeValue);
// // SimpleCut chi2topo_cut("chi2topo", 0., 15.);
// // SimpleCut chi2topo_cut("chi2topo", 0., 15.);
//
// SimpleCut signalcut("issignal", 0, 1);
// SimpleCut signalcut("issignal", 1, 1);
//
// selection_cuts.AddCuts({ chi2primpos_cut,
// chi2primneg_cut,
......@@ -51,84 +56,95 @@ void run_kfps_qa(string filename)
// l_cut,
// isfrompv_cut,
// ldl_cut,
// // chi2topo_cut,
// //chi2topo_cut,
// signalcut});
//
// man.AddCut("LambdaCandidates", selection_cuts);
// // // **********************************************************
// // **********************************************************
// //************** optimized cuts **********************************
// Cuts selection_cuts;
// SimpleCut chi2primpos_cut("chi2primpos", 26., HugeValue);
// SimpleCut chi2primneg_cut("chi2primneg", 40., HugeValue);
// SimpleCut distance_cut("distance", 0., 0.15);
// SimpleCut cosinepos_cut("cosinepos", 0.998, HugeValue);
// // SimpleCut cosineneg_cut("cosineneg", 0., HugeValue);
// SimpleCut chi2geo_cut("chi2geo", 0., 10.);
// // SimpleCut l_cut("l", -5., 200.);
// // SimpleCut isfrompv_cut("isfrompv", 1, 1);
// SimpleCut ldl_cut("ldl", 4., HugeValue);
// SimpleCut chi2topo_cut("chi2topo", 0., 27.);
//
// SimpleCut signalcut("issignal", 0, 1);
//
// // selection_cuts.AddCuts({
// selection_cuts.AddCuts({ chi2primpos_cut,
// chi2primneg_cut,
// distance_cut,
// cosinepos_cut,
// // cosineneg_cut,
// chi2geo_cut,
// // l_cut,
// // isfrompv_cut,
// ldl_cut,
// chi2topo_cut,
// signalcut});
//
// man.AddCut("LambdaCandidates", selection_cuts);
// // // **********************************************************
//************** optimized cuts **********************************
Cuts selection_cuts("selection", "LambdaCandidates");
// SimpleCut chi2primpos_cut("chi2primpos", 26., HugeValue);
// SimpleCut chi2primneg_cut("chi2primneg", 110., HugeValue);
// SimpleCut distance_cut("distance", 0., 0.15);
// SimpleCut cosinepos_cut("cosinepos", 0.99825, HugeValue);
// SimpleCut cosineneg_cut("cosineneg", 0., HugeValue);
// SimpleCut chi2geo_cut("chi2geo", 0., 11.);
// SimpleCut l_cut("l", -5., 200.);
// SimpleCut isfrompv_cut("isfrompv", 1, 1);
// SimpleCut ldl_cut("ldl", 4., HugeValue);
// SimpleCut chi2topo_cut("chi2topo", 0., 29.);
SimpleCut signalcut("issignal", 1, 1);
selection_cuts.AddCuts({
// selection_cuts.AddCuts({ chi2primpos_cut,
// chi2primneg_cut,
// distance_cut,
// cosinepos_cut,
// cosineneg_cut,
// chi2geo_cut,
// l_cut,
// isfrompv_cut,
// ldl_cut,
// chi2topo_cut,
signalcut});
man.AddCut(selection_cuts);
// // **********************************************************
LambdaCandidatesQA(man);
// LambdaSimulatedQA(man);
// LambdaCandVsSimQA(man);
LambdaSimulatedQA(man);
LambdaCandVsSimQA(man);
man.Run();
}
void LambdaCandidatesQA(QA::Manager& man)
{
man.AddEntry("LambdaCandidates", "chi2primpos", nbins/4, 0., 100.);
man.AddEntry("LambdaCandidates", "chi2primneg", nbins/4, 0., 100.);
man.AddEntry("LambdaCandidates", "distance", nbins/4, 0., 5.);
man.AddEntry("LambdaCandidates", "cosinepos", 4*nbins, -1., 1.);
man.AddEntry("LambdaCandidates", "cosineneg", 4*nbins, -1., 1.);
man.AddEntry("LambdaCandidates", "chi2geo", nbins, 0., 30.);
man.AddEntry("LambdaCandidates", "l", nbins, 0., 500.);
man.AddEntry("LambdaCandidates", "isfrompv", 10, -2, 2);
man.AddEntry("LambdaCandidates", "cosinetopo", nbins, -1., 1.);
man.AddEntry("LambdaCandidates", "ldl", nbins, 0., 200.);
man.AddEntry("LambdaCandidates", "chi2topo", nbins, 0., 100.);
man.AddEntry({"LambdaCandidates", "chi2primpos"}, {nbins, 0., 1000.});
man.AddEntry({"LambdaCandidates", "chi2primneg"}, {nbins, 0., 1000.});
man.AddEntry({"LambdaCandidates", "distance"}, {nbins, 0., 20.});
man.AddEntry({"LambdaCandidates", "cosinepos"}, {nbins, 0.5, 1.});
man.AddEntry({"LambdaCandidates", "cosineneg"}, {nbins, -1., 1.});
man.AddEntry({"LambdaCandidates", "chi2geo"}, {nbins, 0., 100.});
man.AddEntry({"LambdaCandidates", "l"}, {nbins, 0., 250.});
// man.AddEntry("LambdaCandidates", "isfrompv", 10, -2, 2);
// man.AddEntry("LambdaCandidates", "cosinetopo", nbins, -1., 1.);
man.AddEntry({"LambdaCandidates", "ldl"}, {nbins, 0., 200.});
man.AddEntry({"LambdaCandidates", "chi2topo"}, {nbins, 0., 100.});
man.AddEntry({"LambdaCandidates", "x"}, {nbins, -5, 5});
man.AddEntry({"LambdaCandidates", "y"}, {nbins, -5, 5});
man.AddEntry({"LambdaCandidates", "z"}, {nbins, -5, 5});
man.AddEntry("LambdaCandidates", "mass", nbins, 1., 2.);
man.AddEntry({"LambdaCandidates", "mass"}, {nbins, 1., 2.});
for(const auto& var : momentum_)
man.AddEntry("LambdaCandidates", var.name_, nbins, var.min_, var.max_);
man.AddEntry({"LambdaCandidates", var.name_}, {nbins, var.min_, var.max_});
man.AddEntry("LambdaCandidates", "issignal", 10, -2, 2);
man.AddEntry({"LambdaCandidates", "issignal"}, {10, -2, 2});
man.AddEntry({"LambdaCandidates", "iszok"}, {10, -2, 2});
man.AddEntry2D({"LambdaCandidates", "LambdaCandidates"}, {"rapidity_cm", "pT"}, {nbins/2, nbins/2}, {-2.5, 0.}, {2.5, 3.});
man.AddEntry2D({{"LambdaCandidates", "rapidity_cm"}, {"LambdaCandidates", "pT"}}, {{nbins/2, -2.5, 2.5}, {nbins/2, 0., 3.}});
}
// void LambdaSimulatedQA(QA::Manager& man)
// {
// man.AddEntry("LambdaSimulated", "mass", nbins, 1., 2.);
// for(const auto& var : momentum_)
// man.AddEntry("LambdaSimulated", var.name_, nbins, var.min_, var.max_);
// }
//
// void LambdaCandVsSimQA(QA::Manager& man)
// {
// man.AddEntry2D({"LambdaCandidates", "LambdaSimulated"}, {"mass", "mass"}, {nbins, nbins}, {1., 1.}, {2., 2.});
// for(const auto& var : momentum_)
// man.AddEntry2D({"LambdaCandidates", "LambdaSimulated"}, {var.name_, var.name_}, {nbins, nbins}, {var.min_, var.min_}, {var.max_, var.max_});
// }
void LambdaSimulatedQA(QA::Manager& man)
{
man.AddEntry({"LambdaSimulated", "x"}, {nbins, -5, 5});
man.AddEntry({"LambdaSimulated", "y"}, {nbins, -5, 5});
man.AddEntry({"LambdaSimulated", "z"}, {nbins, -5, 5});
man.AddEntry({"LambdaSimulated", "mass"}, {nbins, 1., 2.});
for(const auto& var : momentum_)
man.AddEntry({"LambdaSimulated", var.name_}, {nbins, var.min_, var.max_});
}
void LambdaCandVsSimQA(QA::Manager& man)
{
man.AddEntry2D({{"LambdaCandidates", "x"}, {"LambdaCandidates", "x"}}, {{nbins, -5., 5.}});
man.AddEntry2D({{"LambdaCandidates", "y"}, {"LambdaCandidates", "y"}}, {{nbins, -5., 5.}});
man.AddEntry2D({{"LambdaCandidates", "z"}, {"LambdaCandidates", "z"}}, {{nbins, -5., 5.}});
man.AddEntry2D({{"LambdaCandidates", "mass"}, {"LambdaCandidates", "mass"}}, {{nbins, 1., 2.}});
for(const auto& var : momentum_)
man.AddEntry2D({{"LambdaCandidates", var.name_}, {"LambdaCandidates", var.name_}}, {{nbins, var.min_, var.max_}});
}
......@@ -35,7 +35,6 @@ class Manager {
public:
Manager() = delete;
Manager(const std::string& filelist, const std::string& in_tree) :
in_tree_(AnalysisTree::MakeChain(filelist, in_tree)),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment