ATLAS Offline Software
PhysicsAnalysis
AnalysisCommon
AnalysisUtils
AnalysisUtils
AnalysisSelection.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ANALYSISUTILS_ANALYSISSELECTION_H
6
#define ANALYSISUTILS_ANALYSISSELECTION_H
7
16
#include <vector>
17
18
namespace
AnalysisUtils
{
19
20
template
<
class
CRITERIA>
struct
Selection
:
public
CRITERIA
21
{
22
28
template
<
class
COLL>
void
getObjects
(
const
COLL *coll, std::vector<typename COLL::value_type> &
out
)
29
{
30
out
.clear();
31
32
// loop over all elements
33
typename
COLL::const_iterator
it
= coll->begin();
34
typename
COLL::const_iterator
itE
= coll->end();
35
for
(;
it
!=
itE
; ++
it
)
36
// selection
37
if
(
CRITERIA::isAccepted
(*
it
))
38
out
.push_back(*
it
);
39
}
40
46
template
<
class
COLL>
void
getIndices
(
const
COLL *coll, std::vector<int> &
out
)
47
{
48
out
.clear();
49
50
// loop over all elements
51
int
index
= 0;
52
typename
COLL::const_iterator
it
= coll->begin();
53
typename
COLL::const_iterator
itE
= coll->end();
54
for
(;
it
!=
itE
; ++
it
)
55
{
56
// selection
57
if
(
CRITERIA::isAccepted
(*
it
))
58
out
.push_back(
index
);
59
60
++
index
;
61
}
62
}
63
};
64
65
}
// end of AnalysisUtils namespace
66
67
#endif
AnalysisUtils::Selection::getObjects
void getObjects(const COLL *coll, std::vector< typename COLL::value_type > &out)
get objects which pass the selection criteria
Definition:
AnalysisSelection.h:28
AnalysisUtils::Selection::getIndices
void getIndices(const COLL *coll, std::vector< int > &out)
get indices of the objects which pass the selection criteria
Definition:
AnalysisSelection.h:46
index
Definition:
index.py:1
skel.it
it
Definition:
skel.GENtoEVGEN.py:396
python.AthDsoLogger.out
out
Definition:
AthDsoLogger.py:71
AnalysisUtils
utility class to select combination of elements in a collection
Definition:
AnalysisCombination.h:16
TruthTest.itE
itE
Definition:
TruthTest.py:25
InDetSecVtxTruthMatchUtils::isAccepted
bool isAccepted(int matchInfo)
Definition:
InDetSecVtxTruthMatchTool.h:73
DeMoScan.index
string index
Definition:
DeMoScan.py:364
AnalysisUtils::Selection
Definition:
AnalysisSelection.h:21
Generated on Wed Jan 8 2025 21:06:43 for ATLAS Offline Software by
1.8.18