|
|
#include <LHEEvent.h>
Definition at line 23 of file LHEEvent.h.
◆ PDF
◆ WGT
◆ LHEEvent() [1/4]
lhef::LHEEvent::LHEEvent |
( |
const std::shared_ptr< LHERunInfo > & |
runInfo, |
|
|
std::istream & |
in |
|
) |
| |
Definition at line 35 of file LHEEvent.cc.
49 throw cms::Exception(
"InvalidFormat") <<
"Les Houches file contained invalid"
56 int idwtup =
runInfo->getHEPRUP()->IDWTUP;
58 edm::LogWarning(
"Generator|LHEInterface") <<
"Non-allowed negative event weight encountered." << std::endl;
63 edm::LogInfo(
"Generator|LHEInterface") <<
"Event weight not set to one for abs(IDWTUP) == 3" << std::endl;
74 throw cms::Exception(
"InvalidFormat") <<
"Les Houches file contained invalid event"
76 << (
i + 1) <<
"." << std::endl;
82 std::istringstream
ss(
line);
87 ss >>
pdf->id.first >>
pdf->id.second >>
pdf->x.first >>
pdf->x.second >>
pdf->scalePDF >>
pdf->xPDF.first >>
90 edm::LogWarning(
"Generator|LHEInterface") <<
"Les Houches event contained"
91 " unparseable PDF information."
101 edm::LogWarning(
"Generator|LHEInterface") <<
"Les Houches file contained spurious"
102 " content after event data."
References funct::abs(), lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, comments, hepeup, mps_fire::i, lhef::HEPEUP::ICOLUP, lhef::HEPEUP::IDPRUP, lhef::HEPEUP::IDUP, recoMuon::in, lhef::HEPEUP::ISTUP, mps_splice::line, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, originalXWGTUP_, pdf, lhef::HEPEUP::PUP, lhef::HEPEUP::resize(), runInfo, lhef::HEPEUP::SCALUP, skipWhitespace(), lhef::HEPEUP::SPINUP, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, lhef::HEPEUP::VTIMUP, lhef::HEPEUP::XPDWUP, and lhef::HEPEUP::XWGTUP.
◆ LHEEvent() [2/4]
lhef::LHEEvent::LHEEvent |
( |
const std::shared_ptr< LHERunInfo > & |
runInfo, |
|
|
const HEPEUP & |
hepeup |
|
) |
| |
◆ LHEEvent() [3/4]
◆ LHEEvent() [4/4]
◆ ~LHEEvent()
lhef::LHEEvent::~LHEEvent |
( |
| ) |
|
◆ addComment()
void lhef::LHEEvent::addComment |
( |
const std::string & |
line | ) |
|
|
inline |
◆ addWeight()
void lhef::LHEEvent::addWeight |
( |
const WGT & |
wgt | ) |
|
|
inline |
◆ asHepMCEvent()
Definition at line 225 of file LHEEvent.cc.
237 edm::LogWarning(
"Generator|LHEInterface") <<
"Les Houches Event does not contain any partons. "
238 <<
"Not much to convert.";
244 std::vector<HepMC::GenVertex *> genVertices;
247 for (
unsigned int i = 0;
i < nup;
i++)
251 for (
unsigned int i = 0;
i < nup;
i++) {
265 HepMC::GenVertex *current_vtx = in_par->end_vertex();
268 current_vtx =
new HepMC::GenVertex(HepMC::FourVector(0, 0, 0,
cTau));
271 genVertices.push_back(current_vtx);
274 for (
unsigned int j = mother1;
j <= mother2;
j++)
293 HepMC::FourVector(0.0, 0.0, +heprup->EBMUP.first, heprup->EBMUP.first), heprup->IDBMUP.first);
295 HepMC::FourVector(0.0, 0.0, -heprup->EBMUP.second, heprup->EBMUP.second), heprup->IDBMUP.second);
299 HepMC::GenVertex *v1 =
new HepMC::GenVertex();
300 HepMC::GenVertex *v2 =
new HepMC::GenVertex();
301 v1->add_particle_in(
b1);
302 v2->add_particle_in(
b2);
304 hepmc->add_vertex(v1);
305 hepmc->add_vertex(v2);
306 hepmc->set_beam_particles(
b1,
b2);
314 edm::LogWarning(
"Generator|LHEInterface") <<
"Initial partons do already have a"
315 " production vertex. "
317 <<
"Beam particles not connected.";
319 edm::LogWarning(
"Generator|LHEInterface") <<
"Can't find any initial partons to be"
320 " connected to the beam particles.";
322 for (std::vector<HepMC::GenVertex *>::const_iterator iter = genVertices.begin(); iter != genVertices.end(); ++iter)
323 hepmc->add_vertex(*iter);
326 for (
unsigned int i = 0;
i < nup;
i++) {
328 edm::LogWarning(
"Generator|LHEInterface") <<
"Not all LHE particles could be stored"
329 " stored in the HepMC event. "
331 <<
"Check the mother-daughter relations"
332 " in the given LHE input file.";
337 hepmc->set_signal_process_vertex(const_cast<HepMC::GenVertex *>(
findSignalVertex(hepmc.get(),
false)));
References lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, b1, b2, checkHepMCTree(), pdg::cTau(), findSignalVertex(), GenParticle::GenParticle, genParticles2HepMC_cfi::genParticles, getHEPRUP(), hepeup, mps_fire::i, lhef::HEPEUP::IDPRUP, dqmiolumiharvest::j, makeHepMCParticle(), lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, lhef::HEPEUP::SCALUP, and lhef::HEPEUP::VTIMUP.
◆ attempted()
void lhef::LHEEvent::attempted |
( |
| ) |
|
|
inline |
◆ checkHepMCTree()
Definition at line 355 of file LHEEvent.cc.
356 double px = 0,
py = 0, pz = 0, E = 0;
358 for (HepMC::GenEvent::particle_const_iterator iter =
event->particles_begin(); iter !=
event->particles_end();
360 int status = (*iter)->status();
361 HepMC::FourVector fv = (*iter)->momentum();
364 if (
status == 3 && *iter !=
event->beam_particles().first && *iter !=
event->beam_particles().second) {
380 if (
px *
px +
py *
py + pz * pz + E * E > 0.1) {
382 <<
"Energy-momentum badly conserved. " << std::setprecision(3) <<
"sum p_i = [" << std::setw(7) << E <<
", "
383 << std::setw(7) <<
px <<
", " << std::setw(7) <<
py <<
", " << std::setw(7) << pz <<
"]";
References multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, and mps_update::status.
Referenced by asHepMCEvent().
◆ count()
void lhef::LHEEvent::count |
( |
LHERunInfo::CountMode |
count, |
|
|
double |
weight = 1.0 , |
|
|
double |
matchWeight = 1.0 |
|
) |
| |
◆ fillEventInfo()
◆ fillPdfInfo()
void lhef::LHEEvent::fillPdfInfo |
( |
HepMC::PdfInfo * |
info | ) |
const |
Definition at line 191 of file LHEEvent.cc.
197 info->set_pdf1(
pdf->xPDF.first);
198 info->set_pdf2(
pdf->xPDF.second);
199 info->set_scalePDF(
pdf->scalePDF);
206 info->set_pdf1(-1.0);
207 info->set_pdf2(-1.0);
212 info->set_pdf1(-1.0);
213 info->set_pdf2(-1.0);
References funct::abs(), lhef::HEPRUP::EBMUP, getHEPRUP(), hepeup, lhef::HEPEUP::IDUP, info(), lhef::HEPEUP::NUP, pdf, lhef::HEPEUP::PUP, and lhef::HEPEUP::SCALUP.
Referenced by gen::Pythia6Hadronizer::finalizeEvent(), and Herwig6Hadronizer::finalizeEvent().
◆ findSignalVertex()
const HepMC::GenVertex * lhef::LHEEvent::findSignalVertex |
( |
const HepMC::GenEvent * |
event, |
|
|
bool |
status3 = true |
|
) |
| |
|
static |
Definition at line 391 of file LHEEvent.cc.
392 double largestMass2 = -9.0e-30;
393 const HepMC::GenVertex *
vertex =
nullptr;
394 for (HepMC::GenEvent::vertex_const_iterator iter =
event->vertices_begin(); iter !=
event->vertices_end(); ++iter) {
395 if ((*iter)->particles_in_size() < 2)
397 if ((*iter)->particles_out_size() < 1 ||
398 ((*iter)->particles_out_size() == 1 &&
399 (!(*(*iter)->particles_out_const_begin())->end_vertex() ||
400 !(*(*iter)->particles_out_const_begin())->end_vertex()->particles_out_size())))
403 double px = 0.0,
py = 0.0, pz = 0.0, E = 0.0;
404 bool hadStatus3 =
false;
405 for (HepMC::GenVertex::particles_out_const_iterator iter2 = (*iter)->particles_out_const_begin();
406 iter2 != (*iter)->particles_out_const_end();
408 hadStatus3 = hadStatus3 || (*iter2)->status() == 3;
409 px += (*iter2)->momentum().px();
410 py += (*iter2)->momentum().py();
411 pz += (*iter2)->momentum().pz();
412 E += (*iter2)->momentum().e();
414 if (status3 && !hadStatus3)
417 double mass2 = E * E - (
px *
px +
py *
py + pz * pz);
418 if (mass2 > largestMass2) {
420 largestMass2 = mass2;
References multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, and bphysicsOniaDQM_cfi::vertex.
Referenced by asHepMCEvent().
◆ fixHepMCEventTimeOrdering()
◆ getComments()
const std::vector<std::string>& lhef::LHEEvent::getComments |
( |
| ) |
const |
|
inline |
◆ getHEPEUP()
const HEPEUP* lhef::LHEEvent::getHEPEUP |
( |
| ) |
const |
|
inline |
◆ getHEPRUP()
const HEPRUP* lhef::LHEEvent::getHEPRUP |
( |
| ) |
const |
|
inline |
◆ getPDF()
const PDF* lhef::LHEEvent::getPDF |
( |
| ) |
const |
|
inline |
◆ getReadAttempts()
const int lhef::LHEEvent::getReadAttempts |
( |
| ) |
|
|
inline |
◆ getRunInfo()
const std::shared_ptr<LHERunInfo>& lhef::LHEEvent::getRunInfo |
( |
| ) |
const |
|
inline |
◆ makeHepMCParticle()
HepMC::GenParticle * lhef::LHEEvent::makeHepMCParticle |
( |
unsigned int |
i | ) |
const |
|
private |
◆ npLO()
int lhef::LHEEvent::npLO |
( |
| ) |
const |
|
inline |
◆ npNLO()
int lhef::LHEEvent::npNLO |
( |
| ) |
const |
|
inline |
◆ originalXWGTUP()
double lhef::LHEEvent::originalXWGTUP |
( |
| ) |
const |
|
inline |
◆ removeParticle()
void lhef::LHEEvent::removeParticle |
( |
lhef::HEPEUP & |
hepeup, |
|
|
int |
index |
|
) |
| |
|
static |
◆ removeResonances()
void lhef::LHEEvent::removeResonances |
( |
const std::vector< int > & |
ids | ) |
|
Definition at line 173 of file LHEEvent.cc.
177 std::find(ids.begin(), ids.end(),
id) != ids.end())
References funct::abs(), spr::find(), hepeup, mps_fire::i, triggerObjects_cff::id, lhef::HEPEUP::IDUP, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, and removeParticle().
◆ scales()
const std::vector<float>& lhef::LHEEvent::scales |
( |
| ) |
const |
|
inline |
◆ setNpLO()
void lhef::LHEEvent::setNpLO |
( |
int |
n | ) |
|
|
inline |
◆ setNpNLO()
void lhef::LHEEvent::setNpNLO |
( |
int |
n | ) |
|
|
inline |
◆ setPDF()
void lhef::LHEEvent::setPDF |
( |
std::unique_ptr< PDF > |
pdf | ) |
|
|
inline |
◆ setScales()
void lhef::LHEEvent::setScales |
( |
const std::vector< float > & |
scales | ) |
|
|
inline |
◆ weights()
const std::vector<WGT>& lhef::LHEEvent::weights |
( |
| ) |
const |
|
inline |
◆ comments
std::vector<std::string> lhef::LHEEvent::comments |
|
private |
◆ counted
bool lhef::LHEEvent::counted |
|
private |
◆ hepeup
◆ npLO_
int lhef::LHEEvent::npLO_ |
|
private |
◆ npNLO_
int lhef::LHEEvent::npNLO_ |
|
private |
◆ originalXWGTUP_
double lhef::LHEEvent::originalXWGTUP_ |
|
private |
◆ pdf
std::unique_ptr<PDF> lhef::LHEEvent::pdf |
|
private |
◆ readAttemptCounter
int lhef::LHEEvent::readAttemptCounter |
|
private |
◆ runInfo
const std::shared_ptr<LHERunInfo> lhef::LHEEvent::runInfo |
|
private |
◆ scales_
std::vector<float> lhef::LHEEvent::scales_ |
|
private |
◆ weights_
std::vector<WGT> lhef::LHEEvent::weights_ |
|
private |
static void fixSubTree(HepMC::GenVertex *vertex, HepMC::FourVector &_time, std::set< const HepMC::GenVertex * > &visited)
std::vector< std::pair< int, int > > MOTHUP
double originalXWGTUP() const
static int skipWhitespace(std::istream &in)
std::vector< double > SPINUP
HepMC::GenParticle * makeHepMCParticle(unsigned int i) const
static constexpr float b2
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< WGT > weights_
static constexpr float b1
comments_const_iterator comments_begin() const
static bool checkHepMCTree(const HepMC::GenEvent *event)
static const HepMC::GenVertex * findSignalVertex(const HepMC::GenEvent *event, bool status3=true)
std::vector< float > scales_
std::unique_ptr< PDF > pdf
std::vector< std::pair< int, int > > ICOLUP
std::vector< double > VTIMUP
const std::vector< WGT > & weights() const
double cTau(int pdgID, const HepPDT::ParticleDataTable *pdt)
std::pair< double, double > XPDWUP
const lhef::HEPEUP & hepeup() const
const std::vector< float > & scales() const
comments_const_iterator comments_end() const
std::vector< std::string > comments
const std::vector< float > & scales() const
const std::shared_ptr< LHERunInfo > runInfo
Abs< T >::type abs(const T &t)
std::vector< FiveVector > PUP
static void removeParticle(lhef::HEPEUP &hepeup, int index)
const HEPRUP * getHEPRUP() const
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection