BmnRoot
Loading...
Searching...
No Matches
MpdRainGenerator.cxx
Go to the documentation of this file.
1#include "MpdRainGenerator.h"
2#include <TMath.h>
3#include "FairPrimaryGenerator.h"
4
5#include <iostream>
6
8: _PDGType(-1),
9 _N(0),
10 _p(0),
11 _theta(0),
12 _phi(0),
13 _height(0),
14 _d(-1)
15{}
16
17MpdRainGenerator::MpdRainGenerator(Int_t pdgid, Double_t p, Double_t theta, Double_t phi,
18 Double_t d, Double_t height, Int_t n)
19: _PDGType(pdgid),
20 _N(n),
21 _p(p),
22 _theta(theta),
23 _phi(phi),
24 _height(height),
25 _d(d)
26{}
27
28Bool_t MpdRainGenerator::ReadEvent(FairPrimaryGenerator* primGen) {
29
30 // Check for particle type
31 if ( _PDGType == -1 )
32 Fatal("MpdRainGenerator","PDG code not defined.");
33
34 for(int i = -_N; i < _N; i++)
35 for(int j = -_N; j < _N; j++)
36 {
37 TVector3 point(i*_d, j*_d, _height);
38 point.RotateY(_theta);
39 point.RotateZ(_phi);
40
41 TVector3 m;
42 m.SetMagThetaPhi(_p, _theta, _phi);
43 m = -m;
44
45 primGen->AddTrack(_PDGType, m.X(), m.Y(), m.Z(), point.X(), point.Y(), point.Z() );
46 }
47
48 return kTRUE;
49}
const Float_t d
Z-ccordinate of the first GEM-station.
Definition BmnMwpcHit.cxx:7
int i
Definition P4_F32vec4.h:22
__m128 m
Definition P4_F32vec4.h:27
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)