ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
GeneratorObjects
src
McEventCollection.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
#include "
GeneratorObjects/McEventCollection.h
"
6
7
namespace
{
8
class
MatchEventNumber {
9
public
:
10
MatchEventNumber(
int
eventNumber) : m_evtNumber(
eventNumber
) {}
11
bool
operator()
(
const
HepMC::GenEvent
* pGE)
const
{
12
return
(m_evtNumber == pGE->event_number());
13
}
14
private
:
15
int
m_evtNumber;
16
};
17
class
FilledMatchEventNumber {
18
public
:
19
FilledMatchEventNumber(
int
eventNumber) : m_evtNumber(
eventNumber
) {}
20
bool
operator()
(
const
HepMC::GenEvent
* pGE)
const
{
21
return
((m_evtNumber == pGE->event_number()) && !(pGE->vertices_empty()) );
22
}
23
private
:
24
int
m_evtNumber;
25
};
26
}
27
28
29
const
HepMC::GenEvent
*
30
McEventCollection::find
(
int
eventNumber)
const
{
31
const_iterator
i(std::find_if(
begin
(),
end
(), FilledMatchEventNumber(eventNumber)));
32
if
(
end
() == i)
33
{
34
//Didn't find a filled copy, so checking for an empty one.
35
return
(
end
() != (i=std::find_if(
begin
(),
end
(), MatchEventNumber(eventNumber)))) ? *i : nullptr ;
36
37
}
38
return
*i;
39
40
41
}
42
43
44
template
class
ClassName<McEventCollection>
;
McEventCollection.h
operator()
void operator()(T1)
ClassName
An interface for getting the name of a class as a string.
Definition
AthenaKernel/AthenaKernel/ClassName.h:31
DataVector< HepMC::GenEvent >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector< HepMC::GenEvent >::end
const_iterator end() const noexcept
DataVector< HepMC::GenEvent >::begin
const_iterator begin() const noexcept
McEventCollection::find
const HepMC::GenEvent * find(int evtNumber) const
Definition
McEventCollection.cxx:30
HepMC::GenEvent
HepMC3::GenEvent GenEvent
Definition
GenEvent.h:39
xAOD::eventNumber
eventNumber
Definition
EventInfo_v1.cxx:124
Generated on
for ATLAS Offline Software by
1.17.0