CbmRoot
Loading...
Searching...
No Matches
CbmEventGenerator.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
9
10
11#ifndef CBMEVENTGENERATOR_H
12#define CBMEVENTGENERATOR_H 1
13
14
15#include "CbmBeamProfile.h"
16#include "CbmTarget.h"
17
18#include <FairPrimaryGenerator.h>
19
20#include <memory>
21
22class FairGenericStack;
23
24
41class CbmEventGenerator : public FairPrimaryGenerator {
42
43 public:
46
47
49 virtual ~CbmEventGenerator();
50
51
53 virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz,
54 Int_t parent = -1, Bool_t wanttracking = true, Double_t e = -9e9, Double_t tof = 0.,
55 Double_t weight = 0., TMCProcess proc = kPPrimary);
56
57
64 void ForceVertexAtZ(Double_t zVertex);
65
66
70 void ForceVertexInTarget(Bool_t choice = kTRUE) { fForceVertexInTarget = choice; }
71
72
77
78
90 virtual Bool_t GenerateEvent(FairGenericStack* stack);
91
92
94 virtual void Print(Option_t* opt = "") const;
95
96
111 void SetBeamAngle(Double_t meanThetaX, Double_t meanThetaY, Double_t sigmaThetaX = -1., Double_t sigmaThetaY = -1.);
112
113
127 void SetBeamPosition(Double_t meanX, Double_t meanY, Double_t sigmaX = -1., Double_t sigmaY = -1., Double_t zF = 0.);
128
129
139 void SetTarget(std::shared_ptr<const CbmTarget> target) { fTarget = target; }
140
141
142 private:
144 std::shared_ptr<const CbmTarget> fTarget;
147 Double_t fVertexZ;
148
149
157 virtual void MakeBeamAngle(){};
158
159
174 virtual void MakeVertex();
175
176
181 void MakeVertexAtZ();
182
183
188 virtual void MakeVertexInFocalPlane();
189
190
195 virtual void MakeVertexInTarget();
196
197
199};
200
201
202#endif /* CBMEVENTGENERATOR_H */
int Int_t
bool Bool_t
virtual void Print(Option_t *opt="") const
Log output.
virtual Bool_t GenerateEvent(FairGenericStack *stack)
Generate the input event.
Double_t fVertexZ
forced z coordinate of event vertex
void SetBeamAngle(Double_t meanThetaX, Double_t meanThetaY, Double_t sigmaThetaX=-1., Double_t sigmaThetaY=-1.)
Set the beam angle in the focal plane.
CbmEventGenerator()
Default constructor.
void MakeVertexAtZ()
Generate event vertex position at a given z.
Bool_t fForceVertexInTarget
Target properties.
virtual ~CbmEventGenerator()
Destructor.
Bool_t fForceVertexAtZ
If set, vertex must be at given z.
void SetTarget(std::shared_ptr< const CbmTarget > target)
Set target properties.
void ForceVertexAtZ(Double_t zVertex)
Force event vertex to be at a given z.
virtual void MakeVertexInFocalPlane()
Generate event vertex position in the beam focal plane.
virtual void MakeBeamAngle()
Generate beam angle.
const CbmBeamProfile & GetBeamProfile()
Beam profile.
virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz, Int_t parent=-1, Bool_t wanttracking=true, Double_t e=-9e9, Double_t tof=0., Double_t weight=0., TMCProcess proc=kPPrimary)
Add a track to the stack to be transported.
virtual void MakeVertex()
Generate event vertex position.
CbmBeamProfile fBeamProfile
Beam properties.
void SetBeamPosition(Double_t meanX, Double_t meanY, Double_t sigmaX=-1., Double_t sigmaY=-1., Double_t zF=0.)
Set the beam position in the focal plane.
ClassDef(CbmEventGenerator, 2)
std::shared_ptr< const CbmTarget > fTarget
void ForceVertexInTarget(Bool_t choice=kTRUE)
Enable or disable forcing the vertex to be in the target.
virtual void MakeVertexInTarget()
Generate event vertex position in the target.