ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TauThinningAlg Class Reference

Thin taus below a minimum pt threshold. More...

#include <TauThinningAlg.h>

Inheritance diagram for TauThinningAlg:
Collaboration diagram for TauThinningAlg:

Public Member Functions

virtual StatusCode initialize () override
 Gaudi initialize method. More...
 
virtual StatusCode execute (const EventContext &ctx) const override
 Execute the algorithm. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

 AthReentrantAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

Gaudi::Property< bool > m_doVertexCorrection { this, "VertexCorrection", true, "Tau vertex correction" }
 
StringProperty m_streamName { this, "StreamName", "StreamAOD", "Name of the stream being thinned" }
 
SG::ThinningHandleKey< xAOD::TauJetContainerm_taus { this, "Taus", "TauJets", "Tau container to thin" }
 
SG::ThinningHandleKey< xAOD::TauTrackContainerm_tauTracks { this, "TauTracks", "TauTracks", "Tau track container to thin" }
 
SG::ThinningHandleKey< xAOD::PFOContainerm_neutralPFOs { this, "TauNeutralPFOs", "TauNeutralParticleFlowObjects", "Tau neutral PFO container to thin" }
 
SG::ThinningHandleKey< xAOD::CaloClusterContainerm_pi0clusters { this, "TauPi0Clusters", "TauPi0Clusters", "Tau pi0 cluster container to thin" }
 
SG::ThinningHandleKey< CaloClusterCellLinkContainerm_pi0CellLinks { this, "TauPi0CellLinks", "TauPi0Clusters_links", "Tau pi0 cluster cell link container to thin" }
 
SG::ThinningHandleKey< xAOD::ParticleContainerm_finalPi0s { this, "TauFinalPi0s", "TauFinalPi0s", "Tau final pi0 container to thin" }
 
SG::ThinningHandleKey< xAOD::PFOContainerm_shotPFOs { this, "TauShotPFOs", "TauShotParticleFlowObjects", "Tau shot PFO container to thin" }
 
SG::ThinningHandleKey< xAOD::CaloClusterContainerm_shotclusters { this, "TauShotClusters", "TauShotClusters", "Tau shot cluster container to thin" }
 
SG::ThinningHandleKey< CaloClusterCellLinkContainerm_shotCellLinks { this, "TauShotCellLinks", "TauShotClusters_links", "Tau shot cluster cell link container to thin" }
 
SG::ThinningHandleKey< xAOD::PFOContainerm_hadronicPFOs { this, "TauHadronicPFOs", "TauHadronicParticleFlowObjects", "Tau hadronic PFO container to thin" }
 
SG::ThinningHandleKey< xAOD::VertexContainerm_secondaryVertices { this, "TauSecondaryVertices", "TauSecondaryVertices", "Tau secondary vertex container to thin" }
 
SG::ThinningHandleKey< CaloCellContainerm_cells { this, "Cells", "AllCalo", "Cell container to thin" }
 
SG::ThinningHandleKey< CaloClusterCellLinkContainerm_tauCellLinks { this, "TauCellLinks", "CaloCalTopoClusters_links", "Tau cluster cell link container to thin" }
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Thin taus below a minimum pt threshold.

Thinning algorithm that removes entries from all tau-related containers for tau candidates below a minimum pt threshold

Definition at line 25 of file TauThinningAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ AthReentrantAlgorithm()

AthReentrantAlgorithm::AthReentrantAlgorithm
private

Constructor with parameters:

Definition at line 90 of file AthReentrantAlgorithm.cxx.

22  :
24 {
25 
26  // Set up to run AthAlgorithmDHUpdate in sysInitialize before
27  // merging depedency lists. This extends the output dependency
28  // list with any symlinks implied by inheritance relations.
29  m_updateDataHandles =
30  std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
32  std::move (m_updateDataHandles));
33 }

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode TauThinningAlg::execute ( const EventContext &  ctx) const
overridevirtual

Execute the algorithm.

