Main Page
Namespaces
Classes
Package Documentation
CommonTools
CandUtils
interface
makeCompositeCandidate.h
Go to the documentation of this file.
1
#ifndef CandUtils_makeCompositeCandidate_h
2
#define CandUtils_makeCompositeCandidate_h
3
#include "
DataFormats/Candidate/interface/CompositeCandidate.h
"
4
#include "
DataFormats/Candidate/interface/CompositePtrCandidate.h
"
5
#include "
DataFormats/Candidate/interface/ShallowCloneCandidate.h
"
6
#include <memory>
7
8
namespace
helpers
{
9
struct
CompositeCandidateMaker
{
10
CompositeCandidateMaker
(std::auto_ptr<reco::CompositeCandidate> cmp) :
11
cmp_
( cmp ) {
12
}
13
void
addDaughter
(
const
reco::Candidate
& dau) {
14
cmp_
->addDaughter( dau );
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::CompositeCandidate>
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
struct
CompositePtrCandidateMaker
{
31
CompositePtrCandidateMaker
(std::auto_ptr<reco::CompositePtrCandidate> cmp) :
32
cmp_
( cmp ) {
33
}
34
void
addDaughter
(
const
reco::CandidatePtr
& dau) {
35
cmp_
->addDaughter( dau );
36
}
37
template
<
typename
S>
38
std::auto_ptr<reco::Candidate>
operator[]
(
const
S
&
setup
) {
39
setup.set( *
cmp_
);
40
return
release
();
41
}
42
private
:
43
std::auto_ptr<reco::CompositePtrCandidate>
cmp_
;
44
std::auto_ptr<reco::Candidate>
release
() {
45
std::auto_ptr<reco::Candidate> ret( cmp_.get() );
46
cmp_.release();
47
return
ret;
48
}
49
};
50
}
51
52
helpers::CompositeCandidateMaker
53
makeCompositeCandidate
(
const
reco::Candidate
&
c1
,
54
const
reco::Candidate
& c2);
55
56
helpers::CompositeCandidateMaker
57
makeCompositeCandidate
(
const
reco::Candidate
& c1,
58
const
reco::Candidate
& c2,
59
const
reco::Candidate
& c3);
60
61
helpers::CompositeCandidateMaker
62
makeCompositeCandidate
(
const
reco::Candidate
& c1,
63
const
reco::Candidate
& c2,
64
const
reco::Candidate
& c3);
65
66
67
helpers::CompositeCandidateMaker
68
makeCompositeCandidate
(
const
reco::Candidate
& c1,
69
const
reco::Candidate
& c2,
70
const
reco::Candidate
& c3,
71
const
reco::Candidate
& c4);
72
73
template
<
typename
C>
74
helpers::CompositeCandidateMaker
75
makeCompositeCandidate
(
const
typename
C::const_iterator &
begin
,
76
const
typename
C::const_iterator &
end
) {
77
helpers::CompositeCandidateMaker
78
cmp(std::auto_ptr<reco::CompositeCandidate>(
new
reco::CompositeCandidate
) );
79
for
(
typename
C::const_iterator
i
= begin;
i
!=
end
; ++
i
)
80
cmp.
addDaughter
(*
i
);
81
return
cmp;
82
}
83
84
helpers::CompositeCandidateMaker
85
makeCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
& c1,
86
const
reco::CandidateRef
& c2);
87
88
helpers::CompositeCandidateMaker
89
makeCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
& c1,
90
const
reco::CandidateRef
& c2,
91
const
reco::CandidateRef
& c3);
92
93
helpers::CompositeCandidateMaker
94
makeCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
& c1,
95
const
reco::CandidateRef
& c2,
96
const
reco::CandidateRef
& c3,
97
const
reco::CandidateRef
& c4);
98
99
template
<
typename
C>
100
helpers::CompositeCandidateMaker
101
makeCompositeCandidateWithRefsToMaster
(
const
typename
C::const_iterator &
begin
,
102
const
typename
C::const_iterator &
end
) {
103
helpers::CompositeCandidateMaker
104
cmp(std::auto_ptr<reco::CompositeCandidate>(
new
reco::CompositeCandidate
));
105
for
(
typename
C::const_iterator
i
= begin;
i
!=
end
; ++
i
)
106
cmp.
addDaughter
(ShallowCloneCandidate(
CandidateBaseRef
(*
i
)));
107
return
cmp;
108
}
109
110
helpers::CompositePtrCandidateMaker
111
makeCompositePtrCandidate
(
const
reco::CandidatePtr
& c1,
112
const
reco::CandidatePtr
& c2);
113
114
helpers::CompositePtrCandidateMaker
115
makeCompositePtrCandidate
(
const
reco::CandidatePtr
& c1,
116
const
reco::CandidatePtr
& c2,
117
const
reco::CandidatePtr
& c3);
118
119
helpers::CompositePtrCandidateMaker
120
makeCompositePtrCandidate
(
const
reco::CandidatePtr
& c1,
121
const
reco::CandidatePtr
& c2,
122
const
reco::CandidatePtr
& c3);
123
124
125
helpers::CompositePtrCandidateMaker
126
makeCompositePtrCandidate
(
const
reco::CandidatePtr
& c1,
127
const
reco::CandidatePtr
& c2,
128
const
reco::CandidatePtr
& c3,
129
const
reco::CandidatePtr
& c4);
130
131
#endif
makeCompositePtrCandidate
helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const reco::CandidatePtr &c1, const reco::CandidatePtr &c2)
Definition:
makeCompositeCandidate.cc:64
mps_fire.i
i
Definition:
mps_fire.py:156
edm::Ref< CandidateCollection >
helpers::CompositePtrCandidateMaker::addDaughter
void addDaughter(const reco::CandidatePtr &dau)
Definition:
makeCompositeCandidate.h:34
makeCompositeCandidate
helpers::CompositeCandidateMaker makeCompositeCandidate(const reco::Candidate &c1, const reco::Candidate &c2)
Definition:
makeCompositeCandidate.cc:5
reco::Candidate
Definition:
Candidate.h:28
ShallowCloneCandidate.h
GeneralSetup.setup
def setup(process, global_tag, zero_tesla=False)
Definition:
GeneralSetup.py:1
helpers::CompositeCandidateMaker::addDaughter
void addDaughter(const reco::Candidate &dau)
Definition:
makeCompositeCandidate.h:13
helpers::CompositePtrCandidateMaker
Definition:
makeCompositeCandidate.h:30
CompositeCandidate.h
reco::CompositeCandidate
Definition:
CompositeCandidate.h:21
helpers::CompositeCandidateMaker::operator[]
std::auto_ptr< reco::Candidate > operator[](const S &setup)
Definition:
makeCompositeCandidate.h:17
helpers::CompositePtrCandidateMaker::operator[]
std::auto_ptr< reco::Candidate > operator[](const S &setup)
Definition:
makeCompositeCandidate.h:38
helpers::CompositePtrCandidateMaker::cmp_
std::auto_ptr< reco::CompositePtrCandidate > cmp_
Definition:
makeCompositeCandidate.h:43
helpers::CompositeCandidateMaker
Definition:
makeCompositeCandidate.h:9
makeCompositeCandidateWithRefsToMaster
helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef &c1, const reco::CandidateRef &c2)
Definition:
makeCompositeCandidate.cc:32
edm::Ptr< Candidate >
end
#define end
Definition:
vmac.h:37
alignmentValidation.c1
c1
do drawing
Definition:
alignmentValidation.py:1023
helpers::CompositeCandidateMaker::cmp_
std::auto_ptr< reco::CompositeCandidate > cmp_
Definition:
makeCompositeCandidate.h:22
helpers::CompositePtrCandidateMaker::release
std::auto_ptr< reco::Candidate > release()
Definition:
makeCompositeCandidate.h:44
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
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
CompositePtrCandidate.h
helpers::CompositeCandidateMaker::release
std::auto_ptr< reco::Candidate > release()
Definition:
makeCompositeCandidate.h:23
helpers::CompositeCandidateMaker::CompositeCandidateMaker
CompositeCandidateMaker(std::auto_ptr< reco::CompositeCandidate > cmp)
Definition:
makeCompositeCandidate.h:10
helpers::CompositePtrCandidateMaker::CompositePtrCandidateMaker
CompositePtrCandidateMaker(std::auto_ptr< reco::CompositePtrCandidate > cmp)
Definition:
makeCompositeCandidate.h:31
Generated for CMSSW Reference Manual by
1.8.11