ATLAS Offline Software
TrackCollHandle_TrackParticle.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Implementation of class TrackCollHandle_TrackParticle //
9 // //
10 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11 // Initial version: May 2008 //
12 // //
14 
18 #include "VP1Base/IVP1System.h"
21 #include <QStringList>
22 
23 //____________________________________________________________________
25 {
27 }
28 
29 //____________________________________________________________________
31 public:
34  void possiblyUpdateGUI() {//Fixme: to TrackCollHandleBase
35  if (!((updateGUICounter++)%50)) {
37  }
38  }
39 };
40 
41 
42 //____________________________________________________________________
44  const QString& name)
46 {
47  m_d->theclass = this;
48  m_d->updateGUICounter = 0;
49 }
50 
51 //____________________________________________________________________
53 {
54  delete m_d;
55 }
56 
57 //____________________________________________________________________
59 {
60  //Get collection:
61  const Rec::TrackParticleContainer * coll(nullptr);
62  if (!VP1SGAccessHelper(systemBase()).retrieve(coll, name())) {
63  message("Error: Could not retrieve track particle collection with key="+name());
64  return false;
65  }
66 
67  //Make appropriate trk::track handles:
70  for ( it = coll->begin() ; it != itEnd; ++it) {
72  if (!*it) {
73  messageDebug("WARNING: Ignoring null TrackParticle pointer.");
74  continue;
75  }
76  if ((*it)->charge()==0.0) {
77  messageDebug("WARNING: Ignoring TrackParticle which claims to be neutral (charge()==0.0).");
78  continue;
79  }
81  }
82 
83  return true;
84 }
85 
86 //____________________________________________________________________
88 {
89  if (!TrackCollHandleBase::cut(handle))
90  return false;
91 
92  //Fixme: more?
93 
94  return true;
95 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TrackCollHandleBase
Definition: TrackCollHandleBase.h:49
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrackCollHandle_TrackParticle::TrackCollHandle_TrackParticle
TrackCollHandle_TrackParticle(TrackSysCommonData *, const QString &name)
Definition: TrackCollHandle_TrackParticle.cxx:43
TrackCollHandle_TrackParticle::Imp::theclass
TrackCollHandle_TrackParticle * theclass
Definition: TrackCollHandle_TrackParticle.cxx:32
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrackCollHandle_TrackParticle::availableCollections
static QStringList availableCollections(IVP1System *)
Definition: TrackCollHandle_TrackParticle.cxx:24
TrackCollHandle_TrackParticle::Imp::possiblyUpdateGUI
void possiblyUpdateGUI()
Definition: TrackCollHandle_TrackParticle.cxx:34
TrackCollHandleBase::hintNumberOfTracksInEvent
void hintNumberOfTracksInEvent(unsigned)
Definition: TrackCollHandleBase.cxx:509
VP1HelperClassBase::messageDebug
void messageDebug(const QString &) const
Definition: VP1HelperClassBase.cxx:65
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
TrackCollHandle_TrackParticle::Imp::updateGUICounter
int updateGUICounter
Definition: TrackCollHandle_TrackParticle.cxx:33
TrackCollHandle_TrackParticle::cut
virtual bool cut(TrackHandleBase *)
Definition: TrackCollHandle_TrackParticle.cxx:87
VP1SGContentsHelper::getKeys
QStringList getKeys() const
Definition: VP1SGContentsHelper.h:55
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
TrackCollHandleBase::cut
virtual bool cut(TrackHandleBase *)
Definition: TrackCollHandleBase.cxx:316
IVP1System
Definition: IVP1System.h:36
TrackHandle_TrackParticle
Definition: TrackHandle_TrackParticle.h:23
TrackSysCommonData
Definition: TrackSysCommonData.h:50
TrackCollHandle_TrackParticle::~TrackCollHandle_TrackParticle
virtual ~TrackCollHandle_TrackParticle()
Definition: TrackCollHandle_TrackParticle.cxx:52
VP1HelperClassBase::systemBase
IVP1System * systemBase() const
Definition: VP1HelperClassBase.h:50
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrackCollHandleBase::addTrackHandle
void addTrackHandle(TrackHandleBase *)
Definition: TrackCollHandleBase.cxx:515
Rec::TrackParticleContainer
Definition: Reconstruction/Particle/Particle/TrackParticleContainer.h:33
TrackCollHandle_TrackParticle.h
VP1SGContentsHelper
Definition: VP1SGContentsHelper.h:26
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TrackHandle_TrackParticle.h
IVP1System::updateGUI
void updateGUI()
Definition: IVP1System.cxx:262
TrackCollHandle_TrackParticle::load
virtual bool load()
Definition: TrackCollHandle_TrackParticle.cxx:58
TrackCollHandle_TrackParticle::m_d
Imp * m_d
Definition: TrackCollHandle_TrackParticle.h:42
calibdata.cd
cd
Definition: calibdata.py:51
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
VP1SGAccessHelper
Definition: VP1SGAccessHelper.h:25
TrackCollHandle_TrackParticle::Imp
Definition: TrackCollHandle_TrackParticle.cxx:30
TrackHandleBase
Definition: TrackHandleBase.h:56
VP1SGAccessHelper.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IVP1System.h
TrackCollHandle_TrackParticle
Definition: TrackCollHandle_TrackParticle.h:22
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
VP1SGContentsHelper.h
TrackType
Definition: TrackTypes.h:10
TrackCollHandleBase::name
const QString & name() const
Definition: TrackCollHandleBase.cxx:310
TrackParticleContainer.h