ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtDigitization
AtTestSimulation.cxx
Go to the documentation of this file.
1
#include "
AtTestSimulation.h
"
2
3
#include "
AtSimpleSimulation.h
"
4
5
#include <FairTask.h>
// for InitStatus, kSUCCESS
6
7
#include <Math/Point3D.h>
8
#include <Math/Point3Dfwd.h>
// for Math, XYZPoint
9
#include <Math/Vector3D.h>
10
#include <Math/Vector3Dfwd.h>
// for XYZVector
11
#include <Math/Vector4D.h>
// for LorentzVector
12
#include <Math/Vector4Dfwd.h>
// for PxPyPzEVector
13
14
#include <cmath>
15
using namespace
ROOT::Math;
16
17
InitStatus
AtTestSimulation::Init
()
18
{
19
fSimulation->RegisterBranch();
20
21
return
kSUCCESS;
22
}
23
24
void
AtTestSimulation::Exec
(Option_t *)
25
{
26
fSimulation->NewEvent();
27
28
XYZPoint
pos(0, 0, 500);
29
XYZVector
momDir =
XYZVector
(0, 0, 1).Unit();
30
// Assume Pb208 (mass is 207.93 amu)
31
double
m = 207.93 * 931.4936;
// Mev
32
// Assume initial KE is 35 MeV/u
33
double
E = m + 35 * 207.93;
34
// Grab the momentum
35
double
p = sqrt(E * E - m * m);
36
PxPyPzEVector
mom(momDir.X() * p, momDir.Y() * p, momDir.Z() * p, E);
37
fSimulation->SimulateParticle(82, 208, pos, mom);
38
}
39
40
ClassImp
(
AtTestSimulation
);
AtSimpleSimulation.h
XYZVector
ROOT::Math::XYZVector XYZVector
Definition:
AtFindVertex.h:20
AtTestSimulation
Definition:
AtTestSimulation.h:16
ClassImp
ClassImp(AtTestSimulation)
AtTestSimulation::Exec
virtual void Exec(Option_t *option) override
Definition:
AtTestSimulation.cxx:24
XYZPoint
ROOT::Math::XYZPoint XYZPoint
Definition:
AtPatternCircle2D.h:18
PxPyPzEVector
ROOT::Math::PxPyPzEVector PxPyPzEVector
Definition:
AtMCFission.cxx:48
AtTestSimulation::Init
virtual InitStatus Init() override
Definition:
AtTestSimulation.cxx:17
AtTestSimulation.h
Generated on Sat Nov 11 2023 15:30:37 for ATTPCROOT by
1.8.18