Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsAborter.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ActsAborter.h
1 
2 #ifndef TRACKBASE_ACTSABORTER_H
3 #define TRACKBASE_ACTSABORTER_H
4 
8 
9 struct ActsAborter
10 {
11  unsigned int abortlayer = std::numeric_limits<unsigned int>::max();
12  unsigned int abortvolume = std::numeric_limits<unsigned int>::max();
13 
14  template <typename propagator_state_t, typename stepper_t,
15  typename navigator_t>
16  bool operator()(propagator_state_t& state, const stepper_t& /*stepper*/,
17  const navigator_t& navigator, const Acts::Logger&/*logger*/) const
18  {
19  if (navigator.targetReached(state.navigation))
20  {
21  return true;
22  }
23 
24  //if (!state.navigation.currentSurface)
25  if(!navigator.currentSurface(state.navigation))
26  {
27  return false;
28  }
29 
30  auto volumeno = state.navigation.currentSurface->geometryId().volume();
31  auto layerno = state.navigation.currentSurface->geometryId().layer();
32  auto sensitive = state.navigation.currentSurface->geometryId().sensitive();
33 
36  if (layerno == abortlayer and volumeno == abortvolume and sensitive != 0)
37  {
38  navigator.targetReached(state.navigation, true);
39  return true;
40  }
41 
42  return false;
43  }
44 };
45 
46 #endif