RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
eventVolume.cpp
Go to the documentation of this file.
1#include "TROOT.h"
2#include "TVector3.h"
3#include "eventVolume.hpp"
4
7
8eventVGeneral::eventVGeneral(Double_t xmin, Double_t xmax,
9 Double_t ymin, Double_t ymax,
10 Double_t zmin, Double_t zmax): eventVolume(){
11 // Double_t bottom_[] = {xmin, ymin, zmin};
12 // bottom = TVector3(3, bottom_);
13 bottom[0] = xmin;
14 bottom[1] = ymin;
15 bottom[2] = zmin;
16 // Double_t top_[] = {xmax, ymax, zmax};
17 // top = TVector3(3, top_);
18 top[0] = xmax;
19 top[1] = ymax;
20 top[2] = zmax;
21}
22
24 Double_t ylen,
25 Double_t zlen):
26 eventVGeneral(-1*xlen/2, xlen/2,
27 -1*ylen/2, ylen/2,
28 -1*zlen/2, zlen/2) {
29 // Box centered at the origin.
30}
31
32Bool_t eventVGeneral::Inside(TVector3 position){
33 Double_t x, y, z;
34 x = position[0];
35 y = position[1];
36 z = position[2];
37
38 if(bottom[0] > x || top[0] < x){
39 return false;
40 }
41 if(bottom[1] > y || top[1] < y){
42 return false;
43 }
44 if(bottom[2] > z || top[2] < z){
45 return false;
46 }
47 return true;
48}
Axis-aligned box.
eventVGeneral(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
Box from its two corners.
TVector3 bottom
lower corner (xmin, ymin, zmin) in fm
TVector3 top
upper corner (xmax, ymax, zmax) in fm
Bool_t Inside(TVector3 position)
Is the point inside the box (boundary included)?
Base class of event volumes: the region in which an event is "alive".
eventVolume()
Create the volume (nothing to initialise).
Spatial region attached to an event (eventVolume, eventVGeneral).