Jpp  16.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
event_selector.cc File Reference
#include "km3net-dataformat/offline/Evt.hh"
#include "JReconstruction/JEvt.hh"
#include "JReconstruction/JEvtToolkit.hh"
#include "JAAnet/JAAnetToolkit.hh"
#include "JMath/JMathToolkit.hh"

Go to the source code of this file.

Functions

bool accept (const JEvt &in, const Evt *event)
 Event selection. More...
 

Function Documentation

bool accept ( const JEvt &  in,
const Evt event 
)

Event selection.

Parameters
ininput event
eventpointer to Monte Carlo event
Returns
true if accepted; else false

Definition at line 16 of file event_selector.cc.

17 {
18  using namespace JPP;
19 
20  if (!in.empty() && in[0].getQ() >= 100) {
21 
22  if (event != NULL) {
23 
24  Trk muon;
25 
26  for (const auto& t1 : event->mc_trks) {
27  if (is_muon(t1)) {
28  if (t1.E > muon.E) {
29  muon = t1;
30  }
31  }
32  }
33 
34  return (is_muon(muon) && getAngle(getDirection(in[0]), getDirection(muon)) > 5.0);
35  }
36  }
37 
38  return true;
39  //return false;
40 }
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
JDirection3D getDirection(const Vec &dir)
Get direction.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:46