|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #ifndef XAOD_STANDALONE
8 #include "EventInfo/EventInfo.h"
35 ATH_MSG_INFO(
"Attempting to retrieve truth meta data from the first file...");
46 return StatusCode::SUCCESS;
81 return StatusCode::FAILURE;
89 return StatusCode::FAILURE;
95 if (!
registry.registerSystematics(*
this)) {
97 return StatusCode::FAILURE;
102 return StatusCode::SUCCESS;
115 }
catch (
const std::out_of_range&
e) {
118 std::transform(strippedName.begin(), strippedName.end(), strippedName.begin(),
119 [](
unsigned char c){ return std::tolower(c); });
122 std::transform(modifiedName.begin(), modifiedName.end(), modifiedName.begin(),
123 [](
unsigned char c){ return std::tolower(c); });
124 if (strippedName == modifiedName){
125 ATH_MSG_WARNING(
"Using weight name \"" <<
weight <<
"\" instead of requested \"" << weightName <<
"\"");
129 ATH_MSG_FATAL(
"Weight \"" + weightName +
"\" could not be found");
130 throw std::runtime_error(
name() +
": Weight \"" + weightName +
"\" could not be found");
142 const std::size_t *
res;
150 const std::size_t *
res;
172 ATH_MSG_INFO(
"Attempting to retrieve MC channel number...");
174 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData")) {
176 float fltChannelNumber(-1);
179 return StatusCode::SUCCESS;
182 return StatusCode::FAILURE;
192 ATH_MSG_ERROR(
"MC channel number from a new file does not match the previously processed files.");
193 return StatusCode::FAILURE;
196 return StatusCode::SUCCESS;
203 ATH_MSG_INFO(
"Attempting to load weight meta data from xAOD TruthMetaData for channel " << targetChannelNumber);
205 [targetChannelNumber] (
const auto&
it) { return it->mcChannelNumber() == targetChannelNumber; }
211 return StatusCode::FAILURE;
215 const std::vector<std::string> &truthWeightNames = (*itTruthMetaDataPtr)->weightNames();
216 for(std::size_t
idx = 0;
idx < truthWeightNames.size(); ++
idx ) {
233 #ifdef XAOD_STANDALONE
234 return StatusCode::SUCCESS;
237 std::map<std::string, int> hepMCWeightNamesMap;
240 return StatusCode::FAILURE;
244 ATH_MSG_INFO(
"Attempting to load weight meta data from HepMC IOVMetaData container");
245 for (
auto& kv : hepMCWeightNamesMap) {
257 #endif // XAOD_STANDALONE
265 return StatusCode::FAILURE;
269 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Postprocess generator weight names to be name/ROOT friendly.
void initialize(CP::SystematicSet val_affectingSystematics, std::function< StatusCode(const CP::SystematicSet &sys, CalibData &result)> val_calc) noexcept
initialize with the list of affecting systematics and a function to calculate the calibration data fo...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class to wrap a set of SystematicVariations.
This class provides general information about an event. It extends EventInfo with a list of sub-evts ...
::StatusCode StatusCode
StatusCode definition for legacy code.
std::pair< std::vector< unsigned int >, bool > res
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Class describing the basic event information.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
std::string substitute(const std::string &str, const std::string &pattern, const std::string &with)
effects: substitute all occurences of "pattern" with "with" in the string "str" returns: the substitu...
#define ATH_MSG_WARNING(x)
This module implements the central registry for handling systematic uncertainties with CP tools.
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
const T * at(size_type n) const
Access an element, as an rvalue.
const CP::SystematicSet & affectingSystematics() const noexcept
the list of affecting systematics
StatusCode add(const CP::SystematicSet &sys, CalibData value)
add an individual systematic variation
StatusCode get(const CP::SystematicSet &sys, const CalibData *&result) const
get the pointer to the cached calibration data for the given systematic, calculating it if necessary
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....