20 #include "HepMC/IO_HEPEVT.h"
21 #include "HepMC/HEPEVT_Wrapper.h"
24 #include "HepMC/WeightContainer.h"
27 #define KI_BHG_INIT ki_bhg_init_
32 #define BHSETPARAM bhsetparam_
34 void BHSETPARAM(
int* iparam,
float* fparam,
const char* cparam,
int length);
37 #define KI_BHG_FILL ki_bhg_fill_
42 #define KI_BHG_STAT ki_bhg_stat_
51 static HepMC::IO_HEPEVT
conv;
56 call_ki_bhg_stat(iret);
90 long seed = (long)(rng->
mySeed());
97 produces<HepMCProduct>();
98 produces<GenEventInfoProduct>();
99 produces<GenRunInfoProduct, InRun>();
101 cout <<
"BeamHaloProducer: starting event generation ... " << endl;
125 <<
"BeamHaloProducer: function call_ki_bhg_fill returned " << iret << endl;
132 evt =
new HepMC::GenEvent();
134 for (
int theindex = 1; theindex<=
wrapper.number_entries(); theindex++) {
135 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(
wrapper.x(theindex),
wrapper.y(theindex),
wrapper.z(theindex),
wrapper.t(theindex)));
139 Vtx->add_particle_out(Part);
140 evt->add_vertex(Vtx);
146 weights.push_back(weight);
148 std::auto_ptr<HepMCProduct> CMProduct(
new HepMCProduct());
149 if (
evt) CMProduct->addHepMCData(
evt);
162 run.
put( genRunInfo );
166 BHSETPARAM(ival,fval,cval_string.c_str(),cval_string.length());
virtual void produce(Event &e, const EventSetup &es)
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
static HepMC::IO_HEPEVT conv
virtual ~BeamHaloProducer()
Destructor.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CLHEP::HepRandomEngine * _BeamHalo_randomEngine
virtual void endRunProduce(Run &r, const EventSetup &es)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
bool call_ki_bhg_fill(int &iret, float &weight)
BeamHaloProducer(const ParameterSet &)
Constructor.
bool call_bh_set_parameters(int *ival, float *fval, const std::string cval_string)
bool call_ki_bhg_stat(int &iret)
bool call_ki_bhg_init(long &seed)
void put(std::auto_ptr< PROD > product)
Put a new product.
virtual uint32_t mySeed() const =0
Exists for backward compatibility.
static HepMC::HEPEVT_Wrapper wrapper