CMS 3D CMS Logo

lhef::LHEEvent Class Reference

#include <GeneratorInterface/LHEInterface/interface/LHEEvent.h>

List of all members.

Public Types

typedef LHEEventProduct::PDF PDF

Public Member Functions

void addComment (const std::string &line)
std::auto_ptr< HepMC::GenEvent > asHepMCEvent () const
void count (LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
void fillEventInfo (HepMC::GenEvent *hepmc) const
void fillPdfInfo (HepMC::PdfInfo *info) const
const std::vector< std::string > & getComments () const
const HEPEUPgetHEPEUP () const
const HEPRUPgetHEPRUP () const
const PDFgetPDF () const
const boost::shared_ptr
< LHERunInfo > & 
getRunInfo () const
 LHEEvent (const boost::shared_ptr< LHERunInfo > &runInfo, const LHEEventProduct &product)
 LHEEvent (const boost::shared_ptr< LHERunInfo > &runInfo, const HEPEUP &hepeup, const LHEEventProduct::PDF *pdf, const std::vector< std::string > &comments)
 LHEEvent (const boost::shared_ptr< LHERunInfo > &runInfo, const HEPEUP &hepeup)
 LHEEvent (const boost::shared_ptr< LHERunInfo > &runInfo, std::istream &in)
void removeResonances (const std::vector< int > &ids)
void setPDF (std::auto_ptr< PDF > pdf)
 ~LHEEvent ()

Static Public Member Functions

static const HepMC::GenVertex * findSignalVertex (const HepMC::GenEvent *event, bool status3=true)
static void fixHepMCEventTimeOrdering (HepMC::GenEvent *event)
static void removeParticle (lhef::HEPEUP &hepeup, int index)

Private Member Functions

HepMC::GenParticle * makeHepMCParticle (unsigned int i) const

Static Private Member Functions

static bool checkHepMCTree (const HepMC::GenEvent *event)

Private Attributes

std::vector< std::string > comments
HEPEUP hepeup
std::auto_ptr< PDFpdf
const boost::shared_ptr
< LHERunInfo
runInfo


Detailed Description

Definition at line 25 of file LHEEvent.h.


Member Typedef Documentation

typedef LHEEventProduct::PDF lhef::LHEEvent::PDF

Definition at line 39 of file LHEEvent.h.


Constructor & Destructor Documentation

lhef::LHEEvent::LHEEvent ( const boost::shared_ptr< LHERunInfo > &  runInfo,
std::istream &  in 
)

Definition at line 36 of file LHEEvent.cc.

References funct::abs(), lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, comments, lat::endl(), hepeup, i, lhef::HEPEUP::ICOLUP, lhef::HEPEUP::IDPRUP, lhef::HEPEUP::IDUP, lhef::HEPEUP::ISTUP, parsecf::pyparsing::line(), lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, pdf, lhef::HEPEUP::PUP, lhef::HEPEUP::resize(), lhef::HEPEUP::SCALUP, skipWhitespace(), lhef::HEPEUP::SPINUP, ss, ecalRecalibSequence_cff::tag, lhef::HEPEUP::VTIMUP, lhef::HEPEUP::XPDWUP, and lhef::HEPEUP::XWGTUP.

00037                                    :
00038         runInfo(runInfo)
00039 {
00040         hepeup.NUP = 0;
00041         hepeup.XPDWUP.first = hepeup.XPDWUP.second = 0.0;
00042 
00043         in >> hepeup.NUP >> hepeup.IDPRUP >> hepeup.XWGTUP
00044            >> hepeup.SCALUP >> hepeup.AQEDUP >> hepeup.AQCDUP;
00045         if (!in.good())
00046                 throw cms::Exception("InvalidFormat")
00047                         << "Les Houches file contained invalid"
00048                            " event header." << std::endl;
00049 
00050         int idwtup = runInfo->getHEPRUP()->IDWTUP;
00051         if (idwtup >= 0 && hepeup.XWGTUP < 0) {
00052                 edm::LogWarning("Generator|LHEInterface")
00053                         << "Non-allowed egative event weight encountered."
00054                         << std::endl;
00055                 hepeup.XWGTUP = std::abs(hepeup.XWGTUP);
00056         }
00057         if (std::abs(idwtup) >= 3 && std::abs(hepeup.XWGTUP) != 1.) {
00058                 edm::LogWarning("Generator|LHEInterface")
00059                         << "Event weight not set to one for abs(IDWTUP) >= 3"
00060                         << std::endl;
00061                 hepeup.XWGTUP = hepeup.XWGTUP > 0. ? 1.0 : -1.0;
00062         }
00063 
00064         hepeup.resize();
00065 
00066         for(int i = 0; i < hepeup.NUP; i++) {
00067                 in >> hepeup.IDUP[i] >> hepeup.ISTUP[i]
00068                    >> hepeup.MOTHUP[i].first >> hepeup.MOTHUP[i].second
00069                    >> hepeup.ICOLUP[i].first >> hepeup.ICOLUP[i].second
00070                    >> hepeup.PUP[i][0] >> hepeup.PUP[i][1] >> hepeup.PUP[i][2]
00071                    >> hepeup.PUP[i][3] >> hepeup.PUP[i][4]
00072                    >> hepeup.VTIMUP[i] >> hepeup.SPINUP[i];
00073                 if (!in.good())
00074                         throw cms::Exception("InvalidFormat")
00075                                 << "Les Houches file contained invalid event"
00076                                    " in particle line " << (i + 1)
00077                                 << "." << std::endl;
00078         }
00079 
00080         while(skipWhitespace(in) == '#') {
00081                 std::string line;
00082                 std::getline(in, line);
00083                 std::istringstream ss(line);
00084                 std::string tag;
00085                 ss >> tag;
00086                 if (tag == "#pdf") {
00087                         pdf.reset(new PDF);
00088                         ss >> pdf->id.first >> pdf->id.second
00089                            >> pdf->x.first >> pdf->x.second
00090                            >> pdf->scalePDF
00091                            >> pdf->xPDF.first >> pdf->xPDF.second;
00092                         if (ss.bad()) {
00093                                 edm::LogWarning("Generator|LHEInterface")
00094                                         << "Les Houches event contained"
00095                                            " unparseable PDF information."
00096                                         << std::endl;
00097                                 pdf.reset();
00098                         } else
00099                                 continue;
00100                 }
00101 
00102                 comments.push_back(line + "\n");
00103         }
00104 
00105         if (!in.eof())
00106                 edm::LogWarning("Generator|LHEInterface")
00107                         << "Les Houches file contained spurious"
00108                            " content after event data." << std::endl;
00109 }

lhef::LHEEvent::LHEEvent ( const boost::shared_ptr< LHERunInfo > &  runInfo,
const HEPEUP hepeup 
)

Definition at line 111 of file LHEEvent.cc.

00112                                          :
00113         runInfo(runInfo), hepeup(hepeup)
00114 {
00115 }

lhef::LHEEvent::LHEEvent ( const boost::shared_ptr< LHERunInfo > &  runInfo,
const HEPEUP hepeup,
const LHEEventProduct::PDF pdf,
const std::vector< std::string > &  comments 
)

Definition at line 117 of file LHEEvent.cc.

00120                                                          :
00121         runInfo(runInfo), hepeup(hepeup), pdf(pdf ? new PDF(*pdf) : 0),
00122         comments(comments)
00123 {
00124 }

lhef::LHEEvent::LHEEvent ( const boost::shared_ptr< LHERunInfo > &  runInfo,
const LHEEventProduct product 
)

Definition at line 126 of file LHEEvent.cc.

00127                                                    :
00128         runInfo(runInfo), hepeup(product.hepeup()),
00129         pdf(product.pdf() ? new PDF(*product.pdf()) : 0),
00130         comments(product.comments_begin(), product.comments_end())
00131 {
00132 }

lhef::LHEEvent::~LHEEvent (  ) 

Definition at line 134 of file LHEEvent.cc.

00135 {
00136 }


Member Function Documentation

void lhef::LHEEvent::addComment ( const std::string &  line  )  [inline]

Definition at line 49 of file LHEEvent.h.

00049 { comments.push_back(line); }

std::auto_ptr< HepMC::GenEvent > lhef::LHEEvent::asHepMCEvent (  )  const

Definition at line 239 of file LHEEvent.cc.

References lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, b1, b2, checkHepMCTree(), lat::endl(), findSignalVertex(), genParticles_cfi::genParticles, getHEPRUP(), hepeup, i, lhef::HEPEUP::IDPRUP, iter, j, makeHepMCParticle(), lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, lhef::HEPEUP::SCALUP, v1, v2, and lhef::HEPEUP::VTIMUP.

00240 {
00241         std::auto_ptr<HepMC::GenEvent> hepmc(new HepMC::GenEvent);
00242 
00243         hepmc->set_signal_process_id(hepeup.IDPRUP);
00244         hepmc->set_event_scale(hepeup.SCALUP);
00245         hepmc->set_alphaQED(hepeup.AQEDUP);
00246         hepmc->set_alphaQCD(hepeup.AQCDUP);
00247 
00248         unsigned int nup = hepeup.NUP; // particles in event
00249 
00250         // any particles in HEPEUP block?
00251         if (!nup) {
00252                 edm::LogWarning("Generator|LHEInterface")
00253                         << "Les Houches Event does not contain any partons. "
00254                         << "Not much to convert." ;
00255                 return hepmc;
00256         }
00257 
00258         // stores (pointers to) converted particles
00259         std::vector<HepMC::GenParticle*> genParticles;
00260         std::vector<HepMC::GenVertex*> genVertices;
00261 
00262         // I. convert particles
00263         for(unsigned int i = 0; i < nup; i++)
00264                 genParticles.push_back(makeHepMCParticle(i));
00265 
00266         // II. loop again to build vertices
00267         for(unsigned int i = 0; i < nup; i++) {
00268                 unsigned int mother1 = hepeup.MOTHUP.at(i).first;
00269                 unsigned int mother2 = hepeup.MOTHUP.at(i).second;
00270                 double cTau = hepeup.VTIMUP.at(i);      // decay time
00271         
00272                 // current particle has a mother? --- Sorry, parent! We're PC.
00273                 if (mother1) {
00274                         mother1--;      // FORTRAN notation!
00275                 if (mother2)
00276                         mother2--;
00277                 else
00278                         mother2 = mother1;
00279 
00280                 HepMC::GenParticle *in_par = genParticles.at(mother1);
00281                 HepMC::GenVertex *current_vtx = in_par->end_vertex();  // vertex of first mother
00282 
00283                 if (!current_vtx) {
00284                         current_vtx = new HepMC::GenVertex(
00285                                         HepMC::FourVector(0, 0, 0, cTau));
00286 
00287                         // add vertex to event
00288                         genVertices.push_back(current_vtx);
00289                 }
00290 
00291                 for(unsigned int j = mother1; j <= mother2; j++)        // set mother-daughter relations
00292                         if (!genParticles.at(j)->end_vertex())
00293                                 current_vtx->add_particle_in(genParticles.at(j));
00294 
00295                         // connect THIS outgoing particle to current vertex
00296                         current_vtx->add_particle_out(genParticles.at(i));
00297                 }
00298         }
00299 
00300         checkHepMCTree(hepmc.get());
00301 
00302         // III. restore color flow
00303         // ok, nobody knows how to do it so far...
00304 
00305         // IV. fill run information
00306         const HEPRUP *heprup = getHEPRUP();
00307 
00308         // set beam particles
00309         HepMC::GenParticle *b1 = new HepMC::GenParticle(
00310                         HepMC::FourVector(0.0, 0.0, +heprup->EBMUP.first,
00311                                                      heprup->EBMUP.first),
00312                         heprup->IDBMUP.first);
00313         HepMC::GenParticle *b2 = new HepMC::GenParticle(
00314                         HepMC::FourVector(0.0, 0.0, -heprup->EBMUP.second,
00315                                                      heprup->EBMUP.second),
00316                         heprup->IDBMUP.second);
00317         b1->set_status(3);
00318         b2->set_status(3);
00319 
00320         HepMC::GenVertex *v1 = new HepMC::GenVertex();
00321         HepMC::GenVertex *v2 = new HepMC::GenVertex();
00322         v1->add_particle_in(b1);
00323         v2->add_particle_in(b2);
00324 
00325         hepmc->add_vertex(v1);
00326         hepmc->add_vertex(v2);
00327         hepmc->set_beam_particles(b1, b2);
00328 
00329         // first two particles have to be the hard partons going into the interaction
00330         if (genParticles.size() >= 2) {
00331                 if (!genParticles.at(0)->production_vertex() &&
00332                     !genParticles.at(1)->production_vertex()) {
00333                         v1->add_particle_out(genParticles.at(0));
00334                         v2->add_particle_out(genParticles.at(1));
00335                 } else
00336                         edm::LogWarning("Generator|LHEInterface")
00337                                 << "Initial partons do already have a"
00338                                    " production vertex. " << std::endl
00339                                 << "Beam particles not connected.";
00340         } else
00341                 edm::LogWarning("Generator|LHEInterface")
00342                         << "Can't find any initial partons to be"
00343                            " connected to the beam particles.";
00344 
00345         for(std::vector<HepMC::GenVertex*>::const_iterator iter = genVertices.begin();
00346             iter != genVertices.end(); ++iter)
00347                 hepmc->add_vertex(*iter);
00348 
00349         // do some more consistency checks
00350         for(unsigned int i = 0; i < nup; i++) {
00351                 if (!genParticles.at(i)->parent_event()) {
00352                         edm::LogWarning("Generator|LHEInterface")
00353                                 << "Not all LHE particles could be stored"
00354                                    "  stored in the HepMC event. "
00355                                 << std::endl
00356                                 << "Check the mother-daughter relations"
00357                                    " in the given LHE input file.";
00358                         break;
00359                 }
00360         }
00361 
00362         hepmc->set_signal_process_vertex(
00363                         const_cast<HepMC::GenVertex*>(
00364                                 findSignalVertex(hepmc.get(), false)));
00365 
00366         return hepmc;
00367 }

bool lhef::LHEEvent::checkHepMCTree ( const HepMC::GenEvent *  event  )  [static, private]

Definition at line 386 of file LHEEvent.cc.

References iter, and StDecayID::status.

Referenced by asHepMCEvent().

00387 {
00388         double px = 0, py = 0, pz = 0, E = 0;
00389 
00390         for(HepMC::GenEvent::particle_const_iterator iter = event->particles_begin();
00391             iter != event->particles_end(); iter++) {
00392                 int status = (*iter)->status();
00393                 HepMC::FourVector fv = (*iter)->momentum();
00394 
00395                 // incoming particles
00396                 if (status == 3 &&
00397                     *iter != event->beam_particles().first &&
00398                     *iter != event->beam_particles().second) {
00399                         px -= fv.px();
00400                         py -= fv.py();
00401                         pz -= fv.pz();
00402                         E  -= fv.e();
00403                 }
00404 
00405                 // outgoing particles
00406                 if (status == 1) {
00407                         px += fv.px();
00408                         py += fv.py();
00409                         pz += fv.pz();
00410                         E  += fv.e();
00411                 }
00412         }
00413 
00414         if (px*px + py*py + pz*pz + E*E > 0.1) {
00415                 edm::LogWarning("Generator|LHEInterface")
00416                         << "Energy-momentum badly conserved. "
00417                         << std::setprecision(3)
00418                         << "sum p_i  = ["
00419                         << std::setw(7) << E << ", "
00420                         << std::setw(7) << px << ", "
00421                         << std::setw(7) << py << ", "
00422                         << std::setw(7) << pz << "]";
00423 
00424                 return false;
00425         }
00426 
00427         return true;
00428 }

void lhef::LHEEvent::count ( LHERunInfo::CountMode  count,
double  weight = 1.0,
double  matchWeight = 1.0 
)

Definition at line 196 of file LHEEvent.cc.

References hepeup, lhef::HEPEUP::IDPRUP, runInfo, and lhef::HEPEUP::XWGTUP.

00198 {
00199         runInfo->count(hepeup.IDPRUP, mode, hepeup.XWGTUP,
00200                        weight, matchWeight);
00201 }

void lhef::LHEEvent::fillEventInfo ( HepMC::GenEvent *  hepmc  )  const

Definition at line 231 of file LHEEvent.cc.

References lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, hepeup, lhef::HEPEUP::IDPRUP, and lhef::HEPEUP::SCALUP.

00232 {
00233         event->set_signal_process_id(hepeup.IDPRUP);
00234         event->set_event_scale(hepeup.SCALUP);
00235         event->set_alphaQED(hepeup.AQEDUP);
00236         event->set_alphaQCD(hepeup.AQCDUP);
00237 }

void lhef::LHEEvent::fillPdfInfo ( HepMC::PdfInfo *  info  )  const

Definition at line 203 of file LHEEvent.cc.

References funct::abs(), lhef::HEPRUP::EBMUP, getHEPRUP(), hepeup, lhef::HEPEUP::IDUP, lhef::HEPEUP::NUP, pdf, lhef::HEPEUP::PUP, and lhef::HEPEUP::SCALUP.

00204 {
00205         if (pdf.get()) {
00206                 info->set_id1(pdf->id.first);
00207                 info->set_id2(pdf->id.second);
00208                 info->set_x1(pdf->x.first);
00209                 info->set_x2(pdf->x.second);
00210                 info->set_pdf1(pdf->xPDF.first);
00211                 info->set_pdf2(pdf->xPDF.second);
00212                 info->set_scalePDF(pdf->scalePDF);
00213         } else if (hepeup.NUP >= 2) {
00214                 const HEPRUP *heprup = getHEPRUP();
00215                 info->set_id1(hepeup.IDUP[0] == 21 ? 0 : hepeup.IDUP[0]);
00216                 info->set_id2(hepeup.IDUP[1] == 21 ? 0 : hepeup.IDUP[1]);
00217                 info->set_x1(std::abs(hepeup.PUP[0][2] / heprup->EBMUP.first));
00218                 info->set_x2(std::abs(hepeup.PUP[1][2] / heprup->EBMUP.second));
00219                 info->set_pdf1(-1.0);
00220                 info->set_pdf2(-1.0);
00221                 info->set_scalePDF(hepeup.SCALUP);
00222         } else {
00223                 info->set_x1(-1.0);
00224                 info->set_x2(-1.0);
00225                 info->set_pdf1(-1.0);
00226                 info->set_pdf2(-1.0);
00227                 info->set_scalePDF(hepeup.SCALUP);
00228         }
00229 }

const HepMC::GenVertex * lhef::LHEEvent::findSignalVertex ( const HepMC::GenEvent *  event,
bool  status3 = true 
) [static]

Definition at line 430 of file LHEEvent.cc.

References iter.

Referenced by asHepMCEvent(), lhef::Hadronisation::hadronize(), and lhef::Hadronisation::showeredEvent().

00432 {
00433         double largestMass2 = -9.0e-30;
00434         const HepMC::GenVertex *vertex = 0;
00435         for(HepMC::GenEvent::vertex_const_iterator iter = event->vertices_begin();
00436             iter != event->vertices_end(); ++iter) {
00437                 if ((*iter)->particles_in_size() < 2)
00438                         continue;
00439                 if ((*iter)->particles_out_size() < 1 ||
00440                     ((*iter)->particles_out_size() == 1 &&
00441                      (!(*(*iter)->particles_out_const_begin())->end_vertex() ||
00442                       !(*(*iter)->particles_out_const_begin())
00443                                 ->end_vertex()->particles_out_size())))
00444                         continue;
00445 
00446                 double px = 0.0, py = 0.0, pz = 0.0, E = 0.0;
00447                 bool hadStatus3 = false;
00448                 for(HepMC::GenVertex::particles_out_const_iterator iter2 =
00449                                         (*iter)->particles_out_const_begin();
00450                     iter2 != (*iter)->particles_out_const_end(); ++iter2) {
00451                         hadStatus3 = hadStatus3 || (*iter2)->status() == 3;
00452                         px += (*iter2)->momentum().px();
00453                         py += (*iter2)->momentum().py();
00454                         pz += (*iter2)->momentum().pz();
00455                         E += (*iter2)->momentum().e();
00456                 }
00457                 if (status3 && !hadStatus3)
00458                         continue;
00459 
00460                 double mass2 = E * E - (px * px + py * py + pz * pz);
00461                 if (mass2 > largestMass2) {
00462                         vertex = *iter;
00463                         largestMass2 = mass2;
00464                 }
00465         }
00466 
00467         return vertex;
00468 }

void lhef::LHEEvent::fixHepMCEventTimeOrdering ( HepMC::GenEvent *  event  )  [static]

Definition at line 494 of file LHEEvent.cc.

References lhef::fixSubTree(), and iter.

Referenced by lhef::Herwig6Hadronisation::doHadronisation().

00495 {
00496         std::set<const HepMC::GenVertex*> visited;
00497         HepMC::FourVector zeroTime;
00498         for(HepMC::GenEvent::vertex_iterator iter = event->vertices_begin();
00499             iter != event->vertices_end(); ++iter)
00500                 fixSubTree(*iter, zeroTime, visited);
00501 }

const std::vector<std::string>& lhef::LHEEvent::getComments (  )  const [inline]

Definition at line 45 of file LHEEvent.h.

00045 { return comments; }

const HEPEUP* lhef::LHEEvent::getHEPEUP (  )  const [inline]

Definition at line 42 of file LHEEvent.h.

00042 { return &hepeup; }

const HEPRUP* lhef::LHEEvent::getHEPRUP (  )  const [inline]

Definition at line 43 of file LHEEvent.h.

Referenced by asHepMCEvent(), and fillPdfInfo().

00043 { return runInfo->getHEPRUP(); }

const PDF* lhef::LHEEvent::getPDF (  )  const [inline]

Definition at line 44 of file LHEEvent.h.

00044 { return pdf.get(); }

const boost::shared_ptr<LHERunInfo>& lhef::LHEEvent::getRunInfo (  )  const [inline]

Definition at line 41 of file LHEEvent.h.

00041 { return runInfo; }

HepMC::GenParticle * lhef::LHEEvent::makeHepMCParticle ( unsigned int  i  )  const [private]

Definition at line 369 of file LHEEvent.cc.

References hepeup, lhef::HEPEUP::IDUP, lhef::HEPEUP::ISTUP, lhef::HEPEUP::PUP, and StDecayID::status.

Referenced by asHepMCEvent().

00370 {
00371         HepMC::GenParticle *particle = new HepMC::GenParticle(
00372                         HepMC::FourVector(hepeup.PUP.at(i)[0],
00373                                           hepeup.PUP.at(i)[1],
00374                                           hepeup.PUP.at(i)[2],
00375                                           hepeup.PUP.at(i)[3]),
00376                         hepeup.IDUP.at(i));
00377 
00378         int status = hepeup.ISTUP.at(i);
00379 
00380         particle->set_generated_mass(hepeup.PUP.at(i)[4]);
00381         particle->set_status(status > 0 ? (status == 2 ? 3 : status) : 3);
00382 
00383         return particle;
00384 }

void lhef::LHEEvent::removeParticle ( lhef::HEPEUP hepeup,
int  index 
) [static]

Definition at line 145 of file LHEEvent.cc.

References lat::endl(), i, lhef::HEPEUP::ICOLUP, lhef::HEPEUP::IDUP, lhef::HEPEUP::ISTUP, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, lhef::pop(), lhef::HEPEUP::PUP, lhef::HEPEUP::resize(), lhef::HEPEUP::SPINUP, and lhef::HEPEUP::VTIMUP.

Referenced by removeResonances().

00146 {
00147         index--;
00148         if (index < 0 || index >= hepeup.NUP) {
00149                 edm::LogError("Generator|LHEInterface")
00150                         << "removeParticle: Index " << (index + 1)
00151                         << " out of bounds." << std::endl;
00152                 return;
00153         }
00154 
00155         std::pair<int, int> mo = hepeup.MOTHUP[index];
00156 
00157         pop(hepeup.IDUP, index);
00158         pop(hepeup.ISTUP, index);
00159         pop(hepeup.MOTHUP, index);
00160         pop(hepeup.ICOLUP, index);
00161         pop(hepeup.PUP, index);
00162         pop(hepeup.VTIMUP, index);
00163         pop(hepeup.SPINUP, index);
00164         hepeup.NUP--;
00165         hepeup.resize();
00166 
00167         index++;
00168         for(int i = 0; i < hepeup.NUP; i++) {
00169                 if (hepeup.MOTHUP[i].first == index) {
00170                         if (hepeup.MOTHUP[i].second > 0)
00171                                 edm::LogError("Generator|LHEInterface")
00172                                         << "removeParticle: Particle "
00173                                         << (i + 2) << " has two mothers."
00174                                         << std::endl;
00175                         hepeup.MOTHUP[i] = mo;
00176                 }
00177 
00178                 if (hepeup.MOTHUP[i].first > index)
00179                         hepeup.MOTHUP[i].first--;
00180                 if (hepeup.MOTHUP[i].second > index)
00181                         hepeup.MOTHUP[i].second--;
00182         }
00183 }

void lhef::LHEEvent::removeResonances ( const std::vector< int > &  ids  ) 

Definition at line 185 of file LHEEvent.cc.

References funct::abs(), find(), hepeup, i, lhef::HEPEUP::IDUP, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, and removeParticle().

00186 {
00187         for(int i = 1; i <= hepeup.NUP; i++) {
00188                 int id = std::abs(hepeup.IDUP[i - 1]);
00189                 if (hepeup.MOTHUP[i - 1].first > 0 &&
00190                     hepeup.MOTHUP[i - 1].second > 0 &&
00191                     std::find(ids.begin(), ids.end(), id) != ids.end())
00192                         removeParticle(hepeup, i--);
00193         }
00194 }

void lhef::LHEEvent::setPDF ( std::auto_ptr< PDF pdf  )  [inline]

Definition at line 47 of file LHEEvent.h.

00047 { this->pdf = pdf; }


Member Data Documentation

std::vector<std::string> lhef::LHEEvent::comments [private]

Definition at line 75 of file LHEEvent.h.

Referenced by LHEEvent().

HEPEUP lhef::LHEEvent::hepeup [private]

Definition at line 73 of file LHEEvent.h.

Referenced by asHepMCEvent(), count(), fillEventInfo(), fillPdfInfo(), LHEEvent(), makeHepMCParticle(), and removeResonances().

std::auto_ptr<PDF> lhef::LHEEvent::pdf [private]

Definition at line 74 of file LHEEvent.h.

Referenced by fillPdfInfo(), and LHEEvent().

const boost::shared_ptr<LHERunInfo> lhef::LHEEvent::runInfo [private]

Definition at line 71 of file LHEEvent.h.

Referenced by count().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:48:50 2009 for CMSSW by  doxygen 1.5.4