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

#include <MCTruthParticleList.h>

Classes

struct  archived_info_type
 

Public Types

typedef std::map< int, const
simb::MCParticle * > 
list_type
 
typedef list_type::key_type key_type
 
typedef list_type::mapped_type mapped_type
 
typedef list_type::value_type value_type
 
typedef list_type::iterator iterator
 
typedef list_type::const_iterator const_iterator
 
typedef list_type::reverse_iterator reverse_iterator
 
typedef
list_type::const_reverse_iterator 
const_reverse_iterator
 
typedef list_type::size_type size_type
 
typedef list_type::difference_type difference_type
 
typedef list_type::key_compare key_compare
 
typedef list_type::allocator_type allocator_type
 

Public Member Functions

 MCTruthParticleList ()
 
virtual ~MCTruthParticleList ()
 
 MCTruthParticleList (const MCTruthParticleList &rhs)=delete
 
MCTruthParticleListoperator= (const MCTruthParticleList &rhs)=delete
 
 MCTruthParticleList (MCTruthParticleList &&rhs)=default
 
MCTruthParticleListoperator= (MCTruthParticleList &&rhs)=default
 
MCTruthParticleList MakeCopy () const
 Returns a copy of this object. More...
 
void Cut (const double &)
 
const key_typeTrackId (const size_type) const
 
mapped_type const & Particle (const size_type) const
 
mapped_type Particle (const size_type)
 
bool HasParticle (int trackID) const
 Returns whether we have this particle, live (with full information) More...
 
bool KnownParticle (int trackID) const
 Returns whether we have had this particle, archived or live. More...
 
bool IsPrimary (int trackID) const
 
int NumberOfPrimaries () const
 
std::vector< const
simb::MCParticle * > 
GetPrimaries () const
 
const simb::MCParticle * Primary (const int) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
size_type size () const
 
bool empty () const
 
void swap (MCTruthParticleList &other)
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
iterator upper_bound (const key_type &key)
 
const_iterator upper_bound (const key_type &key) const
 
iterator lower_bound (const key_type &key)
 
const_iterator lower_bound (const key_type &key) const
 
mapped_type const & operator[] (const key_type &key) const
 
mapped_type operator[] (const key_type &key)
 
mapped_type at (const key_type &key)
 
mapped_type const & at (const key_type &key) const
 
key_type key (mapped_type const &part) const
 Extracts the key from the specified value. More...
 
void insert (const simb::MCParticle *value)
 
void Add (const simb::MCParticle *value)
 
void Archive (const key_type &key)
 Removes the particle from the list, keeping minimal info of it. More...
 
void Archive (const mapped_type &key)
 
int GetMotherOf (const key_type &key) const
 This function seeks for the exact key, not its absolute value. More...
 
void clear ()
 
size_type erase (const key_type &key)
 
iterator erase (iterator key)
 
int EveId (const int trackID) const
 
void AdoptEveIdCalculator (MCTruthEveIdCalculator *) const
 

Private Types

typedef std::set< int > primaries_type
 
typedef std::map< int,
archived_info_type
archive_type
 
typedef primaries_type::iterator primaries_iterator
 
typedef
primaries_type::const_iterator 
primaries_const_iterator
 

Private Attributes

list_type m_MCTruthParticleList
 Sorted list of particles in the event. More...
 
primaries_type m_primaries
 
archive_type m_archive
 archive of the particles no longer among us More...
 
std::unique_ptr
< MCTruthEveIdCalculator
m_eveIdCalculator
 

Friends

std::ostream & operator<< (std::ostream &output, const MCTruthParticleList &)
 
std::ostream & operator<< (std::ostream &output, const MCTruthParticleList::archived_info_type &)
 

Detailed Description

Definition at line 128 of file MCTruthParticleList.h.

Member Typedef Documentation

typedef list_type::allocator_type truth::MCTruthParticleList::allocator_type

Definition at line 145 of file MCTruthParticleList.h.

Definition at line 173 of file MCTruthParticleList.h.

typedef list_type::const_iterator truth::MCTruthParticleList::const_iterator

Definition at line 139 of file MCTruthParticleList.h.

