RecoEgamma
EgammaPhotonAlgos
src
ConversionForwardEstimator.cc
Go to the documentation of this file.
1
#include "CLHEP/Units/GlobalPhysicalConstants.h"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include "
RecoEgamma/EgammaPhotonAlgos/interface/ConversionForwardEstimator.h
"
4
#include "
TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h
"
5
#include "
TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h
"
6
#include "
TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h
"
7
8
// zero value indicates incompatible ts - hit pair
9
std::pair<bool, double>
ConversionForwardEstimator::estimate
(
const
TrajectoryStateOnSurface
& ts,
10
const
TrackingRecHit
&
hit
)
const
{
11
LogDebug
(
"ConversionForwardEstimator"
)
12
<<
"ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts ...) "
13
<<
"\n"
;
14
// std::cout << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts ...) " << "\n";
15
16
std::pair<bool, double>
result
;
17
18
float
tsPhi = ts.
globalParameters
().
position
().
phi
();
19
GlobalPoint
gp
=
hit
.globalPosition();
20
float
rhPhi =
gp
.phi();
21
float
rhR =
gp
.perp();
22
23
// allow an r fudge of 1.5 * times the sigma
24
// nodt used float dr = 1.5 * hit.localPositionError().yy();
25
//std::cout << " err " << hit.globalPositionError().phierr(gp)
26
// << " " << hit.globalPositionError().rerr(gp) << std::endl;
27
28
// not used float zLayer = ts.globalParameters().position().z();
29
float
rLayer = ts.
globalParameters
().
position
().
perp
();
30
31
float
newdr =
sqrt
(
pow
(
dr_
, 2) + 4. *
hit
.localPositionError().yy());
32
float
rMin
= rLayer - newdr;
33
float
rMax
= rLayer + newdr;
34
float
phiDiff = tsPhi - rhPhi;
35
if
(phiDiff >
pi
)
36
phiDiff -= twopi;
37
if
(phiDiff < -
pi
)
38
phiDiff += twopi;
39
40
//std::cout << " ConversionForwardEstimator: RecHit at " << gp << "\n";
41
//std::cout << " rMin = " << rMin << ", rMax = " << rMax << ", rHit = " << rhR << "\n";
42
//std::cout << " thePhiRangeMin = " << thePhiRangeMin << ", thePhiRangeMax = " << thePhiRangeMax << ", phiDiff = " << phiDiff << "\n";
43
44
if
(phiDiff < thePhiRangeMax && phiDiff >
thePhiRangeMin
&& rhR < rMax && rhR >
rMin
) {
45
// std::cout << " estimator returns 1 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
46
// << thePhiRangeMax << " and rhR " << rMin << " < " << rhR << " < " << rMax << "\n";
47
//std::cout << " YES " << phiDiff << " " <<rLayer-rhR << "\n";
48
//std::cout << " => RECHIT ACCEPTED " << "\n";
49
50
result
.first =
true
;
51
result
.second = phiDiff;
52
}
else
{
53
/*
54
cout << " estimator returns 0 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
55
<< thePhiRangeMax << " and rhR " << rMin << " < " << rhR << " < " << rMax << endl;
56
*/
57
result
.first =
false
;
58
result
.second = 0;
59
}
60
61
return
result
;
62
}
63
64
bool
ConversionForwardEstimator::estimate
(
const
TrajectoryStateOnSurface
& ts,
const
BoundPlane
& plane)
const
{
65
// std::cout << "ConversionForwardEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) always TRUE " << "\n";
66
// this method should return one if a detector ring is close enough
67
// to the hit, zero otherwise.
68
// Now time is wasted looking for hits in the rings which are anyhow
69
// too far from the prediction
70
return
true
;
71
}
72
73
MeasurementEstimator::Local2DVector
ConversionForwardEstimator::maximalLocalDisplacement
(
74
const
TrajectoryStateOnSurface
& ts,
const
BoundPlane
& plane)
const
{
75
/*
76
if ( ts.hasError() ) {
77
LocalError le = ts.localError().positionError();
78
std::cout << " ConversionForwardEstimator::maximalLocalDisplacent local error " << sqrt(le.xx()) << " " << sqrt(le.yy()) << " nSigma " << nSigmaCut() << " sqrt(le.xx())*nSigmaCut() " << sqrt(le.xx())*nSigmaCut() << " sqrt(le.yy())*nSigmaCut() " << sqrt(le.yy())*nSigmaCut() << std::endl;
79
return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
80
81
}
82
else return Local2DVector(99999,99999);
83
*/
84
85
return
Local2DVector
(99999, 99999);
86
}
TrajectoryStateOnSurface.h
photonAnalyzer_cfi.rMax
rMax
Definition:
photonAnalyzer_cfi.py:91
GlobalTrajectoryParameters.h
MessageLogger.h
ConversionForwardEstimator::maximalLocalDisplacement
Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const override
Definition:
ConversionForwardEstimator.cc:73
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition:
GlobalTrajectoryParameters.h:60
ConversionForwardEstimator::thePhiRangeMin
float thePhiRangeMin
Definition:
ConversionForwardEstimator.h:38
TransientTrackingRecHit.h
ConversionForwardEstimator::dr_
float dr_
Definition:
ConversionForwardEstimator.h:40
MeasurementEstimator::Local2DVector
Vector2DBase< float, LocalTag > Local2DVector
Definition:
MeasurementEstimator.h:26
TrajectoryStateOnSurface
Definition:
TrajectoryStateOnSurface.h:16
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
Vector2DBase
Definition:
Vector2DBase.h:8
Point3DBase< float, GlobalTag >
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:431
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
ConversionForwardEstimator::estimate
std::pair< bool, double > estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const override
Definition:
ConversionForwardEstimator.cc:9
TrackingRecHit
Definition:
TrackingRecHit.h:21
ConversionForwardEstimator.h
BoundPlane
photonAnalyzer_cfi.rMin
rMin
Definition:
photonAnalyzer_cfi.py:90
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition:
Power.h:29
mps_fire.result
result
Definition:
mps_fire.py:311
pi
const Double_t pi
Definition:
trackSplitPlot.h:36
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition:
TrajectoryStateOnSurface.h:64
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition:
PV3DBase.h:66
hit
Definition:
SiStripHitEffFromCalibTree.cc:88
Generated for CMSSW Reference Manual by
1.8.16