Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
multiplicity.hh File Reference
#include <sstream>
#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.
 

Function Documentation

◆ get_multiplicity()

int get_multiplicity ( const Evt & event)
inline

Retrieve bundle multiplicity of given event.

Parameters
eventevent

Definition at line 15 of file multiplicity.hh.

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