Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Fun4AllHepMCInputManager.h
Go to the documentation of this file.
1 #ifndef FUN4ALLHEPMCINPUTMANAGER_H__
2 #define FUN4ALLHEPMCINPUTMANAGER_H__
3 
4 #include "PHHepMCGenHelper.h"
5 
8 
9 #include <fstream>
10 #include <iostream>
11 #include <map>
12 #include <string>
13 
14 #ifndef __CINT__
15 #include <boost/iostreams/filtering_streambuf.hpp>
16 #endif
17 
18 #ifndef __CINT__
19 #include <gsl/gsl_rng.h>
20 #endif
21 
22 // forward declaration of classes in namespace
23 namespace HepMC
24 {
25 class IO_GenEvent;
26 class GenEvent;
27 };
28 
29 class PHHepMCGenEvent;
30 class PHCompositeNode;
31 
33 {
34  public:
35  Fun4AllHepMCInputManager(const std::string &name = "DUMMY", const std::string &nodename = "DST", const std::string &topnodename = "TOP");
36  virtual ~Fun4AllHepMCInputManager();
37  virtual int fileopen(const std::string &filenam);
38  virtual int fileclose();
39  virtual int run(const int nevents = 0);
40  int isOpen() { return isopen; }
41  void ReadOscar(const int i = 1) { readoscar = i; }
42  virtual void Print(const std::string &what = "ALL") const;
43  virtual int PushBackEvents(const int i);
44 
45  // Effectivly turn off the synchronization checking
46  //
47  int SyncIt(const SyncObject * /*mastersync*/) { return Fun4AllReturnCodes::SYNC_OK; }
48  int GetSyncObject(SyncObject ** /*mastersync*/) { return Fun4AllReturnCodes::SYNC_NOOBJECT; }
49  int NoSyncPushBackEvents(const int nevt) { return PushBackEvents(nevt); }
50  HepMC::GenEvent *ConvertFromOscar();
51 
54  {
56  }
57 
59  void set_vertex_distribution_mean(const double x, const double y, const double z, const double t)
60  {
62  }
63 
65  void set_vertex_distribution_width(const double x, const double y, const double z, const double t)
66  {
68  }
69  //
71  void set_reuse_vertex(int src_embedding_id)
72  {
73  hepmc_helper.set_reuse_vertex(src_embedding_id);
74  }
75 
81  //
87  protected:
88  int OpenNextFile();
89 
90  int isopen;
93  int readoscar;
94 
95  std::string filename;
96  std::string topNodeName;
98 
99  HepMC::IO_GenEvent *ascii_in;
100  HepMC::GenEvent *evt;
101  HepMC::GenEvent *save_evt;
102 
103  // some pointers for use in decompression handling
104  std::ifstream *filestream; // holds compressed filestream
105  std::istream *unzipstream; // feed into HepMc
106  std::ifstream theOscarFile;
107 
110 
111 #ifndef __CINT__
112  boost::iostreams::filtering_streambuf<boost::iostreams::input> zinbuffer;
113 #endif
114 };
115 
116 #endif /* __FUN4ALLHEPMCINPUTMANAGER_H__ */
virtual int fileopen(const std::string &filenam)
void set_reuse_vertex(int src_embedding_id)
reuse vertex from another PHHepMCGenEvent with embedding_id = src_embedding_id Additional smearing an...
virtual void Print(const std::string &what="ALL") const
int NoSyncPushBackEvents(const int nevt)
void set_vertex_distribution_function(PHHepMCGenHelper::VTXFUNC x, PHHepMCGenHelper::VTXFUNC y, PHHepMCGenHelper::VTXFUNC z, PHHepMCGenHelper::VTXFUNC t)
toss a new vertex according to a Uniform or Gaus distribution
int get_embedding_id() const
PHHepMCGenHelper provides service of DST upload of HepMC subevent, vertex assignment and random gener...
virtual int PushBackEvents(const int i)
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
int SyncIt(const SyncObject *)
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
tuple nevents
Definition: submit_bnl.py:11
Fun4AllHepMCInputManager(const std::string &name="DUMMY", const std::string &nodename="DST", const std::string &topnodename="TOP")
void set_reuse_vertex(int src_embedding_id)
reuse vertex from another PHHepMCGenEvent with embedding_id = src_embedding_id Additional smearing an...
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...
boost::iostreams::filtering_streambuf< boost::iostreams::input > zinbuffer
virtual int run(const int nevents=0)
PHHepMCGenHelper hepmc_helper
helper for insert HepMC event to DST node and add vertex smearing
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...
VTXFUNC
supported function distributions
void set_embedding_id(int id)