Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8308690
ClusteredPhotons.cc
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
ClusteredPhotons.cc
View Options
// -*- C++ -*-
#include
"Rivet/Projections/ClusteredPhotons.hh"
#include
"Rivet/Tools/Logging.hh"
#include
"Rivet/Tools/ParticleIdUtils.hh"
#include
"Rivet/Cmp.hh"
namespace
Rivet
{
int
ClusteredPhotons
::
compare
(
const
Projection
&
p
)
const
{
const
PCmp
fscmp
=
mkNamedPCmp
(
p
,
"Photons"
);
if
(
fscmp
!=
EQUIVALENT
)
return
fscmp
;
const
PCmp
sigcmp
=
mkNamedPCmp
(
p
,
"Signal"
);
if
(
sigcmp
!=
EQUIVALENT
)
return
sigcmp
;
const
ClusteredPhotons
&
other
=
dynamic_cast
<
const
ClusteredPhotons
&>
(
p
);
int
rcmp
=
cmp
(
_dRmax
,
other
.
_dRmax
);
return
rcmp
;
}
void
ClusteredPhotons
::
project
(
const
Event
&
e
)
{
_theParticles
.
clear
();
if
(
!
_dRmax
>
0.0
)
return
;
const
FinalState
&
photons
=
applyProjection
<
FinalState
>
(
e
,
"Photons"
);
const
FinalState
&
signal
=
applyProjection
<
FinalState
>
(
e
,
"Signal"
);
foreach
(
const
Particle
&
p
,
photons
.
particles
())
{
bool
clustered
=
false
;
foreach
(
const
Particle
&
l
,
signal
.
particles
())
{
// Only cluster photons around *charged* signal particles
if
(
PID
::
threeCharge
(
l
.
pdgId
())
==
0
)
continue
;
// Geometrically match momentum vectors
const
FourMomentum
p_l
=
l
.
momentum
();
const
FourMomentum
p_P
=
p
.
momentum
();
if
(
deltaR
(
p_l
.
pseudorapidity
(),
p_l
.
azimuthalAngle
(),
p_P
.
pseudorapidity
(),
p_P
.
azimuthalAngle
())
<
_dRmax
)
{
clustered
=
true
;
}
}
if
(
clustered
)
_theParticles
.
push_back
(
p
);
}
MSG_DEBUG
(
name
()
<<
" found "
<<
_theParticles
.
size
()
<<
" matching photons."
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Dec 21, 12:54 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4022838
Default Alt Text
ClusteredPhotons.cc (1 KB)
Attached To
rRIVETSVN rivetsvn
Event Timeline
Log In to Comment