/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Private Attributes
DayaBay::SimParticleHistory Class Reference

An object which holds/owns the record of a Geant-simulated event. More...

#include <SimParticleHistory.h>

Collaboration diagram for DayaBay::SimParticleHistory:
Collaboration graph
[legend]

List of all members.

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::SimTrackReferencecurrentTrack () 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.

Detailed Description

An object which holds/owns the record of a Geant-simulated event.

Author:
tagg@minos.phy.tufts.edu created Thu Dec 5 18:05:52 2013

Definition at line 46 of file SimParticleHistory.h.


Constructor & Destructor Documentation

DayaBay::SimParticleHistory::SimParticleHistory ( ) [inline]

Default Constructor.

Definition at line 51 of file SimParticleHistory.h.

SimParticleHistory::~SimParticleHistory ( )

Destructor.

Definition at line 7 of file SimParticleHistory.cc.

{
  std::list<SimTrack*>::iterator trackIt;
  for(trackIt = m_tracks.begin(); trackIt != m_tracks.end(); ++trackIt) 
    delete (*trackIt);
  m_tracks.clear();

  std::list<SimVertex*>::iterator vertexIt;
  for(vertexIt = m_vertices.begin(); vertexIt != m_vertices.end(); ++vertexIt) 
    delete (*vertexIt);
  m_vertices.clear();
}

Member Function Documentation

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.

{
  std::map<int, SimTrackReference>::const_iterator it;
  it = m_idToTrack.find(trackid);
  if(it == m_idToTrack.end()) {
    return SimTrackReference(NULL,-999);
  }
  return it->second;
} 
void SimParticleHistory::addTrack ( SimTrack aTrack)

Add a track, transfers ownership.

Definition at line 58 of file SimParticleHistory.cc.

{
  m_tracks.push_back(t);
}
void SimParticleHistory::addPrimaryTrack ( const SimTrack aTrack)

Add track as a primary, does not transfer ownership.

Definition at line 63 of file SimParticleHistory.cc.

{
  m_primaryTracks.push_back(t);
}
void SimParticleHistory::addTrackRef ( int  id,
const SimTrackReference aRef 
)

Add a new link.

Definition at line 68 of file SimParticleHistory.cc.

{
  m_idToTrack[id] = ref;
}
void SimParticleHistory::addVertex ( SimVertex aVertex)

Add a vertex to the history, transfers ownership.

Definition at line 73 of file SimParticleHistory.cc.

{
  m_vertices.push_back(v);
}
std::vector< DayaBay::SimTrack * > DayaBay::SimParticleHistory::trackVector ( ) [inline]

Change a SimTrack list to a SimTrack vector.

Definition at line 192 of file SimParticleHistory.h.

{

                return std::vector<DayaBay::SimTrack*>(m_tracks.begin(),m_tracks.end());
              
}
std::vector< DayaBay::SimVertex * > DayaBay::SimParticleHistory::vertexVector ( ) [inline]

Change a SimVertex list to a SimVertex vector.

Definition at line 199 of file SimParticleHistory.h.

{

                return std::vector<DayaBay::SimVertex*>(m_vertices.begin(),m_vertices.end());
              
}
std::ostream & DayaBay::SimParticleHistory::fillStream ( std::ostream &  s) const

Serialize to an ostream.

Definition at line 20 of file SimParticleHistory.cc.

{
    s << "{ " << std::endl;

    s << m_tracks.size() << " tracks:\n";
    std::list<SimTrack*>::const_iterator trackIt;
    for(trackIt = m_tracks.begin(); trackIt != m_tracks.end(); ++trackIt) {
        (*trackIt)->fillStream(s);
        s << std::endl;
    }

    s << m_vertices.size() << " vertices:\n";
    std::list<SimVertex*>::const_iterator vertexIt;
    for(vertexIt = m_vertices.begin(); vertexIt != m_vertices.end(); ++vertexIt) {
        (*vertexIt)->fillStream(s);
        s << std::endl;
    }

    s << m_primaryTracks.size() << " primaryTracks:\n"
      << "}" << std::endl;
    
    return s;
}
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.

{
  return m_tracks;
}
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.

{
  return m_vertices;
}
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.

{
  return m_primaryTracks;
}
const DayaBay::SimTrackReference & DayaBay::SimParticleHistory::currentTrack ( ) const [inline]

Retrieve const Reference to the current track.

Definition at line 182 of file SimParticleHistory.h.

{
  return m_currentTrack;
}
void DayaBay::SimParticleHistory::setCurrentTrack ( const DayaBay::SimTrackReference value) [inline]

Update Reference to the current track.

Definition at line 187 of file SimParticleHistory.h.

{
  m_currentTrack = value;
}
static void* DayaBay::SimParticleHistory::operator new ( size_t  size) [inline, static]

operator new

Definition at line 108 of file SimParticleHistory.h.

    {
      return ( sizeof(SimParticleHistory) == size ? 
               boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::malloc() :
               ::operator new(size) );
    }
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.

    {
      return ::operator new (size,pObj);
    }
static void DayaBay::SimParticleHistory::operator delete ( void *  p) [inline, static]

operator delete

Definition at line 124 of file SimParticleHistory.h.

    {
      boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::is_from(p) ?
      boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::free(p) :
      ::operator delete(p);
    }
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.

    {
      ::operator delete (p, pObj);
    }

Member Data Documentation

List of tracks in this history.

Definition at line 142 of file SimParticleHistory.h.

List of vertices in this history.

Definition at line 143 of file SimParticleHistory.h.

List of primary tracks in this history.

Definition at line 144 of file SimParticleHistory.h.

Note that result may not be direct; holes may exist.

Definition at line 145 of file SimParticleHistory.h.

Reference to the current track.

Definition at line 146 of file SimParticleHistory.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:05:28 for SimEvent by doxygen 1.7.4