Changes in general code and added class energyhisto for

This commit is contained in:
Christian
2018-09-20 18:43:32 +02:00
parent 7f53fb2bef
commit b3b914f0b4
12 changed files with 473 additions and 245 deletions
+40 -11
View File
@@ -1,22 +1,51 @@
//
// particle.cpp
//
// mc_electron
//
// Created by Christian Reiling on 13.09.18.
// Created by Christian Reiling on 20.09.18.
// Copyright © 2018 Christian Reiling. All rights reserved.
//
#include <stdio.h>
#include <math.h>
#include <vector>
#include <iostream>
#include <fstream>
#include "blitz/array.h"
#include "blitz/tinyvec2.h"
#include "particle.h"
ostream& operator<<(ostream& os, const Particle& partOut)
{
std::ostream& operator<<(std::ostream& os, const species& SpecOut) {
switch (SpecOut) {
case electron:
os<<"e-";
break;
case positron:
os<<"e+";
break;
case proton:
os<<"p";
break;
case tritium:
os<<"T3";
break;
case tritium2:
os<<"T_2";
break;
case helium:
os<<"He3";
break;
case deuterium:
os<<"D2";
break;
case DT:
os<<"DT";
break;
default:
std::cerr<<"unknown species";
exit(1);
}
return (os);
}
std::ostream& operator<<(std::ostream& os, const Particle& partOut) {
os << "(" << partOut.id<<","<<partOut.s<<","<<partOut.m << "," << partOut.q << ","<< partOut.x<<","<< partOut.v <<")";
return os;
}