RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
experiment.hpp
Go to the documentation of this file.
1
3
4#ifndef H_EXPERIMENT
5#define H_EXPERIMENT 1;
6
7#include "TROOT.h"
8#include "particle.hpp"
9#include "event.hpp"
10
11#include "iostream"
12#include "cstdarg"
13
38public:
43 experiment(event* eventT_);
46 void SetTemplate(event* eventT_){eventT=eventT_;}
57 void MakeEvent(Int_t ninparticle_, ...);
59 void OffEvent(){eventOn=false;}
62 void DelEvent(){eventOn=false; delete currentEvent; currentEvent=nullptr;}
64 event* GetEvent(){return currentEvent;}
65
66 friend class experimentP;
67protected:
68private:
69 event * eventT = nullptr;
70 Bool_t eventOn = false;
71 event * currentEvent = nullptr;
72};
73
79class experimentP: public experiment{
80public:
83 experimentP(Int_t ninparticle_){ninparticle=ninparticle_;}
86 void SetNInParticle(Int_t ninparticle_){ninparticle = ninparticle_;}
88 Int_t GetNInParticle(){return ninparticle;}
99 void MakeEvent(particle* p1, ...);
100private:
101 Int_t ninparticle=1;
102};
103
104
105#endif
One simulated system: particles, pairwise forces, inspectors and the time integration.
Definition event.hpp:93
experiment with a fixed particle count: MakeEvent() takes no count.
experimentP(Int_t ninparticle_)
Experiment that builds events of ninparticle_ particles.
void MakeEvent(particle *p1,...)
Create a new event from the template and add exactly GetNInParticle() particles.
void SetNInParticle(Int_t ninparticle_)
Change the number of particles per event.
Int_t ninparticle
particles per event
Int_t GetNInParticle()
Number of particles per event.
Makes a fresh event for each run from a template event.
void MakeEvent(Int_t ninparticle_,...)
Create a new event as a copy of the template and add particles to it.
Definition experiment.cpp:9
event * GetEvent()
The event created by the last MakeEvent() (owned by the experiment's user: see DelEvent()).
event * eventT
template event, not owned
void DelEvent()
Mark the current event as off and delete it (with its particles and inspectors).
Bool_t eventOn
true after MakeEvent(), false after OffEvent()/DelEvent(); informational only
experiment()
Empty experiment; the template must be set with SetTemplate().
void SetTemplate(event *eventT_)
Set (or replace) the template event.
event * currentEvent
last created event (heap)
void OffEvent()
Mark the current event as off. The event itself is kept; only an internal flag changes (nothing else ...
A point body with mass, position, velocity, step count, time and an optional recorded path.
Definition particle.hpp:36