18 return l->p4().Et() >
r->p4().Et();
55 ATH_MSG_ERROR(
"This algorithm is initialized to save NO (0) Photons, so it shouldn't be running at all!");
56 return StatusCode::FAILURE;
60 return StatusCode::SUCCESS;
82 std::vector<const xAOD::Photon*> originalPhotons(inputPhotons->
begin(), inputPhotons->
end());
85 std::vector<const xAOD::Photon*>::iterator it_maxPhotonBound;
88 int sizeOfOriginalPhotonContainer =
static_cast<int>(originalPhotons.size());
91 if (
m_maxNPhotons > 0) it_maxPhotonBound = maxNPhotons < sizeOfOriginalPhotonContainer ? originalPhotons.begin() + maxNPhotons : originalPhotons.end();
92 else it_maxPhotonBound = originalPhotons.end();
99 std::vector<const xAOD::Photon*>::iterator it_ptThresholdBound;
103 ATH_CHECK(h_TLAPhotons.
record (std::make_unique<xAOD::PhotonContainer>(),
104 std::make_unique<PhotonAuxContainer>()) );
111 for(
auto it_ph=originalPhotons.begin(); it_ph!=it_ptThresholdBound; ++it_ph ) {
116 h_TLAPhotons->push_back(copiedPhoton);
123 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
An algorithm that can be simultaneously executed in multiple threads.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::WriteHandleKey< xAOD::PhotonContainer > m_TLAOutPhotonsKey
virtual StatusCode initialize() override
Gaudi::Property< float > m_photonPtThreshold
virtual StatusCode execute(const EventContext &ctx) const override
TrigEgammaTLAPhotonReAlgo(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::PhotonContainer > m_inputPhotonsKeys
Gaudi::Property< int > m_maxNPhotons
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle as a TLoretzVector.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
DataModel_detail::iterator< DVL > partition(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of partition for DataVector/List.
void partial_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > mid, DataModel_detail::iterator< DVL > end)
Specialization of partial_sort for DataVector/List.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
Photon_v1 Photon
Definition of the current "egamma version".
bool operator()(const xAOD::Photon *l, const xAOD::Photon *r) const
HasPtAboveThreshold(double thresholdPt)
bool operator()(const xAOD::Photon *myphoton) const