|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include <boost/algorithm/string/join.hpp>
29 #include "GaudiKernel/ITHistSvc.h"
51 ATH_MSG_WARNING(
"particle property is empty, choose between \"photon\" or \"electron\". Assuming electron.");
56 ATH_MSG_FATAL(
"cannot understand particle property: must be \"electron\" or \"photon\"");
69 return StatusCode::FAILURE;
77 ATH_MSG_INFO(
"================================================================================");
81 ATH_MSG_INFO(
"================================================================================");
88 m_tree =
new TTree(
"all_sys",
"all_sys");
89 m_tree->Branch(
"index", &
m_instance_index,
"index/I")->SetTitle(
"index of the particle as in the original dataset");
107 m_tree->Branch((
prefix +
"cl_E").c_str(), &
m_cl_E, (
prefix +
"cl_E/F").c_str())->SetTitle(
"original xAOD caloCluster energy");
122 std::vector<std::vector<std::string> > all_sys_names_per_tool;
123 std::set<std::string> all_sys_names;
128 const std::string branch_name =
prefix + tool_name +
"_nominal_E";
129 m_tree->Branch(branch_name.c_str(), &
m_nominal_E[itool], (branch_name +
"/F").c_str());
134 std::vector<std::string> sys_names; sys_names.reserve(sys_set.
size());
135 for (
const auto&
sys : sys_set) {
if (
sys.parameter() == 1) { sys_names.push_back(
sys.name()); all_sys_names.insert(
sys.name()); } }
136 std::sort(sys_names.begin(), sys_names.end());
137 all_sys_names_per_tool.push_back(sys_names);
143 for (
const auto&
sys : sys_set) {
144 const std::string branch_name =
prefix + tool_name +
"_ratio_" +
sys.name();
146 (branch_name +
"/F").c_str());
155 std::string
header = std::string(45,
' ');
161 for (
auto sysname : all_sys_names) {
163 for (
const auto& sys_per_tool : all_sys_names_per_tool) {
164 if (
std::find(sys_per_tool.begin(), sys_per_tool.end(), sysname) != sys_per_tool.end())
line +=
" X ";
176 const std::string tree_stream =
"/DATASTREAM";
179 return StatusCode::SUCCESS;
188 return StatusCode::SUCCESS;
263 return StatusCode::SUCCESS;
295 return StatusCode::SUCCESS;
311 return StatusCode::SUCCESS;
321 return StatusCode::FAILURE;
329 return StatusCode::FAILURE;
338 for (
const auto&
sys : sys_set) {
344 ATH_MSG_ERROR(
"Cannot configure calibration tool for systematic");
351 if (
sys.basename().find(
"SCALE") != std::string::npos) {
365 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
std::vector< std::vector< float > > m_energy_variations
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
StatusCode do_energy(xAOD::Egamma &particle, int itool)
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
std::string find(const std::string &s)
return a remapped string
uint64_t eventNumber() const
The current event's event number.
Helper class to provide type-safe access to aux data.
size_t size() const
returns: size of the set
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StatusCode do_truth(const xAOD::Egamma &particle)
Class to wrap a set of SystematicVariations.
std::vector< float > m_nominal_E
uint32_t runNumber() const
The current event's run number.
virtual StatusCode execute()
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
bool hasDecayVtx() const
Check for a decay vertex on this particle.
virtual double e() const override final
The total energy of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
float perp() const
Vertex transverse distance from the beam line.
DumpAllSystematics(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< float > m_energy_variations_sum_up
ToolHandleArray< CP::IEgammaCalibrationAndSmearingTool > m_EgammaCalibrationAndSmearingTools
float m_averageIntPerXing
void fill(H5::Group &out_file, size_t iterations)
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
bool isTrueConvertedPhoton(const xAOD::Photon *ph, float maxRadius=800.)
is the object matched to a true converted photon with R < maxRadius
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
std::vector< float > m_energy_variations_sum_down
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
Class describing the basic event information.
@ Ok
The correction was done successfully.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
#define ATH_MSG_WARNING(x)
virtual StatusCode initialize()
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
float get_eta_calo(const xAOD::CaloCluster &cluster, int author, bool do_throw=false)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
std::string m_reco_container_name
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
StatusCode do_egamma(const xAOD::Egamma &particle)
ParticleType m_particle_type
int pdgId() const
PDG ID code.
std::string m_particle_name
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
virtual StatusCode finalize()
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
unsigned long long m_EventNumber