ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1TrackSystems
src
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
15
#include "
VP1TrackSystems/TrackCollHandle_TrackParticle.h
"
16
#include "
VP1TrackSystems/TrackHandle_TrackParticle.h
"
17
#include "
Particle/TrackParticleContainer.h
"
18
#include "
VP1Base/IVP1System.h
"
19
#include "
VP1Utils/VP1SGAccessHelper.h
"
20
#include "
VP1Utils/VP1SGContentsHelper.h
"
21
#include <QStringList>
22
23
//____________________________________________________________________
24
QStringList
TrackCollHandle_TrackParticle::availableCollections
(
IVP1System
*sys )
25
{
26
return
VP1SGContentsHelper
(sys).
getKeys
<
Rec::TrackParticleContainer
>();
27
}
28
29
//____________________________________________________________________
30
class
TrackCollHandle_TrackParticle::Imp
{
31
public
:
32
TrackCollHandle_TrackParticle
*
theclass
;
33
int
updateGUICounter
;
34
void
possiblyUpdateGUI
() {
//Fixme: to TrackCollHandleBase
35
if
(!((
updateGUICounter
++)%50)) {
36
theclass
->systemBase()->updateGUI();
37
}
38
}
39
};
40
41
42
//____________________________________________________________________
43
TrackCollHandle_TrackParticle::TrackCollHandle_TrackParticle
(
TrackSysCommonData
* cd,
44
const
QString&
name
)
45
:
TrackCollHandleBase
(cd,
name
,
TrackType
::TrackParticle),
m_d
(new
Imp
)
46
{
47
m_d
->theclass =
this
;
48
m_d
->updateGUICounter = 0;
49
}
50
51
//____________________________________________________________________
52
TrackCollHandle_TrackParticle::~TrackCollHandle_TrackParticle
()
53
{
54
delete
m_d
;
55
}
56
57
//____________________________________________________________________
58
bool
TrackCollHandle_TrackParticle::load
()
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:
68
hintNumberOfTracksInEvent
(coll->
size
());
69
Rec::TrackParticleContainer::const_iterator
it, itEnd = coll->
end
();
70
for
( it = coll->
begin
() ; it != itEnd; ++it) {
71
m_d
->possiblyUpdateGUI();
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
}
80
addTrackHandle
(
new
TrackHandle_TrackParticle
(
this
,*it));
81
}
82
83
return
true
;
84
}
85
86
//____________________________________________________________________
87
bool
TrackCollHandle_TrackParticle::cut
(
TrackHandleBase
* handle)
88
{
89
if
(!
TrackCollHandleBase::cut
(handle))
90
return
false
;
91
92
//Fixme: more?
93
94
return
true
;
95
}
IVP1System.h
TrackParticleContainer.h
TrackCollHandle_TrackParticle.h
TrackHandle_TrackParticle.h
VP1SGAccessHelper.h
VP1SGContentsHelper.h
DataVector< TrackParticle >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IVP1System
Definition
IVP1System.h:36
Rec::TrackParticleContainer
Definition
Reconstruction/Particle/Particle/TrackParticleContainer.h:33
TrackCollHandleBase::hintNumberOfTracksInEvent
void hintNumberOfTracksInEvent(unsigned)
Definition
TrackCollHandleBase.cxx:509
TrackCollHandleBase::name
const QString & name() const
Definition
TrackCollHandleBase.cxx:310
TrackCollHandleBase::cut
virtual bool cut(TrackHandleBase *)
Definition
TrackCollHandleBase.cxx:316
TrackCollHandleBase::addTrackHandle
void addTrackHandle(TrackHandleBase *)
Definition
TrackCollHandleBase.cxx:515
TrackCollHandleBase::TrackCollHandleBase
TrackCollHandleBase(TrackSysCommonData *, const QString &name, TrackType::Type)
Definition
TrackCollHandleBase.cxx:97
TrackCollHandle_TrackParticle::Imp
Definition
TrackCollHandle_TrackParticle.cxx:30
TrackCollHandle_TrackParticle::Imp::theclass
TrackCollHandle_TrackParticle * theclass
Definition
TrackCollHandle_TrackParticle.cxx:32
TrackCollHandle_TrackParticle::Imp::updateGUICounter
int updateGUICounter
Definition
TrackCollHandle_TrackParticle.cxx:33
TrackCollHandle_TrackParticle::Imp::possiblyUpdateGUI
void possiblyUpdateGUI()
Definition
TrackCollHandle_TrackParticle.cxx:34
TrackCollHandle_TrackParticle::~TrackCollHandle_TrackParticle
virtual ~TrackCollHandle_TrackParticle()
Definition
TrackCollHandle_TrackParticle.cxx:52
TrackCollHandle_TrackParticle::cut
virtual bool cut(TrackHandleBase *)
Definition
TrackCollHandle_TrackParticle.cxx:87
TrackCollHandle_TrackParticle::m_d
Imp * m_d
Definition
TrackCollHandle_TrackParticle.h:43
TrackCollHandle_TrackParticle::availableCollections
static QStringList availableCollections(IVP1System *)
Definition
TrackCollHandle_TrackParticle.cxx:24
TrackCollHandle_TrackParticle::load
virtual bool load()
Definition
TrackCollHandle_TrackParticle.cxx:58
TrackCollHandle_TrackParticle::TrackCollHandle_TrackParticle
TrackCollHandle_TrackParticle(TrackSysCommonData *, const QString &name)
Definition
TrackCollHandle_TrackParticle.cxx:43
TrackHandleBase
Definition
TrackHandleBase.h:57
TrackHandle_TrackParticle
Definition
TrackHandle_TrackParticle.h:23
TrackSysCommonData
Definition
TrackSysCommonData.h:50
TrackType
Definition
TrackTypes.h:10
VP1HelperClassBase::message
void message(const QString &) const
Definition
VP1HelperClassBase.cxx:49
VP1HelperClassBase::systemBase
IVP1System * systemBase() const
Definition
VP1HelperClassBase.h:50
VP1HelperClassBase::messageDebug
void messageDebug(const QString &) const
Definition
VP1HelperClassBase.cxx:65
VP1SGAccessHelper
Definition
VP1SGAccessHelper.h:25
VP1SGContentsHelper
Definition
VP1SGContentsHelper.h:26
VP1SGContentsHelper::getKeys
QStringList getKeys() const
Definition
VP1SGContentsHelper.h:55
Generated on
for ATLAS Offline Software by
1.17.0