ROOTPWA
primaryVertexGen.h
Go to the documentation of this file.
1 /*
2  * author: Prometeusz (Promme) jasinski
3  * jasinski@kph.uni-mainz.de Promme@web.de
4  *
5  * This file contains some methods simulating the Primary Vertex distribution
6  * in the target cell as well as the incoming beam properties
7  * You might use this script directly via executing in root
8  *
9  * root -l Beam_simulation.C+
10  *
11  * or use the methods here to adapt it in your event generator
12  *
13  * (2010.03.03)
14  * - implementing 2008 h- beam simulation
15  *
16  * (2010.06.16)
17  * - moved to rootpwa svn repository and changed to class structure
18  *
19  */
20 
25 #ifndef TPRIMARYVERTEXGEN_HH
26 #define TPRIMARYVERTEXGEN_HH
27 
28 #include <string>
29 
30 class TH2;
31 
32 namespace rpwa {
33 
35 
36  private:
37 
38  // ********* some global constants and variables **********
40  //static const string histogramfilename("properties_2008/primary_vertex_properties.root");
47 
48  //const double beam_part_mass(0.13957018); // [GeV] 2008's PDG pi-/+ value
49  //const double beam_part_mass(0.493677); // [GeV] 2008's PDG K-/+ value
50  //const double beam_energy_mean(191.29); // [GeV] fit on pi- pi+ pi- energy
51  //const double beam_energy_sigma(1.94476); // [GeV] fit on pi- pi+ pi- energy
56  // in principle the fitted values are missing the momentum transfer to the
57  // recoil particle that should be taken into account in the future
58 
59  public:
60 
61  // loads histograms containing the measure vertex information
62  // initialization of default values
63  // see also above the out commented constants
64  // please TPrimaryVertexGen::Check() afterwards if loading went correctly
65  primaryVertexGen(std::string histfilename = "properties_2008/primary_vertex_properties.root",
66  double beam_part_mass = 0.13957018, // by default pion
67  double mean_beam_energy = 191.29, // measured 2008
68  double mean_beam_energy_spread = 1.94476); // measured sigma 2008
69 
70  // free histograms
72 
73  // check if histograms were loaded properly
74  bool check();
75 
76  // ************* the prototypes ************
77 
78  private:
79 
80  // Loading of distribution histograms specified by histogram filename
81  // if you wish a window showing the loaded histograms then plot = true
82  // returns false if something goes wrong
83  // Please do not use any other methods then
84  bool loadHistograms(std::string filename = "properties_2008/primary_vertex_properties.root",
85  bool plot = true);
86 
87  public:
88 
89  // Get one Vertex point
90  // the position is distributed randomly based on hist_vertex_distr_xy
91  // and hist_vertex_distr_z
92  // you may change the cuts but it is not recommended since the cuts
93  // are tuned for the valid ranges in the histograms
94  // Call Load_histograms() before!
95  TVector3& getVertex(const float cutR = 1.47,
96  const float cutZ_low = -70.,
97  const float cutZ_high = -30.);
98 
99  // Based on the position of the Vertex retrieve the beam
100  // direction properties
101  // given by distributions of
102  // hist_angles_vert_mean
103  // hist_angles_horiz_mean
104  // hist_angles_vert_sigma
105  // hist_angles_horiz_sigma
106  // Call Load_histograms() before!
107  // returns a vector with Mag() == 0 if vertex is out of
108  // range of stored values
109  TVector3& getBeamDir(const TVector3 vertex);
110 
111  // Simulate the beam particle based on fitted
112  // values given by
113  // beam_energy_mean
114  // beam_energy_sigma
115  // beam_part_mass
116  // in principal one should also measure the energy(spread) depending on
117  // X Y in the target since we know that there is a dependence
118  // but this is neglected for now
119  TLorentzVector& getBeamPart(const TVector3 beam_dir);
120 
121  private:
122 
123  /*
124  * big thanks to Sergei Gerassimov for this
125  * smooth palette settings
126  */
127  void gesPalette(int i=0);
128 
129  };
130 
131 }
132 
133 #endif
134 /* @} **/