ATLAS Offline Software
PseudoTrackSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // PseudoTrackSelector
7 // Author: Sebastien Rettie, sebastien.rettie@cern.ch
8 // This is a modified version of exisitng TrackParticleMerger
10 
12 // Pseudotrack selector to be used mainly for creating new track
13 // collections with a subset of input pseudotracks
15 
17 #include "GaudiKernel/MsgStream.h"
22 // Constructor
24 
25 namespace DerivationFramework {
26 
28  const std::string& n,
29  const IInterface* p) : AthAlgTool(t,n,p)
30  {
31  declareInterface<DerivationFramework::IAugmentationTool>(this);
32  // The default goal of this selector is to create a track collection from a subset of pseudo tracks
33  declareProperty("RecoTrackParticleLocation", m_in_recoTrackParticleLocation);
34  declareProperty("PseudoTrackParticleLocation", m_in_pseudoTrackParticleLocation);
35  declareProperty("OutputRecoReplacedWithPseudo", m_out_recoReplacedWithPseudo);
36  declareProperty("OutputRecoReplacedWithPseudoFromB", m_out_recoReplacedWithPseudoFromB);
37  declareProperty("OutputRecoReplacedWithPseudoNotFromB", m_out_recoReplacedWithPseudoNotFromB);
38  declareProperty("OutputRecoPlusPseudo", m_out_recoPlusPseudo);
39  declareProperty("OutputRecoPlusPseudoFromB", m_out_recoPlusPseudoFromB);
40  declareProperty("OutputRecoPlusPseudoNotFromB", m_out_recoPlusPseudoNotFromB);
41  declareProperty("OutputRecoNoFakes", m_out_recoNoFakes);
42  declareProperty("OutputRecoNoFakesFromB", m_out_recoNoFakesFromB);
43  declareProperty("OutputRecoNoFakesNotFromB", m_out_recoNoFakesNotFromB);
44  }
45 
47  // Initialisation
49 
51  {
52  ATH_MSG_DEBUG("Initializing PseudoTrackSelector");
64  ATH_CHECK( m_trackOriginTool.retrieve() );
65  return StatusCode::SUCCESS;
66  }
67 
69  // Finalize
71 
73  {
74  return StatusCode::SUCCESS;
75  }
76 
78  {
79  const EventContext& ctx = Gaudi::Hive::currentContext();
80  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoReplacedWithPseudo = std::make_unique<xAOD::TrackParticleContainer>();
81  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoReplacedWithPseudoAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
82  outputRecoReplacedWithPseudo->setStore(outputRecoReplacedWithPseudoAux.get());
83  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoReplacedWithPseudoFromB = std::make_unique<xAOD::TrackParticleContainer>();
84  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoReplacedWithPseudoFromBAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
85  outputRecoReplacedWithPseudoFromB->setStore(outputRecoReplacedWithPseudoFromBAux.get());
86  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoReplacedWithPseudoNotFromB = std::make_unique<xAOD::TrackParticleContainer>();
87  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoReplacedWithPseudoNotFromBAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
88  outputRecoReplacedWithPseudoNotFromB->setStore(outputRecoReplacedWithPseudoNotFromBAux.get());
89  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoPlusPseudo = std::make_unique<xAOD::TrackParticleContainer>();
90  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoPlusPseudoAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
91  outputRecoPlusPseudo->setStore(outputRecoPlusPseudoAux.get());
92  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoPlusPseudoFromB = std::make_unique<xAOD::TrackParticleContainer>();
93  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoPlusPseudoFromBAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
94  outputRecoPlusPseudoFromB->setStore(outputRecoPlusPseudoFromBAux.get());
95  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoPlusPseudoNotFromB = std::make_unique<xAOD::TrackParticleContainer>();
96  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoPlusPseudoNotFromBAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
97  outputRecoPlusPseudoNotFromB->setStore(outputRecoPlusPseudoNotFromBAux.get());
98  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoNoFakes = std::make_unique<xAOD::TrackParticleContainer>();
99  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoNoFakesAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
100  outputRecoNoFakes->setStore(outputRecoNoFakesAux.get());
101  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoNoFakesFromB = std::make_unique<xAOD::TrackParticleContainer>();
102  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoNoFakesFromBAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
103  outputRecoNoFakesFromB->setStore(outputRecoNoFakesFromBAux.get());
104  std::unique_ptr<xAOD::TrackParticleContainer> outputRecoNoFakesNotFromB = std::make_unique<xAOD::TrackParticleContainer>();
105  std::unique_ptr<xAOD::TrackParticleAuxContainer> outputRecoNoFakesNotFromBAux = std::make_unique<xAOD::TrackParticleAuxContainer>();
106  outputRecoNoFakesNotFromB->setStore(outputRecoNoFakesNotFromBAux.get());
107 
108  // retrieve reco and pseudo tracks
111 
112  // fail if containers not available
113  if (!recoTrackParticleCol.isValid()){
114  ATH_MSG_ERROR( m_in_recoTrackParticleLocation.key() << " not valid!" );
115  return StatusCode::FAILURE;
116  }
117  if (!pseudoTrackParticleCol.isValid()){
118  ATH_MSG_ERROR( m_in_pseudoTrackParticleLocation.key() << " not valid!" );
119  return StatusCode::FAILURE;
120  }
121 
122  // select subset of tracks
123  fillRecoReplacedWithPseudo(recoTrackParticleCol.cptr(), pseudoTrackParticleCol.cptr(), outputRecoReplacedWithPseudo.get());
124  fillRecoReplacedWithPseudo(recoTrackParticleCol.cptr(), pseudoTrackParticleCol.cptr(), outputRecoReplacedWithPseudoFromB.get(), true, false);
125  fillRecoReplacedWithPseudo(recoTrackParticleCol.cptr(), pseudoTrackParticleCol.cptr(), outputRecoReplacedWithPseudoNotFromB.get(), false, true);
126  fillRecoPlusPseudo(recoTrackParticleCol.cptr(), pseudoTrackParticleCol.cptr(), outputRecoPlusPseudo.get());
127  fillRecoPlusPseudo(recoTrackParticleCol.cptr(), pseudoTrackParticleCol.cptr(), outputRecoPlusPseudoFromB.get(), true, false);
128  fillRecoPlusPseudo(recoTrackParticleCol.cptr(), pseudoTrackParticleCol.cptr(), outputRecoPlusPseudoNotFromB.get(), false, true);
129  fillRecoNoFakes(recoTrackParticleCol.cptr(), outputRecoNoFakes.get());
130  fillRecoNoFakes(recoTrackParticleCol.cptr(), outputRecoNoFakesFromB.get(), true, false);
131  fillRecoNoFakes(recoTrackParticleCol.cptr(), outputRecoNoFakesNotFromB.get(), false, true);
132 
133  // Write tracks to store
134  ATH_MSG_DEBUG("outputRecoReplacedWithPseudo has "<<outputRecoReplacedWithPseudo.get()->size()<<" tracks");
136  ATH_CHECK(h_write_recoReplacedWithPseudo.record(std::move(outputRecoReplacedWithPseudo), std::move(outputRecoReplacedWithPseudoAux)));
137  ATH_MSG_DEBUG("wrote "<<m_out_recoReplacedWithPseudo<<" to store");
138 
139  ATH_MSG_DEBUG("outputRecoReplacedWithPseudoFromB has "<<outputRecoReplacedWithPseudoFromB.get()->size()<<" tracks");
141  ATH_CHECK(h_write_recoReplacedWithPseudoFromB.record(std::move(outputRecoReplacedWithPseudoFromB), std::move(outputRecoReplacedWithPseudoFromBAux)));
142  ATH_MSG_DEBUG("wrote "<<m_out_recoReplacedWithPseudoFromB<<" to store");
143 
144  ATH_MSG_DEBUG("outputRecoReplacedWithPseudoNotFromB has "<<outputRecoReplacedWithPseudoNotFromB.get()->size()<<" tracks");
145  SG::WriteHandle<xAOD::TrackParticleContainer> h_write_recoReplacedWithPseudoNotFromB(m_out_recoReplacedWithPseudoNotFromB, ctx);
146  ATH_CHECK(h_write_recoReplacedWithPseudoNotFromB.record(std::move(outputRecoReplacedWithPseudoNotFromB), std::move(outputRecoReplacedWithPseudoNotFromBAux)));
147  ATH_MSG_DEBUG("wrote "<<m_out_recoReplacedWithPseudoNotFromB<<" to store");
148 
149  ATH_MSG_DEBUG("outputRecoPlusPseudo has "<<outputRecoPlusPseudo.get()->size()<<" tracks");
151  ATH_CHECK(h_write_recoPlusPseudo.record(std::move(outputRecoPlusPseudo), std::move(outputRecoPlusPseudoAux)));
152  ATH_MSG_DEBUG("wrote "<<m_out_recoPlusPseudo<<" to store");
153 
154  ATH_MSG_DEBUG("outputRecoPlusPseudoFromB has "<<outputRecoPlusPseudoFromB.get()->size()<<" tracks");
156  ATH_CHECK(h_write_recoPlusPseudoFromB.record(std::move(outputRecoPlusPseudoFromB), std::move(outputRecoPlusPseudoFromBAux)));
157  ATH_MSG_DEBUG("wrote "<<m_out_recoPlusPseudoFromB<<" to store");
158 
159  ATH_MSG_DEBUG("outputRecoPlusPseudoNotFromB has "<<outputRecoPlusPseudoNotFromB.get()->size()<<" tracks");
161  ATH_CHECK(h_write_recoPlusPseudoNotFromB.record(std::move(outputRecoPlusPseudoNotFromB), std::move(outputRecoPlusPseudoNotFromBAux)));
162  ATH_MSG_DEBUG("wrote "<<m_out_recoPlusPseudoNotFromB<<" to store");
163 
164  ATH_MSG_DEBUG("outputRecoNoFakes has "<<outputRecoNoFakes.get()->size()<<" tracks");
166  ATH_CHECK(h_write_recoNoFakes.record(std::move(outputRecoNoFakes), std::move(outputRecoNoFakesAux)));
167  ATH_MSG_DEBUG("wrote "<<m_out_recoNoFakes<<" to store");
168 
169  ATH_MSG_DEBUG("outputRecoNoFakesFromB has "<<outputRecoNoFakesFromB.get()->size()<<" tracks");
171  ATH_CHECK(h_write_recoNoFakesFromB.record(std::move(outputRecoNoFakesFromB), std::move(outputRecoNoFakesFromBAux)));
172  ATH_MSG_DEBUG("wrote "<<m_out_recoNoFakesFromB<<" to store");
173 
174  ATH_MSG_DEBUG("outputRecoNoFakesNotFromB has "<<outputRecoNoFakesNotFromB.get()->size()<<" tracks");
176  ATH_CHECK(h_write_recoNoFakesNotFromB.record(std::move(outputRecoNoFakesNotFromB), std::move(outputRecoNoFakesNotFromBAux)));
177  ATH_MSG_DEBUG("wrote "<<m_out_recoNoFakesNotFromB<<" to store");
178 
179  return StatusCode::SUCCESS;
180  }
181 
183  // Select relevant pseudo tracks
185 
187  const xAOD::TrackParticleContainer* pseudoTrackParticleCol,
188  xAOD::TrackParticleContainer* outputCol,
189  bool onlyFromB /*= false*/,
190  bool onlyNotFromB /*= false*/) const
191  {
192  ATH_MSG_DEBUG("Start fillRecoReplacedWithPseudo with onlyFromB = "<<onlyFromB<<" and onlyNotFromB = "<<onlyNotFromB);
193  // loop over tracks, accept them and add them into output collection
194  if((recoTrackParticleCol && !recoTrackParticleCol->empty()) &&
195  (pseudoTrackParticleCol && !pseudoTrackParticleCol->empty())) {
196  ATH_MSG_DEBUG("Size of reco track particle collection " << recoTrackParticleCol->size());
197  ATH_MSG_DEBUG("Size of pseudo track particle collection " << pseudoTrackParticleCol->size());
198  int n_saved = 0;
199  // loop over reco tracks
200  for(const auto *const tp_reco: *recoTrackParticleCol){
201  // Get truth particle
202  const xAOD::TruthParticle* truth_reco = getTruth(tp_reco);
203  if (truth_reco){
204  bool match_found = false;
205  // loop over pseudo tracks to look for a match
206  for(const auto *const tp_pseudo: *pseudoTrackParticleCol){
207  const xAOD::TruthParticle* truth_pseudo = getTruth(tp_pseudo);
208  if (truth_reco == truth_pseudo){
209  ATH_MSG_DEBUG("reco track has truth-matched pseudo track!");
210  match_found = true;
211  // add pseudo track into output
212  if (!onlyFromB && !onlyNotFromB){
213  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_pseudo);
214  outputCol->push_back(newTrackParticle);
215  n_saved++;
216  ATH_MSG_DEBUG("saving pseudo track");
217  }
218  // Check origin of track
219  int origin = m_trackOriginTool->getTrackOrigin(tp_pseudo);
220  ATH_MSG_DEBUG("fromB: "<<InDet::TrkOrigin::isFromB(origin));
221  if (onlyFromB){
222  if (InDet::TrkOrigin::isFromB(origin)){
223  // Track is from B hadron, replace with pseudo track
224  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_pseudo);
225  outputCol->push_back(newTrackParticle);
226  n_saved++;
227  ATH_MSG_DEBUG("saving fromB pseudo track");
228  }
229  else{
230  // Track is not from B hadron, keep reco track
231  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_reco);
232  outputCol->push_back(newTrackParticle);
233  n_saved++;
234  ATH_MSG_DEBUG("keeping notFromB reco track");
235  }
236  }
237  if (onlyNotFromB){
238  if (!InDet::TrkOrigin::isFromB(origin)){
239  // Track is not from B hadron, replace with pseudo track
240  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_pseudo);
241  outputCol->push_back(newTrackParticle);
242  n_saved++;
243  ATH_MSG_DEBUG("saving notFromB pseudo track");
244  }
245  else{
246  // Track is from B hadron, keep reco track
247  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_reco);
248  outputCol->push_back(newTrackParticle);
249  n_saved++;
250  ATH_MSG_DEBUG("keeping FromB reco track");
251  }
252  }
253  // Found match and replaced relevant track
254  break;
255  }
256  else{
257  ATH_MSG_VERBOSE("truth-matched pseudo track not found yet...");
258  }
259  }
260  if(!match_found){
261  ATH_MSG_DEBUG("reco track that has truth link DOES NOT have truth-matched pseudo track! :(");
262  }
263  }
264  else{
265  ATH_MSG_DEBUG("no truth particle for reco track!");
266  }
267  }
268  ATH_MSG_DEBUG("Size of output track particle collection " << outputCol->size() <<" (sanity: "<<n_saved<<")");
269  }
270  }
271 
273  const xAOD::TrackParticleContainer* pseudoTrackParticleCol,
274  xAOD::TrackParticleContainer* outputCol,
275  bool onlyFromB /*= false*/,
276  bool onlyNotFromB /*= false*/) const
277  {
278  ATH_MSG_DEBUG("Start fillRecoPlusPseudo with onlyFromB = "<<onlyFromB<<" and onlyNotFromB = "<<onlyNotFromB);
279  // loop over tracks, accept them and add them into output collection
280  if((recoTrackParticleCol && !recoTrackParticleCol->empty()) &&
281  (pseudoTrackParticleCol && !pseudoTrackParticleCol->empty())) {
282  ATH_MSG_DEBUG("Size of reco track particle collection " << recoTrackParticleCol->size());
283  ATH_MSG_DEBUG("Size of pseudo track particle collection " << pseudoTrackParticleCol->size());
284  int n_saved = 0;
285  // Start by keeping reco tracks
286  for(const auto *const tp_reco: *recoTrackParticleCol){
287  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_reco);
288  outputCol->push_back(newTrackParticle);
289  n_saved++;
290  }
291  // Now add pseudo tracks that are not matched to reco tracks
292  for(const auto *const tp_pseudo: *pseudoTrackParticleCol){
293  bool match_found = false;
294  const xAOD::TruthParticle* truth_pseudo = getTruth(tp_pseudo);
295  for(const auto *const tp_reco: *recoTrackParticleCol){
296  // Get truth particle
297  const xAOD::TruthParticle* truth_reco = getTruth(tp_reco);
298  if (truth_reco){
299  if (truth_reco == truth_pseudo){
300  ATH_MSG_DEBUG("reco track has truth-matched pseudo track!");
301  match_found = true;
302  break;
303  }
304  }
305  else{
306  ATH_MSG_DEBUG("no truth particle for reco track!");
307  }
308  }
309  if(!match_found){
310  ATH_MSG_DEBUG("no match found, so adding pseudo track to output");
311  if(!onlyFromB && !onlyNotFromB){
312  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_pseudo);
313  outputCol->push_back(newTrackParticle);
314  n_saved++;
315  ATH_MSG_DEBUG("saving pseudo track");
316  }
317  int origin = m_trackOriginTool->getTrackOrigin(tp_pseudo);
318  ATH_MSG_DEBUG("fromB: "<<InDet::TrkOrigin::isFromB(origin));
319  if(onlyFromB && InDet::TrkOrigin::isFromB(origin)){
320  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_pseudo);
321  outputCol->push_back(newTrackParticle);
322  n_saved++;
323  ATH_MSG_DEBUG("saving fromB pseudo track");
324  }
325  if(onlyNotFromB && !InDet::TrkOrigin::isFromB(origin)){
326  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_pseudo);
327  outputCol->push_back(newTrackParticle);
328  n_saved++;
329  ATH_MSG_DEBUG("saving notFromB pseudo track");
330  }
331  }
332  else{
333  ATH_MSG_DEBUG("match found so not adding pseudo track to output");
334  }
335  }
336  ATH_MSG_DEBUG("Size of output track particle collection " << outputCol->size() <<" (sanity: "<<n_saved<<")");
337  }
338  }
339 
341  xAOD::TrackParticleContainer* outputCol,
342  bool onlyFromB /*= false*/,
343  bool onlyNotFromB /*= false*/) const
344  {
345  ATH_MSG_DEBUG("Start fillRecoNoFakes with onlyFromB = "<<onlyFromB<<" and onlyNotFromB = "<<onlyNotFromB);
346  // loop over tracks, accept them and add them into output collection
347  if((recoTrackParticleCol && !recoTrackParticleCol->empty())){
348  ATH_MSG_DEBUG("Size of reco track particle collection " << recoTrackParticleCol->size());
349  int n_saved = 0;
350  static const SG::ConstAccessor< float > acc_truthProb("truthMatchProbability");
351 
352  // loop over tracks
353  for(const auto *const tp_reco: *recoTrackParticleCol){
354  // place cut on truth match probability
355  if (!onlyFromB && !onlyNotFromB){
356  if( acc_truthProb( *tp_reco ) < 0.5) {
357  ATH_MSG_DEBUG("Fake track!");
358  continue;
359  }
360  }
361  int origin = m_trackOriginTool->getTrackOrigin(tp_reco);
362  ATH_MSG_DEBUG("fromB: "<<InDet::TrkOrigin::isFromB(origin));
363  if (onlyFromB && InDet::TrkOrigin::isFromB(origin)){
364  if( acc_truthProb( *tp_reco ) < 0.5) {
365  ATH_MSG_DEBUG("Fake track fromB!");
366  continue;
367  }
368  }
369  if (onlyNotFromB && !InDet::TrkOrigin::isFromB(origin)){
370  if( acc_truthProb( *tp_reco ) < 0.5) {
371  ATH_MSG_DEBUG("Fake track notFromB!");
372  continue;
373  }
374  }
375  // add track into output
376  xAOD::TrackParticle* newTrackParticle = new xAOD::TrackParticle(*tp_reco);
377  outputCol->push_back(newTrackParticle);
378  n_saved++;
379  }
380  ATH_MSG_DEBUG("Size of output track particle collection " << outputCol->size() <<" (sanity: "<<n_saved<<")");
381  }
382  }
383 
385  // create a pointer to a truth particle which will correspond to this track
386  const xAOD::TruthParticle* linkedTruthParticle = nullptr;
387 
388  // if the track doesnt't have a valid truth link, skip to the next track
389  // in practice, all tracks seem to have a truth link, but we need to also
390  // check whether it's valid
391  static const SG::ConstAccessor<TruthLink> truthParticleLinkAcc("truthParticleLink");
392  if ( !truthParticleLinkAcc.isAvailable(*track) ) {
393  return nullptr;
394  }
395 
396  // retrieve the link and check its validity
397  const TruthLink &link = truthParticleLinkAcc(*track);
398 
399  // a missing or invalid link implies truth particle has been dropped from
400  // the truth record at some stage - probably it was a pileup or low pT GEANT
401  // particle.
402  if(!link or !link.isValid()) {
403  return nullptr;
404  }
405 
406  // seems safe to access and return the linked truth particle
407  linkedTruthParticle = (*link);
408  return linkedTruthParticle;
409  }
410 }
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
DerivationFramework::PseudoTrackSelector::m_out_recoNoFakesNotFromB
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoNoFakesNotFromB
Output track collection.
Definition: PseudoTrackSelector.h:59
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::ConstAccessor< float >
DerivationFramework::PseudoTrackSelector::m_out_recoReplacedWithPseudo
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoReplacedWithPseudo
Pseudo track collection.
Definition: PseudoTrackSelector.h:51
DerivationFramework::PseudoTrackSelector::m_out_recoReplacedWithPseudoNotFromB
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoReplacedWithPseudoNotFromB
Output track collection.
Definition: PseudoTrackSelector.h:53
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::PseudoTrackSelector::PseudoTrackSelector
PseudoTrackSelector(const std::string &t, const std::string &n, const IInterface *p)
Standard Algotithm methods:
Definition: PseudoTrackSelector.cxx:27
DerivationFramework::PseudoTrackSelector::m_trackOriginTool
ToolHandle< InDet::IInDetTrackTruthOriginTool > m_trackOriginTool
Definition: PseudoTrackSelector.h:87
DerivationFramework::PseudoTrackSelector::m_in_recoTrackParticleLocation
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_in_recoTrackParticleLocation
Protected data:
Definition: PseudoTrackSelector.h:49
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
DerivationFramework::PseudoTrackSelector::m_out_recoPlusPseudoNotFromB
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoPlusPseudoNotFromB
Output track collection.
Definition: PseudoTrackSelector.h:56
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
PseudoTrackSelector.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DerivationFramework::PseudoTrackSelector::fillRecoNoFakes
void fillRecoNoFakes(const xAOD::TrackParticleContainer *recoTrackParticleCol, xAOD::TrackParticleContainer *outputCol, bool onlyFromB=false, bool onlyNotFromB=false) const
Definition: PseudoTrackSelector.cxx:340
TrackParticleAuxContainer.h
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
DerivationFramework::PseudoTrackSelector::m_out_recoNoFakesFromB
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoNoFakesFromB
Output track collection.
Definition: PseudoTrackSelector.h:58
DerivationFramework::PseudoTrackSelector::fillRecoPlusPseudo
void fillRecoPlusPseudo(const xAOD::TrackParticleContainer *recoTrackParticleCol, const xAOD::TrackParticleContainer *pseudoTrackParticleCol, xAOD::TrackParticleContainer *outputCol, bool onlyFromB=false, bool onlyNotFromB=false) const
Definition: PseudoTrackSelector.cxx:272
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::PseudoTrackSelector::fillRecoReplacedWithPseudo
void fillRecoReplacedWithPseudo(const xAOD::TrackParticleContainer *recoTrackParticleCol, const xAOD::TrackParticleContainer *pseudoTrackParticleCol, xAOD::TrackParticleContainer *outputCol, bool onlyFromB=false, bool onlyNotFromB=false) const
Output track collection.
Definition: PseudoTrackSelector.cxx:186
InDet::TrkOrigin::isFromB
bool isFromB(int origin)
from B decay chain including B-->D
Definition: InDetTrackTruthOriginDefs.h:111
DerivationFramework::PseudoTrackSelector::m_out_recoReplacedWithPseudoFromB
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoReplacedWithPseudoFromB
Output track collection.
Definition: PseudoTrackSelector.h:52
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
DerivationFramework::PseudoTrackSelector::m_in_pseudoTrackParticleLocation
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_in_pseudoTrackParticleLocation
Reco track collection.
Definition: PseudoTrackSelector.h:50
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DerivationFramework::PseudoTrackSelector::m_out_recoNoFakes
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoNoFakes
Output track collection.
Definition: PseudoTrackSelector.h:57
InDetTrackTruthOriginDefs.h
DerivationFramework::PseudoTrackSelector::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: PseudoTrackSelector.cxx:77
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
DerivationFramework::PseudoTrackSelector::m_out_recoPlusPseudo
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoPlusPseudo
Output track collection.
Definition: PseudoTrackSelector.h:54
DerivationFramework::PseudoTrackSelector::finalize
StatusCode finalize()
Definition: PseudoTrackSelector.cxx:72
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
DerivationFramework::PseudoTrackSelector::m_out_recoPlusPseudoFromB
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_out_recoPlusPseudoFromB
Output track collection.
Definition: PseudoTrackSelector.h:55
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
DerivationFramework::PseudoTrackSelector::initialize
StatusCode initialize()
Definition: PseudoTrackSelector.cxx:50
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DerivationFramework::PseudoTrackSelector::getTruth
static const xAOD::TruthParticle * getTruth(const xAOD::TrackParticle *track)
Definition: PseudoTrackSelector.cxx:384
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.