36 return StatusCode::FAILURE;
43 ANA_MSG_ERROR (
"can't specify both sigmaRecommended and systematicsList");
44 return StatusCode::FAILURE;
47 return StatusCode::SUCCESS;
56 std::vector<CP::SystematicSet> systematicsVector;
64 sys.calc (m_recommendedSystematics);
69 if (!regex_match (mysys.name(), expr))
74 systematicsVector.push_back (mysys);
89 assert (!systematicsVector.empty());
90 return systematicsVector;
103 if (affecting.
find (mysys) == affecting.
end())
105 ANA_MSG_ERROR (
"systematic is only registered as recommended, not affecting: " << mysys);
106 return StatusCode::FAILURE;
110 m_affectingSystematics.insert (affecting);
111 m_recommendedSystematics.insert (recommended);
112 return StatusCode::SUCCESS;
121 auto iter = m_objectSystematics.find (
name);
122 if (iter != m_objectSystematics.end())
138 if (m_affectingSystematics.find (mysys) == m_affectingSystematics.end())
140 ANA_MSG_ERROR (
"systematic is set as object systematic, but not affecting: " << mysys);
141 return StatusCode::FAILURE;
144 m_objectSystematics[
name] = std::move (mysystematics);
145 return StatusCode::SUCCESS;
152 const std::string& decorName)
const
154 const std::string
name = objectName +
"." + decorName;
156 auto iter = m_decorSystematics.find (
name);
157 if (iter != m_decorSystematics.end())
159 auto jter = m_copies.find (objectName);
160 if (jter != m_copies.end())
162 const std::string& copyName = jter->second;
173 const std::string& decorName,
176 const std::string
name = objectName +
"." + decorName;
181 if (m_affectingSystematics.find (mysys) == m_affectingSystematics.end())
183 ANA_MSG_ERROR (
"systematic is set as object systematic, but not affecting: " << mysys);
184 return StatusCode::FAILURE;
187 m_decorSystematics[
name] = std::move (mysystematics);
188 return StatusCode::SUCCESS;
195 const std::string& toName)
const
198 auto emplace_result = m_copies.try_emplace (toName, fromName);
199 if (emplace_result.second ==
false)
201 ANA_MSG_ERROR (
"duplicate copy registered for name " << toName);
202 return StatusCode::FAILURE;
204 return StatusCode::SUCCESS;
213 auto iter = m_copies.find (toName);
214 if (iter == m_copies.end())
224 const std::string&
name,
229 ANA_MSG_ERROR (
"not allowed to make systematic name for empty string");
230 return StatusCode::FAILURE;
235 const auto sysSplit =
result.find (
"%SYS%");
236 if (sysSplit == std::string::npos)
240 ANA_MSG_ERROR (
"can't set systematics on name without \"%SYS%\": \"" <<
name <<
"\" sys=" <<
sys.name());
241 return StatusCode::FAILURE;
251 return StatusCode::SUCCESS;
268 if (m_recommendedSystematics.find (mysys) == m_recommendedSystematics.end())
281 return StatusCode::SUCCESS;