|
RooParticle
Particle scattering simulator with ROOT
|
Inspector : one terminating condition of event::DeriveInspect(). More...
#include <inspector.hpp>
Public Types | |
| 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... | |
Public Member Functions | |
| inspector () | |
| Make an inspector without method (invalid until SetMethod()). | |
| virtual | ~inspector () |
| virtual Bool_t | Inspect () |
| Whether the condition is satisfied now (the base class : never). | |
| virtual Double_t | Evaluate () |
| The quantity that is compared with the criterion (the base class : 0). | |
| virtual Bool_t | IsValid () |
| Whether the method name is defined for this kind of inspector (the base class : never). | |
| 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 TString | Print (Bool_t element=kFALSE, Bool_t mechanics=kFALSE, Bool_t mute=kFALSE, Bool_t pprint=kFALSE) |
| Describe the inspector as text (the base class : empty). | |
| virtual Bool_t | IsInspectorP () |
| Whether this is an inspectorP. | |
| virtual Bool_t | IsInspectorE () |
| Whether this is an inspectorE. | |
Static Public Member Functions | |
| static methodID | ParseMethod (TString name) |
| Parse a method name. | |
| static TString | MethodName (methodID id) |
| Name of a method identifier. | |
Protected Attributes | |
| TString | ftn ="" |
| method name as given | |
| methodID | mtd =kInvalid |
| parsed method | |
| Double_t | val =-1 |
| criterion value | |
| Bool_t | abort =kFALSE |
| abort inspector | |
Inspector : one terminating condition of event::DeriveInspect().
The event stops when its inspectors are satisfied. Normal inspectors are combined by event::SetInspectMode(): AND by default (all must be satisfied), or OR (any). The AND default is the design: for example "the particle reached the asymptote (angle between dX and dV below a value) AND went through a minimum number of steps". An inspector set as abort (SetAbort()) stops the event by itself, whatever the others say (close encounter, numerical failure, ...).
Two kinds exist: inspectorP looks at two chosen particles, and inspectorE at the whole event (all particles). In an event with many bodies one can add several inspectorP, for different pairs, and inspectorE together; they are all combined by the inspect mode. The inspector is owned by the event it was added to.
The method is a name ("DEG", ...) or the equal enumerator (methodID). The comparison direction is in the name: a trailing G means greater than the value, L less than. An unknown name is accepted when set but gives kInvalid, and event::DeriveInspect() then refuses to start.
Definition at line 28 of file inspector.hpp.
| enum inspector::methodID |
Method identifier.
The string names (in the tables of inspectorP and inspectorE) and these enumerators are the same thing : "DEG" is kDEG, ... An inspectorP accepts the first group, an inspectorE the second. kInvalid is what an unknown name is parsed to.
| Enumerator | |
|---|---|
| kInvalid | unknown method name |
| kCOS | "COS": cosine of the angle between dX and dV < value |
| kDEG | "DEG": angle between dX and dV in degree < value |
| kRAD | "RAD": angle between dX and dV in radian < value |
| kCNT | "CNT": number of derived steps > value |
| kSPDG | "SPDG": relative speed > value |
| kSPDL | "SPDL": relative speed < value |
| kDSTG | "DSTG": distance > value |
| kDSTL | "DSTL": distance < value |
| kVRG | "VRG": radial velocity > value |
| kVRL | "VRL": radial velocity < value |
| kKEG | "KEG": net kinetic energy > value |
| kKEL | "KEL": net kinetic energy < value |
| kPEG | "PEG": net potential energy > value |
| kPEL | "PEL": net potential energy < value |
| kPKG | "PKG": abs(net PE / net KE) > value |
| kPKL | "PKL": abs(net PE / net KE) < value |
| kEDG | "EDG": relative drift of the net energy > value |
| kEDL | "EDL": relative drift of the net energy < value |
| kTMG | "TMG": evolved time > value |
| kTML | "TML": evolved time < value |
| kDXG | "DXG": largest step count > value |
| kDXL | "DXL": smallest step count < value (Evaluate() gives the largest, see inspectorE) |
| kDNG | "DNG": largest step count > value (Evaluate() gives the smallest, see inspectorE) |
| kDNL | "DNL": smallest step count < value |
| kDSG | "DSG": smallest distance between two particles > value |
| kDSL | "DSL": smallest distance between two particles < value |
| kACG | "ACG": largest acceleration > value |
| kACL | "ACL": largest acceleration < value |
| kVOUT | "VOUT": any moving particle is outside the volume |
| kVOUTA | "VOUTA": all moving particles are outside the volume |
| kASYD | "ASYD": remaining deflection of every moving particle < value (rad), all pairs receding |
| kASYV | "ASYV": remaining relative velocity change of every moving particle < value, all pairs receding |
Definition at line 35 of file inspector.hpp.
|
inline |
Make an inspector without method (invalid until SetMethod()).
Definition at line 83 of file inspector.hpp.
|
inlinevirtual |
Definition at line 84 of file inspector.hpp.
|
inlinevirtual |
The quantity that is compared with the criterion (the base class : 0).
Reimplemented in inspectorP, and inspectorE.
Definition at line 90 of file inspector.hpp.
|
inline |
The criterion value (default -1).
Definition at line 118 of file inspector.hpp.
|
inline |
The method name as given.
Definition at line 112 of file inspector.hpp.
|
inline |
The method identifier (kInvalid for an unknown name).
Definition at line 115 of file inspector.hpp.
|
inlinevirtual |
Whether the condition is satisfied now (the base class : never).
Reimplemented in inspectorP, and inspectorE.
Definition at line 87 of file inspector.hpp.
|
inline |
Whether this is an abort inspector.
Definition at line 125 of file inspector.hpp.
|
inlinevirtual |
Whether this is an inspectorE.
Reimplemented in inspectorE.
Definition at line 138 of file inspector.hpp.
|
inlinevirtual |
Whether this is an inspectorP.
Reimplemented in inspectorP.
Definition at line 135 of file inspector.hpp.
|
inlinevirtual |
Whether the method name is defined for this kind of inspector (the base class : never).
Reimplemented in inspectorP, and inspectorE.
Definition at line 93 of file inspector.hpp.
|
static |
Name of a method identifier.
Definition at line 47 of file inspector.cpp.
|
static |
Parse a method name.
| name | e.g. "DEG" (exact, upper case) |
Definition at line 40 of file inspector.cpp.
|
virtual |
Describe the inspector as text (the base class : empty).
| element | kTRUE : include the particles (inspectorP) |
| mechanics | not used |
| mute | kFALSE (default) also prints to stdout |
| pprint | not used |
Reimplemented in inspectorE, and inspectorP.
Definition at line 208 of file inspector.cpp.
|
inline |
Make this inspector an abort inspector.
| abort_ | kTRUE (default): when satisfied it stops the event by itself, whatever the others say. |
Definition at line 122 of file inspector.hpp.
|
inline |
Set the method by C string (see SetMethod(TString)).
Definition at line 106 of file inspector.hpp.
|
inline |
Set the method by identifier.
Definition at line 109 of file inspector.hpp.
|
inline |
Set the method by name.
| methodname | e.g. "DEG" |
The name is parsed once here; Inspect()/Evaluate() dispatch on the enumerator. An unknown name is kept as it is (GetMethod() returns it) but gives kInvalid.
Definition at line 103 of file inspector.hpp.
|
inline |
Set the criterion value to compare with (in the unit of the quantity).
Definition at line 96 of file inspector.hpp.
|
protected |
abort inspector
Definition at line 144 of file inspector.hpp.
|
protected |
method name as given
Definition at line 141 of file inspector.hpp.
parsed method
Definition at line 142 of file inspector.hpp.
|
protected |
criterion value
Definition at line 143 of file inspector.hpp.