PandaRoot
PndTargetGenerator.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndTargetGenerator header file -----
15 // ----- Created 13/02/2020 by R.Kliemt -----
16 // -------------------------------------------------------------------------
17 
25 #ifndef PND_TARGETGENERATOR_H
26 #define PND_TARGETGENERATOR_H
27 
28 #include "FairGenerator.h"
29 #include <iostream>
30 
31 class FairPrimaryGenerator;
32 class TF1;
33 class TVector3;
34 class TGraph;
35 
36 class PndTargetGenerator : public FairGenerator {
37  public:
40 
42  PndTargetGenerator(TString densityFile, double radius = 0., double drdz = 0., double rlimit = 2.);
43 
45  virtual ~PndTargetGenerator(){};
46 
48  void SetDensityProfile(TString density) { fDensityFile = density; }
49  void SetBeamRadius(double radius = 0.1) { fRsigma = radius; } // default beam spot sigma 1mm^2 by "Fair Operation Modes" document v.6 (2020)
50  void SetBeamPipeRadius(double radius = 2.) { fRlimit = radius; } // Smallest radius around interaction region
51  void SetConstantBeamRegion(double zmin = -140., double zmax = 223)
52  {
53  fConstantZmin = zmin;
54  fConstantZmax = zmax;
55  } //
56  void SetBeamDrDz(double drdz = 0.1) { fDrDz = drdz; } // default maximum beam divergence from 4-sigma emittance of 1-2 mm mrad by "Fair Operation Modes" document v.6 (2020)
57  void SetVerbose(int verb = 1) { fVerbose = verb; }
58  TGraph *GetDensityGraph() { return fDensityGraph; }
60  virtual Bool_t Init();
61  TVector3 SampleInteractionVertex();
62  void ReadDensityFile();
63  virtual Bool_t ReadEvent(FairPrimaryGenerator *) { return true; }; // FIXME Delete!
64  protected:
65  private:
66  double fRlimit; // Radius of beam pipe (hard limit)
67  double fRsigma; // Radius of beam profile (Gaussian sigma)
68  double fConstantZmin; // Start of constant beam width region
69  double fConstantZmax; // End of constant beam width region
70  double fDrDz; // Radius increase slope from (0,0,0)
71  double fDmin; // Minimum density
72  double fDmax; // Maximum density
73  int fVerbose; // Switch debug output
74  bool fDoExtended; // switch if not using distributed targets
75  TString fDensityFile; // ascii file to load density profile
76  TGraph *fDensityGraph; // storage of measured points
77  TGraph *fInvertedCDF; // storage of measured points as inverted "CDF"
78 
79  ClassDef(PndTargetGenerator, 1);
80 };
81 
82 #endif
void SetVerbose(int verb=1)
void SetBeamDrDz(double drdz=0.1)
void SetBeamPipeRadius(double radius=2.)
TVector3 SampleInteractionVertex()
void SetConstantBeamRegion(double zmin=-140., double zmax=223)
virtual Bool_t Init()
void SetBeamRadius(double radius=0.1)
void SetDensityProfile(TString density)
virtual Bool_t ReadEvent(FairPrimaryGenerator *)