67 r.beam (L * e.
beam());
69 list<particle>::const_iterator
p = e.
_initial.begin();
71 r.addinitial(L * (*p));
75 while (p != e.
_final.end()) {
137 list<particle>::const_iterator
p;
141 int q_conserved, p_conserved;
145 q_initial += p->Charge();
146 p_initial += p->get4P();
150 while (p !=
_final.end()) {
151 q_final += p->Charge();
152 p_final += p->get4P();
155 q_conserved = q_initial == q_final;
156 p_conserved = (p_initial - p_final).lenSq() < epsilon;
158 return(q_conserved && p_conserved);
166 const int debug)
const
170 cout <<
"Looking for " << name << charge <<
"[" << index <<
"] in event" << endl;
171 list<particle>::const_iterator
p =
_final.begin();
172 while (p !=
_final.end()) {
174 cout <<
"checking against " << p->Name() << p->Charge() << endl;
175 if ((p->Name() == name) && (p->Charge() == charge)) {
178 cout <<
"found one" << endl
179 <<
"checking against index " << i << endl;
182 cout <<
"found the right one, getting 4p" << endl
191 throw(
"PartNotFound");
199 const int index)
const
202 list<particle>::const_iterator
p =
_initial.begin();
204 if ((p->Name() == name) && (i++ == index))
206 throw(
"PartNotFound");
215 list<particle>::const_iterator
p =
_final.begin();
216 while (p !=
_final.end()) {
227 list<particle>::const_iterator it =
_final.begin();
230 while (it !=
_final.end()) {
245 list<particle>::const_iterator
p =
_final.begin();
246 while (p !=
_final.end()) {
259 list<particle>::const_iterator
p =
_final.begin();
260 while (p !=
_final.end()) {
272 const int index)
const
275 list<particle>::const_iterator
p =
_final.begin();
276 while (p !=
_final.end()) {
277 if ((p->Name() == name) && (p->Charge() == charge)) {
284 throw(
"PartNotFound");
300 list<particle>::const_iterator
p =
_initial.begin();
313 list<particle>::const_iterator
p =
_initial.begin();
327 list<particle>::const_iterator
p =
_initial.begin();
340 const int index)
const
343 list<particle>::const_iterator
p =
_initial.begin();
345 if ((p->Name() == name) && (p->Charge() == charge)) {
352 throw(
"PartNotFound");
361 list<particle>::const_iterator
p = i.begin();
362 while (p != i.end()) {
369 while (p != f.end()) {
386 list<particle>::const_iterator
p = i.begin();
387 while (p != i.end()) {
394 while (p != f.end()) {
414 cout <<
"final particles: ";
416 list<particle>::const_iterator
p =
_final.begin();
417 while (p !=
_final.end()) {
435 throw(
"badIOVersion");
443 const unsigned int nmbDigits = numeric_limits<double>::digits10 + 1;
445 s.precision(nmbDigits);
446 s.setf(ios_base::scientific, ios_base::floatfield);
447 s <<
_final.size() + 1 << endl;
451 << v.
x() <<
" " << v.
y() <<
" " << v.
z() <<
" "
453 list<particle>::const_iterator part =
_final.begin();
454 while (part !=
_final.end()) {
456 s <<
name2id(part->Name(), part->Charge()) <<
" "
457 << part->Charge() <<
" "
458 << v.
x() <<
" " << v.
y() <<
" " << v.
z() <<
" "
470 const unsigned int nmbDigits = numeric_limits<double>::digits10 + 1;
472 s.precision(nmbDigits);
473 s.setf(ios_base::scientific, ios_base::floatfield);
478 << v.
x() <<
" " << v.
y() <<
" " << v.
z() <<
" "
484 << v.
x() <<
" " << v.
y() <<
" " << v.
z() <<
" "
486 list<particle>::const_iterator part =
_final.begin();
487 while (part !=
_final.end()) {
489 s <<
"F " <<
name2id(part->Name(), part->Charge()) <<
" "
490 << part->Charge() <<
" "
492 << v.
x() <<
" " << v.
y() <<
" " << v.
z() <<
" "
513 throw(
"badIOVersion");
527 for (
int i = 0;
i < nparticles; ++
i) {
529 double px, py, pz, t;
530 is >> ptype >> q >> px >> py >> pz >> t;
549 while (!(is >> Tag).eof()) {
551 double px, py, pz, t;
552 is >> ptype >> q >> t >> px >> py >> pz;
581 if ((ver >= 1) && (ver <= 2))
584 cerr <<
"unknown io version " << ver << endl;
585 throw (
"UnknownIOVersion");