Main Page
Namespaces
Classes
Package Documentation
CVS Directory
WorkBook
Offline Guide
Release schedule
•
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
12
#include "
DataFormats/CaloRecHit/interface/CaloRecHit.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
virtual
~CandidateWithRef
();
29
virtual
CandidateWithRef
*
clone
()
const
;
31
void
setRef
(
const
Ref
&
r
) {
ref_
=
r
; }
33
reference
ref
()
const
{
return
ref_
; }
34
35
private
:
37
virtual
bool
overlap
(
const
Candidate
& )
const
;
39
reference
ref_
;
40
};
41
42
// the following has to be added for any single Ref type
43
// GET_DEFAULT_CANDIDATE_COMPONENT( CandidateWithRef<Ref>, CandidateWithRef<Ref>::reference, ref )
44
45
template
<
typename
Ref>
46
CandidateWithRef<Ref>::~CandidateWithRef
() {
47
}
48
49
template
<
typename
Ref>
50
CandidateWithRef<Ref>
*
CandidateWithRef<Ref>::clone
()
const
{
51
return
new
CandidateWithRef<Ref>
( * this );
52
}
53
54
template
<
typename
Ref>
55
bool
CandidateWithRef<Ref>::overlap
(
const
Candidate
&
c
)
const
{
56
const
CandidateWithRef
*
o
=
dynamic_cast<
const
CandidateWithRef
*
>
( &
c
);
57
if
( o == 0 )
return
false
;
58
if
( ref().isNull() )
return
false
;
59
if
( o->
ref
().isNull() )
return
false
;
60
return
( ref() != o->
ref
() );
61
}
62
63
}
64
65
#endif
reco::CandidateWithRef
Definition:
CandidateWithRef.h:18
reco::LeafCandidate
Definition:
LeafCandidate.h:18
reco::Candidate::Charge
int Charge
electric charge type
Definition:
Candidate.h:37
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition:
JetExtendedAssociation.h:33
reco::CandidateWithRef::CandidateWithRef
CandidateWithRef(const LorentzVector &p4, Charge q=0, const Point &vtx=Point(0, 0, 0))
constructor from values
Definition:
CandidateWithRef.h:24
csvReporter.r
tuple r
Definition:
csvReporter.py:25
reco::Candidate
Definition:
Candidate.h:30
RefToBase.h
lumiQueryAPI.q
tuple q
Definition:
lumiQueryAPI.py:1781
reco::CandidateWithRef::ref_
reference ref_
reference to a CaloRecHit
Definition:
CandidateWithRef.h:39
connectstrParser.o
string o
Definition:
connectstrParser.py:70
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:101
reco::CandidateWithRef::CandidateWithRef
CandidateWithRef()
default constructor
Definition:
CandidateWithRef.h:22
reco::CandidateWithRef::overlap
virtual bool overlap(const Candidate &) const
check overlap with another candidate
Definition:
CandidateWithRef.h:55
reco::CandidateWithRef::clone
virtual CandidateWithRef * clone() const
returns a clone of the candidate
Definition:
CandidateWithRef.h:50
reco::CandidateWithRef::~CandidateWithRef
virtual ~CandidateWithRef()
destructor
Definition:
CandidateWithRef.h:46
reco::CandidateWithRef::setRef
void setRef(const Ref &r)
set reference
Definition:
CandidateWithRef.h:31
reco::CandidateWithRef::ref
reference ref() const
reference
Definition:
CandidateWithRef.h:33
trackerHits.c
tuple c
Definition:
trackerHits.py:26
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:39
CaloRecHit.h
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition:
Candidate.h:43
reco::LeafCandidate::p4
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition:
LeafCandidate.h:108
reco::CandidateWithRef::reference
Ref reference
Definition:
CandidateWithRef.h:20
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition:
LeafCandidate.h:29
Generated for CMSSW Reference Manual by
1.8.5