ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1TrackSystems
src
TrackCollHandle_xAODTrackParticle.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_xAODTrackParticle //
9
// //
10
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11
// Initial version: May 2008 //
12
// //
14
15
#include "
VP1TrackSystems/TrackCollHandle_xAODTrackParticle.h
"
16
#include "
VP1TrackSystems/TrackHandle_xAODTrackParticle.h
"
17
18
//#include "xAODTrackParticle/TrackParticleContainer.h"
19
#include "
xAODTracking/TrackParticleContainer.h
"
20
21
#include "
VP1Base/IVP1System.h
"
22
#include "
VP1Utils/VP1SGAccessHelper.h
"
23
#include "
VP1Utils/VP1SGContentsHelper.h
"
24
#include <QStringList>
25
26
//____________________________________________________________________
27
QStringList
TrackCollHandle_xAODTrackParticle::availableCollections
(
IVP1System
*sys )
28
{
29
return
VP1SGContentsHelper
(sys).
getKeys
<
xAOD::TrackParticleContainer
>();
30
}
31
32
//____________________________________________________________________
33
class
TrackCollHandle_xAODTrackParticle::Imp
{
34
public
:
35
TrackCollHandle_xAODTrackParticle
*
theclass
;
36
int
updateGUICounter
;
37
void
possiblyUpdateGUI
() {
//Fixme: to TrackCollHandleBase
38
if
(!((
updateGUICounter
++)%50)) {
39
theclass
->systemBase()->updateGUI();
40
}
41
}
42
};
43
44
45
//____________________________________________________________________
46
TrackCollHandle_xAODTrackParticle::TrackCollHandle_xAODTrackParticle
(
TrackSysCommonData
* cd,
47
const
QString&
name
)
48
:
TrackCollHandleBase
(cd,
name
,
TrackType
::
xAOD
),
m_d
(new
Imp
)
49
{
50
m_d
->theclass =
this
;
51
m_d
->updateGUICounter = 0;
52
}
53
54
//____________________________________________________________________
55
TrackCollHandle_xAODTrackParticle::~TrackCollHandle_xAODTrackParticle
()
56
{
57
delete
m_d
;
58
}
59
60
//____________________________________________________________________
61
bool
TrackCollHandle_xAODTrackParticle::load
()
62
{
63
//Get collection:
64
const
xAOD::TrackParticleContainer
* coll(
nullptr
);
65
if
(!
VP1SGAccessHelper
(
systemBase
()).retrieve(coll,
name
())) {
66
message
(
"Error: Could not retrieve track particle collection with key="
+
name
());
67
return
false
;
68
}
69
70
// // Retrieve the xAOD particles:
71
// const xAOD::TrackParticleContainer* xaod = evtStore()->retrieve<const xAOD::TrackParticleContainer>( m_xAODTrackParticleCollection );
72
73
// Check that the auxiliary store association was made successfully:
74
if
( ! coll->hasStore() ) {
75
message
(
"No auxiliary store got associated to the xAODTrackParticle container with key: "
+
name
());
76
}
77
78
// This is needed for now, until the issues around the DV code are
79
// sorted out...
80
const_cast<
xAOD::TrackParticleContainer
*
>
( coll )->setStore(
81
(
SG::IAuxStore
* ) coll->getConstStore() );
82
83
//Make appropriate trk::track handles:
84
hintNumberOfTracksInEvent
(coll->
size
());
85
xAOD::TrackParticleContainer::const_iterator
it, itEnd = coll->
end
();
86
for
( it = coll->
begin
() ; it != itEnd; ++it) {
87
m_d
->possiblyUpdateGUI();
88
if
(!*it) {
89
messageDebug
(
"WARNING: Ignoring null xAODTrackParticle pointer."
);
90
continue
;
91
}
92
if
((*it)->charge()==0.0) {
93
messageDebug
(
"WARNING: Ignoring xAODTrackParticle which claims to be neutral (charge()==0.0)."
);
94
continue
;
95
}
96
addTrackHandle
(
new
TrackHandle_xAODTrackParticle
(
this
,*it));
97
}
98
99
return
true
;
100
}
101
102
//____________________________________________________________________
103
bool
TrackCollHandle_xAODTrackParticle::cut
(
TrackHandleBase
* handle)
104
{
105
if
(!
TrackCollHandleBase::cut
(handle))
106
return
false
;
107
108
//Fixme: more?
109
110
return
true
;
111
}
TrackParticleContainer.h
IVP1System.h
TrackCollHandle_xAODTrackParticle.h
TrackHandle_xAODTrackParticle.h
VP1SGAccessHelper.h
VP1SGContentsHelper.h
DataVector< xAOD::TrackParticle_v1 >::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
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition
IAuxStore.h:51
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_xAODTrackParticle::Imp
Definition
TrackCollHandle_xAODTrackParticle.cxx:33
TrackCollHandle_xAODTrackParticle::Imp::updateGUICounter
int updateGUICounter
Definition
TrackCollHandle_xAODTrackParticle.cxx:36
TrackCollHandle_xAODTrackParticle::Imp::possiblyUpdateGUI
void possiblyUpdateGUI()
Definition
TrackCollHandle_xAODTrackParticle.cxx:37
TrackCollHandle_xAODTrackParticle::Imp::theclass
TrackCollHandle_xAODTrackParticle * theclass
Definition
TrackCollHandle_xAODTrackParticle.cxx:35
TrackCollHandle_xAODTrackParticle::cut
virtual bool cut(TrackHandleBase *)
Definition
TrackCollHandle_xAODTrackParticle.cxx:103
TrackCollHandle_xAODTrackParticle::~TrackCollHandle_xAODTrackParticle
virtual ~TrackCollHandle_xAODTrackParticle()
Definition
TrackCollHandle_xAODTrackParticle.cxx:55
TrackCollHandle_xAODTrackParticle::load
virtual bool load()
Definition
TrackCollHandle_xAODTrackParticle.cxx:61
TrackCollHandle_xAODTrackParticle::m_d
Imp * m_d
Definition
TrackCollHandle_xAODTrackParticle.h:41
TrackCollHandle_xAODTrackParticle::TrackCollHandle_xAODTrackParticle
TrackCollHandle_xAODTrackParticle(TrackSysCommonData *, const QString &name)
Definition
TrackCollHandle_xAODTrackParticle.cxx:46
TrackCollHandle_xAODTrackParticle::availableCollections
static QStringList availableCollections(IVP1System *)
Definition
TrackCollHandle_xAODTrackParticle.cxx:27
TrackHandleBase
Definition
TrackHandleBase.h:57
TrackHandle_xAODTrackParticle
Definition
TrackHandle_xAODTrackParticle.h:28
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
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::TrackParticleContainer
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticleContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0