Main Page
Namespaces
Classes
Package Documentation
CommonTools
CandUtils
interface
makeNamedCompositeCandidate.h
Go to the documentation of this file.
1
#ifndef CandUtils_makeNamedCompositeCandidate_h
2
#define CandUtils_makeNamedCompositeCandidate_h
3
#include "
DataFormats/Candidate/interface/NamedCompositeCandidate.h
"
4
#include "
DataFormats/Candidate/interface/ShallowCloneCandidate.h
"
5
#include <memory>
6
#include <string>
7
8
namespace
helpers
{
9
struct
NamedCompositeCandidateMaker
{
10
NamedCompositeCandidateMaker
( std::auto_ptr<reco::NamedCompositeCandidate> cmp ) :
11
cmp_
( cmp ) {
12
}
13
void
addDaughter
(
const
reco::Candidate
& dau,
std::string
name
) {
14
cmp_
->addDaughter( dau, name );
15
}
16
template
<
typename
S>
17
std::auto_ptr<reco::Candidate>
operator[]
(
const
S
&
setup
) {
18
setup.set( *
cmp_
);
19
return
release
();
20
}
21
private
:
22
std::auto_ptr<reco::NamedCompositeCandidate>
cmp_
;
23
std::auto_ptr<reco::Candidate>
release
() {
24
std::auto_ptr<reco::Candidate> ret( cmp_.get() );
25
cmp_.release();
26
return
ret;
27
}
28
};
29
}
30
31
helpers::NamedCompositeCandidateMaker
32
makeNamedCompositeCandidate
(
const
reco::Candidate
&
c1
,
std::string
s1,
33
const
reco::Candidate
& c2,
std::string
s2
);
34
35
helpers::NamedCompositeCandidateMaker
36
makeNamedCompositeCandidate
(
const
reco::Candidate
& c1,
std::string
s1,
37
const
reco::Candidate
& c2,
std::string
s2
,
38
const
reco::Candidate
& c3,
std::string
s3 );
39
40
helpers::NamedCompositeCandidateMaker
41
makeNamedCompositeCandidate
(
const
reco::Candidate
& c1,
std::string
s1,
42
const
reco::Candidate
& c2,
std::string
s2
,
43
const
reco::Candidate
& c3,
std::string
s3 );
44
45
46
helpers::NamedCompositeCandidateMaker
47
makeNamedCompositeCandidate
(
const
reco::Candidate
& c1,
std::string
s1,
48
const
reco::Candidate
& c2,
std::string
s2
,
49
const
reco::Candidate
& c3,
std::string
s3,
50
const
reco::Candidate
& c4,
std::string
s4 );
51
52
template
<
typename
C>
53
helpers::NamedCompositeCandidateMaker
54
makeNamedCompositeCandidate
(
const
typename
C::const_iterator &
begin
,
55
const
typename
C::const_iterator &
end
,
56
const
std::vector<std::string>::const_iterator sbegin,
57
const
std::vector<std::string>::const_iterator send ) {
58
helpers::NamedCompositeCandidateMaker
59
cmp( std::auto_ptr<reco::NamedCompositeCandidate>(
new
reco::NamedCompositeCandidate
) );
60
std::vector<std::string>::const_iterator si = sbegin;
61
for
(
typename
C::const_iterator
i
= begin;
i
!= end && si != send; ++
i
, ++si )
62
cmp.
addDaughter
( *
i
, * si );
63
return
cmp;
64
}
65
66
helpers::NamedCompositeCandidateMaker
67
makeNamedCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
& c1,
std::string
s1,
68
const
reco::CandidateRef
& c2,
std::string
s2
);
69
70
helpers::NamedCompositeCandidateMaker
71
makeNamedCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
& c1,
std::string
s1,
72
const
reco::CandidateRef
& c2,
std::string
s2
,
73
const
reco::CandidateRef
& c3,
std::string
s3 );
74
75
helpers::NamedCompositeCandidateMaker
76
makeNamedCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
& c1,
std::string
s1,
77
const
reco::CandidateRef
& c2,
std::string
s2
,
78
const
reco::CandidateRef
& c3,
std::string
s3,
79
const
reco::CandidateRef
& c4,
std::string
s4 );
80
81
template
<
typename
C>
82
helpers::NamedCompositeCandidateMaker
83
makeNamedCompositeCandidateWithRefsToMaster
(
const
typename
C::const_iterator &
begin
,
84
const
typename
C::const_iterator &
end
,
85
const
std::vector<std::string>::const_iterator sbegin,
86
const
std::vector<std::string>::const_iterator send ) {
87
helpers::NamedCompositeCandidateMaker
88
cmp( std::auto_ptr<reco::NamedCompositeCandidate>(
new
reco::NamedCompositeCandidate
) );
89
std::vector<std::string>::const_iterator si = sbegin;
90
for
(
typename
C::const_iterator
i
= begin;
i
!= end && si != send; ++
i
, ++ si )
91
cmp.
addDaughter
( ShallowCloneCandidate(
CandidateBaseRef
( *
i
) ), * si );
92
return
cmp;
93
}
94
95
#endif
mps_fire.i
i
Definition:
mps_fire.py:156
helpers::NamedCompositeCandidateMaker::NamedCompositeCandidateMaker
NamedCompositeCandidateMaker(std::auto_ptr< reco::NamedCompositeCandidate > cmp)
Definition:
makeNamedCompositeCandidate.h:10
edm::Ref< CandidateCollection >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
helpers::NamedCompositeCandidateMaker
Definition:
makeNamedCompositeCandidate.h:9
reco::Candidate
Definition:
Candidate.h:28
ShallowCloneCandidate.h
helpers::NamedCompositeCandidateMaker::addDaughter
void addDaughter(const reco::Candidate &dau, std::string name)
Definition:
makeNamedCompositeCandidate.h:13
GeneralSetup.setup
def setup(process, global_tag, zero_tesla=False)
Definition:
GeneralSetup.py:1
helpers::NamedCompositeCandidateMaker::operator[]
std::auto_ptr< reco::Candidate > operator[](const S &setup)
Definition:
makeNamedCompositeCandidate.h:17
NamedCompositeCandidate.h
makeNamedCompositeCandidate
helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidate(const reco::Candidate &c1, std::string s1, const reco::Candidate &c2, std::string s2)
Definition:
makeNamedCompositeCandidate.cc:5
end
#define end
Definition:
vmac.h:37
makeNamedCompositeCandidateWithRefsToMaster
helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidateWithRefsToMaster(const reco::CandidateRef &c1, std::string s1, const reco::CandidateRef &c2, std::string s2)
Definition:
makeNamedCompositeCandidate.cc:36
alignmentValidation.c1
c1
do drawing
Definition:
alignmentValidation.py:1023
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
indexGen.s2
s2
Definition:
indexGen.py:106
helpers
Definition:
makeCompositeCandidate.h:8
reco::CandidateBaseRef
edm::RefToBase< Candidate > CandidateBaseRef
persistent reference to an object in a collection of Candidate objects
Definition:
CandidateFwd.h:31
begin
#define begin
Definition:
vmac.h:30
reco::NamedCompositeCandidate
Definition:
NamedCompositeCandidate.h:21
dataset.name
name
Definition:
dataset.py:45
helpers::NamedCompositeCandidateMaker::cmp_
std::auto_ptr< reco::NamedCompositeCandidate > cmp_
Definition:
makeNamedCompositeCandidate.h:22
helpers::NamedCompositeCandidateMaker::release
std::auto_ptr< reco::Candidate > release()
Definition:
makeNamedCompositeCandidate.h:23
Generated for CMSSW Reference Manual by
1.8.11