Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
DataFormats
Candidate
interface
CandidateWithRef.h
Go to the documentation of this file.
1
#ifndef Candidate_CandidateWithRef_h
2
#define Candidate_CandidateWithRef_h
3
11
#include "
DataFormats/Candidate/interface/Candidate.h
"
12
#include "
DataFormats/Candidate/interface/LeafCandidate.h
"
13
#include "
DataFormats/Common/interface/RefToBase.h
"
14
15
namespace
reco
{
16
17
template
<
typename
Ref>
18
class
CandidateWithRef
:
public
LeafCandidate
{
19
public
:
20
typedef
Ref
reference
;
22
CandidateWithRef
() :
LeafCandidate
() {}
24
CandidateWithRef
(
const
LorentzVector
&
p4
,
Charge
q
= 0,
const
Point
&
vtx
=
Point
(0, 0, 0))
25
:
LeafCandidate
(
q
, p4,
vtx
) {}
27
~
CandidateWithRef
()
override
;
29
CandidateWithRef
*
clone
()
const override
;
31
void
setRef
(
const
Ref
&
r
) {
ref_
=
r
; }
33
reference
ref
()
const
{
return
ref_
; }
34
35
CMS_CLASS_VERSION
(13)
36
37
private:
39
bool
overlap
(
const
Candidate
&)
const
override;
41
reference
ref_
;
42
};
43
44
// the following has to be added for any single Ref type
45
// GET_DEFAULT_CANDIDATE_COMPONENT( CandidateWithRef<Ref>, CandidateWithRef<Ref>::reference, ref )
46
47
template
<typename
Ref
>
48
CandidateWithRef
<
Ref
>::~
CandidateWithRef
() {}
49
50
template
<
typename
Ref>
51
CandidateWithRef<Ref>
*
CandidateWithRef<Ref>::clone
()
const
{
52
return
new
CandidateWithRef<Ref>
(*this);
53
}
54
55
template
<
typename
Ref>
56
bool
CandidateWithRef<Ref>::overlap
(
const
Candidate
&
c
)
const
{
57
const
CandidateWithRef
*
o
=
dynamic_cast<
const
CandidateWithRef
*
>
(&
c
);
58
if
(o ==
nullptr
)
59
return
false
;
60
if
(
ref
().isNull())
61
return
false
;
62
if
(o->
ref
().isNull())
63
return
false
;
64
return
(
ref
() != o->
ref
());
65
}
66
67
}
// namespace reco
68
69
#endif
reco::CandidateWithRef
Definition:
CandidateWithRef.h:18
reco::LeafCandidate
Definition:
LeafCandidate.h:16
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition:
JetExtendedAssociation.h:32
c
const edm::EventSetup & c
Definition:
SiStripLAProfileBooker.cc:66
LeafCandidate.h
reco::Candidate
Definition:
Candidate.h:27
RefToBase.h
reco::CandidateWithRef::ref_
reference ref_
reference to a CaloRecHit
Definition:
CandidateWithRef.h:41
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:111
CMS_CLASS_VERSION
#define CMS_CLASS_VERSION(_version_)
Definition:
CMS_CLASS_VERSION.h:30
reco::CandidateWithRef::vtx
vtx
Definition:
CandidateWithRef.h:25
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition:
LeafCandidate.h:114
Candidate.h
reco::CandidateWithRef::CandidateWithRef
CandidateWithRef()
default constructor
Definition:
CandidateWithRef.h:22
submitPVResolutionJobs.q
tuple q
Definition:
submitPVResolutionJobs.py:84
reco::CandidateWithRef::overlap
bool overlap(const Candidate &) const override
check overlap with another candidate
Definition:
CandidateWithRef.h:56
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition:
HLTMuonMatchAndPlot.h:49
reco::CandidateWithRef::setRef
void setRef(const Ref &r)
set reference
Definition:
CandidateWithRef.h:31
reco::CandidateWithRef::clone
CandidateWithRef * clone() const override
returns a clone of the candidate
Definition:
CandidateWithRef.h:51
reco::CandidateWithRef::ref
reference ref() const
reference
Definition:
CandidateWithRef.h:33
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition:
DMRtrends.cc:57
class-composition.o
tuple o
Definition:
class-composition.py:65
alignCSCRings.r
list r
Definition:
alignCSCRings.py:93
reco::CandidateWithRef::reference
Ref reference
Definition:
CandidateWithRef.h:20
reco::LeafCandidate::Charge
int Charge
electric charge type
Definition:
LeafCandidate.h:21
runTheMatrix.const
string const
Definition:
runTheMatrix.py:329
svgfig.template
def template
Definition:
svgfig.py:521
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition:
LeafCandidate.h:27
Generated for CMSSW Reference Manual by
1.8.5