ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
GeneratorObjectsTPCnv
src
McEventCollectionCnv_utils.h
Go to the documentation of this file.
1
namespace
{
2
// helper method to compute the number of particles and vertices in a
3
// whole McEventCollection
4
std::pair<unsigned int,unsigned int>
5
nbrParticlesAndVertices(
const
McEventCollection
* mcEvents ) {
6
unsigned
int
nParts = 0;
7
unsigned
int
nVerts = 0;
8
const
McEventCollection::const_iterator
itrEnd = mcEvents->
end
();
9
for
(
McEventCollection::const_iterator
itr = mcEvents->
begin
();
10
itr != itrEnd;
11
++itr ) {
12
nParts += (*itr)->particles_size();
13
nVerts += (*itr)->vertices_size();
14
}
15
16
return
std::make_pair( nParts, nVerts );
17
}
18
std::map<std::string, unsigned long int> names_to_name_index_map(
const
std::vector<std::string> &input )
19
{
20
std::map<std::string, unsigned long int>
result
;
21
unsigned
long
int
i
=0;
22
for
(
const
auto
&
a
: input) {
result
[
a
]=
i
;
i
++;}
23
return
result
;
24
}
25
26
std::vector<std::pair<int,int> > vector_to_vector_int_int(
const
std::vector<int> &input )
27
{
28
// The "i" values used here now match HepMC2 most of the time, but still differ sometimes.
29
std::vector<std::pair<int,int> >
result
;
30
unsigned
long
int
i
=1;
31
for
(
const
auto
&
a
: input) {
result
.push_back(std::pair<int,int>(i,
a
));
i
++;}
32
return
result
;
33
}
34
}
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
DataVector< HepMC::GenEvent >::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.
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Definition
McEventCollection.h:31
get_generator_info.result
result
Definition
get_generator_info.py:21
lumiFormat.i
int i
Definition
lumiFormat.py:85
Generated on
for ATLAS Offline Software by
1.17.0