DataFormats
TrackReco
interface
TrackExtraBase.h
Go to the documentation of this file.
1
#ifndef DataFormats_TrackReco_TrackExtraBase_h
2
#define DataFormats_TrackReco_TrackExtraBase_h
3
17
#include "
DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h
"
18
#include "
DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h
"
19
20
namespace
reco
{
21
22
class
TrackExtraBase
{
23
public
:
24
using
TrajParams
= std::vector<LocalTrajectoryParameters>;
25
using
Chi2sFive
= std::vector<unsigned char>;
26
28
TrackExtraBase
() :
m_firstHit
((unsigned
int
)-1),
m_nHits
(0) {}
29
30
void
setHits
(
TrackingRecHitRefProd
const
&
prod
,
unsigned
firstH,
unsigned
int
nH) {
31
m_hitCollection
.
pushBackItem
(
prod
.refCore(),
true
);
32
m_firstHit
= firstH;
33
m_nHits
= nH;
34
}
35
36
void
setTrajParams
(
TrajParams
tmps,
Chi2sFive
chi2s) {
37
m_trajParams
=
std::move
(tmps);
38
m_chi2sX5
=
std::move
(chi2s);
39
}
40
41
unsigned
int
firstRecHit
()
const
{
return
m_firstHit
; }
42
44
unsigned
int
recHitsSize
()
const
{
return
m_nHits
; }
45
47
auto
recHits
()
const
{
return
TrackingRecHitRange
(
recHitsBegin
(),
recHitsEnd
()); }
48
50
trackingRecHit_iterator
recHitsBegin
()
const
{
return
recHitsProduct
().
data
().begin() +
firstRecHit
(); }
51
53
trackingRecHit_iterator
recHitsEnd
()
const
{
return
recHitsBegin
() +
recHitsSize
(); }
54
56
TrackingRecHitRef
recHitRef
(
unsigned
int
i
)
const
{
57
//Another thread might change the RefCore at the same time.
58
// By using a copy we will be safe.
59
edm::RefCore
hitCollection
(
m_hitCollection
);
60
if
(
hitCollection
.productPtr()) {
61
TrackingRecHitRef::finder_type
finder
;
62
TrackingRecHitRef::value_type
const
*
item
=
63
finder
(*(static_cast<TrackingRecHitRef::product_type const*>(
hitCollection
.productPtr())),
m_firstHit
+
i
);
64
return
TrackingRecHitRef
(
hitCollection
.id(),
item
,
m_firstHit
+
i
);
65
}
66
return
TrackingRecHitRef
(
hitCollection
,
m_firstHit
+
i
);
67
}
68
70
TrackingRecHitRef
recHit
(
unsigned
int
i
)
const
{
return
recHitRef
(
i
); }
71
72
TrackingRecHitCollection
const
&
recHitsProduct
()
const
{
73
return
*edm::getProduct<TrackingRecHitCollection>(
m_hitCollection
);
74
}
75
76
TrajParams
const
&
trajParams
()
const
{
return
m_trajParams
; }
77
Chi2sFive
const
&
chi2sX5
()
const
{
return
m_chi2sX5
; }
78
79
private
:
80
edm::RefCore
m_hitCollection
;
81
unsigned
int
m_firstHit
;
82
unsigned
int
m_nHits
;
83
TrajParams
m_trajParams
;
84
Chi2sFive
m_chi2sX5
;
// chi2 * 5 chopped at 255 (max chi2 is 51)
85
};
86
87
}
// namespace reco
88
89
#endif // DataFormats_TrackReco_TrackExtraBase_h
edm::RefProd< TrackingRecHitCollection >
edm::RefCore
Definition:
RefCore.h:21
mps_fire.i
i
Definition:
mps_fire.py:428
edm::Ref::value_type
T value_type
Definition:
Ref.h:160
reco::TrackExtraBase::m_nHits
unsigned int m_nHits
Definition:
TrackExtraBase.h:82
HLT_FULL_cff.finder
finder
Definition:
HLT_FULL_cff.py:51924
reco::TrackExtraBase::m_trajParams
TrajParams m_trajParams
Definition:
TrackExtraBase.h:83
TrackingRecHitFwd.h
reco::TrackExtraBase::TrackExtraBase
TrackExtraBase()
default constructor
Definition:
TrackExtraBase.h:28
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Ref::finder_type
F finder_type
Definition:
Ref.h:162
reco::TrackExtraBase::chi2sX5
Chi2sFive const & chi2sX5() const
Definition:
TrackExtraBase.h:77
reco::TrackExtraBase::recHitsBegin
trackingRecHit_iterator recHitsBegin() const
first iterator over RecHits
Definition:
TrackExtraBase.h:50
edm::Ref
Definition:
AssociativeIterator.h:58
reco::TrackExtraBase::m_hitCollection
edm::RefCore m_hitCollection
Definition:
TrackExtraBase.h:80
TrackingRecHitRange
edm::Range< trackingRecHit_iterator > TrackingRecHitRange
Range class to enable range-based loops for a tracks RecHits.
Definition:
TrackingRecHitFwd.h:22
LocalTrajectoryParameters.h
reco::TrackExtraBase::m_firstHit
unsigned int m_firstHit
Definition:
TrackExtraBase.h:81
dumpMFGeometry_cfg.prod
prod
Definition:
dumpMFGeometry_cfg.py:24
egammaRechitFilter_cfi.hitCollection
hitCollection
Definition:
egammaRechitFilter_cfi.py:10
edm::OwnVector::const_iterator
Definition:
OwnVector.h:41
reco::TrackExtraBase::setTrajParams
void setTrajParams(TrajParams tmps, Chi2sFive chi2s)
Definition:
TrackExtraBase.h:36
TrackingRecHitRef
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
Definition:
TrackingRecHitFwd.h:14
edm::RefCore::pushBackItem
void pushBackItem(RefCore const &productToBeInserted, bool checkPointer)
Definition:
RefCore.cc:165
createfilelist.int
int
Definition:
createfilelist.py:10
reco::TrackExtraBase::trajParams
TrajParams const & trajParams() const
Definition:
TrackExtraBase.h:76
reco::TrackExtraBase::m_chi2sX5
Chi2sFive m_chi2sX5
Definition:
TrackExtraBase.h:84
reco::TrackExtraBase::recHit
TrackingRecHitRef recHit(unsigned int i) const
get i-th recHit
Definition:
TrackExtraBase.h:70
B2GTnPMonitor_cfi.item
item
Definition:
B2GTnPMonitor_cfi.py:147
reco::TrackExtraBase::setHits
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
Definition:
TrackExtraBase.h:30
reco::TrackExtraBase::recHitsSize
unsigned int recHitsSize() const
number of RecHits
Definition:
TrackExtraBase.h:44
reco::TrackExtraBase::recHitsProduct
TrackingRecHitCollection const & recHitsProduct() const
Definition:
TrackExtraBase.h:72
eostools.move
def move(src, dest)
Definition:
eostools.py:511
reco::TrackExtraBase::Chi2sFive
std::vector< unsigned char > Chi2sFive
Definition:
TrackExtraBase.h:25
edm::OwnVector::data
base const & data() const
Definition:
OwnVector.h:476
reco::TrackExtraBase::recHitRef
TrackingRecHitRef recHitRef(unsigned int i) const
get a ref to i-th recHit
Definition:
TrackExtraBase.h:56
reco::TrackExtraBase::firstRecHit
unsigned int firstRecHit() const
Definition:
TrackExtraBase.h:41
reco::TrackExtraBase
Definition:
TrackExtraBase.h:22
reco::TrackExtraBase::recHitsEnd
trackingRecHit_iterator recHitsEnd() const
last iterator over RecHits
Definition:
TrackExtraBase.h:53
reco::TrackExtraBase::TrajParams
std::vector< LocalTrajectoryParameters > TrajParams
Definition:
TrackExtraBase.h:24
reco::TrackExtraBase::recHits
auto recHits() const
accessor to RecHits
Definition:
TrackExtraBase.h:47
edm::OwnVector< TrackingRecHit >
Generated for CMSSW Reference Manual by
1.8.16