All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | Friends | List of all members
truth::MCTruthParticleHistory Class Reference

#include <MCTruthParticleHistory.h>

Inheritance diagram for truth::MCTruthParticleHistory:

Public Member Functions

 MCTruthParticleHistory (const MCTruthParticleList *list, const int trackID)
 
virtual ~MCTruthParticleHistory ()
 
int EndParticleID () const
 
const MCTruthParticleListParticleList () const
 

Private Attributes

const MCTruthParticleListm_particleList
 
int m_trackID
 

The ParticleList associated with this chain.

More...
 

Friends

std::ostream & operator<< (std::ostream &output, const MCTruthParticleHistory &)
 

Additional Inherited Members

- Public Attributes inherited from std::deque< T >
elements
 STL member. More...
 

Detailed Description

Definition at line 97 of file MCTruthParticleHistory.h.

Constructor & Destructor Documentation

truth::MCTruthParticleHistory::MCTruthParticleHistory ( const MCTruthParticleList list,
const int  trackID 
)

Definition at line 18 of file MCTruthParticleHistory.cxx.

20  , m_trackID(trackID)
21 {
22  // Look for the track in the particle list.
24 
25  // While we're still finding particles in the chain...
26  while ( search != m_particleList->end() ){
27  const simb::MCParticle* particle = (*search).second;
28  push_front( particle );
29 
30  // If this is a primary particle, we're done.
31  int trackID = particle->TrackId();
32  if ( m_particleList->IsPrimary( trackID ) ) break;
33 
34  // Now look for the parent of this particle.
35  int parentID = particle->Mother();
36  search = m_particleList->find( parentID );
37 
38  } // while we're finding particles in the chain
39 }
list_type::const_iterator const_iterator
int m_trackID
The ParticleList associated with this chain.
const MCTruthParticleList * m_particleList
iterator find(const key_type &key)
bool IsPrimary(int trackID) const
list
Definition: file_to_url.sh:28
truth::MCTruthParticleHistory::~MCTruthParticleHistory ( )
virtual

Definition at line 43 of file MCTruthParticleHistory.cxx.

44 {}

Member Function Documentation

int truth::MCTruthParticleHistory::EndParticleID ( ) const
inline

Definition at line 106 of file MCTruthParticleHistory.h.

106 { return m_trackID; }
int m_trackID
The ParticleList associated with this chain.
const MCTruthParticleList* truth::MCTruthParticleHistory::ParticleList ( ) const
inline

Definition at line 109 of file MCTruthParticleHistory.h.

109 { return m_particleList; }
const MCTruthParticleList * m_particleList

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const MCTruthParticleHistory list 
)
friend

Definition at line 47 of file MCTruthParticleHistory.cxx.

48 {
49  // Determine a field width for the particle number.
50  MCTruthParticleHistory::size_type numberOfParticles = list.size();
51  int numberOfDigits = (int) std::log10( (double) numberOfParticles ) + 1;
52 
53  // A simple header.
54  output.width( numberOfDigits );
55  output << "#" << ": < ID, particle >" << "\n";
56 
57  // Write each particle on a separate line.
58  MCTruthParticleHistory::size_type nParticle = 0;
59  for ( MCTruthParticleHistory::const_iterator particle = list.begin();
60  particle != list.end(); ++particle, ++nParticle ){
61  output.width( numberOfDigits );
62  output << nParticle << ": "
63  << (*particle)
64  << "\n";
65  }
66 
67  return output;
68 }
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
list
Definition: file_to_url.sh:28

Member Data Documentation

const MCTruthParticleList* truth::MCTruthParticleHistory::m_particleList
private

Definition at line 114 of file MCTruthParticleHistory.h.

int truth::MCTruthParticleHistory::m_trackID
private

The ParticleList associated with this chain.

Definition at line 115 of file MCTruthParticleHistory.h.


The documentation for this class was generated from the following files: