All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BaseFlashMatch.h
Go to the documentation of this file.
1 /**
2  * \file BaseFlashMatch.h
3  *
4  * \ingroup Base
5  *
6  * \brief Class def header for a class BaseFlashMatch
7  *
8  * @author kazuhiro
9  */
10 
11 /** \addtogroup Base
12 
13  @{*/
14 #ifndef OPT0FINDER_BASEFLASHMATCH_H
15 #define OPT0FINDER_BASEFLASHMATCH_H
16 
17 #include "BaseAlgorithm.h"
18 #include "BaseFlashHypothesis.h"
19 namespace flashmatch {
20 
21  class FlashMatchManager;
22 
23  /**
24  \class BaseFlashMatch
25  Algorithm base class for matching flashmatch::QCluster_t (TPC object) and \n
26  flashmatch::Flash_t (flash). It creates flashmatch::FlashMatch_t which contains \n
27  matching infomration.
28  */
29  class BaseFlashMatch : public BaseAlgorithm{
30  friend class FlashMatchManager;
31 
32  public:
33 
34  /// Default constructor
35  BaseFlashMatch(const std::string name="noname") : BaseAlgorithm(kFlashMatch,name)
36  {}
37 
38  /// Default destructor
39  virtual ~BaseFlashMatch(){}
40 
41  /**
42  CORE FUNCTION: takes in flashmatch::QCluster_t (TPC object) and flashmatch::Flash_t (flash) \n
43  and inspect if two are consistent (i.t. matched) or not. Returns flashmatch::FlashMatch_t \n
44  which represents the compatibility of two inputs. In particular the algorithm needs to \n
45  set the "score" and "QPoint_t" of the return object. The former represents the goodness \n
46  of a match with a value larger than 0. Negative value is interpreted as no match. \n
47  The latter represents the matched TPC 3D point. The "tpc_id and "flash_id" of the return \n
48  object is set by flashmatch::FlashMatchManager, the caller of the algorithm, as it manages \n
49  the overall collection of user input flash and TPC objects. \n
50  \n
51  Note it is flashmatch::FlashMatchManager configuration option to allow an assignment of the \n
52  same flash to multiple TPC object or not. If not allowed, a match with a higher "score" \n
53  in the return object is chosen.
54  */
55  virtual FlashMatch_t Match(const QCluster_t&, const Flash_t&) = 0;
56 
57  /// Method to call flash hypothesis
58  Flash_t GetEstimate(const QCluster_t&) const;
59 
60  /// Method to simply fill provided reference of flashmatch::Flash_t
61  void FillEstimate(const QCluster_t&, Flash_t&) const;
62 
63  /// Sets the TPC and Cryo numbers
64  virtual void SetTPCCryo(int tpc, int cryo) = 0;
65 
66  private:
67 
69 
71 
72  protected:
73 
74  int _tpc = 0; ///< The TPC number to use
75  int _cryo = 0; ///< The Cryostat number to use
76 
77  };
78 }
79 
80 #endif
81 /** @} */ // end of doxygen group
82 
Algorithm type to match flash hypothesis and reconstructed flash.
BaseFlashMatch(const std::string name="noname")
Default constructor.
Class def header for a class BaseAlgorithm.
int _cryo
The Cryostat number to use.
Struct to represent an optical flash.
Collection of charge deposition 3D point (cluster)
virtual void SetTPCCryo(int tpc, int cryo)=0
Sets the TPC and Cryo numbers.
flashmatch::BaseFlashHypothesis * _flash_hypothesis
int _tpc
The TPC number to use.
void SetFlashHypothesis(flashmatch::BaseFlashHypothesis *)
virtual FlashMatch_t Match(const QCluster_t &, const Flash_t &)=0
void FillEstimate(const QCluster_t &, Flash_t &) const
Method to simply fill provided reference of flashmatch::Flash_t.
virtual ~BaseFlashMatch()
Default destructor.
Flash-TPC match info.
const std::string & name() const
Name getter, defined in a logger instance attribute.
Definition: LoggerFeature.h:51
Flash_t GetEstimate(const QCluster_t &) const
Method to call flash hypothesis.