Jpp  test_elongated_shower_pde
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.
6 #include "JMath/JMathToolkit.hh"
7 
9 
10 /**
11  * Event selection.
12  *
13  * \param in input event
14  * \param event pointer to Monte Carlo event
15  * \return true if accepted; else false
16  */
17 extern "C" bool accept(const JEvt& in, const Evt* event)
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 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: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
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19