|
RooParticle
Particle scattering simulator with ROOT
|
Inspector on a pair of particles. More...
#include <inspector.hpp>
Public Member Functions | |
| inspectorP (particle *p1_, particle *p2_, TString method_, Double_t val_=-1) | |
| Make an inspector on two particles, method by name. | |
| inspectorP (particle *p1_, particle *p2_, methodID method_, Double_t val_=-1) | |
| Make an inspector on two particles, method by enumerator (see above). | |
| Bool_t | Inspect () |
| Whether the condition is satisfied now. | |
| Double_t | Evaluate () |
| The compared quantity: cosine, angle (degree or radian), step count, relative speed (c), distance (fm) or radial velocity (c). NaN for a zero vector (angle, cosine, radial velocity); for an invalid method it prints a message and gives 0. | |
| Bool_t | IsValid () |
| Whether the method is one of the inspectorP methods. | |
| void | SetParticles (particle *p1_, particle *p2_) |
| Set both particles. | |
| void | SetParticle1 (particle *p1_) |
| Set the first particle. | |
| void | SetParticle2 (particle *p2_) |
| Set the second particle. | |
| particle * | GetParticle1 () |
| The first particle. | |
| particle * | GetParticle2 () |
| The second particle. | |
| TString | Print (Bool_t particles=kFALSE, Bool_t mechanics=kFALSE, Bool_t mute=kFALSE, Bool_t pprint=kFALSE) |
| Describe as text "[ Inspector Particle: MTD, CRT (criterion), VAL (value), RST (result) ]". | |
| Bool_t | SetInitial_D (Bool_t index=0, TString mtd="", Double_t var=0.1) |
| Move one particle back along its velocity so that the present condition is the one of the given angle (setting the initial position from the present state). | |
| Bool_t | IsInspectorP () |
| Always kTRUE. | |
Public Member Functions inherited from inspector | |
| inspector () | |
| Make an inspector without method (invalid until SetMethod()). | |
| virtual | ~inspector () |
| void | SetValue (Double_t val_) |
| Set the criterion value to compare with (in the unit of the quantity). | |
| void | SetMethod (TString methodname) |
| Set the method by name. | |
| void | SetMethod (const char *methodname) |
| Set the method by C string (see SetMethod(TString)). | |
| void | SetMethod (methodID id_) |
| Set the method by identifier. | |
| TString | GetMethod () |
| The method name as given. | |
| methodID | GetMethodID () |
| The method identifier (kInvalid for an unknown name). | |
| Double_t | GetCriterion () |
| The criterion value (default -1). | |
| void | SetAbort (Bool_t abort_=kTRUE) |
| Make this inspector an abort inspector. | |
| Bool_t | IsAbort () |
| Whether this is an abort inspector. | |
| virtual Bool_t | IsInspectorE () |
| Whether this is an inspectorE. | |
Protected Member Functions | |
| Bool_t | IsDegenerate (Bool_t needV=kTRUE) |
| Whether dX (or, if needV, dV) is the zero vector. | |
| Double_t | CalculateCosine () |
| Cosine of the angle between dX and dV, clamped to [-1, 1] (NaN for a zero vector). | |
| Double_t | CalculateAngle (Bool_t rad=kFALSE) |
| Angle between dX and dV in degree (radian if rad), NaN for a zero vector. | |
| Long_t | CountDeriving () |
| Smaller of the step counts of the two particles. | |
| Double_t | CaculateSPD () |
| Relative speed, norm of dV (c). | |
| Double_t | CalculateDistance () |
| Distance, norm of dX (fm). | |
| Double_t | CalculateRadialVelocity () |
| dX.dV/norm(dX) (c), positive when receding; NaN if dX = 0. | |
Private Attributes | |
| particle * | p1 |
| particle * | p2 |
| the two particles (not owned) | |
Additional Inherited Members | |
Public Types inherited from inspector | |
| enum | methodID { kInvalid = 0 , kCOS , kDEG , kRAD , kCNT , kSPDG , kSPDL , kDSTG , kDSTL , kVRG , kVRL , kKEG , kKEL , kPEG , kPEL , kPKG , kPKL , kEDG , kEDL , kTMG , kTML , kDXG , kDXL , kDNG , kDNL , kDSG , kDSL , kACG , kACL , kVOUT , kVOUTA , kASYD , kASYV } |
| Method identifier. More... | |
Static Public Member Functions inherited from inspector | |
| static methodID | ParseMethod (TString name) |
| Parse a method name. | |
| static TString | MethodName (methodID id) |
| Name of a method identifier. | |
Protected Attributes inherited from inspector | |
| TString | ftn ="" |
| method name as given | |
| methodID | mtd =kInvalid |
| parsed method | |
| Double_t | val =-1 |
| criterion value | |
| Bool_t | abort =kFALSE |
| abort inspector | |
Inspector on a pair of particles.
dX and dV are the relative position (fm) and velocity (c) of the two particles, \(\vec{dX} = \vec x_1 - \vec x_2\). With many bodies, each inspectorP looks only at its own two particles; the other bodies are ignored.
| Method | Satisfied when |
|---|---|
"COS" | cosine of the angle between dX and dV is less than the value |
"DEG" | angle between dX and dV, in degree, is less than the value |
"RAD" | angle between dX and dV, in radian, is less than the value |
"CNT" | number of derived steps is greater than the value |
"SPDG" | relative speed (norm of dV) is greater than the value |
"SPDL" | relative speed (norm of dV) is less than the value |
"DSTG" | distance (norm of dX) is greater than the value |
"DSTL" | distance (norm of dX) is less than the value |
"VRG" | radial velocity dX.dV/norm(dX) is greater than the value (value 0 : receding) |
"VRL" | radial velocity dX.dV/norm(dX) is less than the value (value 0 : approaching) |
The enumerators are kCOS kDEG kRAD kCNT kSPDG kSPDL kDSTG kDSTL kVRG kVRL (inspector::methodID), so new inspectorP(p1, p2, inspector::kDEG, 1) is the same as new inspectorP(p1, p2, "DEG", 1).
The angle is \(\mathrm{atan2}(|\vec{dX}\times\vec{dV}|, \vec{dX}\cdot\vec{dV})\) : accurate also near 0 and 180 degree (acos of the cosine is not). "COS" is clamped to [-1, 1]. A small "DEG" means dX and dV are parallel, i.e. the particles fly apart: it is the asymptote condition after a scattering. "CNT" is the smaller of the step counts of the two particles (an invincible particle counts steps too).
Definition at line 185 of file inspector.hpp.
Make an inspector on two particles, method by name.
| p1_ | first particle (of the event) |
| p2_ | second particle (of the event) |
| method_ | method name, see the table |
| val_ | criterion value (angle in degree for "DEG", radian for "RAD", distance in fm, speed in c, count for "CNT") |
The particles must belong to the event the inspector is added to (event::event(event&) relinks it by index).
Definition at line 54 of file inspector.cpp.
Make an inspector on two particles, method by enumerator (see above).
Definition at line 60 of file inspector.cpp.
|
protected |
Relative speed, norm of dV (c).
Definition at line 140 of file inspector.cpp.
|
protected |
Angle between dX and dV in degree (radian if rad), NaN for a zero vector.
Definition at line 131 of file inspector.cpp.
|
protected |
Cosine of the angle between dX and dV, clamped to [-1, 1] (NaN for a zero vector).
Definition at line 122 of file inspector.cpp.
|
protected |
Distance, norm of dX (fm).
Definition at line 110 of file inspector.cpp.
|
protected |
dX.dV/norm(dX) (c), positive when receding; NaN if dX = 0.
Definition at line 114 of file inspector.cpp.
|
protected |
Smaller of the step counts of the two particles.
Definition at line 144 of file inspector.cpp.
|
virtual |
The compared quantity: cosine, angle (degree or radian), step count, relative speed (c), distance (fm) or radial velocity (c). NaN for a zero vector (angle, cosine, radial velocity); for an invalid method it prints a message and gives 0.
Reimplemented from inspector.
Definition at line 66 of file inspector.cpp.
|
inline |
The first particle.
Definition at line 222 of file inspector.hpp.
|
inline |
The second particle.
Definition at line 224 of file inspector.hpp.
|
virtual |
Whether the condition is satisfied now.
Reimplemented from inspector.
Definition at line 85 of file inspector.cpp.
|
protected |
Whether dX (or, if needV, dV) is the zero vector.
Definition at line 103 of file inspector.cpp.
|
inlinevirtual |
|
virtual |
Whether the method is one of the inspectorP methods.
Reimplemented from inspector.
Definition at line 81 of file inspector.cpp.
|
virtual |
Describe as text "[ Inspector Particle: MTD, CRT (criterion), VAL (value), RST (result) ]".
| particles | kTRUE also prints the two particles |
| mechanics | not used |
| mute | kFALSE (default) also prints to stdout |
| pprint | not used |
Reimplemented from inspector.
Definition at line 214 of file inspector.cpp.
| Bool_t inspectorP::SetInitial_D | ( | Bool_t | index = 0, |
| TString | mtd = "", |
||
| Double_t | var = 0.1 |
||
| ) |
Move one particle back along its velocity so that the present condition is the one of the given angle (setting the initial position from the present state).
| index | false : move p2 ; true : move p1 |
| mtd | "COS", "DEG" or "RAD" (empty : the method of the inspector) |
| var | the target angle margin |
(p0_->GetV().Norm2Sqr()));
Definition at line 149 of file inspector.cpp.
|
inline |
Set the first particle.
Definition at line 217 of file inspector.hpp.
|
inline |
Set the second particle.
Definition at line 219 of file inspector.hpp.
Set both particles.
Definition at line 215 of file inspector.hpp.
|
private |
Definition at line 267 of file inspector.hpp.
|
private |
the two particles (not owned)
Definition at line 267 of file inspector.hpp.