Parameters
ctxCurrent event context.

Definition at line 36 of file TauThinningAlg.cxx.

37 {
39  taus.thinAll();
40 
42  tauTracks.thinAll();
43 
45  neutralPFOs.thinAll();
46 
48  pi0clusters.thinAll();
49 
51  pi0CellLinks.thinAll();
52 
54  shotPFOs.thinAll();
55 
57  hadronicPFOs.thinAll();
58 
60  secondaryVertices.thinAll();
61 
63  cells.thinAll();
64 
66  tauCellLinks.thinAll();
67 
68  // The three following containers didn't exist in r21.
69  // Make them optional, so we won't crash processing a r21 ESD.
70 
71  std::optional<SG::ThinningHandle<xAOD::ParticleContainer> > finalPi0sOpt;
72  if (evtStore()->contains<xAOD::ParticleContainer> (m_finalPi0s.key())) {
73  finalPi0sOpt.emplace (m_finalPi0s, ctx);
74  finalPi0sOpt->thinAll();
75  }
76 
77  std::optional<SG::ThinningHandle<xAOD::CaloClusterContainer> > shotclustersOpt;
78  if (evtStore()->contains<xAOD::CaloClusterContainer> (m_shotclusters.key())) {
79  shotclustersOpt.emplace (m_shotclusters, ctx);
80  shotclustersOpt->thinAll();
81  }
82 
83  std::optional<SG::ThinningHandle<CaloClusterCellLinkContainer> > shotCellLinksOpt;
84  if (evtStore()->contains<CaloClusterCellLinkContainer> (m_shotCellLinks.key())) {
85  shotCellLinksOpt.emplace (m_shotCellLinks, ctx);
86  shotCellLinksOpt->thinAll();
87  }
88 
89  static const SG::ConstAccessor<char> acc_passThinning("passThinning");
90 
91  for (const xAOD::TauJet* tau : *taus) {
92 
93  if (!acc_passThinning(*tau)) continue;
94 
95  // keep tau
96  taus.keep(tau->index());
97 
98  // keep tau tracks
99  for (const xAOD::TauTrack* track : tau->allTracks()) {
100  tauTracks.keep(track->index());
101  }
102 
103  // keep tau cluster cell links and cells within 0.2 of the tau axis
104  TLorentzVector tauAxis = tauRecTools::getTauAxis(*tau, m_doVertexCorrection);
105  const xAOD::Vertex* tauVertex = tau->vertex();
106 
107  for (const xAOD::IParticle* particle : tau->clusters()) {
108  const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>(particle);
109  TLorentzVector clusterP4 = cluster->p4();
110 
111  // correct the four momentum to point to the tau vertex
112  if (tauVertex) {
113  xAOD::CaloVertexedTopoCluster vertexedCluster(*cluster, tauVertex->position());
114  clusterP4 = vertexedCluster.p4();
115  }
116 
117  if (clusterP4.DeltaR(tauAxis) > 0.2) continue;
118 
119  const CaloClusterCellLink* cellLinks = cluster->getCellLinks();
120  if (!cellLinks) {
121  ATH_MSG_WARNING( "Skipping cluster without cell links." );
122  continue;
123  }
124 
125  // cluster cell links
126  CaloClusterCellLinkContainer::const_iterator cellLinks_it = std::find(tauCellLinks->begin(), tauCellLinks->end(), cellLinks);
127  if(cellLinks_it != tauCellLinks->end()) {
128  size_t link_index = std::distance(tauCellLinks->begin(), cellLinks_it);
129  tauCellLinks.keep(link_index);
130  }
131  else {
132  ATH_MSG_WARNING( "Could not find cluster cell link in " << m_tauCellLinks.key() << ", skipping cluster." );
133  continue;
134  }
135 
136  // cells
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() << ")" );
142  continue;
143  }
144  cells.keep (it.index());
145  }
146  }
147 
148  // keep neutral PFOs, pi0 clusters, cell links and cells
149  for(size_t i=0; i<tau->nNeutralPFOs(); i++) {
150  // neutral PFOs
151  neutralPFOs.keep(tau->neutralPFO(i)->index());
152 
153  // pi0 clusters
154  const xAOD::CaloCluster* cluster = tau->neutralPFO(i)->cluster(0);
155  pi0clusters.keep(cluster->index());
156 
157  // pi0 cell links
158  const CaloClusterCellLink* cellLinks = cluster->getCellLinks();
159  CaloClusterCellLinkContainer::const_iterator cellLinks_it = std::find(pi0CellLinks->begin(), pi0CellLinks->end(), cellLinks);
160  if(cellLinks_it != pi0CellLinks->end()) {
161  size_t link_index = std::distance(pi0CellLinks->begin(), cellLinks_it);
162  pi0CellLinks.keep(link_index);
163  }
164  else {
165  ATH_MSG_WARNING( "Could not find cluster cell link in " << m_pi0CellLinks.key() << ", won't be saved in xAOD." );
166  }
167 
168  // pi0 cells
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() << ")" );
174  continue;
175  }
176  cells.keep (it.index());
177  }
178  }
179 
180  // keep final pi0s
181  if (finalPi0sOpt) {
182  for(size_t i=0; i<tau->nPi0s(); i++) {
183  finalPi0sOpt->keep(tau->pi0(i)->index());
184  }
185  }
186 
187  // keep shot PFOs, clusters, cell links and cells
188  for(size_t i=0; i<tau->nShotPFOs(); i++) {
189  // shot PFOs
190  shotPFOs.keep(tau->shotPFO(i)->index());
191 
192  // shot clusters
193  const xAOD::CaloCluster* cluster = tau->shotPFO(i)->cluster(0);
194  if (!cluster) continue;
195  if (shotclustersOpt) {
196  shotclustersOpt->keep(cluster->index());
197  }
198 
199  // shot cell links
200  const CaloClusterCellLink* cellLinks = cluster->getCellLinks();
201  if (shotCellLinksOpt) {
202  CaloClusterCellLinkContainer::const_iterator cellLinks_it = std::find((*shotCellLinksOpt)->begin(), (*shotCellLinksOpt)->end(), cellLinks);
203  if(cellLinks_it != (*shotCellLinksOpt)->end()) {
204  size_t link_index = std::distance((*shotCellLinksOpt)->begin(), cellLinks_it);
205  shotCellLinksOpt->keep(link_index);
206  }
207  else {
208  ATH_MSG_WARNING( "Could not find cluster cell link in " << m_shotCellLinks.key() << ", won't be saved in xAOD." );
209  }
210  }
211 
212  // shot cells
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() << ")" );
218  continue;
219  }
220  cells.keep (it.index());
221  }
222  }
223 
224  // keep hadronic PFOs
225  for(size_t i=0; i<tau->nHadronicPFOs(); i++) {
226  hadronicPFOs.keep(tau->hadronicPFO(i)->index());
227  }
228 
229  // keep secondary vertex when present
230  if (tau->secondaryVertex() != nullptr) {
231  secondaryVertices.keep(tau->secondaryVertex()->index());
232  }
233  }
234 
235  return StatusCode::SUCCESS;
236 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode TauThinningAlg::initialize ( )
overridevirtual

