19 #include "HepMC/IO_HEPEVT.h"
20 #include "HepMC/HEPEVT_Wrapper.h"
23 #include "HepMC/WeightContainer.h"
26 #define KI_BHG_INIT ki_bhg_init_
31 #define BHSETPARAM bhsetparam_
33 void BHSETPARAM(
int* iparam,
float* fparam,
const char* cparam,
int length);
36 #define KI_BHG_FILL ki_bhg_fill_
41 #define KI_BHG_STAT ki_bhg_stat_
50 static HepMC::IO_HEPEVT
conv;
55 call_ki_bhg_stat(iret);
86 produces<HepMCProduct>();
87 produces<GenEventInfoProduct>();
88 produces<GenRunInfoProduct, InRun>();
90 cout <<
"BeamHaloProducer: starting event generation ... " << endl;
133 <<
"BeamHaloProducer: function call_ki_bhg_fill returned " << iret << endl;
140 evt =
new HepMC::GenEvent();
142 for (
int theindex = 1; theindex<=
wrapper.number_entries(); theindex++) {
143 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(
wrapper.x(theindex),
wrapper.y(theindex),
wrapper.z(theindex),
wrapper.t(theindex)));
147 Vtx->add_particle_out(Part);
148 evt->add_vertex(Vtx);
154 weights.push_back(weight);
156 std::auto_ptr<HepMCProduct> CMProduct(
new HepMCProduct());
157 if (
evt) CMProduct->addHepMCData(
evt);
170 run.
put( genRunInfo );
174 BHSETPARAM(ival,fval,cval_string.c_str(),cval_string.length());
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
LuminosityBlockIndex index() const
static HepMC::IO_HEPEVT conv
void setRandomEngine(CLHEP::HepRandomEngine *v)
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &) override
virtual ~BeamHaloProducer()
Destructor.
virtual void produce(Event &e, const EventSetup &es) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CLHEP::HepRandomEngine * _BeamHalo_randomEngine
virtual void endRunProduce(Run &r, const EventSetup &es) override
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)
StreamID streamID() const
bool call_ki_bhg_init(long &seed)
void put(std::auto_ptr< PROD > product)
Put a new product.
volatile std::atomic< bool > shutdown_flag false
static HepMC::HEPEVT_Wrapper wrapper