13 #include <frog/FROG.h>
18 #include <HepMC/GenEvent.h>
19 #include <HepMC/IO_GenEvent.h>
29 #include <boost/iostreams/filter/bzip2.hpp>
30 #include <boost/iostreams/filter/gzip.hpp>
31 #include <boost/iostreams/filtering_streambuf.hpp>
36 #include <gsl/gsl_const.h>
37 #include <gsl/gsl_randist.h>
38 #include <gsl/gsl_rng.h>
43 const string &name,
const string &nodename,
const string &topnodename)
45 , _min_integration_time(-17500.0)
46 , _max_integration_time(+17500.0)
47 , _collision_rate(100.0e3)
48 , _time_between_crossings(106.0)
49 , _ave_coll_per_crossing(1.0)
69 RandomGenerator = gsl_rng_alloc(gsl_rng_mt19937);
71 gsl_rng_set(RandomGenerator, seed);
78 gsl_rng_free(RandomGenerator);
87 _ave_coll_per_crossing = _collision_rate * _time_between_crossings * 1e-9;
88 _min_crossing = _min_integration_time / _time_between_crossings;
89 _max_crossing = _max_integration_time / _time_between_crossings;
93 cout <<
"Fun4AllHepMCPileupInputManager::run:first event: - ";
94 cout <<
" _ave_coll_per_crossing = " << _ave_coll_per_crossing;
95 cout <<
" _min_crossing = " << _min_crossing;
96 cout <<
" _max_crossing = " << _max_crossing;
97 cout <<
". Start first event."<<endl;
102 for (
int icrossing = _min_crossing; icrossing <= _max_crossing; ++icrossing)
104 double crossing_time = _time_between_crossings * icrossing;
106 int ncollisions = gsl_ran_poisson(RandomGenerator, _ave_coll_per_crossing);
110 for (
int icollision = 0; icollision < ncollisions; ++icollision)
112 double t0 = crossing_time;
123 cout <<
Name() <<
": No Input file open" << endl;
131 cout <<
Name() <<
": No Input file from filelist opened" << endl;
159 cout <<
"error type: " <<
ascii_in->error_type()
160 <<
", rdstate: " <<
ascii_in->rdstate() << endl;
169 cout <<
"hepmc evt no: " <<
evt->event_number() << endl;
PHHepMCGenEventMap is collection of HEPMC events input into this simulation map of embedding ID -> PH...
int verbosity
The verbosity level. 0 means not verbose at all.
bool addEvent(HepMC::GenEvent *evt)
host an HepMC event
void CurrentEvent(const int evt)
virtual void moveVertex(double x, double y, double z, double t=0)
move the collision vertex position in the Hall coordinate system, use PHENIX units of cm...
int get_embedding_id() const
void set_vertex_distribution_mean(const double x, const double y, const double z, const double t)
set the mean value of the vertex distribution, use PHENIX units of cm, ns
void set_vertex_distribution_function(VTXFUNC x, VTXFUNC y, VTXFUNC z, VTXFUNC t)
toss a new vertex according to a Uniform or Gaus distribution
virtual const std::string Name() const
Returns the name of this module.
void move_vertex(PHHepMCGenEvent *genevent)
move vertex according to vertex settings
virtual int Verbosity() const
Gets the verbosity of this module.
PHHepMCGenEvent * insert_active_event(const PHHepMCGenEvent *event=nullptr)
insert a event of interest, e.g. jetty event from pythia
Output some useful messages during manual command line running.
const PHHepMCGenEventMap * get_geneventmap() const
void set_vertex_distribution_width(const double x, const double y, const double z, const double t)
set the width of the vertex distribution function about the mean, use PHENIX units of cm...
normal distribution with sigma width set via set_vertex_distribution_width()
void set_embedding_id(int id)
PHHepMCGenEvent * insert_background_event(const PHHepMCGenEvent *event=nullptr)
insert a event of background, e.g. Au+Au collision background. First event has embedding ID = 0...