Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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/CaloRecHit/interface/CaloRecHit.h
"
12
#include "
DataFormats/Common/interface/RefToBase.h
"
13
14
namespace
reco
{
15
16
template
<
typename
Ref>
17
class
CandidateWithRef
:
public
LeafCandidate
{
18
public
:
19
typedef
Ref
reference
;
21
CandidateWithRef
() :
LeafCandidate
() { }
23
CandidateWithRef
(
const
LorentzVector
&
p4
,
Charge
q
= 0,
const
Point
& vtx =
Point
( 0, 0, 0 ) ) :
24
LeafCandidate
(
q
, p4, vtx ) { }
26
virtual
~CandidateWithRef
();
28
virtual
CandidateWithRef
*
clone
()
const
;
30
void
setRef
(
const
Ref
&
r
) {
ref_
=
r
; }
32
reference
ref
()
const
{
return
ref_
; }
33
34
CMS_CLASS_VERSION
(10)
35
36
private
:
38
virtual
bool
overlap
(
const
Candidate
& )
const
;
40
reference
ref_
;
41
};
42
43
// the following has to be added for any single Ref type
44
// GET_DEFAULT_CANDIDATE_COMPONENT( CandidateWithRef<Ref>, CandidateWithRef<Ref>::reference, ref )
45
46
template
<typename
Ref
>
47
CandidateWithRef
<
Ref
>::~
CandidateWithRef
() {
48
}
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 == 0 )
return
false
;
59
if
(
ref
().isNull() )
return
false
;
60
if
( o->
ref
().isNull() )
return
false
;
61
return
(
ref
() != o->
ref
() );
62
}
63
64
}
65
66
#endif
reco::CandidateWithRef
Definition:
CandidateWithRef.h:17
reco::LeafCandidate
Definition:
LeafCandidate.h:21
reco::Candidate::Charge
int Charge
electric charge type
Definition:
Candidate.h:39
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition:
JetExtendedAssociation.h:32
reco::LeafCandidate::p4
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
Definition:
LeafCandidate.h:148
reco::CandidateWithRef::CandidateWithRef
CandidateWithRef(const LorentzVector &p4, Charge q=0, const Point &vtx=Point(0, 0, 0))
constructor from values
Definition:
CandidateWithRef.h:23
reco::Candidate
Definition:
Candidate.h:32
RefToBase.h
lumiQueryAPI.q
tuple q
Definition:
lumiQueryAPI.py:1839
reco::CandidateWithRef::ref_
reference ref_
reference to a CaloRecHit
Definition:
CandidateWithRef.h:40
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:107
CMS_CLASS_VERSION
#define CMS_CLASS_VERSION(_version_)
Definition:
CMS_CLASS_VERSION.h:30
reco::CandidateWithRef::CandidateWithRef
CandidateWithRef()
default constructor
Definition:
CandidateWithRef.h:21
reco::CandidateWithRef::overlap
virtual bool overlap(const Candidate &) const
check overlap with another candidate
Definition:
CandidateWithRef.h:56
reco::CandidateWithRef::clone
virtual CandidateWithRef * clone() const
returns a clone of the candidate
Definition:
CandidateWithRef.h:51
python.connectstrParser.o
string o
Definition:
connectstrParser.py:70
reco::CandidateWithRef::~CandidateWithRef
virtual ~CandidateWithRef()
destructor
Definition:
CandidateWithRef.h:47
reco::CandidateWithRef::setRef
void setRef(const Ref &r)
set reference
Definition:
CandidateWithRef.h:30
reco::CandidateWithRef::ref
reference ref() const
reference
Definition:
CandidateWithRef.h:32
compareJSON.const
string const
Definition:
compareJSON.py:14
trackerHits.c
tuple c
Definition:
trackerHits.py:26
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:41
private
#define private
Definition:
FWFileEntry.h:17
CaloRecHit.h
alignCSCRings.r
list r
Definition:
alignCSCRings.py:92
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition:
Candidate.h:45
reco::CandidateWithRef::reference
Ref reference
Definition:
CandidateWithRef.h:19
svgfig.template
def template
Definition:
svgfig.py:520
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition:
LeafCandidate.h:32
Generated for CMSSW Reference Manual by
1.8.5