27 unsigned int writeOpts = wOpts::writePileUp | wOpts::writeBeamSpot;
28 if (
m_isMC) writeOpts |= wOpts::isMC;
29 m_tree.addBranch(std::make_shared<MuonVal::EventInfoBranch>(
m_tree, writeOpts));
31 auto add_correctionHelper = [
this](std::shared_ptr<IsoCorrectionTestHelper> helper) {
56 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
62 template <
class TARGET_TYPE,
class CONT_TYPE,
class COPY_TYPE>
65 std::pair<std::unique_ptr<COPY_TYPE>,
66 std::unique_ptr<xAOD::ShallowAuxContainer>>& cont)
const {
68 ATH_MSG_DEBUG(
"No key given. Assume it's no required to load the container");
69 return StatusCode::SUCCESS;
74 return StatusCode::FAILURE;
79 std::unique_ptr<COPY_TYPE>& elems = cont.first;
80 for (
auto part : *(elems.get()) ) {
85 return StatusCode::SUCCESS;
103 const EventContext& ctx = Gaudi::Hive::currentContext();
106 std::pair<std::unique_ptr<xAOD::ElectronContainer>, std::unique_ptr<xAOD::ShallowAuxContainer>> ElShallow;
108 Electrons = ElShallow.first.get();
111 std::pair<std::unique_ptr<xAOD::PhotonContainer>, std::unique_ptr<xAOD::ShallowAuxContainer>> PhShallow;
113 Photons = PhShallow.first.get();
116 std::pair<std::unique_ptr<xAOD::MuonContainer>, std::unique_ptr<xAOD::ShallowAuxContainer>> MuonsShallow;
118 Muons = MuonsShallow.first.get();
123 return StatusCode::FAILURE;
138 TrackSet selected_trks{}, expected_trks{};
143 return StatusCode::FAILURE;
151 expected_trks = std::move(cache.
tracks);
152 muon_clusters = std::move(cache.
clusters);
153 pflows = std::move(cache.
flows);
157 auto fill_helper = [&](std::shared_ptr<IsoCorrectionTestHelper> helper,
const xAOD::IParticleContainer* parts) -> StatusCode{
158 if (!helper)
return StatusCode::SUCCESS;
159 helper->SetClusters(muon_clusters);
160 helper->SetFlowElements(pflows);
161 return helper->Fill(parts);
167 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
@ Error
Some error happened during the object correction.
Gaudi::Property< bool > m_isMC
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
Input containers.
TestIsolationCloseByCorrAlg(const std::string &name, ISvcLocator *svcLoc)
Gaudi::Property< std::string > m_updatedIsoDeco
ToolHandle< CP::IIsolationCloseByCorrectionTool > m_isoCloseByCorrTool
const CP::IsolationCloseByCorrectionTool * correction_tool() const
Gaudi::Property< std::string > m_backup_prefix
Gaudi::Property< std::string > m_selDecoration
StatusCode loadContainer(const EventContext &ctx, const SG::ReadHandleKey< CONT_TYPE > &key, std::pair< std::unique_ptr< COPY_TYPE >, std::unique_ptr< xAOD::ShallowAuxContainer > > &cont) const
Gaudi::Property< float > m_el_min_pt
std::shared_ptr< IsoCorrectionTestHelper > m_ele_helper
Gaudi::Property< std::string > m_isoDecoration
std::shared_ptr< IsoCorrectionTestHelper > m_pho_helper
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_polTrkKey
Optionally the algorithm can test the behaviour of the tracks selected by the IsoCloseByCorrectionTrk...
MuonVal::MuonTesterTree m_tree
StatusCode finalize() override
bool passSelection(const EventContext &ctx, const xAOD::Muon *muon) const
SG::ReadHandleKey< xAOD::EgammaContainer > m_photKey
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Optionally the user can also parse the elec / muon / photon selection tools.
Gaudi::Property< float > m_ph_min_pt
ToolHandle< CP::IIsolationSelectionTool > m_isoSelectorTool
StatusCode initialize() override
ToolHandle< IAsgPhotonIsEMSelector > m_photSelTool
SelectionDecorator m_selDecorator
Gaudi::Property< float > m_mu_min_pt
std::shared_ptr< IsoCorrectionTestHelper > m_muo_helper
Gaudi::Property< float > m_el_max_eta
Gaudi::Property< float > m_ph_max_eta
SG::ReadHandleKey< xAOD::EgammaContainer > m_elecKey
Gaudi::Property< float > m_mu_max_eta
SelectionDecorator m_isoDecorator
StatusCode execute() override
ToolHandle< IAsgElectronLikelihoodTool > m_elecSelTool
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual Type::ObjectType type() const override=0
The type of the object as a simple enumeration, remains pure virtual in e/gamma.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Select isolated Photons, Electrons and Muons.
std::set< FlowElementPtr > PflowSet
std::set< TrackPtr > TrackSet
std::set< CaloClusterPtr > ClusterSet
@ Electron
The object is an electron.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Egamma_v1 Egamma
Definition of the current "egamma version".
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.