Warning, /include/ThePEG/EventRecord/Collision.tcc is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //
0003 // Collision.tcc is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 //
0010 // This is the implementation of the templated member functions of
0011 // the Collision class.
0012 //
0013
0014 #include "Step.h"
0015 #include "Event.h"
0016
0017 namespace ThePEG {
0018
0019 template <class OutputIterator>
0020 void Collision::select(OutputIterator r, const SelectorBase & s) const {
0021 if ( s.allSteps() ) {
0022 if ( incoming().first && s.intermediate() && s.check(*incoming().first) )
0023 *r++ = incoming().first;
0024 if ( incoming().first && s.intermediate() && s.check(*incoming().second) )
0025 *r++ = incoming().second;
0026 for ( StepVector::const_iterator it = theSteps.begin();
0027 it != theSteps.end(); ++it ) (**it).select(r, s);
0028 } else {
0029 if ( incoming().first && s.intermediate() &&
0030 s.check(*incoming().first) && steps().size() < 2 )
0031 *r++ = incoming().first;
0032 if (incoming().first && s.intermediate() &&
0033 s.check(*incoming().second) && steps().size() < 2 )
0034 *r++ = incoming().second;
0035 finalStep()->select(r, s);
0036 }
0037 }
0038
0039 template <class Iterator>
0040 void Collision::addParticles(Iterator first, Iterator last) {
0041 allParticles.insert(first, last);
0042 if ( event() ) event()->addParticles(first, last);
0043 }
0044
0045 }