RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
inspector Class Reference

Inspector : one terminating condition of event::DeriveInspect(). More...

#include <inspector.hpp>

Inheritance diagram for inspector:
inspectorE inspectorP

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
 

Detailed Description

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.

Member Enumeration Documentation

◆ 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.

Constructor & Destructor Documentation

◆ inspector()

inspector::inspector ( )
inline

Make an inspector without method (invalid until SetMethod()).

Definition at line 83 of file inspector.hpp.

◆ ~inspector()

virtual inspector::~inspector ( )
inlinevirtual

Definition at line 84 of file inspector.hpp.

Member Function Documentation

◆ Evaluate()

virtual Double_t inspector::Evaluate ( )
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.

◆ GetCriterion()

Double_t inspector::GetCriterion ( )
inline

The criterion value (default -1).

Definition at line 118 of file inspector.hpp.

◆ GetMethod()

TString inspector::GetMethod ( )
inline

The method name as given.

Definition at line 112 of file inspector.hpp.

◆ GetMethodID()

methodID inspector::GetMethodID ( )
inline

The method identifier (kInvalid for an unknown name).

Definition at line 115 of file inspector.hpp.

◆ Inspect()

virtual Bool_t inspector::Inspect ( )
inlinevirtual

Whether the condition is satisfied now (the base class : never).

Reimplemented in inspectorP, and inspectorE.

Definition at line 87 of file inspector.hpp.

◆ IsAbort()

Bool_t inspector::IsAbort ( )
inline

Whether this is an abort inspector.

Definition at line 125 of file inspector.hpp.

◆ IsInspectorE()

virtual Bool_t inspector::IsInspectorE ( )
inlinevirtual

Whether this is an inspectorE.

Reimplemented in inspectorE.

Definition at line 138 of file inspector.hpp.

◆ IsInspectorP()

virtual Bool_t inspector::IsInspectorP ( )
inlinevirtual

Whether this is an inspectorP.

Reimplemented in inspectorP.

Definition at line 135 of file inspector.hpp.

◆ IsValid()

virtual Bool_t inspector::IsValid ( )
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.

◆ MethodName()

TString inspector::MethodName ( methodID  id)
static

Name of a method identifier.

Returns
the name, "" for kInvalid.

Definition at line 47 of file inspector.cpp.

◆ ParseMethod()

inspector::methodID inspector::ParseMethod ( TString  name)
static

Parse a method name.

Parameters
namee.g. "DEG" (exact, upper case)
Returns
the identifier, kInvalid if unknown.

Definition at line 40 of file inspector.cpp.

◆ Print()

TString inspector::Print ( Bool_t  element = kFALSE,
Bool_t  mechanics = kFALSE,
Bool_t  mute = kFALSE,
Bool_t  pprint = kFALSE 
)
virtual

Describe the inspector as text (the base class : empty).

Parameters
elementkTRUE : include the particles (inspectorP)
mechanicsnot used
mutekFALSE (default) also prints to stdout
pprintnot used

Reimplemented in inspectorE, and inspectorP.

Definition at line 208 of file inspector.cpp.

◆ SetAbort()

void inspector::SetAbort ( Bool_t  abort_ = kTRUE)
inline

Make this inspector an abort inspector.

Parameters
abort_kTRUE (default): when satisfied it stops the event by itself, whatever the others say.

Definition at line 122 of file inspector.hpp.

◆ SetMethod() [1/3]

void inspector::SetMethod ( const char *  methodname)
inline

Set the method by C string (see SetMethod(TString)).

Definition at line 106 of file inspector.hpp.

◆ SetMethod() [2/3]

void inspector::SetMethod ( methodID  id_)
inline

Set the method by identifier.

Definition at line 109 of file inspector.hpp.

◆ SetMethod() [3/3]

void inspector::SetMethod ( TString  methodname)
inline

Set the method by name.

Parameters
methodnamee.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.

◆ SetValue()

void inspector::SetValue ( Double_t  val_)
inline

Set the criterion value to compare with (in the unit of the quantity).

Definition at line 96 of file inspector.hpp.

Member Data Documentation

◆ abort

Bool_t inspector::abort =kFALSE
protected

abort inspector

Definition at line 144 of file inspector.hpp.

◆ ftn

TString inspector::ftn =""
protected

method name as given

Definition at line 141 of file inspector.hpp.

◆ mtd

methodID inspector::mtd =kInvalid
protected

parsed method

Definition at line 142 of file inspector.hpp.

◆ val

Double_t inspector::val =-1
protected

criterion value

Definition at line 143 of file inspector.hpp.


The documentation for this class was generated from the following files: