RecoPixelVertexing
PixelTriplets
plugins
ThirdHitRZPrediction.h
Go to the documentation of this file.
1
#ifndef ThirdHitRZPrediction_H
2
#define ThirdHitRZPrediction_H
3
9
#include <algorithm>
10
11
#include "
RecoPixelVertexing/PixelTriplets/interface/ThirdHitRZPredictionBase.h
"
12
13
template
<
class
Propagator>
14
class
ThirdHitRZPrediction
:
public
ThirdHitRZPredictionBase
{
15
public
:
16
ThirdHitRZPrediction
() :
ThirdHitRZPredictionBase
(),
thePropagator
(nullptr) {}
17
ThirdHitRZPrediction
(
const
Propagator
*
propagator
,
float
tolerance
,
const
DetLayer
*layer =
nullptr
)
18
:
ThirdHitRZPredictionBase
(
tolerance
, layer),
thePropagator
(
propagator
) {}
19
20
inline
Range
operator()
(
const
DetLayer
*layer =
nullptr
);
21
inline
Range
operator()
(
float
rORz)
const
{
return
(*
this
)(rORz, *
thePropagator
); }
22
inline
Range
operator()
(
float
rORz,
const
Propagator
&
propagator
)
const
;
23
24
void
initPropagator
(
const
Propagator
*
propagator
) {
thePropagator
=
propagator
; }
25
26
private
:
27
float
transform
(
const
Propagator
&
propagator
,
float
rOrZ)
const
{
28
return
theBarrel
?
propagator
.zAtR(rOrZ) :
propagator
.rAtZ(rOrZ);
29
}
30
31
const
Propagator
*
thePropagator
;
32
};
33
34
template
<
class
Propagator>
35
typename
ThirdHitRZPrediction<Propagator>::Range
ThirdHitRZPrediction<Propagator>::operator()
(
const
DetLayer
*layer) {
36
if
(layer)
37
initLayer(layer);
38
if
(!theBarrel && !theForward)
39
return
Range
(0., 0.);
40
float
v1 =
transform
(*thePropagator, theDetRange.min());
41
float
v2 =
transform
(*thePropagator, theDetRange.max());
42
if
(v1 > v2)
43
std::swap
(v1, v2);
44
return
Range
(v1 - theTolerance.left(), v2 + theTolerance.right());
45
}
46
47
template
<
class
Propagator>
48
typename
ThirdHitRZPrediction<Propagator>::Range
ThirdHitRZPrediction<Propagator>::operator()
(
49
float
rOrZ,
const
Propagator
&
propagator
)
const
{
50
float
v
=
transform
(
propagator
, rOrZ);
51
return
Range
(
v
- theTolerance.left(),
v
+ theTolerance.right());
52
}
53
54
#endif
ThirdHitRZPrediction::ThirdHitRZPrediction
ThirdHitRZPrediction()
Definition:
ThirdHitRZPrediction.h:16
DetLayer
Definition:
DetLayer.h:21
Range
PixelRecoRange< float > Range
Definition:
PixelTripletHLTGenerator.cc:31
ThirdHitRZPrediction::operator()
Range operator()(float rORz) const
Definition:
ThirdHitRZPrediction.h:21
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
ThirdHitRZPredictionBase::Range
PixelRecoRange< float > Range
Definition:
ThirdHitRZPredictionBase.h:20
ThirdHitRZPrediction::initPropagator
void initPropagator(const Propagator *propagator)
Definition:
ThirdHitRZPrediction.h:24
Propagator
Definition:
Propagator.h:44
ThirdHitRZPredictionBase.h
TrackCandidateProducer_cfi.propagator
propagator
Definition:
TrackCandidateProducer_cfi.py:17
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition:
DataFrameContainer.h:209
ThirdHitRZPrediction
Definition:
ThirdHitRZPrediction.h:14
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition:
HcalDetIdTransform.cc:7
PixelRecoRange< float >
ThirdHitRZPredictionBase
Definition:
ThirdHitRZPredictionBase.h:18
ThirdHitRZPredictionBase::theBarrel
bool theBarrel
Definition:
ThirdHitRZPredictionBase.h:33
tolerance
const double tolerance
Definition:
HGCalGeomParameters.cc:26
ThirdHitRZPrediction::operator()
Range operator()(const DetLayer *layer=nullptr)
Definition:
ThirdHitRZPrediction.h:35
ThirdHitRZPrediction::ThirdHitRZPrediction
ThirdHitRZPrediction(const Propagator *propagator, float tolerance, const DetLayer *layer=nullptr)
Definition:
ThirdHitRZPrediction.h:17
ThirdHitRZPrediction::transform
float transform(const Propagator &propagator, float rOrZ) const
Definition:
ThirdHitRZPrediction.h:27
ThirdHitRZPrediction::thePropagator
const Propagator * thePropagator
Definition:
ThirdHitRZPrediction.h:31
Generated for CMSSW Reference Manual by
1.8.16