Jpp  15.0.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
event_selector.cc
Go to the documentation of this file.
5 #include "JMath/JMathToolkit.hh"
6 
8 
9 /**
10  * Event selection.
11  *
12  * \param in input event
13  * \param event pointer to Monte Carlo event
14  * \return true if accepted; else false
15  */
16 extern "C" bool accept(const JEvt& in, const Evt* event)
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 accept(const JEvt &in, const Evt *event)
Event selection.
Auxiliary methods for geometrical methods.
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.
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
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:41
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
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19