File indexing completed on 2024-09-27 07:03:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #include "eXevent.h"
0036
0037
0038 eXEvent::eXEvent() :
0039 _particles(0)
0040 ,_vertices(0)
0041 { }
0042
0043 eXEvent::eXEvent(starlightConstants::event &ev) :
0044 _particles(0)
0045 ,_vertices(0)
0046 {
0047 for(int i = 0; i < ev._numberOfTracks; i++)
0048 {
0049 starlightParticle p(
0050 ev.px[i],
0051 ev.py[i],
0052 ev.pz[i],
0053 starlightConstants::UNKNOWN,
0054 starlightConstants::UNKNOWN,
0055 ev._fsParticle[i],
0056 ev._charge[i]
0057 );
0058 addParticle(p);
0059 }
0060 }
0061
0062 eXEvent::~eXEvent()
0063 { }
0064
0065
0066 eXEvent& eXEvent::operator=(const eXEvent& rhs)
0067 {
0068
0069 if(this != &rhs)
0070 {
0071 this->_particles = rhs._particles;
0072 this->_vertices = rhs._vertices;
0073 this->_gammaEnergies = rhs._gammaEnergies;
0074 this->_sources = rhs._sources;
0075 this->_target = rhs._target;
0076 this->_vertext = rhs._vertext;
0077 }
0078 return *this;
0079 }
0080
0081 eXEvent& eXEvent::operator+(const eXEvent& ev)
0082 {
0083 for(unsigned int n = 0; n < ev._particles.size(); n++)
0084 {
0085 this->_particles.push_back(ev._particles.at(n));
0086 }
0087 for(unsigned int n = 0; n < ev._vertices.size(); n++)
0088 {
0089 this->_vertices.push_back(ev._vertices.at(n));
0090 }
0091 for(unsigned int n = 0; n < ev._gammaEnergies.size(); n++)
0092 {
0093 this->_gammaEnergies.push_back(ev._gammaEnergies.at(n));
0094 }
0095 for(unsigned int n = 0; n<ev._sources.size(); ++n){
0096 this->_sources.push_back(ev._sources.at(n));
0097 }
0098 for(unsigned int n = 0; n<ev._target.size(); ++n){
0099 this->_target.push_back(ev._target.at(n));
0100 }
0101 for(unsigned int n = 0; n<ev._vertext.size(); ++n){
0102 this->_vertext.push_back(ev._vertext.at(n));
0103 }
0104 return *this;
0105 }
0106
0107 void eXEvent::boost(double rapidity, double e_rapidity)
0108 {
0109 vector3 boostVector(0, 0, tanh(rapidity));
0110 vector3 electron_boostVector(0, 0, tanh(e_rapidity));
0111
0112 std::vector<starlightParticle>::iterator part = _particles.begin();
0113
0114 for (part = _particles.begin(); part != _particles.end(); part++)
0115 {
0116 (*part).Boost(boostVector);
0117 }
0118 std::vector<lorentzVector>::iterator ele = _sources.begin();
0119 for( ele = _sources.begin(); ele != _sources.end(); ++ele){
0120 (*ele).Boost(electron_boostVector);
0121 }
0122 std::vector<lorentzVector>::iterator target = _target.begin();
0123 for( target = _target.begin(); target != _target.end(); ++target){
0124 (*target).Boost(boostVector);
0125 }
0126 }
0127
0128 void eXEvent::reflect()
0129 {
0130
0131 std::vector<starlightParticle>::iterator part = _particles.begin();
0132
0133 for (part = _particles.begin(); part != _particles.end(); part++)
0134 {
0135 lorentzVector v = (*part).getVertex();
0136 (*part).reflect();
0137 }
0138
0139
0140 _gamma[0].reflect();
0141
0142
0143 _sources[0].reflect();
0144
0145
0146 _target[0].reflect();
0147
0148 }