Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetScapeEvent.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetScapeEvent.cc
1 /*******************************************************************************
2  * Copyright (c) The JETSCAPE Collaboration, 2018
3  *
4  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
5  *
6  * For the list of contributors see AUTHORS.
7  *
8  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9  *
10  * or via email to bugs.jetscape@gmail.com
11  *
12  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13  * See COPYING for details.
14  ******************************************************************************/
15 
16 #include "JetScapeEvent.h"
17 #include <iostream>
18 
19 using namespace std;
20 
21 namespace Jetscape {
22 
23 JetScapeEvent::JetScapeEvent() {}
24 
25 JetScapeEvent::JetScapeEvent(const JetScapeEvent &c) {
26  partonCollection.clear();
27  const vector<Parton> tmp = c.getPartonCollection();
28  for (unsigned int ipart = 0; ipart < tmp.size(); ipart++) {
29  partonCollection.push_back(c.getParton(ipart));
30  }
31 }
32 
33 JetScapeEvent::~JetScapeEvent() { partonCollection.clear(); }
34 
35 const vector<Parton> &JetScapeEvent::getPartonCollection() const {
36  return partonCollection;
37 }
38 
39 const Parton &JetScapeEvent::getParton(int idx) const {
40  return partonCollection.at(idx);
41 }
42 
43 void JetScapeEvent::addParton(Parton &p) { partonCollection.push_back(p); }
44 
45 void JetScapeEvent::addPartonShower(shared_ptr<PartonShower> ps) {
46  for (unsigned int ipart = 0; ipart < ps->GetNumberOfPartons(); ipart++) {
47  partonCollection.push_back(*(ps->GetPartonAt(ipart)));
48  }
49 }
50 
51 void JetScapeEvent::deleteParton(int idx) {
52  partonCollection.erase(partonCollection.begin() + idx); //inefficient delete!!
53 }
54 
55 } // end namespace Jetscape