19 #include "HepMC/IO_HEPEVT.h" 20 #include "HepMC/HEPEVT_Wrapper.h" 23 #include "HepMC/WeightContainer.h" 25 #define KI_BHG_INIT ki_bhg_init_ 30 #define BHSETPARAM bhsetparam_ 32 void BHSETPARAM(
int* iparam,
float* fparam,
const char* cparam,
int length);
35 #define KI_BHG_FILL ki_bhg_fill_ 40 #define KI_BHG_STAT ki_bhg_stat_ 48 static HepMC::IO_HEPEVT
conv;
52 call_ki_bhg_stat(iret);
60 iparam[0] =
pset.getUntrackedParameter<
int>(
"GENMOD");
61 iparam[1] =
pset.getUntrackedParameter<
int>(
"LHC_B1");
62 iparam[2] =
pset.getUntrackedParameter<
int>(
"LHC_B2");
63 iparam[3] =
pset.getUntrackedParameter<
int>(
"IW_MUO");
64 iparam[4] =
pset.getUntrackedParameter<
int>(
"IW_HAD");
66 iparam[6] =
pset.getUntrackedParameter<
int>(
"OFFSET", 0);
67 iparam[7] =
pset.getUntrackedParameter<
int>(
"shift_bx");
69 fparam[0] = (
float)
pset.getUntrackedParameter<
double>(
"EG_MIN");
70 fparam[1] = (
float)
pset.getUntrackedParameter<
double>(
"EG_MAX");
72 fparam[2] = (
float)
pset.getUntrackedParameter<
double>(
"BXNS");
73 fparam[3] = (
float)
pset.getUntrackedParameter<
double>(
"W0", 1.0);
75 cparam =
pset.getUntrackedParameter<
std::string>(
"G3FNAME",
"input.txt");
78 produces<HepMCProduct>(
"unsmeared");
79 produces<GenEventInfoProduct>();
80 produces<GenRunInfoProduct, Transition::EndRun>();
82 usesResource(
"BeamHaloProducer");
84 cout <<
"BeamHaloProducer: starting event generation ... " << endl;
120 <<
"BeamHaloProducer: function call_ki_bhg_fill returned " << iret << endl;
128 for (
int theindex = 1; theindex <=
wrapper.number_entries(); theindex++) {
129 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(
133 Vtx->add_particle_out(Part);
134 evt->add_vertex(Vtx);
137 evt->set_event_number(
e.id().event());
139 HepMC::WeightContainer&
weights =
evt->weights();
142 std::unique_ptr<HepMCProduct> CMProduct(
new HepMCProduct());
144 CMProduct->addHepMCData(
evt);
160 BHSETPARAM(ival, fval, cval_string.c_str(), cval_string.length());
~BeamHaloProducer() override
Destructor.
static HepMC::IO_HEPEVT conv
void setRandomEngine(CLHEP::HepRandomEngine *v)
void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &) override
void produce(Event &e, const EventSetup &es) override
CLHEP::HepRandomEngine * _BeamHalo_randomEngine
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)
bool call_ki_bhg_init(long &seed)
static HepMC::HEPEVT_Wrapper wrapper