Jpp  test_elongated_shower_pde
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 "km3net-dataformat/definitions/fitparameters.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 17 of file event_selector.cc.

18 {
19  using namespace JPP;
20 
21  if (!in.empty() && in[0].getQ() >= 100) {
22 
23  if (event != NULL) {
24 
25  Trk muon;
26 
27  for (const auto& t1 : event->mc_trks) {
28  if (is_muon(t1)) {
29  if (t1.E > muon.E) {
30  muon = t1;
31  }
32  }
33  }
34 
35  return (is_muon(muon) && getAngle(getDirection(in[0]), getDirection(muon)) > 5.0);
36  }
37  }
38 
39  return true;
40  //return false;
41 }
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