|
[Rivet-svn] rivet: Code formattingRivet Mercurial rivet at projects.hepforge.orgTue Nov 14 17:45:02 GMT 2017
details: https://rivet.hepforge.org/hg/rivet/rev/c85c6a00b49b branches: changeset: 6137:c85c6a00b49b user: Andy Buckley <andy at insectnation.org> date: Tue Nov 14 17:41:43 2017 +0000 description: Code formatting diffs (truncated from 74 to 50 lines): --- a/src/Projections/DISLepton.cc Mon Nov 13 14:44:31 2017 +0000 +++ b/src/Projections/DISLepton.cc Tue Nov 14 17:41:43 2017 +0000 @@ -11,46 +11,46 @@ void DISLepton::project(const Event& e) { + const ParticlePair& inc = applyProjection<Beam>(e, "Beam").beams(); - bool firstIsLepton = PID::isLepton(inc.first.pid()); bool secondIsLepton = PID::isLepton(inc.second.pid()); - if (firstIsLepton && !secondIsLepton) { _incoming = inc.first; } else if (!firstIsLepton && secondIsLepton) { _incoming = inc.second; } else { - //eek! throw Error("DISLepton projector could not find the correct beam."); } - const GenParticle* current_l=_incoming.genParticle(); + + const GenParticle* current_l = _incoming.genParticle(); bool found_next_vertex = true; while (found_next_vertex) { - found_next_vertex = false; - if (!current_l->end_vertex()) break; - std::vector<const GenParticle*> out_n; - std::vector<const GenParticle*> out_c; - for (const GenParticle* pp : particles_out(current_l, HepMC::children)) { - if (current_l->pdg_id() == pp->pdg_id()) out_n.push_back(pp); - //+-1 should allow neutrino to electron and electron to neutrino - if (std::abs(std::abs(current_l->pdg_id()) - std::abs(pp->pdg_id())) == 1) out_c.push_back(pp); - } - if (out_n.empty() && out_c.empty()) { - MSG_WARNING("DISLepton projector: no electron/lepton in the new vertex."); - break; - } - if (out_c.size() + out_n.size() > 1) { - MSG_WARNING("DISLepton projector: more than one electron/lepton in the new vertex."); - break; - } - if (out_c.size() == 1) current_l = out_c.front(); - if (out_n.size() == 1) current_l = out_n.front(); - found_next_vertex = true; + found_next_vertex = false; + if (!current_l->end_vertex()) break; + vector<const GenParticle*> out_n, out_c; + for (const GenParticle* pp : particles_out(current_l, HepMC::children)) { + if (current_l->pdg_id() == pp->pdg_id()) out_n.push_back(pp);
More information about the Rivet-svn mailing list |