jyfl_pottu_templates
/home/jhsaren/git/analysis/jyfl_pottu_templates/RDT_SelectorEnergyTimeTuike.hpp
Go to the documentation of this file.
1 
6 #ifndef H_RDT_SELECTORENERGYTIMETUIKE
7 #define H_RDT_SELECTORENERGYTIMETUIKE
8 
9 #include <vector>
10 
11 
12 
14 public:
15 
17  uint16_t genp1{1};
18  pottu::Gate1D<float> energyGate{0,1e8};
19  pottu::Gate1D<float> timeGate{0,1e8};
20  pottu::Gate1D<float> tuikeGate{0,1e8};
21  };
22 
23 
24  template <class H, class CONF>
25  bool test( const H &history, const CONF &conf ) const noexcept {
26  for( const auto &cond : _conditions ) {
27  if( cond.genp1 >= history.size() )
28  return false;
29 
30  if( !cond.tuikeGate( history[cond.genp1]->tuike.sume ) )
31  return false;
32 
33  if( !cond.energyGate( history[cond.genp1]->dssd.xe ) )
34  return false;
35 
36  const int64_t dt = history[cond.genp1]->time - history[cond.genp1-1]->time;
37  if( !cond.timeGate( CONF::daq::ticsToSeconds(dt) ) )
38  return false;
39 
40  }
41  return true;
42  }
43 
44 
45  std::vector<decay_condition_t> &conditions() noexcept { return _conditions; }
46 
47 
48 private:
49  std::vector<decay_condition_t> _conditions;
50 };
51 
52 
53 #endif
Definition: RDT_SelectorEnergyTimeTuike.hpp:13
Definition: RDT_SelectorEnergyTimeTuike.hpp:16