RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
experimentP Class Reference

experiment with a fixed particle count: MakeEvent() takes no count. More...

#include <experiment.hpp>

Inheritance diagram for experimentP:
experiment

Public Member Functions

 experimentP (Int_t ninparticle_)
 Experiment that builds events of ninparticle_ particles.
 
void SetNInParticle (Int_t ninparticle_)
 Change the number of particles per event.
 
Int_t GetNInParticle ()
 Number of particles per event.
 
void MakeEvent (particle *p1,...)
 Create a new event from the template and add exactly GetNInParticle() particles.
 
- Public Member Functions inherited from experiment
 experiment ()
 Empty experiment; the template must be set with SetTemplate().
 
 experiment (event *eventT_)
 Experiment with a template.
 
void SetTemplate (event *eventT_)
 Set (or replace) the template event.
 
void MakeEvent (Int_t ninparticle_,...)
 Create a new event as a copy of the template and add particles to it.
 
void OffEvent ()
 Mark the current event as off. The event itself is kept; only an internal flag changes (nothing else reads it).
 
void DelEvent ()
 Mark the current event as off and delete it (with its particles and inspectors).
 
event * GetEvent ()
 The event created by the last MakeEvent() (owned by the experiment's user: see DelEvent()).
 

Private Attributes

Int_t ninparticle =1
 particles per event
 

Detailed Description

experiment with a fixed particle count: MakeEvent() takes no count.

Same template pattern and ownership as experiment. The number of particles per event is stored with the object (default 1), so the call is MakeEvent(p1, p2, ...) with exactly that many pointers.

Definition at line 79 of file experiment.hpp.

Constructor & Destructor Documentation

◆ experimentP()

experimentP::experimentP ( Int_t  ninparticle_)
inline

Experiment that builds events of ninparticle_ particles.

Parameters
ninparticle_number of particles per event

Definition at line 83 of file experiment.hpp.

Member Function Documentation

◆ GetNInParticle()

Int_t experimentP::GetNInParticle ( )
inline

Number of particles per event.

Definition at line 88 of file experiment.hpp.

◆ MakeEvent()

void experimentP::MakeEvent ( particle *  p1,
  ... 
)

Create a new event from the template and add exactly GetNInParticle() particles.

The first particle is always added (even if the count is 0 or negative); the remaining count-1 are read from the variadic list. The number of pointers passed must equal GetNInParticle(): there is no check, a shortfall is undefined behaviour. This hides experiment::MakeEvent. The new event replaces the previous one (not deleted); the particles are owned by the new event.

Parameters
p1first particle (must be non-null)
...the remaining particle* arguments

Definition at line 26 of file experiment.cpp.

◆ SetNInParticle()

void experimentP::SetNInParticle ( Int_t  ninparticle_)
inline

Change the number of particles per event.

Parameters
ninparticle_number of particles per event

Definition at line 86 of file experiment.hpp.

Member Data Documentation

◆ ninparticle

Int_t experimentP::ninparticle =1
private

particles per event

Definition at line 101 of file experiment.hpp.


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