29 return StatusCode::SUCCESS;
71 std::optional<SG::ThinningHandle<xAOD::ParticleContainer> > finalPi0sOpt;
74 finalPi0sOpt->thinAll();
77 std::optional<SG::ThinningHandle<xAOD::CaloClusterContainer> > shotclustersOpt;
80 shotclustersOpt->thinAll();
83 std::optional<SG::ThinningHandle<CaloClusterCellLinkContainer> > shotCellLinksOpt;
86 shotCellLinksOpt->thinAll();
93 if (!acc_passThinning(*tau))
continue;
96 taus.keep(tau->index());
100 tauTracks.
keep(track->index());
109 TLorentzVector clusterP4 = cluster->
p4();
114 clusterP4 = vertexedCluster.
p4();
117 if (clusterP4.DeltaR(tauAxis) > 0.2)
continue;
127 if(cellLinks_it != tauCellLinks->end()) {
128 size_t link_index = std::distance(tauCellLinks->begin(), cellLinks_it);
129 tauCellLinks.
keep(link_index);
139 for (; it != end; ++it) {
140 if (it.index() >= cells->size()) {
141 ATH_MSG_WARNING(
"Cell index " << it.index() <<
" is larger than the number of cells in " <<
m_cells.key() <<
" (" << cells->size() <<
")" );
144 cells.keep (it.index());
149 for(
size_t i=0; i<tau->nNeutralPFOs(); i++) {
151 neutralPFOs.
keep(tau->neutralPFO(i)->index());
160 if(cellLinks_it != pi0CellLinks->end()) {
161 size_t link_index = std::distance(pi0CellLinks->begin(), cellLinks_it);
162 pi0CellLinks.
keep(link_index);
171 for (; it != end; ++it) {
172 if (it.index() >= cells->size()) {
173 ATH_MSG_WARNING(
"Cell index " << it.index() <<
" is larger than the number of cells in " <<
m_cells.key() <<
" (" << cells->size() <<
")" );
176 cells.keep (it.index());
182 for(
size_t i=0; i<tau->nPi0s(); i++) {
183 finalPi0sOpt->keep(tau->pi0(i)->index());
188 for(
size_t i=0; i<tau->nShotPFOs(); i++) {
190 shotPFOs.
keep(tau->shotPFO(i)->index());
194 if (!cluster)
continue;
195 if (shotclustersOpt) {
196 shotclustersOpt->keep(cluster->
index());
201 if (shotCellLinksOpt) {
203 if(cellLinks_it != (*shotCellLinksOpt)->end()) {
204 size_t link_index = std::distance((*shotCellLinksOpt)->begin(), cellLinks_it);
205 shotCellLinksOpt->keep(link_index);
215 for (; it != end; ++it) {
216 if (it.index() >= cells->size()) {
217 ATH_MSG_WARNING(
"Cell index " << it.index() <<
" is larger than the number of cells in " <<
m_cells.key() <<
" (" << cells->size() <<
")" );
220 cells.keep (it.index());
225 for(
size_t i=0; i<tau->nHadronicPFOs(); i++) {
226 hadronicPFOs.
keep(tau->hadronicPFO(i)->index());
230 if (tau->secondaryVertex() !=
nullptr) {
231 secondaryVertices.
keep(tau->secondaryVertex()->index());
235 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for reading from StoreGate.
Handle for requesting thinning for a data object.
ServiceHandle< StoreGateSvc > & evtStore()
const_iterator to loop over cells belonging to a cluster
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
const_iterator end() const
const end method
const_iterator begin() const
const begin method
DataModel_detail::const_iterator< DataVector > const_iterator
size_t index() const
Return the index of this element within its container.
Helper class to provide constant type-safe access to aux data.
void thinAll()
Mark that all elements should be thinned away.
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
virtual StatusCode initialize() override
Gaudi initialize method.
SG::ThinningHandleKey< CaloClusterCellLinkContainer > m_tauCellLinks
SG::ThinningHandleKey< xAOD::ParticleContainer > m_finalPi0s
SG::ThinningHandleKey< xAOD::VertexContainer > m_secondaryVertices
SG::ThinningHandleKey< CaloClusterCellLinkContainer > m_pi0CellLinks
SG::ThinningHandleKey< xAOD::TauJetContainer > m_taus
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_shotclusters
Gaudi::Property< bool > m_doVertexCorrection
StringProperty m_streamName
virtual StatusCode execute(const EventContext &ctx) const override
Execute the algorithm.
SG::ThinningHandleKey< xAOD::PFOContainer > m_shotPFOs
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_pi0clusters
SG::ThinningHandleKey< xAOD::PFOContainer > m_hadronicPFOs
SG::ThinningHandleKey< CaloCellContainer > m_cells
SG::ThinningHandleKey< CaloClusterCellLinkContainer > m_shotCellLinks
SG::ThinningHandleKey< xAOD::PFOContainer > m_neutralPFOs
SG::ThinningHandleKey< xAOD::TauTrackContainer > m_tauTracks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual FourMom_t p4() const final
The full 4-momentum of the particle.
Evaluate cluster kinematics with a different vertex / signal state.
Class providing the definition of the 4-vector interface.
const Amg::Vector3D & position() const
Returns the 3-pos.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Vertex_v1 Vertex
Define the latest version of the vertex class.
TauTrack_v1 TauTrack
Definition of the current version.
TauJet_v3 TauJet
Definition of the current "tau version".