|
ATLAS Offline Software
|
Go to the documentation of this file.
30 ISvcLocator* pSvcLocator)
31 : AsgService (
name, pSvcLocator)
33 declareServiceInterface<ISystematicsSvc>();
45 return StatusCode::FAILURE;
52 ANA_MSG_ERROR (
"can't specify both sigmaRecommended and systematicsList");
53 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
65 std::vector<CP::SystematicSet> systematicsVector;
73 sys.calc (m_recommendedSystematics);
78 if (!regex_match (mysys.name(), expr))
83 systematicsVector.push_back (mysys);
98 assert (!systematicsVector.empty());
99 return systematicsVector;
112 if (affecting.
find (mysys) == affecting.
end())
114 ANA_MSG_ERROR (
"systematic is only registered as recommended, not affecting: " << mysys);
115 return StatusCode::FAILURE;
119 m_affectingSystematics.insert (affecting);
120 m_recommendedSystematics.insert (recommended);
121 return StatusCode::SUCCESS;
130 auto iter = m_objectSystematics.find (
name);
131 if (iter != m_objectSystematics.end())
147 if (m_affectingSystematics.find (mysys) == m_affectingSystematics.end())
149 ANA_MSG_ERROR (
"systematic is set as object systematic, but not affecting: " << mysys);
150 return StatusCode::FAILURE;
153 m_objectSystematics[
name] = std::move (mysystematics);
154 return StatusCode::SUCCESS;
161 const std::string& decorName)
const
163 const std::string
name = objectName +
"." + decorName;
165 auto iter = m_decorSystematics.find (
name);
166 if (iter != m_decorSystematics.end())
168 auto jter = m_copies.find (objectName);
169 if (jter != m_copies.end())
171 const std::string& copyName = jter->second;
182 const std::string& decorName,
185 const std::string
name = objectName +
"." + decorName;
190 if (m_affectingSystematics.find (mysys) == m_affectingSystematics.end())
192 ANA_MSG_ERROR (
"systematic is set as object systematic, but not affecting: " << mysys);
193 return StatusCode::FAILURE;
196 m_decorSystematics[
name] = std::move (mysystematics);
197 return StatusCode::SUCCESS;
204 const std::string& toName)
const
207 auto emplace_result = m_copies.try_emplace (toName, fromName);
208 if (emplace_result.second ==
false)
210 ANA_MSG_ERROR (
"duplicate copy registered for name " << toName);
211 return StatusCode::FAILURE;
213 return StatusCode::SUCCESS;
222 auto iter = m_copies.find (toName);
223 if (iter == m_copies.end())
233 const std::string&
name,
238 ANA_MSG_ERROR (
"not allowed to make systematic name for empty string");
239 return StatusCode::FAILURE;
244 const auto sysSplit =
result.find (
"%SYS%");
245 if (sysSplit == std::string::npos)
249 ANA_MSG_ERROR (
"can't set systematics on name without \"%SYS%\": \"" <<
name <<
"\" sys=" <<
sys.name());
250 return StatusCode::FAILURE;
260 return StatusCode::SUCCESS;
277 if (m_recommendedSystematics.find (mysys) == m_recommendedSystematics.end())
290 return StatusCode::SUCCESS;
virtual StatusCode makeSystematicsName(std::string &result, const std::string &name, const CP::SystematicSet &sys) const override
make the name for the given systematics
virtual StatusCode finalize() override
This class handles turning the list of systematics into the actual list of nuisance parameter points ...
virtual CP::SystematicSet getDecorSystematics(const std::string &objectName, const std::string &decorName) const override
get the systematics for the given object in the event store
std::mutex m_systematicsMutex
a mutex for accessing the above mutable members
Class to wrap a set of SystematicVariations.
SystematicsSvc(const std::string &name, ISvcLocator *pSvcLocator)
standard constructor
virtual StatusCode setObjectSystematics(const std::string &name, const CP::SystematicSet &systematics) const override
set the systematics for the given object in the event store
Gaudi::Property< std::vector< std::string > > m_systematicsList
the names of the systematics to request
Select isolated Photons, Electrons and Muons.
virtual StatusCode initialize() override
set up/tear down functions
virtual StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting) const override
register a set of recommended and affecting systematics
virtual CP::SystematicSet getObjectSystematics(const std::string &name) const override
get the systematics for the given object in the event store
virtual StatusCode registerCopy(const std::string &fromName, const std::string &toName) const override
register a (shallow) copy from one object to the next
Gaudi::Property< float > m_sigmaRecommended
load all recommended systematics at the given number of sigmas
::StatusCode StatusCode
StatusCode definition for legacy code.
const_iterator end() const
description: const iterator to the end of the set
virtual std::vector< CP::SystematicSet > makeSystematicsVector() const override
get the list of systematics
virtual std::string getCopySource(const std::string &toName) const override
get a source object name from which a target object has been copied
iterator find(const SystematicVariation &sys) const
description: find an element in the set
Gaudi::Property< std::string > m_nominalSystematicsName
nominal systematics name
virtual StatusCode setDecorSystematics(const std::string &objectName, const std::string &decorName, const CP::SystematicSet &systematics) const override
set the systematics for the given object in the event store
Gaudi::Property< std::string > m_systematicsRegex
the regular expression for filterinf systematics