Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
9f2ddf5f
Commit
9f2ddf5f
authored
8 years ago
by
Olivier Couet
Browse files
Options
Downloads
Patches
Plain Diff
Apply the patch suggested here:
https://root.cern.ch/phpBB3/viewtopic.php?p=102250#p102250
parent
f480eabf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
montecarlo/eg/inc/TParticle.h
+21
-0
21 additions, 0 deletions
montecarlo/eg/inc/TParticle.h
with
21 additions
and
0 deletions
montecarlo/eg/inc/TParticle.h
+
21
−
0
View file @
9f2ddf5f
...
...
@@ -86,6 +86,7 @@ public:
// virtual TString* Name () const { return fName.Data(); }
// virtual char* GetName() const { return fName.Data(); }
Double_t
Ek
()
const
{
return
fE
-
fCalcMass
;
}
Int_t
GetStatusCode
()
const
{
return
fStatusCode
;
}
Int_t
GetPdgCode
()
const
{
return
fPdgCode
;
}
Int_t
GetFirstMother
()
const
{
return
fMother
[
0
];
}
...
...
@@ -104,9 +105,29 @@ public:
Int_t
Beauty
()
const
;
Int_t
Charm
()
const
;
Int_t
Strangeness
()
const
;
Double_t
PhiX
()
const
{
return
TMath
::
Pi
()
+
TMath
::
ATan2
(
-
fPz
,
-
fPy
);
}
// note that PhiX() returns an angle between 0 and 2pi
Double_t
PhiY
()
const
{
return
TMath
::
Pi
()
+
TMath
::
ATan2
(
-
fPx
,
-
fPz
);
}
// note that PhiY() returns an angle between 0 and 2pi
Double_t
PhiZ
()
const
{
return
TMath
::
Pi
()
+
TMath
::
ATan2
(
-
fPy
,
-
fPx
);
}
// note that PhiZ() returns an angle between 0 and 2pi
Double_t
ThetaX
()
const
{
return
(
fPx
==
0
)
?
TMath
::
PiOver2
()
:
TMath
::
ACos
(
fPx
/
P
());
}
Double_t
ThetaY
()
const
{
return
(
fPy
==
0
)
?
TMath
::
PiOver2
()
:
TMath
::
ACos
(
fPy
/
P
());
}
Double_t
ThetaZ
()
const
{
return
(
fPz
==
0
)
?
TMath
::
PiOver2
()
:
TMath
::
ACos
(
fPz
/
P
());
}
Double_t
GetPolarTheta
()
const
{
return
fPolarTheta
;
}
Double_t
GetPolarPhi
()
const
{
return
fPolarPhi
;
}
void
GetPolarisation
(
Double_t
&
theta
,
Double_t
&
phi
)
const
{
theta
=
fPolarTheta
;
phi
=
fPolarPhi
;
}
void
SetPolarTheta
(
Double_t
theta
)
{
fPolarTheta
=
theta
;
}
void
SetPolarPhi
(
Double_t
phi
)
{
fPolarPhi
=
phi
;
}
void
SetPolarisation
(
Double_t
theta
,
Double_t
phi
)
{
fPolarTheta
=
theta
;
fPolarPhi
=
phi
;
}
void
Momentum
(
TLorentzVector
&
v
)
const
{
v
.
SetPxPyPzE
(
fPx
,
fPy
,
fPz
,
fE
);
}
void
ProductionVertex
(
TLorentzVector
&
v
)
const
{
v
.
SetXYZT
(
fVx
,
fVy
,
fVz
,
fVt
);
}
Double_t
Theta
(
const
TParticle
&
p
)
// Returns the angle between momenta of particles
{
Double_t
v
=
P
()
*
p
.
P
();
if
(
v
==
0
)
v
=
1
;
else
v
=
(
fPx
*
p
.
Px
()
+
fPy
*
p
.
Py
()
+
fPz
*
p
.
Pz
())
/
v
;
if
(
v
>
1
)
v
=
1
;
else
if
(
v
<
-
1
)
v
=
-
1
;
// just a precaution
return
TMath
::
ACos
(
v
);
}
// ****** redefine several most oftenly used methods of LORENTZ_VECTOR
Double_t
Vx
()
const
{
return
fVx
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment