#include <SimParticleHistory.h>
Collaboration diagram for DayaBay::SimParticleHistory:
Public Member Functions | |
SimParticleHistory () | |
Default Constructor. | |
~SimParticleHistory () | |
Destructor. | |
const SimTrackReference | track (int trackid) const |
This function returns either a SimTrackReference (which is either direct or indirect) for a given Geant track ID. | |
void | addTrack (SimTrack *aTrack) |
Add a track, transfers ownership. | |
void | addPrimaryTrack (const SimTrack *aTrack) |
Add track as a primary, does not transfer ownership. | |
void | addTrackRef (int id, const SimTrackReference &aRef) |
Add a new link. | |
void | addVertex (SimVertex *aVertex) |
Add a vertex to the history, transfers ownership. | |
std::vector< DayaBay::SimTrack * > | trackVector () |
Change a SimTrack list to a SimTrack vector. | |
std::vector< DayaBay::SimVertex * > | vertexVector () |
Change a SimVertex list to a SimVertex vector. | |
std::ostream & | fillStream (std::ostream &s) const |
Serialize to an ostream. | |
const std::list< DayaBay::SimTrack * > & | tracks () const |
Retrieve const List of tracks in this history. | |
const std::list< DayaBay::SimVertex * > & | vertices () const |
Retrieve const List of vertices in this history. | |
const std::list< const DayaBay::SimTrack * > & | primaryTracks () const |
Retrieve const List of primary tracks in this history. | |
const DayaBay::SimTrackReference & | currentTrack () const |
Retrieve const Reference to the current track. | |
void | setCurrentTrack (const DayaBay::SimTrackReference &value) |
Update Reference to the current track. | |
Static Public Member Functions | |
static void * | operator new (size_t size) |
operator new | |
static void * | operator new (size_t size, void *pObj) |
placement operator new it is needed by libstdc++ 3.2.3 (e.g. | |
static void | operator delete (void *p) |
operator delete | |
static void | operator delete (void *p, void *pObj) |
placement operator delete not sure if really needed, but it does not harm | |
Private Attributes | |
std::list< DayaBay::SimTrack * > | m_tracks |
List of tracks in this history. | |
std::list< DayaBay::SimVertex * > | m_vertices |
List of vertices in this history. | |
std::list< const DayaBay::SimTrack * > | m_primaryTracks |
List of primary tracks in this history. | |
std::map< int, DayaBay::SimTrackReference > | m_idToTrack |
Note that result may not be direct; holes may exist. | |
DayaBay::SimTrackReference | m_currentTrack |
Reference to the current track. |
Definition at line 46 of file SimParticleHistory.h.
DayaBay::SimParticleHistory::SimParticleHistory | ( | ) | [inline] |
Default Constructor.
Definition at line 51 of file SimParticleHistory.h.
00051 : m_tracks(), 00052 m_vertices(), 00053 m_primaryTracks(), 00054 m_idToTrack(), 00055 m_currentTrack() {}
SimParticleHistory::~SimParticleHistory | ( | ) |
Destructor.
Definition at line 7 of file SimParticleHistory.cc.
00008 { 00009 std::list<SimTrack*>::iterator trackIt; 00010 for(trackIt = m_tracks.begin(); trackIt != m_tracks.end(); ++trackIt) 00011 delete (*trackIt); 00012 m_tracks.clear(); 00013 00014 std::list<SimVertex*>::iterator vertexIt; 00015 for(vertexIt = m_vertices.begin(); vertexIt != m_vertices.end(); ++vertexIt) 00016 delete (*vertexIt); 00017 m_vertices.clear(); 00018 }
const SimTrackReference SimParticleHistory::track | ( | int | trackid | ) | const |
This function returns either a SimTrackReference (which is either direct or indirect) for a given Geant track ID.
Definition at line 46 of file SimParticleHistory.cc.
00047 { 00048 std::map<int, SimTrackReference>::const_iterator it; 00049 it = m_idToTrack.find(trackid); 00050 if(it == m_idToTrack.end()) { 00051 return SimTrackReference(NULL,-999); 00052 } 00053 return it->second; 00054 }
void SimParticleHistory::addTrack | ( | SimTrack * | aTrack | ) |
Add a track, transfers ownership.
Definition at line 58 of file SimParticleHistory.cc.
00059 { 00060 m_tracks.push_back(t); 00061 }
void SimParticleHistory::addPrimaryTrack | ( | const SimTrack * | aTrack | ) |
Add track as a primary, does not transfer ownership.
Definition at line 63 of file SimParticleHistory.cc.
00064 { 00065 m_primaryTracks.push_back(t); 00066 }
void SimParticleHistory::addTrackRef | ( | int | id, | |
const SimTrackReference & | aRef | |||
) |
Add a new link.
Definition at line 68 of file SimParticleHistory.cc.
00069 { 00070 m_idToTrack[id] = ref; 00071 }
void SimParticleHistory::addVertex | ( | SimVertex * | aVertex | ) |
Add a vertex to the history, transfers ownership.
Definition at line 73 of file SimParticleHistory.cc.
00074 { 00075 m_vertices.push_back(v); 00076 }
std::vector< DayaBay::SimTrack * > DayaBay::SimParticleHistory::trackVector | ( | ) | [inline] |
std::vector< DayaBay::SimVertex * > DayaBay::SimParticleHistory::vertexVector | ( | ) | [inline] |
Change a SimVertex list to a SimVertex vector.
Definition at line 199 of file SimParticleHistory.h.
00200 { 00201 00202 return std::vector<DayaBay::SimVertex*>(m_vertices.begin(),m_vertices.end()); 00203 00204 }
std::ostream & DayaBay::SimParticleHistory::fillStream | ( | std::ostream & | s | ) | const |
Serialize to an ostream.
Definition at line 20 of file SimParticleHistory.cc.
00021 { 00022 s << "{ " << std::endl; 00023 00024 s << m_tracks.size() << " tracks:\n"; 00025 std::list<SimTrack*>::const_iterator trackIt; 00026 for(trackIt = m_tracks.begin(); trackIt != m_tracks.end(); ++trackIt) { 00027 (*trackIt)->fillStream(s); 00028 s << std::endl; 00029 } 00030 00031 s << m_vertices.size() << " vertices:\n"; 00032 std::list<SimVertex*>::const_iterator vertexIt; 00033 for(vertexIt = m_vertices.begin(); vertexIt != m_vertices.end(); ++vertexIt) { 00034 (*vertexIt)->fillStream(s); 00035 s << std::endl; 00036 } 00037 00038 s << m_primaryTracks.size() << " primaryTracks:\n" 00039 << "}" << std::endl; 00040 00041 return s; 00042 }
const std::list< DayaBay::SimTrack * > & DayaBay::SimParticleHistory::tracks | ( | ) | const [inline] |
Retrieve const List of tracks in this history.
Definition at line 167 of file SimParticleHistory.h.
00168 { 00169 return m_tracks; 00170 }
const std::list< DayaBay::SimVertex * > & DayaBay::SimParticleHistory::vertices | ( | ) | const [inline] |
Retrieve const List of vertices in this history.
Definition at line 172 of file SimParticleHistory.h.
00173 { 00174 return m_vertices; 00175 }
const std::list< const DayaBay::SimTrack * > & DayaBay::SimParticleHistory::primaryTracks | ( | ) | const [inline] |
Retrieve const List of primary tracks in this history.
Definition at line 177 of file SimParticleHistory.h.
00178 { 00179 return m_primaryTracks; 00180 }
const DayaBay::SimTrackReference & DayaBay::SimParticleHistory::currentTrack | ( | ) | const [inline] |
Retrieve const Reference to the current track.
Definition at line 182 of file SimParticleHistory.h.
00183 { 00184 return m_currentTrack; 00185 }
void DayaBay::SimParticleHistory::setCurrentTrack | ( | const DayaBay::SimTrackReference & | value | ) | [inline] |
Update Reference to the current track.
Definition at line 187 of file SimParticleHistory.h.
00188 { 00189 m_currentTrack = value; 00190 }
static void* DayaBay::SimParticleHistory::operator new | ( | size_t | size | ) | [inline, static] |
operator new
Definition at line 108 of file SimParticleHistory.h.
00109 { 00110 return ( sizeof(SimParticleHistory) == size ? 00111 boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::malloc() : 00112 ::operator new(size) ); 00113 }
static void* DayaBay::SimParticleHistory::operator new | ( | size_t | size, | |
void * | pObj | |||
) | [inline, static] |
placement operator new it is needed by libstdc++ 3.2.3 (e.g.
in std::vector) it is not needed in libstdc++ >= 3.4
Definition at line 118 of file SimParticleHistory.h.
static void DayaBay::SimParticleHistory::operator delete | ( | void * | p | ) | [inline, static] |
operator delete
Definition at line 124 of file SimParticleHistory.h.
00125 { 00126 boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::is_from(p) ? 00127 boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::free(p) : 00128 ::operator delete(p); 00129 }
static void DayaBay::SimParticleHistory::operator delete | ( | void * | p, | |
void * | pObj | |||
) | [inline, static] |
placement operator delete not sure if really needed, but it does not harm
Definition at line 133 of file SimParticleHistory.h.
00134 { 00135 ::operator delete (p, pObj); 00136 }
std::list<DayaBay::SimTrack*> DayaBay::SimParticleHistory::m_tracks [private] |
std::list<DayaBay::SimVertex*> DayaBay::SimParticleHistory::m_vertices [private] |
std::list<const DayaBay::SimTrack*> DayaBay::SimParticleHistory::m_primaryTracks [private] |
Note that result may not be direct; holes may exist.
Definition at line 145 of file SimParticleHistory.h.