Commit 2aad1964 authored by Tomas Dado's avatar Tomas Dado
Browse files

AnalysisTop: Add option to filter nominal branches

parent 51f8d1cf
......@@ -4985,7 +4985,13 @@ namespace top {
if(treeManager->name() == "truth") filteredBranches= m_config->filterPartonLevelBranches();
else if(treeManager->name() == "particleLevel") filteredBranches= m_config->filterParticleLevelBranches();
else if(treeManager->name() == "nominal_Loose") filteredBranches= m_config->filterNominalLooseBranches();
else filteredBranches= m_config->filterBranches();
else if(treeManager->name() == "nominal") {
if (m_config->filterNominalBranches().empty()) {
filteredBranches= m_config->filterBranches();
} else {
filteredBranches= m_config->filterNominalBranches();
}
} else filteredBranches= m_config->filterBranches();
// lambda to test a wildcard on the variable
auto matches_wildcard = [&variable] (const std::string& wildcard) {
......
......@@ -422,6 +422,9 @@ namespace top {
registerParameter("FilterNominalLooseBranches",
"Comma separated list of names of the nominal_Loose tree branches that will be removed from the output",
" ");
registerParameter("FilterNominalBranches",
"Comma separated list of names of the nominal tree branches that will be removed from the output. If not provided, the branches from FilterBraches will be used",
" ");
registerParameter("FilterTrees",
"Comma separated list of names of the trees that will be removed from the output", " ");
......
......@@ -1023,6 +1023,17 @@ namespace top {
this->setFilterNominalLooseBranches(branches);
}
// Get list of nominal branches to be filtered
if (settings->value("FilterNominalBranches") != " ") {
std::vector<std::string> branches;
tokenize(settings->value("FilterNominalBranches"), branches, ",");
if (branches.size() == 0) {
ATH_MSG_WARNING("You provided \"FilterNominalBranches\" option but you did not provide any meaningful values. Ignoring");
}
this->setFilterNominalBranches(branches);
}
// Force recomputation of CP variables?
if (settings->value("RecomputeCPVariables") == "False") m_recomputeCPvars = false;
......
......@@ -163,6 +163,14 @@ namespace top {
}
}
// List of Nominal branches to be removed
inline std::vector<std::string> filterNominalBranches() const {return m_filterNominalBranches;}
inline void setFilterNominalBranches(const std::vector<std::string>& value) {
if (!m_configFixed) {
m_filterNominalBranches = value;
}
}
// Generators name
inline std::string getGenerators() const {return m_generators;}
inline void setGenerators(const std::string value) {
......@@ -2107,7 +2115,7 @@ namespace top {
bool m_isMC;
bool m_isAFII;
bool m_isDataOverlay;
std::vector<std::string> m_filterBranches, m_filterPartonLevelBranches, m_filterParticleLevelBranches, m_filterNominalLooseBranches;
std::vector<std::string> m_filterBranches, m_filterPartonLevelBranches, m_filterParticleLevelBranches, m_filterNominalLooseBranches, m_filterNominalBranches;
std::string m_generators;
std::string m_AMITag;
bool m_isPrimaryxAOD;
......
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