-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First description of the interface (#8)
* First description of the interface * added method that returns the preferred coordinate syste, * fixed doc on interface --------- Co-authored-by: Mikhail Mikhasenko <mikhail.mikhasenko@cern.ch>
- Loading branch information
1 parent
7c237b5
commit 8b2f2d2
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# [Interface](@id interface) | ||
|
||
## Implementation | ||
|
||
This section explains how the object can become a `LorentzVector`. A type `MyLorentzVector` will comply to the `LorentzVector` interface if one of the following et of methods is implemented. | ||
|
||
### Option 1: position with cartesian coordinates | ||
|
||
| Required Methods | Brief Description | | ||
|--------------------------------------------------------------|-------------------------------------------------| | ||
| `LorentzVectorBase.islorentzvector(::Type{MyLorentzVector})` | Declare that your type implements the interface | | ||
| `LorentzVectorBase.coordinatesystem(::Type{MyLorentzVector}) = LorentzVectorBase.XYZE` | Declare the preferred coordinated system | | ||
| `LorentzVectorBase.x(::Tupe{MyLorentzVector})` | x cartesian coordinate | | ||
| `LorentzVectorBase.y(::Tupe{MyLorentzVector})` | y cartesian coordinate | | ||
| `LorentzVectorBase.z(::Tupe{MyLorentzVector})` | z cartesian coordinate | | ||
| `LorentzVectorBase.t(::Tupe{MyLorentzVector})` | t cartesian coordinate | | ||
| | | | ||
|
||
|
||
### Option 2: four-momentum with catesian coordinates | ||
|
||
| Required Methods | Brief Description | | ||
|--------------------------------------------------------------|-------------------------------------------------| | ||
| `LorentzVectorBase.islorentzvector(::Type{MyLorentzVector})` | Declare that your type implements the interface | | ||
| `LorentzVectorBase.coordinatesystem(::Type{MyLorentzVector}) = LorentzVectorBase.XYZE` | Declare the preferred coordinated system | | ||
| `LorentzVectorBase.px(::Tupe{MyLorentzVector})` | x cartesian coordinate | | ||
| `LorentzVectorBase.py(::Tupe{MyLorentzVector})` | y cartesian coordinate | | ||
| `LorentzVectorBase.pz(::Tupe{MyLorentzVector})` | z cartesian coordinate | | ||
| `LorentzVectorBase.pt(::Tupe{MyLorentzVector})` | t cartesian coordinate | | ||
| | | | ||
|
||
### Option 3 four-momentum with cylindrical coordinates | ||
|
||
| Required Methods | Brief Description | | ||
|--------------------------------------------------------------|-------------------------------------------------| | ||
| `LorentzVectorBase.islorentzvector(::Type{MyLorentzVector})` | Declare that your type implements the interface | | ||
| `LorentzVectorBase.coordinatesystem(::Type{MyLorentzVector})`| Declare the preferred coordinated system. Must return PtEtaPhiM, PtEtaPhiE, PtYPhiM, or PtYPhiE (from LorentzVectorBase).| | ||
| `LorentzVectorBase.pt(::Tupe{MyLorentzVector})` | x cartesian coordinate | | ||
| `LorentzVectorBase.phi(::Tupe{MyLorentzVector})` | z cartesian coordinate | | ||
|
||
<br> | ||
and *one of* | ||
|
||
| | | | ||
|---|---| | ||
| `LorentzVectorBase.eta(::Tupe{MyLorentzVector})` | y cartesian coordinate | | ||
| `LorentzVectorBase.rapidity(::Tupe{MyLorentzVector})` | y cartesian coordinate | | ||
|
||
<br> | ||
and *one of* | ||
|
||
| | | | ||
|-|-| | ||
| `LorentzVectorBase.energy(::Tupe{MyLorentzVector})` | energy | | ||
| `LorentzVectorBase.mass(::Tupe{MyLorentzVector})` | invariant mass | | ||
|
||
The methods that returns the coordinates of the prefered system (returned by `coordinatesystem()`) must be implemented. | ||
|
||
## Optional methods | ||
|
||
| | | | ||
|-|-| | ||
| `LorentzVectorBase.mass2(::MyType{MyLorentzVector})` | mass to the square | | ||
| `LorentzVectorBase.spatial_magnitude2(::MyType{MyLorentzVector})` | mass to the square | | ||
| Any of the above method i.e, a method of option Y when methods of option X are provided || | ||
|
||
======= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters