Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Levi Evans
athena
Commits
fb331214
Commit
fb331214
authored
Mar 25, 2021
by
Adam Edward Barton
Browse files
Merge branch 'hepmclink' into 'master'
Simplify dummy HepMcEventLinks See merge request
atlas/athena!41011
parents
95ab9250
e91a631d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.h
View file @
fb331214
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
* Copyright (C) 2002-201
9
CERN for the benefit of the ATLAS collaboration.
* Copyright (C) 2002-20
2
1 CERN for the benefit of the ATLAS collaboration.
*/
/**
* @file GeneratorObjects/CachedParticlePtr.h
...
...
@@ -106,6 +106,12 @@ public:
void
set
(
const
IProxyDict
*
sg
,
const
HepMC
::
GenParticle
*
part
)
const
;
/**
* @brief Check if the cached pointer is valid
*/
bool
isValid
()
const
;
private:
/**
* @brief Convert a store pointer to a void* stored value.
...
...
Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.icc
View file @
fb331214
/*
* Copyright (C) 2002-201
9
CERN for the benefit of the ATLAS collaboration.
* Copyright (C) 2002-20
2
1 CERN for the benefit of the ATLAS collaboration.
*/
/**
* @file GeneratorObjects/CachedParticlePtr.icc
...
...
@@ -125,6 +125,16 @@ void CachedParticlePtr::set (const IProxyDict* sg,
}
/**
* @brief Check if the cached pointer is valid
*/
inline
bool
CachedParticlePtr
::
isValid
()
const
{
return
m_ptr
!=
nullptr
;
}
/**
* @brief Convert a store pointer to a void* to store.
* @param sg IProxyDict* to reference.
...
...
Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h
View file @
fb331214
...
...
@@ -305,7 +305,7 @@ public:
* @brief Default constructor. Makes a null link.
* @param sg Optional specification of a specific store to reference.
*/
HepMcParticleLink
(
IProxyDict
*
sg
=
SG
::
CurrentEventStore
::
store
()
);
HepMcParticleLink
(
IProxyDict
*
sg
=
nullptr
);
/**
...
...
Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc
View file @
fb331214
...
...
@@ -306,7 +306,7 @@ HepMcParticleLink::ExtendedBarCode::setIndex (index_type idx,
* @param sg Optional specification of a specific store to reference.
*/
inline
HepMcParticleLink
::
HepMcParticleLink
(
IProxyDict
*
sg
/*=
SG::CurrentEventStore::store()
*/
)
HepMcParticleLink
::
HepMcParticleLink
(
IProxyDict
*
sg
/*=
nullptr
*/
)
:
m_ptrs
(
sg
)
{
}
...
...
Generators/GeneratorObjects/src/HepMcParticleLink.cxx
View file @
fb331214
...
...
@@ -166,6 +166,11 @@ HepMcParticleLink::HepMcParticleLink (const HepMC::GenParticle* part,
*/
const
HepMC
::
GenParticle
*
HepMcParticleLink
::
cptr
()
const
{
// dummy link
if
(
!
m_ptrs
.
isValid
())
{
return
nullptr
;
}
const
IProxyDict
*
sg
=
nullptr
;
auto
p
=
m_ptrs
.
get
(
sg
);
if
(
!
p
)
{
...
...
@@ -243,6 +248,11 @@ const HepMC::GenParticle* HepMcParticleLink::cptr() const
*/
HepMC3
::
ConstGenParticlePtr
HepMcParticleLink
::
scptr
()
const
{
// dummy link
if
(
!
m_ptrs
.
isValid
())
{
return
nullptr
;
}
HepMC3
::
ConstGenParticlePtr
pp
{
nullptr
};
const
IProxyDict
*
sg
=
nullptr
;
auto
p
=
m_ptrs
.
get
(
sg
);
...
...
@@ -315,6 +325,11 @@ HepMC3::ConstGenParticlePtr HepMcParticleLink::scptr() const
*/
HepMcParticleLink
::
index_type
HepMcParticleLink
::
eventIndex
()
const
{
// dummy link
if
(
!
m_ptrs
.
isValid
())
{
return
ExtendedBarCode
::
UNDEFINED
;
}
index_type
index
,
position
;
m_extBarcode
.
eventIndex
(
index
,
position
);
if
(
index
==
ExtendedBarCode
::
UNDEFINED
)
{
...
...
InnerDetector/InDetSimEvent/src/SiCharge.cxx
View file @
fb331214
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
2
1 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
...
...
@@ -35,7 +35,7 @@ SiCharge::SiCharge(const double& charge,const double& time,
m_charge
(
charge
),
m_time
(
time
),
m_processType
(
processType
),
m_partLink
(
HepMcParticleLink
(
(
unsigned
int
)
0
,
0
))
m_partLink
(
HepMcParticleLink
())
{}
...
...
InnerDetector/InDetSimEvent/src/SiTotalCharge.cxx
View file @
fb331214
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
2
1 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
...
...
@@ -18,14 +18,14 @@
SiTotalCharge
::
SiTotalCharge
(
const
alloc_t
&
alloc
)
:
m_charge
(
0
),
m_chargeComposition
(
alloc
),
m_emptyLink
(
(
unsigned
int
)
0
,
0
)
m_emptyLink
()
{}
// Copy constructor:
SiTotalCharge
::
SiTotalCharge
(
const
SiTotalCharge
&
totalCharge
)
:
m_charge
(
totalCharge
.
m_charge
),
m_chargeComposition
(
totalCharge
.
m_chargeComposition
),
m_emptyLink
(
(
unsigned
int
)
0
,
0
)
m_emptyLink
()
{}
// Assignment operator:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment