src
PhysicsTools
IsolationUtils
interface
PtIsolationAlgo.h
Go to the documentation of this file.
1
#ifndef IsolationUtils_PtIsolationAlgo_h
2
#define IsolationUtils_PtIsolationAlgo_h
3
/* \class PtIsolationAlgo<T, C>
4
*
5
* \author Francesco Fabozzi, INFN
6
*/
7
#include "
DataFormats/Math/interface/deltaR.h
"
8
9
template
<
typename
T,
typename
C>
10
class
PtIsolationAlgo
{
11
public
:
12
typedef
double
value_type
;
13
PtIsolationAlgo
() {}
14
PtIsolationAlgo
(
double
dRMin
,
double
dRMax
,
double
dzMax
,
double
d0Max
,
double
ptMin
)
15
:
dRMin_
(
dRMin
),
dRMax_
(
dRMax
),
dzMax_
(
dzMax
),
d0Max_
(
d0Max
),
ptMin_
(
ptMin
) {}
16
double
operator()
(
const
T
&,
const
C
&)
const
;
17
18
private
:
19
double
dRMin_
,
dRMax_
,
dzMax_
,
d0Max_
,
ptMin_
;
20
};
21
22
template
<
typename
T,
typename
C>
23
double
PtIsolationAlgo<T, C>::operator()
(
const
T
&
cand
,
const
C
&
elements
)
const
{
24
double
ptSum = 0;
25
double
candVz =
cand
.vz();
26
double
candEta =
cand
.eta();
27
double
candPhi =
cand
.phi();
28
for
(
typename
C::const_iterator elem =
elements
.begin(); elem !=
elements
.end(); ++elem) {
29
double
elemPt = elem->pt();
30
if
(elemPt < ptMin_)
31
continue
;
32
double
elemVx = elem->vx();
33
double
elemVy = elem->vy();
34
double
elemD0 =
sqrt
(elemVx * elemVx + elemVy * elemVy);
35
if
(elemD0 > d0Max_)
36
continue
;
37
double
dz
= fabs(elem->vz() - candVz);
38
if
(
dz
> dzMax_)
39
continue
;
40
double
dR
=
deltaR
(elem->eta(), elem->phi(), candEta, candPhi);
41
if
((
dR
> dRMax_) || (
dR
< dRMin_))
42
continue
;
43
ptSum += elemPt;
44
}
45
return
ptSum;
46
}
47
48
#endif
deltaR.h
PtIsolationAlgo::dRMax_
double dRMax_
Definition:
PtIsolationAlgo.h:19
PtIsolationAlgo::ptMin_
double ptMin_
Definition:
PtIsolationAlgo.h:19
ptMin
constexpr float ptMin
Definition:
PhotonIDValueMapProducer.cc:155
PVValHelper::dz
Definition:
PVValidationHelpers.h:51
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition:
PbPb_ZMuSkimMuonDPG_cff.py:63
PtIsolationAlgo::value_type
double value_type
Definition:
PtIsolationAlgo.h:12
PtIsolationAlgo::PtIsolationAlgo
PtIsolationAlgo()
Definition:
PtIsolationAlgo.h:13
PtIsolationAlgo::PtIsolationAlgo
PtIsolationAlgo(double dRMin, double dRMax, double dzMax, double d0Max, double ptMin)
Definition:
PtIsolationAlgo.h:14
dzMax
constexpr float dzMax
Definition:
PhotonIDValueMapProducer.cc:152
PtIsolationAlgo::d0Max_
double d0Max_
Definition:
PtIsolationAlgo.h:19
AlignmentTrackSelector_cfi.d0Max
d0Max
Definition:
AlignmentTrackSelector_cfi.py:22
PtIsolationAlgo::dRMin_
double dRMin_
Definition:
PtIsolationAlgo.h:19
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
PtIsolationAlgo::dzMax_
double dzMax_
Definition:
PtIsolationAlgo.h:19
correctionTermsCaloMet_cff.C
C
Definition:
correctionTermsCaloMet_cff.py:34
PtIsolationAlgo::operator()
double operator()(const T &, const C &) const
Definition:
PtIsolationAlgo.h:23
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition:
HGC3DClusterGenMatchSelector_cfi.py:7
metBenchmark_cfi.dRMax
dRMax
Definition:
metBenchmark_cfi.py:18
HLT_2023v12_cff.dRMin
dRMin
Definition:
HLT_2023v12_cff.py:7835
cand
Definition:
decayParser.h:32
T
long double T
Definition:
Basic3DVectorLD.h:48
PtIsolationAlgo
Definition:
PtIsolationAlgo.h:10
bookConverter.elements
elements
Definition:
bookConverter.py:147
Generated for CMSSW Reference Manual by
1.8.14