All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndcode/sbndcode/OpDetReco/OpFlash/FlashFinder/SimpleFlashAlgo.h
Go to the documentation of this file.
1 #ifndef SIMPLEFLASHALGO_H
2 #define SIMPLEFLASHALGO_H
3 
4 #include "FlashAlgoBase.h"
5 #include "FlashAlgoFactory.h"
6 #include <map>
7 
8 namespace lightana
9 {
10 
11  class SimpleFlashAlgo : public FlashAlgoBase {
12 
13  public:
14 
15  SimpleFlashAlgo(const std::string name);
16 
17  void Configure(const Config_t &p);
18 
19  virtual ~SimpleFlashAlgo();
20 
22 
23  bool Veto(double t) const;
24 
25  const std::vector<double>& PESumArray() const { return _pesum_v; }
26 
27  const double TimeRes() const { return _time_res; }
28 
29  private:
30 
31  double TotalCharge(const std::vector<double>& PEs);
32  double _min_pe_flash; // minimum PE to make a flash
33  double _min_pe_coinc; // minimum PE to make a flash candidate
34  double _min_mult_coinc; // minimum PE to use an OpHit
35  double _integral_time; // integral period
36  double _veto_time; // veto time
37  double _time_res; // time resolution of pe sum
38  double _pre_sample; // time pre-sample
39  int _tpc; // tpc
40 
41  std::vector<double> _pesum_v; // pw aum array
42  std::vector<double> _pe_baseline_v; // calibration: PEs to be subtracted from each opdet
43 
44  std::map<double,double> _flash_veto_range_m; // veto window start
45 
46  bool _debug; // debug mode flag
47 
48  // list of opchannel to use
49  std::vector<int> _opch_to_index_v;
50  std::vector<int> _index_to_opch_v;
51 
52  };
53 
54  /**
55  \class lightana::SimpleFlashAlgoFactory
56  \brief A concrete factory class for lightana::SimpleFlashAlgo
57  */
59 
60  public:
61  /// ctor
62  SimpleFlashAlgoFactory() { FlashAlgoFactory::get().add_factory("SimpleFlashAlgo",this); }
63  /// dtor
65  /// creation method
66  FlashAlgoBase* create(const std::string instance_name) { return new SimpleFlashAlgo(instance_name); }
67  };
68 
69 }
70 #endif
71 
72 /** @} */ // end of doxygen group
FlashAlgoBase * create(const std::string instance_name)
creation method
void add_factory(const std::string name, lightana::FlashAlgoFactoryBase *factory)
Factory registration method (should be called by global factory instance in algorithm header) ...
pdgs p
Definition: selectors.fcl:22
std::vector< lightana::LiteOpFlash_t > LiteOpFlashArray_t
std::vector< lightana::LiteOpHit_t > LiteOpHitArray_t
A concrete factory class for lightana::SimpleFlashAlgo.
static FlashAlgoFactory & get()
Static sharable instance getter.
then echo fcl name
double TotalCharge(const std::vector< double > &PEs)