All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
flashmatch::TimeCompatMatch Class Reference

#include <TimeCompatMatch.h>

Inheritance diagram for flashmatch::TimeCompatMatch:
flashmatch::BaseProhibitAlgo flashmatch::BaseAlgorithm flashmatch::LoggerFeature

Public Member Functions

 TimeCompatMatch (const std::string name="TimeCompatMatch")
 Default constructor. More...
 
 ~TimeCompatMatch ()
 Default destructor. More...
 
bool MatchCompatible (const QCluster_t &clus, const Flash_t &flash)
 CORE FUNCTION: determines if a flash and cluster are at all compatible (bool return) More...
 
- Public Member Functions inherited from flashmatch::BaseProhibitAlgo
 BaseProhibitAlgo (const std::string name="noname")
 Default constructor. More...
 
virtual ~BaseProhibitAlgo ()
 Default destructor. More...
 
- Public Member Functions inherited from flashmatch::BaseAlgorithm
 BaseAlgorithm (const Algorithm_t type, const std::string name)
 Default constructor. More...
 
 ~BaseAlgorithm ()
 Default destructor. More...
 
void Configure (const Config_t &pset)
 Function to accept configuration. More...
 
Algorithm_t AlgorithmType () const
 Algorithm type. More...
 
const std::string & AlgorithmName () const
 Algorithm name. More...
 
- Public Member Functions inherited from flashmatch::LoggerFeature
 LoggerFeature (const std::string logger_name="LoggerFeature")
 Default constructor. More...
 
 LoggerFeature (const LoggerFeature &original)
 Default copy constructor. More...
 
virtual ~LoggerFeature ()
 Default destructor. More...
 
const flashmatch::loggerlogger () const
 Logger getter. More...
 
void set_verbosity (::flashmatch::msg::Level_t level)
 Verbosity level. More...
 
const std::string & name () const
 Name getter, defined in a logger instance attribute. More...
 

Protected Member Functions

void _Configure_ (const Config_t &pset)
 

Private Attributes

double _time_buffer
 Buffer time to allow some uncertainty [us]. More...
 

Detailed Description

Simple flash matching algorithm. Based on absolute time of flash and track w.r.t. trigger time, if the two objects are incompatible (because the time-difference is larger than a full drift window) the match is not allowed

Definition at line 44 of file TimeCompatMatch.h.

Constructor & Destructor Documentation

flashmatch::TimeCompatMatch::TimeCompatMatch ( const std::string  name = "TimeCompatMatch")

Default constructor.

Definition at line 14 of file TimeCompatMatch.cxx.

16  {}
BaseProhibitAlgo(const std::string name="noname")
Default constructor.
const std::string & name() const
Name getter, defined in a logger instance attribute.
Definition: LoggerFeature.h:51
flashmatch::TimeCompatMatch::~TimeCompatMatch ( )
inline

Default destructor.

Definition at line 52 of file TimeCompatMatch.h.

52 {}

Member Function Documentation

void flashmatch::TimeCompatMatch::_Configure_ ( const Config_t pset)
protectedvirtual

Implements flashmatch::BaseAlgorithm.

Definition at line 18 of file TimeCompatMatch.cxx.

19  {
20  _time_buffer = pset.get<double>("TimeBuffer");
21  }
double _time_buffer
Buffer time to allow some uncertainty [us].
bool flashmatch::TimeCompatMatch::MatchCompatible ( const QCluster_t clus,
const Flash_t flash 
)
virtual

CORE FUNCTION: determines if a flash and cluster are at all compatible (bool return)

Implements flashmatch::BaseProhibitAlgo.

Definition at line 23 of file TimeCompatMatch.cxx.

24  {
25  if(clus.empty()) {
26  FLASH_INFO() << "QCluster_t is empty." << std::endl;
27  return false;
28  }
29 
30  // get time of flash
31  auto flash_time = flash.time;
32 
33  // get time of cluster by looking at the range of x-positions
34  // FIXME: 1036?
35  double clus_x_min = 1036.; // cm
36  double clus_x_max = -1036.; // cm
37  for (auto const& pt : clus){
38  if (pt.x > clus_x_max) { clus_x_max = pt.x; }
39  if (pt.x < clus_x_min) { clus_x_min = pt.x; }
40  }
41 
42  FLASH_INFO() << "Cluster x min: " << clus_x_min << ", x max: " << clus_x_max << std::endl;
43 
44  // Earliest flash time => assume clus_x_max is @ detector X-max boundary
45  #if USING_LARSOFT == 1
46  double xmax = DetectorSpecs::GetME().ActiveVolume().Max()[0];
47  double clus_t_min = (clus_x_max - xmax) / DetectorSpecs::GetME().DriftVelocity();
48  double clus_t_max = clus_x_min / DetectorSpecs::GetME().DriftVelocity();
49  #else
50  double xmax = DetectorSpecs::GetME().ActiveVolume().Max()[0];
51  double clus_t_min = (clus_x_max - xmax) / DetectorSpecs::GetME().DriftVelocity();
52  double clus_t_max = clus_x_min / DetectorSpecs::GetME().DriftVelocity();
53  #endif
54  FLASH_INFO() << "Cluster xmax: " << xmax << ", clus_t_min: " << clus_t_min
55  << ", clus_t_max: " << clus_t_max
56  << ", flash_time: " << flash_time << std::endl;
57 
58  /*
59  std::cout<< "Inspecting TPC object @ " << clus.time << std::endl;
60  std::cout<< "xmin = " << clus_x_min << " ... xmax = " << clus_x_max << std::endl;
61  std::cout<< "tmin = " << clus_t_min << " ... tmax = " << clus_t_max << std::endl;
62  std::cout<< "Flash time @ " << flash_time << std::endl;
63  */
64  return ((clus_t_min - _time_buffer) < flash_time && flash_time < (clus_t_max + _time_buffer));
65 
66  }
double _time_buffer
Buffer time to allow some uncertainty [us].
const geoalgo::AABox & ActiveVolume() const
Detector active volume.
Definition: FMWKInterface.h:54
#define FLASH_INFO()
Compiler macro for INFO message.
static DetectorSpecs & GetME(std::string filename="detector_specs.cfg")
Definition: FMWKInterface.h:44
const Point_t & Max() const
Maximum point getter.
double DriftVelocity() const
Drift velocity.
Definition: FMWKInterface.h:63

Member Data Documentation

double flashmatch::TimeCompatMatch::_time_buffer
private

Buffer time to allow some uncertainty [us].

Definition at line 63 of file TimeCompatMatch.h.


The documentation for this class was generated from the following files: