47 return StatusCode::SUCCESS;
50 if (
P == P1) {
return true; }
53 if (OrigP == OrigP1) {
return OrigP !=
nullptr; }
54 return (OrigP == P1 || OrigP1 ==
P);
61 return StatusCode::FAILURE;
67 return StatusCode::FAILURE;
72 return StatusCode::FAILURE;
83 if (vertices->empty() ||
84 std::find_if(vertices->begin(), vertices->end(), [](
const xAOD::Vertex* vtx){
85 return vtx->vertexType() == xAOD::VxType::PriVtx;
86 }) == vertices->end())
return StatusCode::SUCCESS;
91 using view_map = std::map<int, std::vector<const xAOD::TrackParticle*> >;
92 view_map track_sectors;
96 const int sec = sector_mapping.
getSector(trk->phi());
97 std::vector<const xAOD::TrackParticle*>&
container = track_sectors[sec];
103 std::vector<SelDecorator> selDecors;
105 selDecors.emplace_back(key, ctx);
109 if (!selDecors.empty() && std::find_if(selDecors.begin(), selDecors.end(), [trk](
const SelDecorator& dec){
111 }) == selDecors.end())
continue;
112 std::vector<int> sectors;
113 sector_mapping.
getSectors(trk->phi(), sectors);
115 iso_tracks.reserve(tracks->size());
116 for (
const int sector : sectors) {
117 view_map::iterator itr = track_sectors.find(sector);
118 if (itr == track_sectors.end())
continue;
120 if(!
isSame(trk, to_copy)) iso_tracks.push_back(to_copy);
127 decor_ptcone40(*trk) =
result.ptcones[0];
128 decor_ptcone30(*trk) =
result.ptcones[1];
129 decor_ptcone20(*trk) =
result.ptcones[2];
131 decor_ptvarcone40(*trk) =
result.ptvarcones_10GeVDivPt[0];
132 decor_ptvarcone30(*trk) =
result.ptvarcones_10GeVDivPt[1];
133 decor_ptvarcone20(*trk) =
result.ptvarcones_10GeVDivPt[2];
135 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.
An algorithm that can be simultaneously executed in multiple threads.
DataVector adapter that acts like it holds const pointers.
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
TrackIsolationDecorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
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.
bool isPresent() const
Is the referenced object present in SG?
Handle class for adding a decoration to an object.
Class providing the definition of the 4-vector interface.
SG::WriteDecorHandle< ContType, dType > makeHandle(const EventContext &ctx, const SG::WriteDecorHandleKey< ContType > &key, const dType &defValue=dType{})
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
@ 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...
Vertex_v1 Vertex
Define the latest version of the vertex class.