EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eXevent.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eXevent.cpp
1 
2 //
3 // Copyright 2017
4 //
5 // This file is part of estarlight.
6 //
7 // starlight is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // starlight is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with starlight. If not, see <http://www.gnu.org/licenses/>.
19 //
21 //
22 // File and Version Information:
23 // $Rev:: 263 $: revision of last commit
24 // $Author:: mlomnitz $: author of last commit
25 // $Date:: 02/28/2017 #$: date of last commit
26 //
27 // Description:
28 //
29 // Container for eX eventrs
30 //
31 //
33 
34 
35 #include "eXevent.h"
36 
37 
39  _particles(0)
40  ,_vertices(0)
41 { }
42 
44  _particles(0)
45  ,_vertices(0)
46 {
47  for(int i = 0; i < ev._numberOfTracks; i++)
48  {
50  ev.px[i],
51  ev.py[i],
52  ev.pz[i],
55  ev._fsParticle[i],
56  ev._charge[i]
57  );
58  addParticle(p);
59  }
60 }
61 
63 { }
64 
65 
67 {
68 
69  if(this != &rhs)
70  {
71  this->_particles = rhs._particles;
72  this->_vertices = rhs._vertices;
73  this->_gammaEnergies = rhs._gammaEnergies;
74  this->_sources = rhs._sources;
75  this->_target = rhs._target;
76  this->_vertext = rhs._vertext;
77  }
78  return *this;
79 }
80 
82 {
83  for(unsigned int n = 0; n < ev._particles.size(); n++)
84  {
85  this->_particles.push_back(ev._particles.at(n));
86  }
87  for(unsigned int n = 0; n < ev._vertices.size(); n++)
88  {
89  this->_vertices.push_back(ev._vertices.at(n));
90  }
91  for(unsigned int n = 0; n < ev._gammaEnergies.size(); n++)
92  {
93  this->_gammaEnergies.push_back(ev._gammaEnergies.at(n));
94  }
95  for(unsigned int n = 0; n<ev._sources.size(); ++n){
96  this->_sources.push_back(ev._sources.at(n));
97  }
98  for(unsigned int n = 0; n<ev._target.size(); ++n){
99  this->_target.push_back(ev._target.at(n));
100  }
101  for(unsigned int n = 0; n<ev._vertext.size(); ++n){
102  this->_vertext.push_back(ev._vertext.at(n));
103  }
104  return *this;
105 }
106 
107 void eXEvent::boost(double rapidity, double e_rapidity)
108 {
109  vector3 boostVector(0, 0, tanh(rapidity));
110  vector3 electron_boostVector(0, 0, tanh(e_rapidity));
111  //
112  std::vector<starlightParticle>::iterator part = _particles.begin();
113 
114  for (part = _particles.begin(); part != _particles.end(); part++)
115  {
116  (*part).Boost(boostVector);
117  }
118  std::vector<lorentzVector>::iterator ele = _sources.begin();
119  for( ele = _sources.begin(); ele != _sources.end(); ++ele){
120  (*ele).Boost(electron_boostVector);
121  }
122  std::vector<lorentzVector>::iterator target = _target.begin();
123  for( target = _target.begin(); target != _target.end(); ++target){
124  (*target).Boost(boostVector);
125  }
126 }
127 
129 {
130  //Flip decay leptons
131  std::vector<starlightParticle>::iterator part = _particles.begin();
132 
133  for (part = _particles.begin(); part != _particles.end(); part++)
134  {
135  lorentzVector v = (*part).getVertex();
136  (*part).reflect();
137  }
138 
139  //Flip gamma
140  _gamma[0].reflect();
141 
142  //Flip outgoing electron
143  _sources[0].reflect();
144 
145  //Flip target
146  _target[0].reflect();
147 
148 }