49 return StatusCode::SUCCESS;
52 if (
P == P1) {
return true; }
55 if (OrigP == OrigP1) {
return OrigP !=
nullptr; }
56 return (OrigP == P1 || OrigP1 ==
P);
68 IsoDecorator decor_ptcone20{
m_ptcone20_key, ctx, -Gaudi::Units::GeV};
69 IsoDecorator decor_ptcone30{
m_ptcone30_key, ctx, -Gaudi::Units::GeV};
70 IsoDecorator decor_ptcone40{
m_ptcone40_key, ctx, -Gaudi::Units::GeV};
76 if (vertices->
empty() ||
78 return vtx->vertexType() == xAOD::VxType::PriVtx;
79 }) == vertices->
end())
return StatusCode::SUCCESS;
84 using view_map = std::map<int, std::vector<const xAOD::TrackParticle*> >;
85 view_map track_sectors;
88 const int sec = sector_mapping.
getSector(trk->phi());
89 std::vector<const xAOD::TrackParticle*>& container = track_sectors[sec];
90 if (container.empty()) container.reserve(idTracks->
size());
91 container.push_back(trk);
95 std::vector<SelDecorator> selDecors;
97 selDecors.emplace_back(key, ctx);
101 if (!selDecors.empty() && std::ranges::find_if(selDecors, [trk](
const SelDecorator& dec){
103 }) == selDecors.end())
continue;
104 std::vector<int> sectors;
105 sector_mapping.
getSectors(trk->phi(), sectors);
107 iso_tracks.reserve(tracks->size());
108 for (
const int sector : sectors) {
109 view_map::iterator itr = track_sectors.find(sector);
110 if (itr == track_sectors.end())
continue;
112 if(!
isSame(trk, to_copy)) iso_tracks.push_back(to_copy);
119 decor_ptcone40(*trk) = result.ptcones[0];
120 decor_ptcone30(*trk) = result.ptcones[1];
121 decor_ptcone20(*trk) = result.ptcones[2];
123 decor_ptvarcone40(*trk) = result.ptvarcones_10GeVDivPt[0];
124 decor_ptvarcone30(*trk) = result.ptvarcones_10GeVDivPt[1];
125 decor_ptvarcone20(*trk) = result.ptvarcones_10GeVDivPt[2];
127 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
DataVector adapter that acts like it holds const pointers.
Handle class for adding a decoration to an object.
DataVector adapter that acts like it holds const pointers.
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.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_ptvarcone20_key
StatusCode execute(const EventContext &ctx) const override
static bool isSame(const xAOD::IParticle *a, const xAOD::IParticle *b)
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_ptcone20_key
Now let's come to the WriteDecorHandleKeys.
~TrackIsolationDecorAlg()
Destructor:
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_ptcone30_key
StatusCode initialize() override
Athena algorithm's Hooks.
ToolHandle< xAOD::ITrackIsolationTool > m_isoTool
Gaudi::Property< std::vector< std::string > > m_trkSel_Decors
Optional list of decorators to select only the good tracks for the isolation decoration.
SG::ReadDecorHandleKeyArray< xAOD::TrackParticleContainer > m_trkSel_keys
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_toDeorTrkKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_ptvarcone40_key
Gaudi::Property< std::string > m_customName
SG::ReadHandleKey< xAOD::VertexContainer > m_vtx_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_ptcone40_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_idTrkKey
xAOD::TrackCorrection m_trk_corr
Gaudi::Property< float > m_pt_min
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_ptvarcone30_key
std::vector< xAOD::Iso::IsolationType > m_trk_iso_types
void getSectors(double phi, std::vector< int > §ors) const
returns the main sector plus neighboring if the phi position is in an overlap region
int getSector(double phi) const
returns the sector corresponding to the phi position
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
Auxiliary class to instantiate WriteDecorHandles.The handles can be created in an empty state.
Class providing the definition of the 4-vector interface.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
@ coreTrackPtr
tracks pointer
TrackParticle_v1 TrackParticle
Reference the current persistent version:
const IParticle * getOriginalObject(const IParticle ©)
This function can be used to conveniently get a pointer back to the original object from which a copy...
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".