Gaudi initialize method.

Definition at line 13 of file TauThinningAlg.cxx.

14 {
15  ATH_CHECK( m_taus.initialize(m_streamName) );
16  ATH_CHECK( m_tauTracks.initialize(m_streamName) );
17  ATH_CHECK( m_neutralPFOs.initialize(m_streamName) );
18  ATH_CHECK( m_pi0clusters.initialize(m_streamName) );
20  ATH_CHECK( m_finalPi0s.initialize(m_streamName) );
21  ATH_CHECK( m_shotPFOs.initialize(m_streamName) );
22  ATH_CHECK( m_shotclusters.initialize(m_streamName) );
24  ATH_CHECK( m_hadronicPFOs.initialize(m_streamName) );
28 
29  return StatusCode::SUCCESS;
30 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_cells

SG::ThinningHandleKey<CaloCellContainer> TauThinningAlg::m_cells { this, "Cells", "AllCalo", "Cell container to thin" }
private

Definition at line 98 of file TauThinningAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doVertexCorrection

Gaudi::Property<bool> TauThinningAlg::m_doVertexCorrection { this, "VertexCorrection", true, "Tau vertex correction" }
private

Definition at line 46 of file TauThinningAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_finalPi0s

SG::ThinningHandleKey<xAOD::ParticleContainer> TauThinningAlg::m_finalPi0s { this, "TauFinalPi0s", "TauFinalPi0s", "Tau final pi0 container to thin" }
private

Definition at line 74 of file TauThinningAlg.h.

◆ m_hadronicPFOs

SG::ThinningHandleKey<xAOD::PFOContainer> TauThinningAlg::m_hadronicPFOs { this, "TauHadronicPFOs", "TauHadronicParticleFlowObjects", "Tau hadronic PFO container to thin" }
private

Definition at line 90 of file TauThinningAlg.h.

◆ m_neutralPFOs

SG::ThinningHandleKey<xAOD::PFOContainer> TauThinningAlg::m_neutralPFOs { this, "TauNeutralPFOs", "TauNeutralParticleFlowObjects", "Tau neutral PFO container to thin" }
private

Definition at line 62 of file TauThinningAlg.h.

◆ m_pi0CellLinks

SG::ThinningHandleKey<CaloClusterCellLinkContainer> TauThinningAlg::m_pi0CellLinks { this, "TauPi0CellLinks", "TauPi0Clusters_links", "Tau pi0 cluster cell link container to thin" }
private

Definition at line 70 of file TauThinningAlg.h.

◆ m_pi0clusters

SG::ThinningHandleKey<xAOD::CaloClusterContainer> TauThinningAlg::m_pi0clusters { this, "TauPi0Clusters", "TauPi0Clusters", "Tau pi0 cluster container to thin" }
private

Definition at line 66 of file TauThinningAlg.h.

◆ m_secondaryVertices

SG::ThinningHandleKey<xAOD::VertexContainer> TauThinningAlg::m_secondaryVertices { this, "TauSecondaryVertices", "TauSecondaryVertices", "Tau secondary vertex container to thin" }
private

Definition at line 94 of file TauThinningAlg.h.

◆ m_shotCellLinks

SG::ThinningHandleKey<CaloClusterCellLinkContainer> TauThinningAlg::m_shotCellLinks { this, "TauShotCellLinks", "TauShotClusters_links", "Tau shot cluster cell link container to thin" }
private

Definition at line 86 of file TauThinningAlg.h.

◆ m_shotclusters

SG::ThinningHandleKey<xAOD::CaloClusterContainer> TauThinningAlg::m_shotclusters { this, "TauShotClusters", "TauShotClusters", "Tau shot cluster container to thin" }
private

Definition at line 82 of file TauThinningAlg.h.

◆ m_shotPFOs

SG::ThinningHandleKey<xAOD::PFOContainer> TauThinningAlg::m_shotPFOs { this, "TauShotPFOs", "TauShotParticleFlowObjects", "Tau shot PFO container to thin" }
private

Definition at line 78 of file TauThinningAlg.h.

◆ m_streamName

StringProperty TauThinningAlg::m_streamName { this, "StreamName", "StreamAOD", "Name of the stream being thinned" }
private

Definition at line 50 of file TauThinningAlg.h.

◆ m_tauCellLinks

SG::ThinningHandleKey<CaloClusterCellLinkContainer> TauThinningAlg::m_tauCellLinks { this, "TauCellLinks", "CaloCalTopoClusters_links", "Tau cluster cell link container to thin" }
private

Definition at line 102 of file TauThinningAlg.h.

◆ m_taus

SG::ThinningHandleKey<xAOD::TauJetContainer> TauThinningAlg::m_taus { this, "Taus", "TauJets", "Tau container to thin" }
private

Definition at line 54 of file TauThinningAlg.h.

◆ m_tauTracks

SG::ThinningHandleKey<xAOD::TauTrackContainer> TauThinningAlg::m_tauTracks { this, "TauTracks", "TauTracks", "Tau track container to thin" }
private

Definition at line 58 of file TauThinningAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TauThinningAlg::m_finalPi0s
SG::ThinningHandleKey< xAOD::ParticleContainer > m_finalPi0s
Definition: TauThinningAlg.h:75
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
tauRecTools::getTauAxis
TLorentzVector getTauAxis(const xAOD::TauJet &tau, bool doVertexCorrection=true)
Return the four momentum of the tau axis The tau axis is widely used to select clusters and cells in ...
Definition: Reconstruction/tauRecTools/Root/HelperFunctions.cxx:33
TauThinningAlg::m_neutralPFOs
SG::ThinningHandleKey< xAOD::PFOContainer > m_neutralPFOs
Definition: TauThinningAlg.h:63
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TauThinningAlg::m_shotPFOs
SG::ThinningHandleKey< xAOD::PFOContainer > m_shotPFOs
Definition: TauThinningAlg.h:79
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
SG::ConstAccessor< char >
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
SG::ThinningHandle
Handle for requesting thinning for a data object.
Definition: ThinningHandle.h:84
SG::ThinningHandleKey::initialize
StatusCode initialize(const std::string &stream, const std::string &qualifier, bool used=true)
Should be called during the initialize phase.
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TauThinningAlg::m_streamName
StringProperty m_streamName
Definition: TauThinningAlg.h:51
TauThinningAlg::m_cells
SG::ThinningHandleKey< CaloCellContainer > m_cells
Definition: TauThinningAlg.h:99
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
TauThinningAlg::m_doVertexCorrection
Gaudi::Property< bool > m_doVertexCorrection
Definition: TauThinningAlg.h:47
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TauThinningAlg::m_tauCellLinks
SG::ThinningHandleKey< CaloClusterCellLinkContainer > m_tauCellLinks
Definition: TauThinningAlg.h:103
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
TauThinningAlg::m_shotclusters
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_shotclusters
Definition: TauThinningAlg.h:83
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TauThinningAlg::m_pi0CellLinks
SG::ThinningHandleKey< CaloClusterCellLinkContainer > m_pi0CellLinks
Definition: TauThinningAlg.h:71
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
TauThinningAlg::m_shotCellLinks
SG::ThinningHandleKey< CaloClusterCellLinkContainer > m_shotCellLinks
Definition: TauThinningAlg.h:87
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
Definition: CaloCluster_v1.cxx:905
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
xAOD::CaloCluster_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: CaloCluster_v1.cxx:465
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
TauThinningAlg::m_tauTracks
SG::ThinningHandleKey< xAOD::TauTrackContainer > m_tauTracks
Definition: TauThinningAlg.h:59
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TauTrack_v1
Definition: TauTrack_v1.h:27
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
xAOD::CaloVertexedTopoCluster
Evaluate cluster kinematics with a different vertex / signal state.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloVertexedTopoCluster.h:38
TauThinningAlg::m_pi0clusters
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_pi0clusters
Definition: TauThinningAlg.h:67
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
TauThinningAlg::m_secondaryVertices
SG::ThinningHandleKey< xAOD::VertexContainer > m_secondaryVertices
Definition: TauThinningAlg.h:95
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TauThinningAlg::m_hadronicPFOs
SG::ThinningHandleKey< xAOD::PFOContainer > m_hadronicPFOs
Definition: TauThinningAlg.h:91
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
TauThinningAlg::m_taus
SG::ThinningHandleKey< xAOD::TauJetContainer > m_taus
Definition: TauThinningAlg.h:55