13 #include "CLHEP/Random/RandFlat.h" 32 produces<HepMCProduct>(
"unsmeared");
33 produces<GenEventInfoProduct>();
42 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
e.streamID());
45 cout <<
" FlatRandomPtAndDxyGunProducer : Begin New Event Generation" << endl;
58 for (
unsigned int ip = 0; ip <
fPartIDs.size(); ++ip) {
71 bool passLoop =
false;
72 while (not passLoop) {
77 float dxysign = CLHEP::RandFlat::shoot(engine, -1, 1);
83 for (
int i = 0;
i < 10000;
i++) {
86 lxy =
sqrt(vx * vx + vy * vy);
96 for (
int j = 0;
j < 100;
j++) {
97 vz = CLHEP::RandFlat::shoot(engine, 0.0,
lzMax_);
99 if (
v0 <= 0
or lxy * lxy / (ConeTheta * ConeTheta) >
v0 *
v0) {
106 passLoop = (passLxy and passLz);
112 float time =
sqrt(vx * vx + vy * vy + vz * vz);
114 HepMC::GenVertex* Vtx1 =
new HepMC::GenVertex(HepMC::FourVector(vx, vy, vz,
time));
118 double mass = PData->mass().value();
123 Part->suggest_barcode(barcode);
125 Vtx1->add_particle_out(Part);
126 fEvt->add_vertex(Vtx1);
129 HepMC::GenVertex* Vtx2 =
new HepMC::GenVertex(HepMC::FourVector(-vx, -vy, -vz,
time));
136 APart->suggest_barcode(barcode);
138 Vtx2->add_particle_out(APart);
139 fEvt->add_vertex(Vtx2);
142 fEvt->set_event_number(
e.id().event());
143 fEvt->set_signal_process_id(20);
150 BProduct->addHepMCData(
fEvt);
157 cout <<
" FlatRandomPtAndDxyGunProducer : End New Event Generation" << endl;
T getParameter(std::string const &) const
Sin< T >::type sin(const T &t)
~FlatRandomPtAndDxyGunProducer() override
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void produce(Event &e, const EventSetup &es) override
ESHandle< HepPDT::ParticleDataTable > fPDGTable
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::vector< int > fPartIDs
HepPDT::ParticleData ParticleData
FlatRandomPtAndDxyGunProducer(const ParameterSet &pset)