Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
multiplicity.hh
Go to the documentation of this file.
1#ifndef __TOOLS_MULTIPLICITY__
2#define __TOOLS_MULTIPLICITY__
3
4#include <sstream>
5
8
9
10/**
11 * Retrieve bundle multiplicity of given event.
12 *
13 * \param event event
14 */
15inline int get_multiplicity(const Evt& event)
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}
30
31#endif
General exception.
Definition Exception.hh:14
int get_multiplicity(const Evt &event)
Retrieve bundle multiplicity of given event.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition Evt.hh:21
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