Commit d834d43c authored by Viktor's avatar Viktor Committed by Florian Uhlig
Browse files

squash minor changes: clang-format, change binning, AT vesion in comment

parent e62205fe
set(ANALYSISTREE_VERSION e5a1f89993ecce314371d64bc921485ac4888511) #v2.1.0
set(ANALYSISTREE_VERSION e5a1f89993ecce314371d64bc921485ac4888511) #v2.1.1
set(ANALYSISTREE_SRC_URL "https://github.com/HeavyIonAnalysis/AnalysisTree.git")
set(ANALYSISTREE_DESTDIR "${CMAKE_BINARY_DIR}/external/ANALYSISTREE-prefix")
......
......@@ -33,7 +33,8 @@ void run_analysis_tree_maker(TString dataSet = "../../../run/test", TString setu
// ----- Load the geometry setup -------------------------------------
std::cout << std::endl;
const TString setupFile = srcDir + "/geometry/setup/setup_" + setupName + ".C";
const TString setupFile =
srcDir + "/geometry/setup/setup_" + setupName + ".C";
const TString setupFunct = "setup_" + setupName + "()";
std::cout << "-I- " << myName << ": Loading macro " << setupFile << std::endl;
......@@ -51,7 +52,8 @@ void run_analysis_tree_maker(TString dataSet = "../../../run/test", TString setu
auto* parFileList = new TList();
std::cout << "-I- " << myName << ": Using raw file " << rawFile << std::endl;
std::cout << "-I- " << myName << ": Using parameter file " << parFile << std::endl;
std::cout << "-I- " << myName << ": Using parameter file " << parFile
<< std::endl;
std::cout << "-I- " << myName << ": Using reco file " << recFile << std::endl;
if (unigenFile.Length() > 0) std::cout << "-I- " << myName << ": Using unigen file " << unigenFile << std::endl;
......@@ -82,12 +84,14 @@ void run_analysis_tree_maker(TString dataSet = "../../../run/test", TString setu
auto* l1 = new CbmL1("CbmL1", 1, 3);
if (setup->IsActive(ECbmModuleId::kMvd)) {
setup->GetGeoTag(ECbmModuleId::kMvd, geoTag);
const TString mvdMatBudgetFileName = srcDir + "/parameters/mvd/mvd_matbudget_" + geoTag + ".root";
const TString mvdMatBudgetFileName =
srcDir + "/parameters/mvd/mvd_matbudget_" + geoTag + ".root";
l1->SetMvdMaterialBudgetFileName(mvdMatBudgetFileName.Data());
}
if (setup->IsActive(ECbmModuleId::kSts)) {
setup->GetGeoTag(ECbmModuleId::kSts, geoTag);
const TString stsMatBudgetFileName = srcDir + "/parameters/sts/sts_matbudget_" + geoTag + ".root";
const TString stsMatBudgetFileName =
srcDir + "/parameters/sts/sts_matbudget_" + geoTag + ".root";
l1->SetStsMaterialBudgetFileName(stsMatBudgetFileName.Data());
}
run->AddTask(l1);
......@@ -95,7 +99,8 @@ void run_analysis_tree_maker(TString dataSet = "../../../run/test", TString setu
// --- TRD pid tasks
if (setup->IsActive(ECbmModuleId::kTrd)) {
CbmTrdSetTracksPidLike* trdLI = new CbmTrdSetTracksPidLike("TRDLikelihood", "TRDLikelihood");
CbmTrdSetTracksPidLike* trdLI =
new CbmTrdSetTracksPidLike("TRDLikelihood", "TRDLikelihood");
trdLI->SetUseMCInfo(kTRUE);
trdLI->SetUseMomDependence(kTRUE);
run->AddTask(trdLI);
......@@ -113,9 +118,10 @@ void run_analysis_tree_maker(TString dataSet = "../../../run/test", TString setu
man->AddTask(new CbmSimEventHeaderConverter("SimEventHeader"));
man->AddTask(new CbmRecEventHeaderConverter("RecEventHeader"));
man->AddTask(new CbmSimTracksConverter("SimParticles", "", unigenFile.Data()));
man->AddTask(new CbmSimTracksConverter("SimParticles"));
CbmStsTracksConverter* taskCbmStsTracksConverter = new CbmStsTracksConverter("VtxTracks", "SimParticles");
CbmStsTracksConverter* taskCbmStsTracksConverter =
new CbmStsTracksConverter("VtxTracks", "SimParticles");
taskCbmStsTracksConverter->SetIsWriteKFInfo();
taskCbmStsTracksConverter->SetIsReproduceCbmKFPF();
man->AddTask(taskCbmStsTracksConverter);
......
AnalysisTree::Cuts* GetCbmEventCuts(const std::string& branch, std::string name="CbmGoodEvent") {
AnalysisTree::SimpleCut vtx_x_cut = AnalysisTree::RangeCut(branch+".vtx_x", -0.5, 0.5);
AnalysisTree::SimpleCut vtx_y_cut = AnalysisTree::RangeCut(branch+".vtx_y", -0.5, 0.5);
AnalysisTree::SimpleCut vtx_z_cut = AnalysisTree::RangeCut(branch+".vtx_z", -0.1, 0.1);
AnalysisTree::SimpleCut vtx_chi2_cut = AnalysisTree::RangeCut(branch+".vtx_chi2", 0.8, 1.7);
AnalysisTree::Cuts* GetCbmEventCuts(const std::string& branch, std::string name = "CbmGoodEvent")
{
AnalysisTree::SimpleCut vtx_x_cut = AnalysisTree::RangeCut(branch + ".vtx_x", -0.5, 0.5);
AnalysisTree::SimpleCut vtx_y_cut = AnalysisTree::RangeCut(branch + ".vtx_y", -0.5, 0.5);
AnalysisTree::SimpleCut vtx_z_cut = AnalysisTree::RangeCut(branch + ".vtx_z", -0.1, 0.1);
AnalysisTree::SimpleCut vtx_chi2_cut = AnalysisTree::RangeCut(branch + ".vtx_chi2", 0.8, 1.7);
auto* event_cuts = new AnalysisTree::Cuts(std::move(name), {vtx_x_cut, vtx_y_cut, vtx_z_cut, vtx_chi2_cut});
return event_cuts;
}
AnalysisTree::Cuts* GetCbmTrackCuts(const std::string& branch, std::string name="CbmGoodVertexTrack") {
AnalysisTree::SimpleCut vtx_chi2_track_cut = AnalysisTree::RangeCut(branch+".vtx_chi2", 0, 3);
AnalysisTree::SimpleCut nhits_cut = AnalysisTree::RangeCut(branch+".nhits", 4, 100);
AnalysisTree::SimpleCut chi2_cut({branch + ".chi2", branch + ".ndf"}, [](std::vector<double> par){ return par[0]/par[1] < 3; });
AnalysisTree::SimpleCut eta_cut = AnalysisTree::RangeCut(branch+".eta", 0.2, 6);
AnalysisTree::Cuts* GetCbmTrackCuts(const std::string& branch, std::string name = "CbmGoodVertexTrack")
{
AnalysisTree::SimpleCut vtx_chi2_track_cut = AnalysisTree::RangeCut(branch + ".vtx_chi2", 0, 3);
AnalysisTree::SimpleCut nhits_cut = AnalysisTree::RangeCut(branch + ".nhits", 4, 100);
AnalysisTree::SimpleCut chi2_cut({branch + ".chi2", branch + ".ndf"},
[](std::vector<double> par) { return par[0] / par[1] < 3; });
AnalysisTree::SimpleCut eta_cut = AnalysisTree::RangeCut(branch + ".eta", 0.2, 6);
auto* vertex_tracks_cuts = new AnalysisTree::Cuts(std::move(name), {vtx_chi2_track_cut, nhits_cut, chi2_cut, eta_cut});
auto* vertex_tracks_cuts =
new AnalysisTree::Cuts(std::move(name), {vtx_chi2_track_cut, nhits_cut, chi2_cut, eta_cut});
return vertex_tracks_cuts;
}
AnalysisTree::Cuts* GetCbmTofHitsCuts(const std::string& branch, std::string name="CbmGoodTofHit") {
AnalysisTree::SimpleCut tof_cuts_dx = AnalysisTree::RangeCut(branch+".dx", -2, 2);
AnalysisTree::SimpleCut tof_cuts_dy = AnalysisTree::RangeCut(branch+ ".dy", -1, 1);
AnalysisTree::Cuts* GetCbmTofHitsCuts(const std::string& branch, std::string name = "CbmGoodTofHit")
{
AnalysisTree::SimpleCut tof_cuts_dx = AnalysisTree::RangeCut(branch + ".dx", -2, 2);
AnalysisTree::SimpleCut tof_cuts_dy = AnalysisTree::RangeCut(branch + ".dy", -1, 1);
auto* tof_cuts = new AnalysisTree::Cuts(std::move(name), {tof_cuts_dx, tof_cuts_dy});
return tof_cuts;
}
AnalysisTree::Cuts* GetCbmMcTracksCuts(const std::string& branch, std::string name="CbmMcPrimaryTrack") {
auto* sim_tracks_cut = new AnalysisTree::Cuts(std::move(name), {AnalysisTree::EqualsCut(branch+".mother_id", -1)});
AnalysisTree::Cuts* GetCbmMcTracksCuts(const std::string& branch, std::string name = "CbmMcPrimaryTrack")
{
auto* sim_tracks_cut = new AnalysisTree::Cuts(std::move(name), {AnalysisTree::EqualsCut(branch + ".mother_id", -1)});
return sim_tracks_cut;
}
\ No newline at end of file
......@@ -79,10 +79,10 @@ void TrdTracksQA(QA::Task& task)
AddTrackQA(&task, trd_tracks);
AddTracksMatchQA(&task, trd_tracks, rec_tracks);
task.AddH1({"TRD energy loss in 1st station, keV", {trd_tracks, "energy_loss_0"}, {gNbins, 0, 1}});
task.AddH1({"TRD energy loss in 2nd station", {trd_tracks, "energy_loss_1"}, {gNbins, 0, 1}});
task.AddH1({"TRD energy loss in 3rd station", {trd_tracks, "energy_loss_2"}, {gNbins, 0, 1}});
task.AddH1({"TRD energy loss in 4th station", {trd_tracks, "energy_loss_3"}, {gNbins, 0, 1}});
task.AddH1({"TRD energy loss in 1st station, keV", {trd_tracks, "energy_loss_0"}, {gNbins, 0, 50}});
task.AddH1({"TRD energy loss in 2nd station", {trd_tracks, "energy_loss_1"}, {gNbins, 0, 50}});
task.AddH1({"TRD energy loss in 3rd station", {trd_tracks, "energy_loss_2"}, {gNbins, 0, 50}});
task.AddH1({"TRD energy loss in 4th station", {trd_tracks, "energy_loss_3"}, {gNbins, 0, 50}});
task.AddH1({"Number of hits in TRD", {trd_tracks, "n_hits"}, {6, 0, 6}});
......@@ -151,25 +151,23 @@ void TofHitsQA(QA::Task& task)
{"sign(q)*p TOF, GeV/c", {tof_hits, "qp_tof"}, {gNbins, -10, 10}});
SimpleCut sc_protons = EqualsCut("SimParticles.pid", 2212);
SimpleCut sc_prim = EqualsCut("SimParticles.mother_id", -1);
SimpleCut sc_prim = EqualsCut("SimParticles.mother_id", -1);
auto prim = new Cuts("mc_primary", {sc_prim});
auto protons = new Cuts("mc_protons", {sc_protons});
auto prim = new Cuts("mc_primary", {sc_prim});
auto protons = new Cuts("mc_protons", {sc_protons});
auto prim_protons = new Cuts("mc_primary_protons", {sc_protons, sc_prim});
auto prim_pions = new Cuts("mc_primary_pions_pos", {EqualsCut("SimParticles.pid", 211), sc_prim});
auto prim_kaons = new Cuts("mc_primary_kaons_pos", {EqualsCut("SimParticles.pid", 321), sc_prim});
auto prim_pions = new Cuts("mc_primary_pions_pos", {EqualsCut("SimParticles.pid", 211), sc_prim});
auto prim_kaons = new Cuts("mc_primary_kaons_pos", {EqualsCut("SimParticles.pid", 321), sc_prim});
std::vector<Cuts*> cuts = {nullptr, prim, protons, prim_protons, prim_pions, prim_kaons};
for(auto cut : cuts){
task.AddH2({"p_{MC}, GeV/c", {"SimParticles", "p"}, {250, 0, 10}},{"m^{2}, GeV^{2}/c^{2}", {"TofHits", "mass2"}, {500, -1, 2}}, cut);
for (auto cut : cuts) {
task.AddH2({"p_{MC}, GeV/c", {"SimParticles", "p"}, {250, 0, 10}},
{"m^{2}, GeV^{2}/c^{2}", {"TofHits", "mass2"}, {500, -1, 2}}, cut);
}
}
void SimParticlesQA(QA::Task& task)
{
AddParticleQA(&task, sim_particles);
}
void SimParticlesQA(QA::Task& task) { AddParticleQA(&task, sim_particles); }
void SimEventHeaderQA(QA::Task& task)
{
......
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