typedef list_type::const_reverse_iterator truth::MCTruthParticleList::const_reverse_iterator

Definition at line 141 of file MCTruthParticleList.h.

typedef list_type::difference_type truth::MCTruthParticleList::difference_type

Definition at line 143 of file MCTruthParticleList.h.

typedef list_type::iterator truth::MCTruthParticleList::iterator

Definition at line 138 of file MCTruthParticleList.h.

typedef list_type::key_compare truth::MCTruthParticleList::key_compare

Definition at line 144 of file MCTruthParticleList.h.

typedef list_type::key_type truth::MCTruthParticleList::key_type

Definition at line 135 of file MCTruthParticleList.h.

typedef std::map<int,const simb::MCParticle*> truth::MCTruthParticleList::list_type

Definition at line 134 of file MCTruthParticleList.h.

typedef list_type::mapped_type truth::MCTruthParticleList::mapped_type

Definition at line 136 of file MCTruthParticleList.h.

typedef primaries_type::const_iterator truth::MCTruthParticleList::primaries_const_iterator
private

Definition at line 175 of file MCTruthParticleList.h.

typedef primaries_type::iterator truth::MCTruthParticleList::primaries_iterator
private

Definition at line 174 of file MCTruthParticleList.h.

typedef std::set< int > truth::MCTruthParticleList::primaries_type
private

Definition at line 172 of file MCTruthParticleList.h.

typedef list_type::reverse_iterator truth::MCTruthParticleList::reverse_iterator

Definition at line 140 of file MCTruthParticleList.h.

typedef list_type::size_type truth::MCTruthParticleList::size_type

Definition at line 142 of file MCTruthParticleList.h.

typedef list_type::value_type truth::MCTruthParticleList::value_type

Definition at line 137 of file MCTruthParticleList.h.

Constructor & Destructor Documentation

truth::MCTruthParticleList::MCTruthParticleList ( )

Definition at line 37 of file MCTruthParticleList.cxx.

38 {
39 }
truth::MCTruthParticleList::~MCTruthParticleList ( )
virtual

Definition at line 43 of file MCTruthParticleList.cxx.

44 {
45  this->clear();
46 }
truth::MCTruthParticleList::MCTruthParticleList ( const MCTruthParticleList rhs)
delete
truth::MCTruthParticleList::MCTruthParticleList ( MCTruthParticleList &&  rhs)
default

Member Function Documentation

void truth::MCTruthParticleList::Add ( const simb::MCParticle *  value)
inline

Definition at line 325 of file MCTruthParticleList.h.

325 { insert(value); }
void insert(const simb::MCParticle *value)
temporary value
void truth::MCTruthParticleList::AdoptEveIdCalculator ( MCTruthEveIdCalculator calc) const

Definition at line 398 of file MCTruthParticleList.cxx.

399 {
400  m_eveIdCalculator.reset(calc);
401 }
std::unique_ptr< MCTruthEveIdCalculator > m_eveIdCalculator
void truth::MCTruthParticleList::Archive ( const key_type key)

Removes the particle from the list, keeping minimal info of it.

Definition at line 283 of file MCTruthParticleList.cxx.

284 {
285  auto& part = m_MCTruthParticleList.at(key);
286  if (part == nullptr) return; // already archived, nothing to do
287 
288  // create a new archive item with the particle;
289  m_archive[key] = archived_info_type(*part);
290 
291  // dispose of the particle in the list (the cell will still be there
292  delete part;
293  part = nullptr;
294 } // MCTruthParticleList::Archive()
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
archive_type m_archive
archive of the particles no longer among us
void truth::MCTruthParticleList::Archive ( const mapped_type key)

Definition at line 298 of file MCTruthParticleList.cxx.

299 {
300  Archive(key(part));
301 }
void Archive(const key_type &key)
Removes the particle from the list, keeping minimal info of it.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
truth::MCTruthParticleList::mapped_type truth::MCTruthParticleList::at ( const key_type key)
inline

Definition at line 340 of file MCTruthParticleList.h.

