Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
PhysicsTools
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/ShallowCloneCandidate.h
"
5
#include <memory>
6
7
namespace
helpers {
8
struct
CompositeCandidateMaker {
9
CompositeCandidateMaker
( std::auto_ptr<reco::CompositeCandidate> cmp ) :
10
cmp_
( cmp ) {
11
}
12
void
addDaughter
(
const
reco::Candidate
& dau ) {
13
cmp_
->addDaughter( dau );
14
}
15
template
<
typename
S>
16
std::auto_ptr<reco::Candidate>
operator[]
(
const
S
&
setup
) {
17
setup.set( *
cmp_
);
18
return
release
();
19
}
20
private
:
21
std::auto_ptr<reco::CompositeCandidate>
cmp_
;
22
std::auto_ptr<reco::Candidate>
release
() {
23
std::auto_ptr<reco::Candidate>
ret
(
cmp_
.get() );
24
cmp_
.release();
25
return
ret
;
26
}
27
};
28
}
29
30
helpers::CompositeCandidateMaker
31
makeCompositeCandidate
(
const
reco::Candidate
&
c1
,
32
const
reco::Candidate
& c2 );
33
34
helpers::CompositeCandidateMaker
35
makeCompositeCandidate
(
const
reco::Candidate
&
c1
,
36
const
reco::Candidate
& c2,
37
const
reco::Candidate
& c3 );
38
39
helpers::CompositeCandidateMaker
40
makeCompositeCandidate
(
const
reco::Candidate
&
c1
,
41
const
reco::Candidate
& c2,
42
const
reco::Candidate
& c3 );
43
44
45
helpers::CompositeCandidateMaker
46
makeCompositeCandidate
(
const
reco::Candidate
&
c1
,
47
const
reco::Candidate
& c2,
48
const
reco::Candidate
& c3,
49
const
reco::Candidate
& c4 );
50
51
template
<
typename
C>
52
helpers::CompositeCandidateMaker
53
makeCompositeCandidate
(
const
typename
C::const_iterator &
begin
,
54
const
typename
C::const_iterator &
end
) {
55
helpers::CompositeCandidateMaker
56
cmp( std::auto_ptr<reco::CompositeCandidate>(
new
reco::CompositeCandidate
) );
57
for
(
typename
C::const_iterator
i
= begin;
i
!=
end
; ++
i
)
58
cmp.
addDaughter
( *
i
);
59
return
cmp;
60
}
61
62
helpers::CompositeCandidateMaker
63
makeCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
&
c1
,
64
const
reco::CandidateRef
& c2 );
65
66
helpers::CompositeCandidateMaker
67
makeCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
&
c1
,
68
const
reco::CandidateRef
& c2,
69
const
reco::CandidateRef
& c3 );
70
71
helpers::CompositeCandidateMaker
72
makeCompositeCandidateWithRefsToMaster
(
const
reco::CandidateRef
&
c1
,
73
const
reco::CandidateRef
& c2,
74
const
reco::CandidateRef
& c3,
75
const
reco::CandidateRef
& c4 );
76
77
template
<
typename
C>
78
helpers::CompositeCandidateMaker
79
makeCompositeCandidateWithRefsToMaster
(
const
typename
C::const_iterator &
begin
,
80
const
typename
C::const_iterator &
end
) {
81
helpers::CompositeCandidateMaker
82
cmp( std::auto_ptr<reco::CompositeCandidate>(
new
reco::CompositeCandidate
) );
83
for
(
typename
C::const_iterator
i
= begin;
i
!=
end
; ++
i
)
84
cmp.
addDaughter
( ShallowCloneCandidate(
CandidateBaseRef
( *
i
) ) );
85
return
cmp;
86
}
87
88
#endif
i
int i
Definition:
DBlmapReader.cc:9
edm::Ref< CandidateCollection >
run_regression.ret
int ret
Definition:
run_regression.py:388
alignmentValidation.c1
tuple c1
do drawing
Definition:
alignmentValidation.py:1023
reco::Candidate
Definition:
Candidate.h:28
ShallowCloneCandidate.h
helpers::CompositeCandidateMaker::cmp_
std::auto_ptr< reco::CompositeCandidate > cmp_
Definition:
makeCompositeCandidate.h:22
helpers::CompositeCandidateMaker::addDaughter
void addDaughter(const reco::Candidate &dau)
Definition:
makeCompositeCandidate.h:12
CompositeCandidate.h
reco::CompositeCandidate
Definition:
CompositeCandidate.h:21
helpers::CompositeCandidateMaker::operator[]
std::auto_ptr< reco::Candidate > operator[](const S &setup)
Definition:
makeCompositeCandidate.h:16
helpers::CompositeCandidateMaker
Definition:
makeCompositeCandidate.h:9
end
#define end
Definition:
vmac.h:37
makeCompositeCandidateWithRefsToMaster
helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef &c1, const reco::CandidateRef &c2)
Definition:
makeCompositeCandidate.cc:32
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
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
makeCompositeCandidate
helpers::CompositeCandidateMaker makeCompositeCandidate(const reco::Candidate &c1, const reco::Candidate &c2)
Definition:
makeCompositeCandidate.cc:5
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:9
HcalObjRepresent::setup
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition:
HcalObjRepresent.h:628
Generated for CMSSW Reference Manual by
1.8.5