Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:19:18

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2018
0003  *
0004  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
0005  * 
0006  * For the list of contributors see AUTHORS.
0007  *
0008  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
0009  *
0010  * or via email to bugs.jetscape@gmail.com
0011  *
0012  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
0013  * See COPYING for details.
0014  ******************************************************************************/
0015 
0016 #include "JetScapeEvent.h"
0017 #include <iostream>
0018 
0019 using namespace std;
0020 
0021 namespace Jetscape {
0022 
0023 JetScapeEvent::JetScapeEvent() {}
0024 
0025 JetScapeEvent::JetScapeEvent(const JetScapeEvent &c) {
0026   partonCollection.clear();
0027   const vector<Parton> tmp = c.getPartonCollection();
0028   for (unsigned int ipart = 0; ipart < tmp.size(); ipart++) {
0029     partonCollection.push_back(c.getParton(ipart));
0030   }
0031 }
0032 
0033 JetScapeEvent::~JetScapeEvent() { partonCollection.clear(); }
0034 
0035 const vector<Parton> &JetScapeEvent::getPartonCollection() const {
0036   return partonCollection;
0037 }
0038 
0039 const Parton &JetScapeEvent::getParton(int idx) const {
0040   return partonCollection.at(idx);
0041 }
0042 
0043 void JetScapeEvent::addParton(Parton &p) { partonCollection.push_back(p); }
0044 
0045 void JetScapeEvent::addPartonShower(shared_ptr<PartonShower> ps) {
0046   for (unsigned int ipart = 0; ipart < ps->GetNumberOfPartons(); ipart++) {
0047     partonCollection.push_back(*(ps->GetPartonAt(ipart)));
0048   }
0049 }
0050 
0051 void JetScapeEvent::deleteParton(int idx) {
0052   partonCollection.erase(partonCollection.begin() + idx); //inefficient delete!!
0053 }
0054 
0055 } // end namespace Jetscape