1 #ifndef __OPT0FINDERFMWKINTERFACE_CXX__
2 #define __OPT0FINDERFMWKINTERFACE_CXX__
11 #if USING_LARSOFT == 0
18 assert(!filename.empty());
19 if(filename.find(
"/") != 0)
20 filename = std::string(getenv(
"FMATCH_DATADIR")) +
"/" + filename;
25 auto max_pt =
p.get<std::vector<double> >(
"MaxPosition");
26 auto min_pt =
p.get<std::vector<double> >(
"MinPosition");
27 assert(max_pt.size() == 3);
28 assert(min_pt.size() == 3);
29 assert(max_pt[0] >= min_pt[0] &&
30 max_pt[1] >= min_pt[1] &&
31 max_pt[2] >= min_pt[2]);
39 if(!
p.contains_value(key))
break;
41 assert(pmt.size()==3);
53 auto iter =
_bbox_map.find(std::pair<int,int>(tpc, cryo));
55 FLASH_CRITICAL() <<
"Boundary box map doesn't contain cryo " << cryo
56 <<
" or tpc " << tpc <<
"!" << std::endl;
57 throw OpT0FinderException();
72 ::art::ServiceHandle<geo::Geometry>
const geo;
73 auto const clock_data = ::art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
74 auto const det_prop = ::art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clock_data);
79 _pmt_v.resize(geo->NOpDets());
81 for (
size_t opdet = 0; opdet < geo->NOpDets(); opdet++) {
83 std::vector<double> pos(3, 0.);
84 geo->OpDetGeoFromOpDet(opdet).GetCenter(&pos[0]);
90 double global_x_min = 1e9, global_x_max = -1e9;
91 double global_y_min = 1e9, global_y_max = -1e9;
92 double global_z_min = 1e9, global_z_max = -1e9;
94 _bbox_map.reserve(geo->Ncryostats() * geo->NTPC());
96 for (
size_t cryo = 0; cryo < geo->Ncryostats(); cryo++) {
97 for (
size_t tpc = 0; tpc < geo->NTPC(cryo); tpc++) {
108 if (x_min < global_x_min) global_x_min = x_min;
109 if (x_max > global_x_max) global_x_max = x_max;
110 if (y_min < global_y_min) global_y_min = y_min;
111 if (y_max > global_y_max) global_y_max = y_max;
112 if (z_min < global_z_min) global_z_min = z_min;
113 if (z_max > global_z_max) global_z_max = z_max;
119 global_x_max, global_y_max, global_z_max);
144 auto iter =
_bbox_map.find(std::pair<int,int>(tpc, cryo));
146 FLASH_CRITICAL() <<
"Boundary box map doesn't contain cryo " << cryo
147 <<
" or tpc " << tpc <<
"!" << std::endl;
process_name opflash particleana ie ie ie z
PSet CreatePSetFromFile(std::string fname, std::string cfg_name)
Given a configuration file (full path), create and return flashmatch::PSet.
const geoalgo::AABox & ActiveVolume() const
Detector active volume.
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) -> bbox.
Geometry information for a single TPC.
Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple & 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): .
double HalfLength() const
Length is associated with z coordinate [cm].
fhicl::ParameterSet Config_t
Configuration object.
static PhotonVisibilityService & GetME(std::string filename="PhotonLibrary-20180801.root")
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")
#define FLASH_CRITICAL()
Compiler macro for CRITICAL message.
Utility functions in Base/PSet.
double HalfHeight() const
Height is associated with y coordinate [cm].
const sim::PhotonVoxelDef & GetVoxelDef() const
std::string to_string(WindowPattern const &pattern)
float GetVisibilityReflected(double x, double y, double z, unsigned int opch) const
Visibility Reflected.
std::vector< geoalgo::Point_t > _pmt_v
float GetVisibility(Point const &p, unsigned int OpChannel, bool wantReflected=false) const
static DetectorSpecs * _me
Voxel definition.
double HalfWidth() const
Width is associated with x coordinate [cm].
const std::vector< std::vector< float > > & GetLibraryData() const
Point GetCenter() const
Returns the center of the TPC volume in world coordinates [cm].