341 { return m_MCTruthParticleList.at(std::abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
truth::MCTruthParticleList::mapped_type const & truth::MCTruthParticleList::at ( const key_type key) const
inline

Definition at line 342 of file MCTruthParticleList.h.

343 { return m_MCTruthParticleList.at(std::abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
truth::MCTruthParticleList::iterator truth::MCTruthParticleList::begin ( )
inline

Definition at line 315 of file MCTruthParticleList.h.

315 { return m_MCTruthParticleList.begin(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::const_iterator truth::MCTruthParticleList::begin ( ) const
inline

Definition at line 316 of file MCTruthParticleList.h.

316 { return m_MCTruthParticleList.begin(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
void truth::MCTruthParticleList::clear ( )

Definition at line 311 of file MCTruthParticleList.cxx.

312 {
313  m_MCTruthParticleList.clear();
314  m_archive.clear();
315  m_primaries.clear();
316 }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
archive_type m_archive
archive of the particles no longer among us
void truth::MCTruthParticleList::Cut ( const double &  cut)

Definition at line 66 of file MCTruthParticleList.cxx.

67 {
68  // The safest way to do this is to create a list of track IDs that
69  // fail the cut, then delete those IDs.
70 
71  // Define a list of IDs.
72  typedef std::set< key_type > keyList_type;
73  keyList_type keyList;
74 
75  // Add each ID that fails the cut to the list.
76  for ( const_iterator i = m_MCTruthParticleList.begin(); i != m_MCTruthParticleList.end(); ++i )
77  {
78  const simb::MCParticle* particle = (*i).second;
79  if (!particle) continue;
80  Double_t totalInitialEnergy = particle->E();
81  if ( totalInitialEnergy < cut ) keyList.insert( (*i).first );
82  }
83 
84  // Go through the list, deleting the particles that are on the list.
85  for ( keyList_type::const_iterator i = keyList.begin(); i != keyList.end(); ++i ) this->erase( *i );
86 }
list_type::const_iterator const_iterator
list_type m_MCTruthParticleList
Sorted list of particles in the event.
size_type erase(const key_type &key)
bool truth::MCTruthParticleList::empty ( ) const
inline

Definition at line 324 of file MCTruthParticleList.h.

324 { return m_MCTruthParticleList.empty(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::iterator truth::MCTruthParticleList::end ( )
inline

Definition at line 317 of file MCTruthParticleList.h.

317 { return m_MCTruthParticleList.end(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::const_iterator truth::MCTruthParticleList::end ( ) const
inline

Definition at line 318 of file MCTruthParticleList.h.

318 { return m_MCTruthParticleList.end(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
MCTruthParticleList::size_type truth::MCTruthParticleList::erase ( const key_type key)

Definition at line 326 of file MCTruthParticleList.cxx.

327 {
328  iterator entry = m_MCTruthParticleList.find( abs(key) );
329  if (entry == m_MCTruthParticleList.end()) return 0;
330  erase(entry);
331  return 1;
332 }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
size_type erase(const key_type &key)
MCTruthParticleList::iterator truth::MCTruthParticleList::erase ( iterator  key)

Definition at line 320 of file MCTruthParticleList.cxx.

321 {
322  delete position->second;
323  return m_MCTruthParticleList.erase( position );
324 }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
int truth::MCTruthParticleList::EveId ( const int  trackID) const

Definition at line 371 of file MCTruthParticleList.cxx.

372 {
373  // If the eve ID calculator has never been initialized, use the
374  // default method.
375  if ( m_eveIdCalculator.get() == 0 ){
376  AdoptEveIdCalculator( new MCTruthEveIdCalculator );
377  }
378 
379  // If the eve ID calculator has changed, or we're looking at a
380  // different MCTruthParticleList, initialize the calculator.
381  static MCTruthEveIdCalculator* saveEveIdCalculator = 0;
382 
383  if ( saveEveIdCalculator != m_eveIdCalculator.get() ) {
384  saveEveIdCalculator = m_eveIdCalculator.get();
385  m_eveIdCalculator->Init( this );
386  }
387  if ( m_eveIdCalculator->ParticleList() != this ){
388  m_eveIdCalculator->Init( this );
389  }
390 
391  // After the "bookkeeping" tests, here's where we actually do the
392  // calculation.
393  return m_eveIdCalculator->CalculateEveId( trackID );
394 }
std::unique_ptr< MCTruthEveIdCalculator > m_eveIdCalculator
void AdoptEveIdCalculator(MCTruthEveIdCalculator *) const
createEngine this
truth::MCTruthParticleList::iterator truth::MCTruthParticleList::find ( const key_type key)
inline

Definition at line 328 of file MCTruthParticleList.h.

329 { return m_MCTruthParticleList.find(abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
truth::MCTruthParticleList::const_iterator truth::MCTruthParticleList::find ( const key_type key) const
inline

Definition at line 330 of file MCTruthParticleList.h.

331 { return m_MCTruthParticleList.find(abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
int truth::MCTruthParticleList::GetMotherOf ( const key_type key) const

This function seeks for the exact key, not its absolute value.

Definition at line 304 of file MCTruthParticleList.cxx.

305 {
306  auto part = m_MCTruthParticleList.at(key);
307  return part? part->Mother(): m_archive.at(key).Mother();
308 } // MCTruthParticleList::GetMotherOf()
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
archive_type m_archive
archive of the particles no longer among us
std::vector< const simb::MCParticle * > truth::MCTruthParticleList::GetPrimaries ( ) const

Definition at line 145 of file MCTruthParticleList.cxx.

146 {
147  std::vector<const simb::MCParticle*> primaries;
148  primaries.reserve(m_primaries.size());
149  // for each particle, check if its track ID is in the primaries list
150  // iPartPair is std::pair<const int, simb::MCParticle*>
151  for (auto& iPartPair: m_MCTruthParticleList)
152  {
153  if (m_primaries.count(iPartPair.first))
154  primaries.push_back(iPartPair.second);
155  } // for
156  if (primaries.size() != m_primaries.size())
157  {
158  throw cet::exception("MCTruthParticleList")
159  << "sim::MCTruthParticleList::GetPrimaries() collected " << primaries.size()
160  << " primaries, not " << m_primaries.size() << " as expected\n";
161  }
162 
163  return primaries;
164 } // MCTruthParticleList::GetPrimaries()
list_type m_MCTruthParticleList
Sorted list of particles in the event.
bool truth::MCTruthParticleList::HasParticle ( int  trackID) const
inline

Returns whether we have this particle, live (with full information)

Definition at line 221 of file MCTruthParticleList.h.

222  {
223  auto iParticle = find(trackID);
224  return (iParticle != end()) && (iParticle->second != nullptr);
225  }
iterator find(const key_type &key)
void truth::MCTruthParticleList::insert ( const simb::MCParticle *  value)

Definition at line 259 of file MCTruthParticleList.cxx.

260 {
261  int trackID = key(particle);
262  iterator insertion = m_MCTruthParticleList.lower_bound( trackID );
263  if ( insertion == m_MCTruthParticleList.end() )
264  {
265  // The best "hint" we can give is that the particle will go at
266  // the end of the list.
267  m_MCTruthParticleList.insert( insertion, value_type( trackID, particle ) );
268  }
269  else if ( (*insertion).first != trackID ){
270  // It turns out that the best hint we can give is one more
271  // than the result of lower_bound.
272  m_MCTruthParticleList.insert( ++insertion, value_type( trackID, particle ) );
273  }
274 
275  // If this is a primary particle, add it to the list. use
276  // rimary as the process string to look for as the P may or may not
277  // be capitalized
278  if ( particle->Process().find("rimary") != std::string::npos )
279  m_primaries.insert( trackID );
280 }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
list_type::value_type value_type
bool truth::MCTruthParticleList::IsPrimary ( int  trackID) const

Definition at line 116 of file MCTruthParticleList.cxx.

117 {
118  return m_primaries.find( trackID ) != m_primaries.end();
119 }
truth::MCTruthParticleList::key_type truth::MCTruthParticleList::key ( mapped_type const &  part) const
inline

Extracts the key from the specified value.

Definition at line 348 of file MCTruthParticleList.h.

348 { return part->TrackId(); }
bool truth::MCTruthParticleList::KnownParticle ( int  trackID) const
inline

Returns whether we have had this particle, archived or live.

Definition at line 228 of file MCTruthParticleList.h.

228 { return find(trackID) != end(); }
iterator find(const key_type &key)
truth::MCTruthParticleList::iterator truth::MCTruthParticleList::lower_bound ( const key_type key)
inline

Definition at line 336 of file MCTruthParticleList.h.

337 { return m_MCTruthParticleList.lower_bound(abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
truth::MCTruthParticleList::const_iterator truth::MCTruthParticleList::lower_bound ( const key_type key) const
inline

Definition at line 338 of file MCTruthParticleList.h.

339 { return m_MCTruthParticleList.lower_bound(abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
MCTruthParticleList truth::MCTruthParticleList::MakeCopy ( ) const

Returns a copy of this object.

Definition at line 51 of file MCTruthParticleList.cxx.

52 {
54 
55  // Copy each entry in the other MCTruthParticleList.
56  for (std::pair<int, const simb::MCParticle*> const& partInfo: m_MCTruthParticleList)
57  list.insert(partInfo.second? new simb::MCParticle(*(partInfo.second)): nullptr);
58 
59  list.m_archive = m_archive;
60 
61  return list;
62 } // MCTruthParticleList::MakeCopy()
list_type m_MCTruthParticleList
Sorted list of particles in the event.
archive_type m_archive
archive of the particles no longer among us
list
Definition: file_to_url.sh:28
int truth::MCTruthParticleList::NumberOfPrimaries ( ) const

Definition at line 122 of file MCTruthParticleList.cxx.

123 {
124  return m_primaries.size();
125 }
MCTruthParticleList& truth::MCTruthParticleList::operator= ( const MCTruthParticleList rhs)
delete
MCTruthParticleList& truth::MCTruthParticleList::operator= ( MCTruthParticleList &&  rhs)
default
truth::MCTruthParticleList::mapped_type const & truth::MCTruthParticleList::operator[] ( const key_type key) const
inline

Definition at line 346 of file MCTruthParticleList.h.

347 { return at(key); }
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
mapped_type at(const key_type &key)
truth::MCTruthParticleList::mapped_type truth::MCTruthParticleList::operator[] ( const key_type key)
inline

Definition at line 344 of file MCTruthParticleList.h.

345 { return at(key); }
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
mapped_type at(const key_type &key)
MCTruthParticleList::mapped_type const & truth::MCTruthParticleList::Particle ( const size_type  index) const

Definition at line 98 of file MCTruthParticleList.cxx.

99 {
101  std::advance(i,index);
102 
103  return (*i).second;
104 }
list_type::const_iterator const_iterator
list_type m_MCTruthParticleList
Sorted list of particles in the event.
MCTruthParticleList::mapped_type truth::MCTruthParticleList::Particle ( const size_type  index)

Definition at line 107 of file MCTruthParticleList.cxx.

108 {
109  iterator i = m_MCTruthParticleList.begin();
110  std::advance(i,index);
111 
112  return (*i).second;
113 }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
const simb::MCParticle * truth::MCTruthParticleList::Primary ( const int  index) const

Definition at line 128 of file MCTruthParticleList.cxx.

129 {
130  // Advance "index" entries from the beginning of the primary list.
131  primaries_const_iterator primary = m_primaries.begin();
132  std::advance( primary, index );
133 
134  // Get the track ID from that entry in the list.
135  int trackID = *primary;
136 
137  // Find the entry in the particle list with that track ID.
138  const_iterator entry = m_MCTruthParticleList.find(trackID);
139 
140  // Return the Particle object in that entry.
141  return (*entry).second;
142 }
list_type::const_iterator const_iterator
primaries_type::const_iterator primaries_const_iterator
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::reverse_iterator truth::MCTruthParticleList::rbegin ( )
inline

Definition at line 319 of file MCTruthParticleList.h.

319 { return m_MCTruthParticleList.rbegin(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::const_reverse_iterator truth::MCTruthParticleList::rbegin ( ) const
inline

Definition at line 320 of file MCTruthParticleList.h.

320 { return m_MCTruthParticleList.rbegin(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::reverse_iterator truth::MCTruthParticleList::rend ( )
inline

Definition at line 321 of file MCTruthParticleList.h.

321 { return m_MCTruthParticleList.rend(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::const_reverse_iterator truth::MCTruthParticleList::rend ( ) const
inline

Definition at line 322 of file MCTruthParticleList.h.

322 { return m_MCTruthParticleList.rend(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::size_type truth::MCTruthParticleList::size ( ) const
inline

Definition at line 323 of file MCTruthParticleList.h.

323 { return m_MCTruthParticleList.size(); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
void truth::MCTruthParticleList::swap ( truth::MCTruthParticleList other)
inline

Definition at line 326 of file MCTruthParticleList.h.

327 { m_MCTruthParticleList.swap( other.m_MCTruthParticleList ); m_archive.swap( other.m_archive ); m_primaries.swap( other.m_primaries); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
archive_type m_archive
archive of the particles no longer among us
const MCTruthParticleList::key_type & truth::MCTruthParticleList::TrackId ( const size_type  index) const

Definition at line 90 of file MCTruthParticleList.cxx.

91 {
93  std::advance(i,index);
94 
95  return (*i).first;
96 }
list_type::const_iterator const_iterator
list_type m_MCTruthParticleList
Sorted list of particles in the event.
truth::MCTruthParticleList::iterator truth::MCTruthParticleList::upper_bound ( const key_type key)
inline

Definition at line 332 of file MCTruthParticleList.h.

333 { return m_MCTruthParticleList.upper_bound(abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)
truth::MCTruthParticleList::const_iterator truth::MCTruthParticleList::upper_bound ( const key_type key) const
inline

Definition at line 334 of file MCTruthParticleList.h.

335 { return m_MCTruthParticleList.upper_bound(abs(key)); }
list_type m_MCTruthParticleList
Sorted list of particles in the event.
key_type key(mapped_type const &part) const
Extracts the key from the specified value.
T abs(T value)

Friends And Related Function Documentation

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

Definition at line 336 of file MCTruthParticleList.cxx.

337 {
338  // Determine a field width for the particle number.
339  MCTruthParticleList::size_type numberOfParticles = list.size();
340  int numberOfDigits = (int) std::log10( (double) numberOfParticles ) + 1;
341 
342  // A simple header.
343  output.width( numberOfDigits );
344  output << "#" << ": < ID, particle >" << std::endl;
345 
346  // Write each particle on a separate line.
347  MCTruthParticleList::size_type nParticle = 0;
348  for ( MCTruthParticleList::const_iterator particle = list.begin();
349  particle != list.end(); ++particle, ++nParticle )
350  {
351  output.width( numberOfDigits );
352  output << nParticle << ": "
353  << "<" << (*particle).first << ",";
354  if (particle->second)
355  output << *(particle->second);
356  else {
357  auto iArch = list.m_archive.find(particle->first);
358  if (iArch == list.m_archive.end())
359  output << "lost [INTERNAL ERROR!]";
360  else
361  output << "(archived) " << iArch->second;
362  }
363  output << ">" << std::endl;
364  }
365 
366  return output;
367 }
list_type::const_iterator const_iterator
list_type::size_type size_type
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
list
Definition: file_to_url.sh:28
std::ostream& operator<< ( std::ostream &  output,
const MCTruthParticleList::archived_info_type info 
)
friend

Definition at line 405 of file MCTruthParticleList.cxx.

406 {
407  output << "Mother ID=" << info.Mother() << std::endl;
408  return output;
409 }
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output

Member Data Documentation

archive_type truth::MCTruthParticleList::m_archive
private

archive of the particles no longer among us

Definition at line 180 of file MCTruthParticleList.h.

std::unique_ptr<MCTruthEveIdCalculator> truth::MCTruthParticleList::m_eveIdCalculator
mutableprivate

Definition at line 186 of file MCTruthParticleList.h.

list_type truth::MCTruthParticleList::m_MCTruthParticleList
private

Sorted list of particles in the event.

Definition at line 177 of file MCTruthParticleList.h.

primaries_type truth::MCTruthParticleList::m_primaries
private

Sorted list of the track IDs of primary particles.

Definition at line 178 of file MCTruthParticleList.h.


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