ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
GeneratorObjects
GeneratorObjects
McEventCollection.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef GENERATOROBJECTSMCEVENTCOLLECTION_H
6
#define GENERATOROBJECTSMCEVENTCOLLECTION_H 1
7
8
9
#include "
AthContainers/DataVector.h
"
10
#include "
AthenaKernel/CLASS_DEF.h
"
11
#include "
AtlasHepMC/GenEvent.h
"
12
#include "
AtlasHepMC/GenParticle.h
"
13
#include "
AtlasHepMC/GenVertex.h
"
14
29
30
class
McEventCollection
:
public
DataVector
<HepMC::GenEvent>
31
{
32
typedef
DataVector<HepMC::GenEvent>::iterator
EventIterator
;
33
typedef
DataVector<HepMC::GenEvent>::const_iterator
EventConstIterator
;
34
35
public
:
36
McEventCollection
();
37
38
~McEventCollection
();
39
40
McEventCollection
(
const
McEventCollection
& in);
41
42
43
McEventCollection
&
operator=
(
const
McEventCollection
&);
44
45
const
HepMC::GenEvent
*
find
(
int
evtNumber)
const
;
46
};
47
48
inline
49
McEventCollection::McEventCollection
(
void
)
50
:
DataVector
<
HepMC
::GenEvent> ()
51
{}
52
53
inline
McEventCollection::McEventCollection
(
const
McEventCollection
& in) :
DataVector
<
HepMC
::GenEvent>()
54
{
55
McEventCollection::operator=
(in);
56
}
57
58
59
inline
McEventCollection
&
McEventCollection::operator=
(
const
McEventCollection
& in)
60
{
61
if
(
this
!= &in) {
62
// Force a deep copy on the DataVector
63
//
64
for
(
const
HepMC::GenEvent
*
ev
: in)
65
{
66
HepMC::GenEvent
* nev =
new
HepMC::GenEvent
(*
ev
);
67
auto
ri =
ev
->run_info();
68
if
(ri) {
69
std::shared_ptr<HepMC3::GenRunInfo> nri = std::make_shared<HepMC3::GenRunInfo>(*(ri.get()));
70
nev->set_run_info(std::move(nri));
71
}
72
// Fill barcodes attribute in copied GenEvent
73
HepMC::fillBarcodesAttribute
(nev);
74
DataVector<HepMC::GenEvent>::push_back
(nev);
75
}
76
}
77
78
return
*
this
;
79
}
80
81
inline
82
McEventCollection::~McEventCollection
(
void
)
83
{}
84
85
86
CLASS_DEF
(
McEventCollection
, 133273, 1)
87
88
#endif
CLASS_DEF.h
macros to associate a CLID to a type
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
GenEvent.h
GenParticle.h
GenVertex.h
DataVector::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition
DataVector.h:838
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::iterator
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
Definition
DataVector.h:842
DataVector< HepMC::GenEvent >::DataVector
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Definition
McEventCollection.h:31
McEventCollection::McEventCollection
McEventCollection()
Definition
McEventCollection.h:49
McEventCollection::EventIterator
DataVector< HepMC::GenEvent >::iterator EventIterator
Definition
McEventCollection.h:32
McEventCollection::find
const HepMC::GenEvent * find(int evtNumber) const
Definition
McEventCollection.cxx:30
McEventCollection::operator=
McEventCollection & operator=(const McEventCollection &)
Definition
McEventCollection.h:59
McEventCollection::EventConstIterator
DataVector< HepMC::GenEvent >::const_iterator EventConstIterator
Definition
McEventCollection.h:33
McEventCollection::~McEventCollection
~McEventCollection()
Definition
McEventCollection.h:82
ev
int ev
Definition
globals.cxx:25
HepMC
Definition
Barcode.h:13
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *e)
Definition
GenEvent.h:393
HepMC::GenEvent
HepMC3::GenEvent GenEvent
Definition
GenEvent.h:39
Generated on
for ATLAS Offline Software by
1.17.0