BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
MpdRainGenerator.cxx
Go to the documentation of this file.
1#include "MpdRainGenerator.h"
2
3#include "FairPrimaryGenerator.h"
4
5#include <TMath.h>
6#include <iostream>
7
9 : _PDGType(-1)
10 , _N(0)
11 , _p(0)
12 , _theta(0)
13 , _phi(0)
14 , _height(0)
15 , _d(-1)
16{}
17
19 Double_t p,
20 Double_t theta,
21 Double_t phi,
22 Double_t d,
23 Double_t height,
24 Int_t n)
25 : _PDGType(pdgid)
26 , _N(n)
27 , _p(p)
28 , _theta(theta)
29 , _phi(phi)
30 , _height(height)
31 , _d(d)
32{}
33
34Bool_t MpdRainGenerator::ReadEvent(FairPrimaryGenerator* primGen)
35{
36
37 // Check for particle type
38 if (_PDGType == -1)
39 Fatal("MpdRainGenerator", "PDG code not defined.");
40
41 for (int i = -_N; i < _N; i++)
42 for (int j = -_N; j < _N; j++) {
43 TVector3 point(i * _d, j * _d, _height);
44 point.RotateY(_theta);
45 point.RotateZ(_phi);
46
47 TVector3 m;
48 m.SetMagThetaPhi(_p, _theta, _phi);
49 m = -m;
50
51 primGen->AddTrack(_PDGType, m.X(), m.Y(), m.Z(), point.X(), point.Y(), point.Z());
52 }
53
54 return kTRUE;
55}
int i
Definition P4_F32vec4.h:22
__m128 m
Definition P4_F32vec4.h:27
bool Bool_t
int Int_t
double Double_t
constexpr Bool_t kTRUE
void Fatal(const char *location, const char *msgfmt,...)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
Double_t Z() const
Double_t Y() const
void RotateZ(Double_t)
Double_t X() const
void RotateY(Double_t)
*brief user defined string literal for JSON values *sa std::size_t n
Definition json.hpp:20362