All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FMWKInterface.h
Go to the documentation of this file.
1 #ifndef __OPT0FINDERFMWKINTERFACE_H__
2 #define __OPT0FINDERFMWKINTERFACE_H__
3 
4 #ifndef USING_LARSOFT
5 #define USING_LARSOFT 1
6 #endif
7 
8 #include <unordered_map>
9 #include <boost/functional/hash.hpp>
10 
11 #if USING_LARSOFT == 0
14 #include "FMWKTools/PhotonVoxels.h"
15 namespace flashmatch {
16  /// Configuration object
17  using Config_t = flashmatch::PSet;
18 }
19 #else
20 // #include "sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoAABox.h"
22 #include "OpT0FinderException.h"
23 #include "OpT0FinderLogger.h"
24 #include "fhiclcpp/ParameterSet.h"
29 namespace flashmatch{
30  /// Configuration object
31  using Config_t = fhicl::ParameterSet;
32 }
33 #endif
34 
35 
36 namespace flashmatch {
37 
38  class DetectorSpecs {
39 
40  public:
41  DetectorSpecs(std::string filename="specs.cfg");
43 
44  inline static DetectorSpecs& GetME(std::string filename="detector_specs.cfg")
45  {
46  if(!_me) _me = new DetectorSpecs(filename);
47  return *_me;
48  }
49 
50  /// PMT XYZ position filler
51  inline const geoalgo::Point_t& PMTPosition(size_t opch) { return _pmt_v.at(opch); }
52 
53  /// Detector active volume
54  inline const geoalgo::AABox& ActiveVolume() const { return _bbox; }
55 
56  /// Detector active volume given cryo and tpc
57  const geoalgo::AABox& ActiveVolume(int tpc, int cryo=0) const;
58 
59  /// # of PMTs
60  inline size_t NOpDets() const { return _pmt_v.size(); }
61 
62  /// Drift velocity
63  inline double DriftVelocity() const { return _drift_velocity; }
64 
65  /// Visibility
66  float GetVisibility(double x, double y, double z, unsigned int opch) const;
67 
68  /// Visibility Reflected
69  float GetVisibilityReflected(double x, double y, double z, unsigned int opch) const;
70 
71  /// Photon Library data access FIXME
72  const std::vector<std::vector<float > >& GetPhotonLibraryData() const;
73 
74  /// Voxel definition
75  #if USING_LARSOFT == 0
76  inline const sim::PhotonVoxelDef& GetVoxelDef() const { return _voxel_def; }
77  #endif
78 
79  private:
80  static DetectorSpecs* _me;
81  std::vector<geoalgo::Point_t> _pmt_v;
83  std::unordered_map<std::pair<int, int>, geoalgo::AABox, boost::hash<std::pair<int, int>>> _bbox_map; ///< A bbox map (cryo,tpc) -> bbox
85  #if USING_LARSOFT == 0
86  sim::PhotonVoxelDef _voxel_def;
87  #endif
88  };
89 
90 }
91 #endif
process_name opflash particleana ie ie ie z
const geoalgo::AABox & ActiveVolume() const
Detector active volume.
Definition: FMWKInterface.h:54
size_t NOpDets() const
of PMTs
Definition: FMWKInterface.h:60
process_name opflash particleana ie x
const std::vector< std::vector< float > > & GetPhotonLibraryData() const
Photon Library data access FIXME.
BEGIN_PROLOG could also be dds filename
std::unordered_map< std::pair< int, int >, geoalgo::AABox, boost::hash< std::pair< int, int > > > _bbox_map
A bbox map (cryo,tpc) -&gt; bbox.
Definition: FMWKInterface.h:83
Representation of a region of space diced into voxels.
Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple &amp; popular representation of 3D boundary box for collision detection. The concept was taken from the reference, Real-Time-Collision-Detection (RTCD), and in particular Ch. 4.2 (page 77): .
fhicl::ParameterSet Config_t
Configuration object.
Definition: FMWKInterface.h:31
static DetectorSpecs & GetME(std::string filename="detector_specs.cfg")
Definition: FMWKInterface.h:44
float GetVisibility(double x, double y, double z, unsigned int opch) const
Visibility.
process_name opflash particleana ie ie y
DetectorSpecs(std::string filename="specs.cfg")
Class def header for exception classes in OpT0Finder package.
Class def header for a class flashmatch::ConfigManager.
const geoalgo::Point_t & PMTPosition(size_t opch)
PMT XYZ position filler.
Definition: FMWKInterface.h:51
float GetVisibilityReflected(double x, double y, double z, unsigned int opch) const
Visibility Reflected.
std::vector< geoalgo::Point_t > _pmt_v
Definition: FMWKInterface.h:81
logger utility class definition header file.
double DriftVelocity() const
Drift velocity.
Definition: FMWKInterface.h:63
static DetectorSpecs * _me
Voxel definition.
Definition: FMWKInterface.h:80
art framework interface to geometry description
A nested configuration parameter set holder for flashmatch framework.
Definition: PSet.h:26