ATLAS Offline Software
Loading...
Searching...
No Matches
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
11#include "AtlasHepMC/GenEvent.h"
15
30
31class McEventCollection : public DataVector<HepMC::GenEvent>
32{
35
36 public:
38
40
42
43
45
46 const HepMC::GenEvent* find(int evtNumber) const;
47};
48
49inline
53
58
59
61{
62 if (this != &in) {
63 // Force a deep copy on the DataVector
64 //
65 for (const HepMC::GenEvent* ev : in)
66 {
67 HepMC::GenEvent* nev = new HepMC::GenEvent(*ev);
68#ifdef HEPMC3
69 auto ri = ev->run_info();
70 if (ri) {
71 std::shared_ptr<HepMC3::GenRunInfo> nri = std::make_shared<HepMC3::GenRunInfo>(*(ri.get()));
72 nev->set_run_info(std::move(nri));
73 }
74 // Fill barcodes attribute in copied GenEvent
76#endif
78 }
79 }
80
81 return *this;
82}
83
84inline
87
88
90
91#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
Definition DataVector.h:842
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
DataVector< HepMC::GenEvent >::iterator EventIterator
const HepMC::GenEvent * find(int evtNumber) const
McEventCollection & operator=(const McEventCollection &)
DataVector< HepMC::GenEvent >::const_iterator EventConstIterator
int ev
Definition globals.cxx:25
void fillBarcodesAttribute(GenEvent *)
Definition GenEvent.h:627