Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #ifndef XAOD_STANDALONE
33 ATH_MSG_INFO(
"Attempting to retrieve truth meta data from the first file...");
42 if (!
sys.name().empty())
ATH_MSG_WARNING(
"Mapping for " <<
sys.name() <<
" missing, setting to index 0.");
44 return StatusCode::SUCCESS;
79 return StatusCode::FAILURE;
87 return StatusCode::FAILURE;
93 if (!
registry.registerSystematics(*
this)) {
95 return StatusCode::FAILURE;
100 return StatusCode::SUCCESS;
113 }
catch (
const std::out_of_range&
e) {
115 std::string strippedName = std::regex_replace(weightName,
std::regex(
" "),
"_");
116 std::transform(strippedName.begin(), strippedName.end(), strippedName.begin(),
117 [](
unsigned char c){ return std::tolower(c); });
119 std::string modifiedName = std::regex_replace(
weight,
std::regex(
" "),
"_");
120 std::transform(modifiedName.begin(), modifiedName.end(), modifiedName.begin(),
121 [](
unsigned char c){ return std::tolower(c); });
122 if (strippedName == modifiedName){
123 ATH_MSG_WARNING(
"Using weight name \"" <<
weight <<
"\" instead of requested \"" << weightName <<
"\"");
127 ATH_MSG_FATAL(
"Weight \"" + weightName +
"\" could not be found");
128 throw std::runtime_error(
name() +
": Weight \"" + weightName +
"\" could not be found");
140 const std::size_t *
res;
148 const std::size_t *
res;
170 ATH_MSG_INFO(
"Attempting to retrieve MC channel number...");
172 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData")) {
174 float fltChannelNumber(-1);
177 return StatusCode::SUCCESS;
180 return StatusCode::FAILURE;
190 ATH_MSG_ERROR(
"MC channel number from a new file does not match the previously processed files.");
191 return StatusCode::FAILURE;
194 return StatusCode::SUCCESS;
201 ATH_MSG_INFO(
"Attempting to load weight meta data from xAOD TruthMetaData for channel " << targetChannelNumber);
203 [targetChannelNumber] (
const auto&
it) { return it->mcChannelNumber() == targetChannelNumber; }
209 return StatusCode::FAILURE;
213 const std::vector<std::string> &truthWeightNames = (*itTruthMetaDataPtr)->weightNames();
214 for(std::size_t
idx = 0;
idx < truthWeightNames.size(); ++
idx ) {
231 #ifdef XAOD_STANDALONE
232 return StatusCode::SUCCESS;
235 std::map<std::string, int> hepMCWeightNamesMap;
238 return StatusCode::FAILURE;
242 ATH_MSG_INFO(
"Attempting to load weight meta data from HepMC IOVMetaData container");
243 for (
auto& kv : hepMCWeightNamesMap) {
255 #endif // XAOD_STANDALONE
263 return StatusCode::FAILURE;
267 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.
::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.
#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....