|
|
#include <IO_EPOS.h>
Definition at line 20 of file IO_EPOS.h.
◆ IO_EPOS() [1/2]
EPOS::IO_EPOS::IO_EPOS |
( |
| ) |
|
◆ ~IO_EPOS()
EPOS::IO_EPOS::~IO_EPOS |
( |
| ) |
|
|
override |
◆ IO_EPOS() [2/2]
EPOS::IO_EPOS::IO_EPOS |
( |
const IO_EPOS & |
| ) |
|
|
inlineprivate |
Definition at line 46 of file IO_EPOS.h.
46 : HepMC::IO_BaseClass() {}
◆ build_end_vertex()
void EPOS::IO_EPOS::build_end_vertex |
( |
int |
i, |
|
|
std::vector< HepMC::GenParticle * > & |
hepevt_particle, |
|
|
HepMC::GenEvent * |
evt |
|
) |
| |
|
protected |
Definition at line 229 of file IO_EPOS.cc.
234 HepMC::GenVertex* end_vtx =
p->end_vertex();
235 while (!end_vtx && daughter > 0) {
236 end_vtx = hepevt_particle[daughter]->production_vertex();
238 end_vtx->add_particle_in(
p);
245 end_vtx =
new GenVertex();
246 end_vtx->add_particle_in(
p);
247 evt->add_vertex(end_vtx);
253 while (end_vtx && daughter > 0) {
254 if (!hepevt_particle[daughter]->production_vertex()) {
256 end_vtx->add_particle_out(hepevt_particle[daughter]);
259 if (end_vtx->position() == FourVector(0, 0, 0, 0)) {
265 if (prod_pos != FourVector(0, 0, 0, 0)) {
266 end_vtx->set_position(prod_pos);
269 }
else if (hepevt_particle[daughter]->production_vertex() != end_vtx) {
276 std::cerr <<
"HepMC::IO_EPOS: inconsistent mother/daugher "
278 <<
"inspecting the event first with "
279 <<
"\n\tEPOS_Wrapper::check_hepevt_consistency()"
280 <<
"\n This warning can be turned off with the "
281 <<
"IO_EPOS::print_inconsistency_errors switch." << std::endl;
286 if (!
p->end_vertex() && !
p->production_vertex()) {
References build_production_vertex(), beam_dqm_sourceclient-live_cfg::cerr, EPOS::EPOS_Wrapper::event_number(), EPOS::EPOS_Wrapper::first_child(), GenParticle::GenParticle, mps_fire::i, EPOS::EPOS_Wrapper::last_child(), m_print_inconsistency_errors, EPOS::EPOS_Wrapper::number_children(), AlCaHLTBitMon_ParallelJobs::p, EPOS::EPOS_Wrapper::t(), EPOS::EPOS_Wrapper::x(), EPOS::EPOS_Wrapper::y(), and EPOS::EPOS_Wrapper::z().
Referenced by fill_next_event().
◆ build_particle()
HepMC::GenParticle * EPOS::IO_EPOS::build_particle |
( |
int |
index | ) |
|
|
protected |
◆ build_production_vertex()
void EPOS::IO_EPOS::build_production_vertex |
( |
int |
i, |
|
|
std::vector< HepMC::GenParticle * > & |
hepevt_particle, |
|
|
HepMC::GenEvent * |
evt |
|
) |
| |
|
protected |
Definition at line 174 of file IO_EPOS.cc.
178 HepMC::GenVertex* prod_vtx =
p->production_vertex();
179 while (!prod_vtx && mother > 0) {
180 prod_vtx = hepevt_particle[mother]->end_vertex();
182 prod_vtx->add_particle_out(
p);
192 prod_vtx =
new HepMC::GenVertex();
193 prod_vtx->add_particle_out(
p);
194 evt->add_vertex(prod_vtx);
197 if (prod_vtx && prod_vtx->position() == FourVector(0, 0, 0, 0)) {
198 prod_vtx->set_position(prod_pos);
203 while (prod_vtx && mother > 0) {
204 if (!hepevt_particle[mother]->end_vertex()) {
206 prod_vtx->add_particle_in(hepevt_particle[mother]);
207 }
else if (hepevt_particle[mother]->end_vertex() != prod_vtx) {
217 std::cerr <<
"HepMC::IO_EPOS: inconsistent mother/daugher "
219 <<
"inspecting the event first with "
220 <<
"\n\tEPOS_Wrapper::check_hepevt_consistency()"
221 <<
"\n This warning can be turned off with the "
222 <<
"IO_EPOS::print_inconsistency_errors switch." << std::endl;
References beam_dqm_sourceclient-live_cfg::cerr, EPOS::EPOS_Wrapper::event_number(), EPOS::EPOS_Wrapper::first_parent(), GenParticle::GenParticle, mps_fire::i, EPOS::EPOS_Wrapper::last_parent(), m_print_inconsistency_errors, EPOS::EPOS_Wrapper::number_parents(), AlCaHLTBitMon_ParallelJobs::p, EPOS::EPOS_Wrapper::t(), EPOS::EPOS_Wrapper::x(), EPOS::EPOS_Wrapper::y(), and EPOS::EPOS_Wrapper::z().
Referenced by build_end_vertex(), and fill_next_event().
◆ fill_next_event()
Definition at line 33 of file IO_EPOS.cc.
37 std::cerr <<
"IO_EPOS::fill_next_event error - passed null event." << std::endl;
47 hepevt_particle[0] =
nullptr;
52 HepMC::GenVertex*
primaryVertex =
new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), 0);
54 if (!evt->signal_process_vertex())
57 std::set<HepMC::GenVertex*> new_vertices;
62 evt->set_beam_particles(hepevt_particle[1], hepevt_particle[2]);
95 if (!hepevt_particle[
i3]->end_vertex() && !hepevt_particle[
i3]->production_vertex()) {
96 HepMC::GenVertex* prod_vtx =
new GenVertex();
97 prod_vtx->add_particle_out(hepevt_particle[
i3]);
98 evt->add_vertex(prod_vtx);
References funct::abs(), build_end_vertex(), build_particle(), build_production_vertex(), beam_dqm_sourceclient-live_cfg::cerr, EPOS::EPOS_Wrapper::event_number(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i3, m_skip_nucl_frag, m_trust_both_mothers_and_daughters, m_trust_mothers_before_daughters, EPOS::EPOS_Wrapper::number_entries(), HiggsValidation_cfi::pdg_id, BeamMonitor_cff::primaryVertex, and trust_beam_particles().
◆ find_in_map()
int EPOS::IO_EPOS::find_in_map |
( |
const std::map< HepMC::GenParticle *, int > & |
m, |
|
|
HepMC::GenParticle * |
p |
|
) |
| const |
|
protected |
◆ print()
void EPOS::IO_EPOS::print |
( |
std::ostream & |
ostr = std::cout | ) |
const |
|
override |
◆ print_inconsistency_errors()
bool EPOS::IO_EPOS::print_inconsistency_errors |
( |
| ) |
const |
|
inline |
◆ set_print_inconsistency_errors()
void EPOS::IO_EPOS::set_print_inconsistency_errors |
( |
bool |
b = true | ) |
|
|
inline |
◆ set_skip_nuclear_fragments()
void EPOS::IO_EPOS::set_skip_nuclear_fragments |
( |
bool |
b = true | ) |
|
|
inline |
◆ set_trust_beam_particles()
void EPOS::IO_EPOS::set_trust_beam_particles |
( |
bool |
b = true | ) |
|
|
inline |
◆ set_trust_both_mothers_and_daughters()
void EPOS::IO_EPOS::set_trust_both_mothers_and_daughters |
( |
bool |
b = false | ) |
|
|
inline |
◆ set_trust_mothers_before_daughters()
void EPOS::IO_EPOS::set_trust_mothers_before_daughters |
( |
bool |
b = true | ) |
|
|
inline |
◆ trust_beam_particles()
bool EPOS::IO_EPOS::trust_beam_particles |
( |
| ) |
const |
|
inline |
◆ trust_both_mothers_and_daughters()
bool EPOS::IO_EPOS::trust_both_mothers_and_daughters |
( |
| ) |
const |
|
inline |
◆ trust_mothers_before_daughters()
bool EPOS::IO_EPOS::trust_mothers_before_daughters |
( |
| ) |
const |
|
inline |
◆ write_event()
Definition at line 104 of file IO_EPOS.cc.
111 index_to_particle[0] =
nullptr;
112 std::map<HepMC::GenParticle*, int> particle_to_index;
113 int particle_counter = 0;
114 for (HepMC::GenEvent::vertex_const_iterator
v = evt->vertices_begin();
v != evt->vertices_end(); ++
v) {
117 for (HepMC::GenVertex::particles_in_const_iterator
p1 = (*v)->particles_in_const_begin();
118 p1 != (*v)->particles_in_const_end();
123 index_to_particle[particle_counter] = *
p1;
124 particle_to_index[*
p1] = particle_counter;
128 for (HepMC::GenVertex::particles_out_const_iterator
p2 = (*v)->particles_out_const_begin();
129 p2 != (*v)->particles_out_const_end();
131 if (!(*p2)->end_vertex()) {
136 index_to_particle[particle_counter] = *
p2;
137 particle_to_index[*
p2] = particle_counter;
148 for (
int i = 1;
i <= particle_counter; ++
i) {
151 FourVector
m = index_to_particle[
i]->momentum();
156 if (index_to_particle[
i]->production_vertex() && index_to_particle[
i]->production_vertex()->particles_in_size()) {
157 FourVector
p = index_to_particle[
i]->production_vertex()->position();
159 int num_mothers = index_to_particle[
i]->production_vertex()->particles_in_size();
161 find_in_map(particle_to_index, *(index_to_particle[
i]->production_vertex()->particles_in_const_begin()));
162 int last_mother = first_mother + num_mothers - 1;
163 if (first_mother == 0)
References find_in_map(), mps_fire::i, visualization-live-secondInstance_cfg::m, EPOS::EPOS_Wrapper::max_number_entries(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, HiggsValidation_cfi::pdg_id, EPOS::EPOS_Wrapper::set_children(), EPOS::EPOS_Wrapper::set_event_number(), EPOS::EPOS_Wrapper::set_id(), EPOS::EPOS_Wrapper::set_mass(), EPOS::EPOS_Wrapper::set_momentum(), EPOS::EPOS_Wrapper::set_number_entries(), EPOS::EPOS_Wrapper::set_parents(), EPOS::EPOS_Wrapper::set_position(), EPOS::EPOS_Wrapper::set_status(), mps_update::status, and findQualityFiles::v.
◆ m_print_inconsistency_errors
bool EPOS::IO_EPOS::m_print_inconsistency_errors |
|
private |
◆ m_skip_nucl_frag
bool EPOS::IO_EPOS::m_skip_nucl_frag |
|
private |
◆ m_trust_beam_particles
bool EPOS::IO_EPOS::m_trust_beam_particles |
|
private |
◆ m_trust_both_mothers_and_daughters
bool EPOS::IO_EPOS::m_trust_both_mothers_and_daughters |
|
private |
◆ m_trust_mothers_before_daughters
bool EPOS::IO_EPOS::m_trust_mothers_before_daughters |
|
private |
static void set_number_entries(int noentries)
set number of entries in EPOS
void build_production_vertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
static double pz(int index)
Z momentum.
bool m_trust_mothers_before_daughters
static int last_parent(int index)
index of last mother
static int number_entries()
num entries in current evt
static double y(int index)
Y Production vertex.
static double x(int index)
X Production vertex.
primaryVertex
hltOfflineBeamSpot for HLTMON
bool m_trust_both_mothers_and_daughters
static void set_momentum(int index, double px, double py, double pz, double e)
set particle momentum
static double py(int index)
Y momentum.
bool m_trust_beam_particles
static int event_number()
event number
void build_end_vertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt)
static int number_children(int index)
number of children
bool m_print_inconsistency_errors
static int last_child(int index)
index of last daughter
static double z(int index)
Z Production vertex.
static double t(int index)
production time
static void set_children(int index, int firstchild, int lastchild)
define children of a particle
static int id(int index)
PDG particle id.
bool trust_beam_particles() const
static void set_position(int index, double x, double y, double z, double t)
set particle production vertex
static void set_mass(int index, double mass)
set particle mass
int find_in_map(const std::map< HepMC::GenParticle *, int > &m, HepMC::GenParticle *p) const
static double e(int index)
Energy.
static double px(int index)
X momentum.
static int max_number_entries()
size of common block
static void set_parents(int index, int firstparent, int lastparent)
define parents of a particle
Abs< T >::type abs(const T &t)
static void set_status(int index, int status)
set particle status
static int number_parents(int index)
number of parents
static void set_event_number(int evtno)
set event number
static int first_parent(int index)
index of 1st mother
static double m(int index)
generated mass
static int first_child(int index)
index of 1st daughter
HepMC::GenParticle * build_particle(int index)
static int status(int index)
status code
static void set_id(int index, int id)
set particle ID