Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
multiplicity.hh File Reference
#include "km3net-dataformat/offline/Evt.hh"
#include "km3net-dataformat/offline/Trk.hh"

Go to the source code of this file.

Functions

int get_multiplicity (const Evt &event)
 Retrieve bundle multiplicity of given event. More...
 

Function Documentation

int get_multiplicity ( const Evt event)
inline

Retrieve bundle multiplicity of given event.

Parameters
eventevent

Definition at line 13 of file multiplicity.hh.

14 {
15  using namespace std;
16 
17  // Bundle multiplicity is stored in the `len` member variable for `track_bundle`s.
18 
19  for ( auto& t : event.mc_trks ) {
20  if ( t.status == TRK_ST_MUONBUNDLE ) { return (int) t.len; }
21  }
22 
23  ostream& out = Exception::getOstream();
24  out << "get_multiplicity(): The following event does not correspond to a muon bundle:" << endl;
25  event.print(out);
26  throw Exception(static_cast<ostringstream&>(out).str());
27 }
static const int TRK_ST_MUONBUNDLE
initial state muon bundle (mupage)
Definition: trkmembers.hh:18
General exception.
Definition: Exception.hh:13
static std::ostream & getOstream()
Get output stream for conversion of exception.
Definition: Exception.hh:63
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49