Event Analysis
Introduction
The routines in this section are intended to be used to analyze
event properties. As such they are not part of the main event
generation chain, but can be used in comparisons between Monte
Carlo events and real data. They are rather free-standing, but
assume that input is provided in the PYTHIA 8
Event
format, and use a few basic facilities such
as four-vectors.
In addition to the methods presented here, there is also the
possibility to make use of external
jet finders .
Sphericity
The standard sphericity tensor is
S^{ab} = (sum_i p_i^a p_i^b) / (sum_i p_i^2)
where the sum i runs over the particles in the event,
a, b = x, y, z, and p without such an index is
the absolute size of the three-momentum . This tensor can be
diagonalized to find eigenvalues and eigenvectors.
The above tensor can be generalized by introducing a power
r, such that
S^{ab} = (sum_i p_i^a p_i^b p_i^{r-2}) / (sum_i p_i^r)
In particular, r = 1 gives a linear dependence on momenta
and thus a collinear safe definition, unlike sphericity.
To do sphericity analyses you have to set up a Sphericity
instance, and then feed in events to it, one at a time. The results
for the latest event are available as output from a few methods.
Sphericity::Sphericity(double power = 2., int select = 2)
create a sphericity analysis object, where
argument
power (default = 2.
) :
is the power r defined above, i.e.
argumentoption
2. : gives Spericity, and
argumentoption
1. : gives the linear form.
argument
select (default = 2
) :
tells which particles are analyzed,
argumentoption
1 : all final-state particles,
argumentoption
2 : all observable final-state particles,
i.e. excluding neutrinos and other particles without strong or
electromagnetic interactions (the isVisible()
particle method), and
argumentoption
3 : only charged final-state particles.
bool Sphericity::analyze( const Event& event, ostream& os = cout)
perform a sphericity analysis, where
argument
event : is an object of the Event
class,
most likely the pythia.event
one.
argument
os (default = cout
) : is the output stream for
error messages. (The method does not rely on the Info
mchinery for error messages.)
If the routine returns false
the
analysis failed, e.g. if too few particles are present to analyze.
After the analysis has been performed, a few methods are available
to return the result of the analysis of the latest event:
double Sphericity::sphericity()
gives the sphericity (or equivalent if r is not 2),
double Sphericity::aplanarity()
gives the aplanarity (with the same comment),
double Sphericity::eigenValue(int i)
gives one of the three eigenvalues for i = 1, 2 or 3, in
descending order,
Vec4 Sphericity::EventAxis(i)
gives the matching normalized eigenvector, as a Vec4
with vanishing time/energy component.
void Sphericity::list(ostream& os = cout)
provides a listing of the above information.
There is also one method that returns information accumulated for all
the events analyzed so far.
int Sphericity::nError()
tells the number of times analyze(...)
failed to analyze
events, i.e. returned false
.
Thrust
Thrust is obtained by varying the thrust axis so that the longitudinal
momentum component projected onto it is maximized, and thrust itself is
then defined as the sum of absolute longitudinal momenta divided by
the sum of absolute momenta. The major axis is found correspondingly
in the plane transverse to thrust, and the minor one is then defined
to be transverse to both. Oblateness is the difference between the major
and the minor values.
The calculation of thrust is more computer-time-intensive than e.g.
linear sphericity, introduced above, and has no specific advantages except
historical precedent. In the PYTHIA 6 implementation the search was
speeded up at the price of then not being guaranteed to hit the absolute
maximum. The current implementation studies all possibilities, but at
the price of being slower, with time consumption for an event with
n particles growing like n^3.
To do thrust analyses you have to set up a Thrust
instance, and then feed in events to it, one at a time. The results
for the latest event are available as output from a few methods.
Thrust::Thrust(int select = 2)
create a thrust analysis object, where
argument
select (default = 2
) :
tells which particles are analyzed,
argumentoption
1 : all final-state particles,
argumentoption
2 : all observable final-state particles,
i.e. excluding neutrinos and other particles without strong or
electromagnetic interactions (the isVisible()
particle method), and
argumentoption
3 : only charged final-state particles.
bool Thrust::analyze( const Event& event, ostream& os = cout)
perform a thrust analysis, where
argument
event : is an object of the Event
class,
most likely the pythia.event
one.
argument
os (default = cout
) : is the output stream for
error messages. (The method does not rely on the Info
mchinery for error messages.)
If the routine returns false
the
analysis failed, e.g. if too few particles are present to analyze.
After the analysis has been performed, a few methods are available
to return the result of the analysis of the latest event:
double Thrust::thrust()
double Thrust::tMajor()
double Thrust::tMinor()
double Thrust::oblateness()
gives the thrust, major, minor and oblateness values, respectively,
Vec4 Thrust::eventAxis(int i)
gives the matching normalized event-axis vectors, for i = 1, 2 or 3
corresponding to thrust, major or minor, as a Vec4
with
vanishing time/energy component.
void Thrust::list(ostream& os = cout)
provides a listing of the above information.
There is also one method that returns information accumulated for all
the events analyzed so far.
int Thrust::nError()
tells the number of times analyze(...)
failed to analyze
events, i.e. returned false
.
ClusterJet
ClusterJet
(a.k.a. LUCLUS
and
PYCLUS
) is a clustering algorithm of the type used for
analyses of e^+e^- events, see the PYTHIA 6 manual. All
visible particles in the events are clustered into jets. A few options
are available for some well-known distance measures. Cutoff
distances can either be given in terms of a scaled quadratic quantity
like y = pT^2/E^2 or an unscaled linear one like pT.
To do jet finding analyses you have to set up a ClusterJet
instance, and then feed in events to it, one at a time. The results
for the latest event are available as output from a few methods.
ClusterJet::ClusterJet(string measure = "Lund", int select = 2, int massSet = 2, bool precluster = false, bool reassign = false)
create a ClusterJet
instance, where
argument
measure (default = "Lund"
) : distance measure,
to be provided as a character string (actually, only the first character
is necessary)
argumentoption
"Lund" : the Lund pT distance,
argumentoption
"JADE" : the JADE mass distance, and
argumentoption
"Durham" : the Durham kT measure.
argument
select (default = 2
) :
tells which particles are analyzed,
argumentoption
1 : all final-state particles,
argumentoption
2 : all observable final-state particles,
i.e. excluding neutrinos and other particles without strong or
electromagnetic interactions (the isVisible()
particle
method), and
argumentoption
3 : only charged final-state particles.
argument
massSet (default = 2
) : masses assumed for the particles
used in the analysis
argumentoption
0 : all massless,
argumentoption
1 : photons are massless while all others are
assigned the pi+- mass, and
argumentoption
2 : all given their correct masses.
argument
precluster (default = false
) :
perform or not a early preclustering step, where nearby particles
are lumped together so as to speed up the subsequent normal clustering.
argument
reassign (default = false
) :
reassign all particles to the nearest jet each time after two jets
have been joined.
ClusterJet::analyze( const Event& event, double yScale, double pTscale, int nJetMin = 1, int nJetMax = 0, ostream& os = cout)
performs a jet finding analysis, where
argument
event : is an object of the Event
class,
most likely the pythia.event
one.
argument
yScale :
is the cutoff joining scale, below which jets are joined. Is given
in quadratic dimensionless quantities. Either yScale
or pTscale
must be set nonvanishing, and the larger of
the two dictates the actual value.
argument
pTscale :
is the cutoff joining scale, below which jets are joined. Is given
in linear quantities, such as pT or m depending on
the measure used, but always in units of GeV. Either yScale
or pTscale
must be set nonvanishing, and the larger of
the two dictates the actual value.
argument
nJetMin (default = 1
) :
the minimum number of jets to be reconstructed. If used, it can override
the yScale
and pTscale
values.
argument
nJetMax (default = 0
) :
the maximum number of jets to be reconstructed. Is not used if below
nJetMin
. If used, it can override the yScale
and pTscale
values. Thus e.g.
nJetMin = nJetMax = 3
can be used to reconstruct exactly
3 jets.
argument
os (default = cout
) : is the output stream for
error messages. (The method does not rely on the Info
mchinery for error messages.)
If the routine returns false
the analysis failed,
e.g. because the number of particles was smaller than the minimum number
of jets requested.
After the analysis has been performed, a few ClusterJet
class methods are available to return the result of the analysis:
int ClusterJet::size()
gives the number of jets found, with jets numbered 0 through
size() - 1
,
Vec4 ClusterJet::p(int i)
gives a Vec4
corresponding to the four-momentum defined by
the sum of all the contributing particles to the i'th jet,
int ClusterJet::jetAssignment(int i)
gives the index of the jet that the particle i of the event
record belongs to,
void ClusterJet::list(ostream& os = cout)
provides a listing of the reconstructed jets.
int ClusterJet::distanceSize()
the number of most recent clustering scales that have been stored
for readout with the next method. Normally this would be five,
but less if fewer clustering steps occured.
double ClusterJet::distance(int i)
clustering scales, with distance(0)
being the most
recent one, i.e. normally the highest, up to distance(4)
being the fifth most recent. That is, with n being the final
number of jets, ClusterJet::size()
, the scales at which
n+1 jets become n, n+2 become n+1,
and so on till n+5 become n+4. Nonexisting clustering
scales are returned as zero. The physical interpretation of a scale is
as provided by the respective distance measure (Lund, JADE, Durham).
There is also one method that returns information accumulated for all
the events analyzed so far.
int ClusterJet::nError()
tells the number of times analyze(...)
failed to analyze
events, i.e. returned false
.
CellJet
CellJet
(a.k.a. PYCELL
) is a simple cone jet
finder in the UA1 spirit, see the PYTHIA 6 manual. It works in an
(eta, phi, eT) space, where eta is pseudorapidity,
phi azimuthal angle and eT transverse energy.
It will draw cones in R = sqrt(Delta-eta^2 + Delta-phi^2)
around seed cells. If the total eT inside the cone exceeds
the threshold, a jet is formed, and the cells are removed from further
analysis. There are no split or merge procedures, so later-found jets
may be missing some of the edge regions already used up by previous
ones. Not all particles in the event are assigned to jets; leftovers
may be viewed as belonging to beam remnants or the underlying event.
It is not used by any experimental collaboration, but is closely
related to the more recent and better theoretically motivated
anti-kT algorithm [Cac08].
To do jet finding analyses you have to set up a CellJet
instance, and then feed in events to it, one at a time. Especially note
that, if you want to use the options where energies are smeared in
order so emulate detector imperfections, you must hand in an external
random number generator, preferably the one residing in the
Pythia
class. The results for the latest event are
available as output from a few methods.
CellJet::CellJet(double etaMax = 5., int nEta = 50, int nPhi = 32, int select = 2, int smear = 0, double resolution = 0.5, double upperCut = 2., double threshold = 0., Rndm* rndmPtr = 0)
create a CellJet
instance, where
argument
etaMax (default = 5.
) :
the maximum +-pseudorapidity that the detector is assumed to cover.
argument
nEta (default = 50
) :
the number of equal-sized bins that the +-etaMax range
is assumed to be divided into.
argument
nPhi (default = 32
) :
the number of equal-sized bins that the phi range
+-pi is assumed to be divided into.
argument
select (default = 2
) :
tells which particles are analyzed,
argumentoption
1 : all final-state particles,
argumentoption
2 : all observable final-state particles,
i.e. excluding neutrinos and other particles without strong or
electromagnetic interactions (the isVisible()
particle
method),
and
argumentoption
3 : only charged final-state particles.
argument
smear (default = 0
) :
strategy to smear the actual eT bin by bin,
argumentoption
0 : no smearing,
argumentoption
1 : smear the eT according to a Gaussian
with width resolution * sqrt(eT), with the Gaussian truncated
at 0 and upperCut * eT,
argumentoption
2 : smear the e = eT * cosh(eta) according
to a Gaussian with width resolution * sqrt(e), with the
Gaussian truncated at 0 and upperCut * e.
argument
resolution (default = 0.5
) :
see above.
argument
upperCut (default = 2.
) :
see above.
argument
threshold (default = 0 GeV
) :
completely neglect all bins with an eT < threshold.
argument
rndmPtr (default = 0
) :
the random-number generator used to select the smearing described
above. Must be handed in for smearing to be possible. If your
Pythia
class instance is named pythia
,
then &pythia.rndm
would be the logical choice.
bool CellJet::analyze( const Event& event, double eTjetMin = 20., double coneRadius = 0.7, double eTseed = 1.5, ostream& os = cout)
performs a jet finding analysis, where
argument
event : is an object of the Event
class,
most likely the pythia.event
one.
argument
eTjetMin (default = 20. GeV
) :
is the minimum transverse energy inside a cone for this to be
accepted as a jet.
argument
coneRadius (default = 0.7
) :
is the size of the cone in (eta, phi) space drawn around
the geometric center of the jet.
argument
eTseed (default = 1.5 GeV
) :
the mimimum eT in a cell for this to be acceptable as
the trial center of a jet.
argument
os (default = cout
) : is the output stream for
error messages. (The method does not rely on the Info
mchinery for error messages.)
If the routine returns false
the analysis failed,
but currently this is not foreseen ever to happen.
After the analysis has been performed, a few CellJet
class methods are available to return the result of the analysis:
int CellJet::size()
gives the number of jets found, with jets numbered 0 through
size() - 1
,
double CellJet::eT(i)
gives the eT of the i'th jet, where jets have been
ordered with decreasing eT values,
double CellJet::etaCenter(int i)
double CellJet::phiCenter(int i)
gives the eta and phi coordinates of the geometrical
center of the i'th jet,
double CellJet::etaWeighted(int i)
double CellJet::phiWeighted(int i)
gives the eta and phi coordinates of the
eT-weighted center of the i'th jet,
int CellJet::multiplicity(int i)
gives the number of particles clustered into the i'th jet,
Vec4 CellJet::pMassless(int i)
gives a Vec4
corresponding to the four-momentum defined
by the eT and the weighted center of the i'th jet,
Vec4 CellJet::pMassive(int i)
gives a Vec4
corresponding to the four-momentum defined by
the sum of all the contributing cells to the i'th jet, where
each cell contributes a four-momentum as if all the eT is
deposited in the center of the cell,
double CellJet::m(int i)
gives the invariant mass of the i'th jet, defined by the
pMassive
above,
void CellJet::list()
provides a listing of the above information (except pMassless
,
for reasons of space).
There is also one method that returns information accumulated for all
the events analyzed so far.
int CellJet::nError()
tells the number of times analyze(...)
failed to analyze
events, i.e. returned false
.