All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
phot::PhotonVisibilityService Class Reference

#include <PhotonVisibilityService.h>

Public Member Functions

 ~PhotonVisibilityService ()
 
 PhotonVisibilityService (fhicl::ParameterSet const &pset)
 
void reconfigure (fhicl::ParameterSet const &p)
 
double GetQuenchingFactor (double dQdx) const
 
template<typename Point >
bool HasVisibility (Point const &p, bool wantReflected=false) const
 
template<typename Point >
float GetVisibility (Point const &p, unsigned int OpChannel, bool wantReflected=false) const
 
template<typename Point >
MappedCounts_t GetAllVisibilities (Point const &p, bool wantReflected=false) const
 
void LoadLibrary () const
 
void StoreLibrary ()
 
void StoreLightProd (int VoxID, double N)
 
void RetrieveLightProd (int &VoxID, double &N) const
 
void SetLibraryEntry (int VoxID, OpDetID_t libOpChannel, float N, bool wantReflected=false)
 
float GetLibraryEntry (int VoxID, OpDetID_t libOpChannel, bool wantReflected=false) const
 
bool HasLibraryEntries (int VoxID, bool wantReflected=false) const
 
phot::IPhotonLibrary::Counts_t GetLibraryEntries (int VoxID, bool wantReflected=false) const
 
template<typename Point >
MappedT0s_t GetReflT0s (Point const &p) const
 
void SetLibraryReflT0Entry (int VoxID, int OpChannel, float value)
 
phot::IPhotonLibrary::Counts_t GetLibraryReflT0Entries (int VoxID) const
 
float GetLibraryReflT0Entry (int VoxID, OpDetID_t libOpChannel) const
 
template<typename Point >
MappedParams_t GetTimingPar (Point const &p) const
 
void SetLibraryTimingParEntry (int VoxID, int OpChannel, float value, size_t parnum)
 
phot::IPhotonLibrary::Params_t GetLibraryTimingParEntries (int VoxID) const
 
float GetLibraryTimingParEntry (int VoxID, OpDetID_t libOpChannel, size_t npar) const
 
template<typename Point >
MappedFunctions_t GetTimingTF1 (Point const &p) const
 
void SetLibraryTimingTF1Entry (int VoxID, int OpChannel, TF1 const &func)
 
phot::IPhotonLibrary::Functions_t GetLibraryTimingTF1Entries (int VoxID) const
 
void SetDirectLightPropFunctions (TF1 const *functions[8], double &d_break, double &d_max, double &tf1_sampling_factor) const
 
void SetReflectedCOLightPropFunctions (TF1 const *functions[5], double &t0_max, double &t0_break_point) const
 
void LoadTimingsForVUVPar (std::vector< std::vector< double >>(&v)[7], double &step_size, double &max_d, double &min_d, double &vuv_vgroup_mean, double &vuv_vgroup_max, double &inflexion_point_distance, double &angle_bin_timing_vuv) const
 
void LoadTimingsForVISPar (std::vector< double > &distances, std::vector< double > &radial_distances, std::vector< std::vector< std::vector< double >>> &cut_off, std::vector< std::vector< std::vector< double >>> &tau, double &vis_vmean, double &angle_bin_timing_vis) const
 
void LoadVUVSemiAnalyticProperties (bool &isFlatPDCorr, bool &isDomePDCorr, double &delta_angulo_vuv, double &radius) const
 
void LoadGHFlat (std::vector< std::vector< double >> &GHvuvpars_flat, std::vector< double > &border_corr_angulo_flat, std::vector< std::vector< double >> &border_corr_flat) const
 
void LoadGHDome (std::vector< std::vector< double >> &GHvuvpars_dome, std::vector< double > &border_corr_angulo_dome, std::vector< std::vector< double >> &border_corr_dome) const
 
void LoadVisSemiAnalyticProperties (double &delta_angulo_vis, double &radius) const
 
void LoadVisParsFlat (std::vector< double > &vis_distances_x_flat, std::vector< double > &vis_distances_r_flat, std::vector< std::vector< std::vector< double >>> &vispars_flat) const
 
void LoadVisParsDome (std::vector< double > &vis_distances_x_dome, std::vector< double > &vis_distances_r_dome, std::vector< std::vector< std::vector< double >>> &vispars_dome) const
 
bool IsBuildJob () const
 
bool UseParameterization () const
 
bool StoreReflected () const
 
bool StoreReflT0 () const
 
bool IncludeParPropTime () const
 
size_t ParPropTimeNpar () const
 
std::string ParPropTimeFormula () const
 
bool IncludePropTime () const
 
bool UseNhitsModel () const
 
bool ApplyVISBorderCorrection () const
 
std::string VISBorderCorrectionType () const
 
const sim::PhotonVoxelDefGetVoxelDef () const
 
size_t NOpChannels () const
 
 PhotonVisibilityService (const std::string library="PhotonLibrary-20180801.root")
 
float GetVisibility (double *xyz, unsigned int OpChannel) const
 
float GetVisibility (double x, double y, double z, unsigned int OpChannel) const
 
std::vector< std::vector< float > > GetVisibilityXY (double z) const
 
std::vector< std::vector< float > > GetVisibilityYZ (double x) const
 
std::vector< std::vector< float > > GetVisibilityZX (double y) const
 
float Fraction2AbsoluteX (float frac) const
 
float Fraction2AbsoluteY (float frac) const
 
float Fraction2AbsoluteZ (float frac) const
 
float GetMaxX () const
 
float GetMaxY () const
 
float GetMaxZ () const
 
float GetMinX () const
 
float GetMinY () const
 
float GetMinZ () const
 
int GetNX () const
 
int GetNY () const
 
int GetNZ () const
 
size_t GetNOpChannels () const
 
const std::vector< float > * GetAllVisibilities (double *xyz) const
 
const std::vector< std::vector
< float > > & 
GetLibraryData () const
 
void LoadLibrary () const
 
void StoreLibrary ()
 
void StoreLightProd (int VoxID, double N)
 
void RetrieveLightProd (int &VoxID, double &N) const
 
void SetLibraryEntry (int VoxID, int OpChannel, float N)
 
float GetLibraryEntry (int VoxID, int OpChannel) const
 
const std::vector< float > * GetLibraryEntries (int VoxID) const
 
bool IsBuildJob () const
 
bool UseParameterization () const
 
sim::PhotonVoxelDef GetVoxelDef () const
 
int NOpChannels () const
 
const std::string & GetLibraryFilename ()
 

Static Public Member Functions

template<typename Point >
static double DistanceToOpDet (Point const &p, unsigned int OpDet)
 
template<typename Point >
static double SolidAngleFactor (Point const &p, unsigned int OpDet)
 
static PhotonVisibilityServiceGetME (std::string filename="PhotonLibrary-20180801.root")
 

Private Types

using LibraryIndex_t = phot::IPhotonMappingTransformations::LibraryIndex_t
 Type of optical library index. More...
 

Private Member Functions

geo::Point_t LibLocation (geo::Point_t const &p) const
 
int VoxelAt (geo::Point_t const &p) const
 
float doGetVisibilityOfOpLib (geo::Point_t const &p, LibraryIndex_t libIndex, bool wantReflected=false) const
 

Private Attributes

int fCurrentVoxel
 
double fCurrentValue
 
float fXmin
 
float fXmax
 
float fYmin
 
float fYmax
 
float fZmin
 
float fZmax
 
int fNx
 
int fNy
 
int fNz
 
bool fUseCryoBoundary
 
bool fLibraryBuildJob
 
bool fDoNotLoadLibrary
 
bool fParameterization
 
bool fHybrid
 
bool fStoreReflected
 
bool fStoreReflT0
 
bool fIncludePropTime
 
bool fUseNhitsModel
 
bool fApplyVISBorderCorrection
 
std::string fVISBorderCorrectionType
 
bool fParPropTime
 
size_t fParPropTime_npar
 
std::string fParPropTime_formula
 
int fParPropTime_MaxRange
 
bool fInterpolate
 
bool fReflectOverZeroX
 
TF1 * fparslogNorm = nullptr
 
TF1 * fparslogNorm_far = nullptr
 
TF1 * fparsMPV = nullptr
 
TF1 * fparsMPV_far = nullptr
 
TF1 * fparsWidth = nullptr
 
TF1 * fparsCte = nullptr
 
TF1 * fparsCte_far = nullptr
 
TF1 * fparsSlope = nullptr
 
double fD_break
 
double fD_max
 
double fTF1_sampling_factor
 
TF1 * fparslogNorm_refl = nullptr
 
TF1 * fparsMPV_refl = nullptr
 
TF1 * fparsWidth_refl = nullptr
 
TF1 * fparsCte_refl = nullptr
 
TF1 * fparsSlope_refl = nullptr
 
double fT0_max
 
double fT0_break_point
 
std::vector< double > fDistances_landau
 
std::vector< std::vector
< double > > 
fNorm_over_entries
 
std::vector< std::vector
< double > > 
fMpv
 
std::vector< std::vector
< double > > 
fWidth
 
std::vector< double > fDistances_exp
 
std::vector< std::vector
< double > > 
fSlope
 
std::vector< std::vector
< double > > 
fExpo_over_Landau_norm
 
double fstep_size
 
double fmax_d
 
double fmin_d
 
double fvuv_vgroup_mean
 
double fvuv_vgroup_max
 
double finflexion_point_distance
 
double fangle_bin_timing_vuv
 
std::vector< double > fDistances_refl
 
std::vector< double > fDistances_radial_refl
 
std::vector< std::vector
< std::vector< double > > > 
fCut_off
 
std::vector< std::vector
< std::vector< double > > > 
fTau
 
double fvis_vmean
 
double fangle_bin_timing_vis
 
bool fIsFlatPDCorr
 
bool fIsDomePDCorr
 
double fdelta_angulo_vuv
 
std::vector< std::vector
< double > > 
fGHvuvpars_flat
 
std::vector< double > fborder_corr_angulo_flat
 
std::vector< std::vector
< double > > 
fborder_corr_flat
 
std::vector< std::vector
< double > > 
fGHvuvpars_dome
 
std::vector< double > fborder_corr_angulo_dome
 
std::vector< std::vector
< double > > 
fborder_corr_dome
 
double fdelta_angulo_vis
 
std::vector< double > fvis_distances_x_flat
 
std::vector< double > fvis_distances_r_flat
 
std::vector< std::vector
< std::vector< double > > > 
fvispars_flat
 
std::vector< double > fvis_distances_x_dome
 
std::vector< double > fvis_distances_r_dome
 
std::vector< std::vector
< std::vector< double > > > 
fvispars_dome
 
double fradius
 
std::string fLibraryFile
 
IPhotonLibraryfTheLibrary
 
sim::PhotonVoxelDef fVoxelDef
 
std::unique_ptr
< phot::IPhotonMappingTransformations
fMapping
 Mapping of detector space into library space. More...
 
size_t fNOpDetChannels
 
PhotonLibraryfTheLibrary
 

Static Private Attributes

static PhotonVisibilityService_me = nullptr
 

Implementation functions

bool doHasVisibility (geo::Point_t const &p, bool wantReflected=false) const
 
float doGetVisibility (geo::Point_t const &p, unsigned int OpChannel, bool wantReflected=false) const
 
MappedCounts_t doGetAllVisibilities (geo::Point_t const &p, bool wantReflected=false) const
 
MappedT0s_t doGetReflT0s (geo::Point_t const &p) const
 
MappedParams_t doGetTimingPar (geo::Point_t const &p) const
 
MappedFunctions_t doGetTimingTF1 (geo::Point_t const &p) const
 
static double DistanceToOpDetImpl (geo::Point_t const &p, unsigned int OpDet)
 
static double SolidAngleFactorImpl (geo::Point_t const &p, unsigned int OpDet)
 

Detailed Description

Definition at line 37 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

Member Typedef Documentation

Type of optical library index.

Definition at line 40 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

Constructor & Destructor Documentation

phot::PhotonVisibilityService::~PhotonVisibilityService ( )

Definition at line 50 of file PhotonVisibilityService.cc.

51  {
52  delete fparslogNorm;
53  delete fparslogNorm_far;
54  delete fparsMPV;
55  delete fparsMPV_far;
56  delete fparsWidth;
57  delete fparsCte;
58  delete fparsCte_far;
59  delete fparsSlope;
60  delete fparslogNorm_refl;
61  delete fparsMPV_refl;
62  delete fparsWidth_refl;
63  delete fparsCte_refl;
64  delete fparsSlope_refl;
65  delete fTheLibrary;
66  }
phot::PhotonVisibilityService::PhotonVisibilityService ( fhicl::ParameterSet const &  pset)

Definition at line 69 of file PhotonVisibilityService.cc.

70  :
71 
72  fCurrentVoxel(0)
73  , fCurrentValue(0.)
74  , fXmin(0.)
75  , fXmax(0.)
76  , fYmin(0.)
77  , fYmax(0.)
78  , fZmin(0.)
79  , fZmax(0.)
80  , fNx(0)
81  , fNy(0)
82  , fNz(0)
83  , fUseCryoBoundary(false)
84  , fLibraryBuildJob(false)
85  , fDoNotLoadLibrary(false)
86  , fParameterization(false)
87  , fHybrid(false)
88  , fStoreReflected(false)
89  , fStoreReflT0(false)
90  , fIncludePropTime(false)
91  , fUseNhitsModel(false)
92  , fParPropTime(false)
96  , fInterpolate(false)
97  , fReflectOverZeroX(false)
98  , fparslogNorm(nullptr)
99  , fparslogNorm_far(nullptr)
100  , fparsMPV(nullptr)
101  , fparsMPV_far(nullptr)
102  , fparsWidth(nullptr)
103  , fparsCte(nullptr)
104  , fparsCte_far(nullptr)
105  , fparsSlope(nullptr)
106  , fD_break(0.0)
107  , fD_max(0.0)
108  , fTF1_sampling_factor(0.0)
109  , fparslogNorm_refl(nullptr)
110  , fparsMPV_refl(nullptr)
111  , fparsWidth_refl(nullptr)
112  , fparsCte_refl(nullptr)
113  , fparsSlope_refl(nullptr)
114  , fT0_max(0.0)
115  , fT0_break_point(0.0)
116  , fLibraryFile()
117  , fTheLibrary(nullptr)
118  , fVoxelDef()
119  {
120  this->reconfigure(pset);
121 
122  if (pset.has_key("ReflectOverZeroX")) { // legacy parameter warning
123  if (pset.has_key("Mapping")) {
124  throw art::Exception(art::errors::Configuration)
125  << "`PhotonVisbilityService` configuration specifies both `Mapping` and "
126  "`ReflectOverZeroX`."
127  " Please remove the latter (and use `PhotonMappingXMirrorTransformations` tool).";
128  }
129  else {
130  mf::LogWarning("PhotonVisbilityService")
131  << "Please update the configuration of `PhotonVisbilityService` service"
132  " replacing `ReflectOverZeroX` with tool configuration:"
133  "\n Mapping: { tool_type: \"PhotonMappingXMirrorTransformations\" }";
134  }
135  } // if
136  fhicl::ParameterSet mapDefaultSet;
137  mapDefaultSet.put("tool_type",
138  fReflectOverZeroX ? "PhotonMappingXMirrorTransformations" :
139  "PhotonMappingIdentityTransformations");
140  fMapping = art::make_tool<phot::IPhotonMappingTransformations>(
141  pset.get<fhicl::ParameterSet>("Mapping", mapDefaultSet));
142 
143  mf::LogInfo("PhotonVisibilityService") << "PhotonVisbilityService initializing" << std::endl;
144  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
void reconfigure(fhicl::ParameterSet const &p)
phot::PhotonVisibilityService::PhotonVisibilityService ( const std::string  library = "PhotonLibrary-20180801.root")

Definition at line 70 of file PhotonVisibilityService.cxx.

70  :
71  fCurrentVoxel(0),
72  fCurrentValue(0.),
73  fXmin( -395.0 ),
74  fXmax( -45.0 ),
75  fYmin( -215.2 ),
76  fYmax( 174.8 ),
77  fZmin( -995.0 ),
78  fZmax( 965.0 ),
79  fNx(70),
80  fNy(78),
81  fNz(392),
82  fNOpDetChannels(180),
83  fUseCryoBoundary(true),
84  fLibraryBuildJob(false),
85  fDoNotLoadLibrary(false),
86  fParameterization(false),
87  fLibraryFile(library),
88  fTheLibrary(nullptr)
89  {
91  return;
92  }
Representation of a region of space diced into voxels.

Member Function Documentation

bool phot::PhotonVisibilityService::ApplyVISBorderCorrection ( ) const
inline
template<typename Point >
static double phot::PhotonVisibilityService::DistanceToOpDet ( Point const &  p,
unsigned int  OpDet 
)
inlinestatic

Definition at line 52 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

53  {
55  }
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
static double DistanceToOpDetImpl(geo::Point_t const &p, unsigned int OpDet)
double phot::PhotonVisibilityService::DistanceToOpDetImpl ( geo::Point_t const &  p,
unsigned int  OpDet 
)
staticprivate

Definition at line 429 of file PhotonVisibilityService.cc.

430  {
431  art::ServiceHandle<geo::Geometry const> geom;
432  return geom->OpDetGeoFromOpDet(OpDet).DistanceToPoint(p);
433  }
pdgs p
Definition: selectors.fcl:22
auto phot::PhotonVisibilityService::doGetAllVisibilities ( geo::Point_t const &  p,
bool  wantReflected = false 
) const
private

Definition at line 401 of file PhotonVisibilityService.cc.

403  {
405 
406  // first we fill a container of visibilities in the library index space
407  // (it is directly the values of the library unless interpolation is
408  // requested)
409  if (fInterpolate) {
410  // this is a punch into multithreading face:
411  static std::vector<float> ret;
412  ret.resize(fMapping->libraryMappingSize(p));
413  for (std::size_t libIndex = 0; libIndex < ret.size(); ++libIndex) {
414  ret[libIndex] = doGetVisibilityOfOpLib(p, LibraryIndex_t(libIndex), wantReflected);
415  }
416  data = &ret.front();
417  }
418  else {
419  auto const VoxID = VoxelAt(p);
420  data = GetLibraryEntries(VoxID, wantReflected);
421  }
422  return fMapping->applyOpDetMapping(p, data);
423  }
phot::IPhotonLibrary::Counts_t GetLibraryEntries(int VoxID, bool wantReflected=false) const
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
pdgs p
Definition: selectors.fcl:22
phot::IPhotonMappingTransformations::LibraryIndex_t LibraryIndex_t
Type of optical library index.
float doGetVisibilityOfOpLib(geo::Point_t const &p, LibraryIndex_t libIndex, bool wantReflected=false) const
const float * Counts_t
Type for visibility count per optical channel.
auto phot::PhotonVisibilityService::doGetReflT0s ( geo::Point_t const &  p) const
private

Definition at line 572 of file PhotonVisibilityService.cc.

573  {
574  // both the input and the output go through mapping to apply needed symmetries.
575  int const VoxID = VoxelAt(p);
577  return fMapping->applyOpDetMapping(p, data);
578  }
phot::IPhotonLibrary::Counts_t GetLibraryReflT0Entries(int VoxID) const
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
pdgs p
Definition: selectors.fcl:22
const float * Counts_t
Type for visibility count per optical channel.
auto phot::PhotonVisibilityService::doGetTimingPar ( geo::Point_t const &  p) const
private

Definition at line 619 of file PhotonVisibilityService.cc.

620  {
621  int const VoxID = VoxelAt(p);
623  return fMapping->applyOpDetMapping(p, params);
624  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
pdgs p
Definition: selectors.fcl:22
std::vector< float > const * Params_t
phot::IPhotonLibrary::Params_t GetLibraryTimingParEntries(int VoxID) const
auto phot::PhotonVisibilityService::doGetTimingTF1 ( geo::Point_t const &  p) const
private

Definition at line 627 of file PhotonVisibilityService.cc.

628  {
629  int const VoxID = VoxelAt(p);
631  return fMapping->applyOpDetMapping(p, functions);
632  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
pdgs p
Definition: selectors.fcl:22
phot::IPhotonLibrary::Functions_t GetLibraryTimingTF1Entries(int VoxID) const
float phot::PhotonVisibilityService::doGetVisibility ( geo::Point_t const &  p,
unsigned int  OpChannel,
bool  wantReflected = false 
) const
private

Definition at line 479 of file PhotonVisibilityService.cc.

482  {
483  // here we quietly confuse op. det. channel (interface) and op. det. (library)
484  LibraryIndex_t const libIndex = fMapping->opDetToLibraryIndex(p, OpChannel);
485  return doGetVisibilityOfOpLib(p, libIndex, wantReflected);
486  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
pdgs p
Definition: selectors.fcl:22
phot::IPhotonMappingTransformations::LibraryIndex_t LibraryIndex_t
Type of optical library index.
float doGetVisibilityOfOpLib(geo::Point_t const &p, LibraryIndex_t libIndex, bool wantReflected=false) const
float phot::PhotonVisibilityService::doGetVisibilityOfOpLib ( geo::Point_t const &  p,
LibraryIndex_t  libIndex,
bool  wantReflected = false 
) const
private

Definition at line 448 of file PhotonVisibilityService.cc.

451  {
452  if (!fInterpolate) { return GetLibraryEntry(VoxelAt(p), libIndex, wantReflected); }
453 
454  // In case we're outside the bounding box we'll get a empty optional list.
455  auto const neis = GetVoxelDef().GetNeighboringVoxelIDs(LibLocation(p));
456  if (!neis) return 0.0;
457 
458  // Sum up all the weighted neighbours to get interpolation behaviour
459  float vis = 0.0;
460  for (const sim::PhotonVoxelDef::NeiInfo& n : neis.value()) {
461  if (n.id < 0) continue;
462  vis += n.weight * GetLibraryEntry(n.id, libIndex, wantReflected);
463  }
464  return vis;
465  }
pdgs p
Definition: selectors.fcl:22
float GetLibraryEntry(int VoxID, OpDetID_t libOpChannel, bool wantReflected=false) const
geo::Point_t LibLocation(geo::Point_t const &p) const
std::optional< std::array< NeiInfo, 8U > > GetNeighboringVoxelIDs(Point const &v) const
Returns IDs of the eight neighboring voxels around v.
bool phot::PhotonVisibilityService::doHasVisibility ( geo::Point_t const &  p,
bool  wantReflected = false 
) const
private

Definition at line 470 of file PhotonVisibilityService.cc.

472  {
473  return HasLibraryEntries(VoxelAt(p), wantReflected);
474  }
pdgs p
Definition: selectors.fcl:22
bool HasLibraryEntries(int VoxID, bool wantReflected=false) const
float phot::PhotonVisibilityService::Fraction2AbsoluteX ( float  frac) const
float phot::PhotonVisibilityService::Fraction2AbsoluteY ( float  frac) const
float phot::PhotonVisibilityService::Fraction2AbsoluteZ ( float  frac) const
const std::vector< float > * phot::PhotonVisibilityService::GetAllVisibilities ( double *  xyz) const

Definition at line 235 of file PhotonVisibilityService.cxx.

236  {
237  int VoxID = fVoxelDef.GetVoxelID(xyz);
238  return GetLibraryEntries(VoxID);
239  }
phot::IPhotonLibrary::Counts_t GetLibraryEntries(int VoxID, bool wantReflected=false) const
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
template<typename Point >
MappedCounts_t phot::PhotonVisibilityService::GetAllVisibilities ( Point const &  p,
bool  wantReflected = false 
) const
inline

Definition at line 79 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

80  {
81  return doGetAllVisibilities(geo::vect::toPoint(p), wantReflected);
82  }
MappedCounts_t doGetAllVisibilities(geo::Point_t const &p, bool wantReflected=false) const
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
const std::vector<std::vector<float> >& phot::PhotonVisibilityService::GetLibraryData ( ) const
inline
const std::vector< float > * phot::PhotonVisibilityService::GetLibraryEntries ( int  VoxID) const

Definition at line 314 of file PhotonVisibilityService.cxx.

315  {
316  if(fTheLibrary == 0)
317  LoadLibrary();
318 
319  return fTheLibrary->GetCounts(VoxID);
320  }
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
phot::IPhotonLibrary::Counts_t phot::PhotonVisibilityService::GetLibraryEntries ( int  VoxID,
bool  wantReflected = false 
) const

Definition at line 531 of file PhotonVisibilityService.cc.

532  {
533  if (fTheLibrary == 0) LoadLibrary();
534 
535  if (!wantReflected)
536  return fTheLibrary->GetCounts(VoxID);
537  else
538  return fTheLibrary->GetReflCounts(VoxID);
539  }
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
virtual Counts_t GetReflCounts(size_t Voxel) const =0
float phot::PhotonVisibilityService::GetLibraryEntry ( int  VoxID,
int  OpChannel 
) const

Definition at line 324 of file PhotonVisibilityService.cxx.

325  {
326  if(fTheLibrary == 0)
327  LoadLibrary();
328 
329  return fTheLibrary->GetCount(VoxID, Channel);
330  }
virtual float GetCount(size_t Voxel, size_t OpChannel) const =0
float phot::PhotonVisibilityService::GetLibraryEntry ( int  VoxID,
OpDetID_t  libOpChannel,
bool  wantReflected = false 
) const

Definition at line 554 of file PhotonVisibilityService.cc.

557  {
558  if (fTheLibrary == 0) LoadLibrary();
559 
560  if (!wantReflected)
561  return fTheLibrary->GetCount(VoxID, libOpChannel);
562  else
563  return fTheLibrary->GetReflCount(VoxID, libOpChannel);
564  }
virtual float GetReflCount(size_t Voxel, size_t OpChannel) const =0
virtual float GetCount(size_t Voxel, size_t OpChannel) const =0
const std::string& phot::PhotonVisibilityService::GetLibraryFilename ( )
inline
phot::IPhotonLibrary::Counts_t phot::PhotonVisibilityService::GetLibraryReflT0Entries ( int  VoxID) const

Definition at line 583 of file PhotonVisibilityService.cc.

584  {
585  if (fTheLibrary == 0) LoadLibrary();
586 
587  return fTheLibrary->GetReflT0s(VoxID);
588  }
virtual T0s_t GetReflT0s(size_t Voxel) const =0
float phot::PhotonVisibilityService::GetLibraryReflT0Entry ( int  VoxID,
OpDetID_t  libOpChannel 
) const

Definition at line 607 of file PhotonVisibilityService.cc.

608  {
609  if (fTheLibrary == 0) LoadLibrary();
610 
611  return fTheLibrary->GetReflT0(VoxID, libOpChannel);
612  }
virtual float GetReflT0(size_t Voxel, size_t OpChannel) const =0
phot::IPhotonLibrary::Params_t phot::PhotonVisibilityService::GetLibraryTimingParEntries ( int  VoxID) const

Definition at line 637 of file PhotonVisibilityService.cc.

638  {
639  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
640  if (fTheLibrary == 0) LoadLibrary();
641 
642  return lib->GetTimingPars(VoxID);
643  }
float phot::PhotonVisibilityService::GetLibraryTimingParEntry ( int  VoxID,
OpDetID_t  libOpChannel,
size_t  npar 
) const

Definition at line 690 of file PhotonVisibilityService.cc.

693  {
694  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
695  if (fTheLibrary == 0) LoadLibrary();
696 
697  return lib->GetTimingPar(VoxID, libOpChannel, npar);
698  }
phot::IPhotonLibrary::Functions_t phot::PhotonVisibilityService::GetLibraryTimingTF1Entries ( int  VoxID) const

Definition at line 648 of file PhotonVisibilityService.cc.

649  {
650  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
651  if (fTheLibrary == 0) LoadLibrary();
652 
653  return lib->GetTimingTF1s(VoxID);
654  }
float phot::PhotonVisibilityService::GetMaxX ( ) const
inline
float phot::PhotonVisibilityService::GetMaxY ( ) const
inline
float phot::PhotonVisibilityService::GetMaxZ ( ) const
inline
static PhotonVisibilityService& phot::PhotonVisibilityService::GetME ( std::string  filename = "PhotonLibrary-20180801.root")
inlinestatic

Definition at line 84 of file sbncode/sbncode/OpT0Finder/flashmatch/Base/FMWKTools/PhotonVisibilityService.h.

85  {
86  // argument allows user to choose file loaded
87  // if relative, searches for file in designated folder
88  // if absolute, searches for file with given path
89  // see LoadLibrary()
91  return *_me;
92  }
BEGIN_PROLOG could also be dds filename
PhotonVisibilityService(fhicl::ParameterSet const &pset)
float phot::PhotonVisibilityService::GetMinX ( ) const
inline
float phot::PhotonVisibilityService::GetMinY ( ) const
inline
float phot::PhotonVisibilityService::GetMinZ ( ) const
inline
size_t phot::PhotonVisibilityService::GetNOpChannels ( ) const
inline
int phot::PhotonVisibilityService::GetNX ( ) const
inline
int phot::PhotonVisibilityService::GetNY ( ) const
inline
int phot::PhotonVisibilityService::GetNZ ( ) const
inline
double phot::PhotonVisibilityService::GetQuenchingFactor ( double  dQdx) const

Definition at line 389 of file PhotonVisibilityService.cc.

390  {
391  // for now, no quenching
392  return 1.0;
393  }
template<typename Point >
MappedT0s_t phot::PhotonVisibilityService::GetReflT0s ( Point const &  p) const
inline

Definition at line 97 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

98  {
100  }
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
MappedT0s_t doGetReflT0s(geo::Point_t const &p) const
template<typename Point >
MappedParams_t phot::PhotonVisibilityService::GetTimingPar ( Point const &  p) const
inline

Definition at line 107 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

108  {
110  }
MappedParams_t doGetTimingPar(geo::Point_t const &p) const
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
template<typename Point >
MappedFunctions_t phot::PhotonVisibilityService::GetTimingTF1 ( Point const &  p) const
inline

Definition at line 117 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

118  {
120  }
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
MappedFunctions_t doGetTimingTF1(geo::Point_t const &p) const
float phot::PhotonVisibilityService::GetVisibility ( double *  xyz,
unsigned int  OpChannel 
) const

Definition at line 267 of file PhotonVisibilityService.cxx.

268  {
269  int VoxID = fVoxelDef.GetVoxelID(xyz);
270  return GetLibraryEntry(VoxID, OpChannel);
271  }
float GetLibraryEntry(int VoxID, OpDetID_t libOpChannel, bool wantReflected=false) const
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
float phot::PhotonVisibilityService::GetVisibility ( double  x,
double  y,
double  z,
unsigned int  OpChannel 
) const

Definition at line 273 of file PhotonVisibilityService.cxx.

274  {
275  int VoxID = fVoxelDef.GetVoxelID(x,y,z);
276  return GetLibraryEntry(VoxID, OpChannel);
277  }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
float GetLibraryEntry(int VoxID, OpDetID_t libOpChannel, bool wantReflected=false) const
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
process_name opflash particleana ie ie y
template<typename Point >
float phot::PhotonVisibilityService::GetVisibility ( Point const &  p,
unsigned int  OpChannel,
bool  wantReflected = false 
) const
inline

Definition at line 72 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

73  {
74  return doGetVisibility(geo::vect::toPoint(p), OpChannel, wantReflected);
75  }
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
float doGetVisibility(geo::Point_t const &p, unsigned int OpChannel, bool wantReflected=false) const
std::vector< std::vector< float > > phot::PhotonVisibilityService::GetVisibilityXY ( double  z) const

Definition at line 135 of file PhotonVisibilityService.cxx.

135  {
136  std::vector<std::vector<float> > result(fNx,std::vector<float>(fNy,0.));
137  if(z < fZmin || z > fZmax) return result;
138 
139  if(fTheLibrary == 0)
140  LoadLibrary();
141 
142  for(int ix=0; ix<fNx; ++ix) {
143  for(int iy=0; iy<fNy; ++iy) {
144  int vox_id = ix + iy * fNx;
145  double vis_sum = 0.;
146  for(auto const& vis_pmt : *(fTheLibrary->GetCounts(vox_id)))
147  vis_sum += ((double)(vis_pmt));
148  result[ix][iy] = vis_sum;
149  }
150  }
151  return result;
152  }
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
std::vector< std::vector< float > > phot::PhotonVisibilityService::GetVisibilityYZ ( double  x) const

Definition at line 95 of file PhotonVisibilityService.cxx.

95  {
96  std::vector<std::vector<float> > result(fNy,std::vector<float>(fNz,0.));
97  if(x < fXmin || x > fXmax) return result;
98 
99  if(fTheLibrary == 0)
100  LoadLibrary();
101 
102  for(int iy=0; iy<fNy; ++iy) {
103  for(int iz=0; iz<fNz; ++iz) {
104  int vox_id = iy*fNx + iz * (fNy + fNx);
105  double vis_sum = 0.;
106  for(auto const& vis_pmt : *(fTheLibrary->GetCounts(vox_id)))
107  vis_sum += ((double)(vis_pmt));
108  result[iy][iz] = vis_sum;
109  }
110  }
111  return result;
112  }
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
std::vector< std::vector< float > > phot::PhotonVisibilityService::GetVisibilityZX ( double  y) const

Definition at line 115 of file PhotonVisibilityService.cxx.

115  {
116  std::vector<std::vector<float> > result(fNz,std::vector<float>(fNx,0.));
117  if(y < fYmin || y > fYmax) return result;
118 
119  if(fTheLibrary == 0)
120  LoadLibrary();
121 
122  for(int ix=0; ix<fNx; ++ix) {
123  for(int iz=0; iz<fNz; ++iz) {
124  int vox_id = ix + iz * (fNy + fNx);
125  double vis_sum = 0.;
126  for(auto const& vis_pmt : *(fTheLibrary->GetCounts(vox_id)))
127  vis_sum += ((double)(vis_pmt));
128  result[iz][ix] = vis_sum;
129  }
130  }
131  return result;
132  }
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
sim::PhotonVoxelDef phot::PhotonVisibilityService::GetVoxelDef ( ) const
inline
const sim::PhotonVoxelDef& phot::PhotonVisibilityService::GetVoxelDef ( ) const
inline
bool phot::PhotonVisibilityService::HasLibraryEntries ( int  VoxID,
bool  wantReflected = false 
) const

Definition at line 544 of file PhotonVisibilityService.cc.

546  {
547  if (!fTheLibrary) LoadLibrary();
548  return fTheLibrary->isVoxelValid(VoxID);
549  }
virtual bool isVoxelValid(size_t Voxel) const
template<typename Point >
bool phot::PhotonVisibilityService::HasVisibility ( Point const &  p,
bool  wantReflected = false 
) const
inline

Definition at line 65 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

66  {
67  return doHasVisibility(geo::vect::toPoint(p), wantReflected);
68  }
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
bool doHasVisibility(geo::Point_t const &p, bool wantReflected=false) const
bool phot::PhotonVisibilityService::IncludeParPropTime ( ) const
inline
bool phot::PhotonVisibilityService::IncludePropTime ( ) const
inline
bool phot::PhotonVisibilityService::IsBuildJob ( ) const
inline
bool phot::PhotonVisibilityService::IsBuildJob ( ) const
inline
geo::Point_t phot::PhotonVisibilityService::LibLocation ( geo::Point_t const &  p) const
private

Definition at line 851 of file PhotonVisibilityService.cc.

852  {
853  return fMapping->detectorToLibrary(p);
854  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
pdgs p
Definition: selectors.fcl:22
void phot::PhotonVisibilityService::LoadGHDome ( std::vector< std::vector< double >> &  GHvuvpars_dome,
std::vector< double > &  border_corr_angulo_dome,
std::vector< std::vector< double >> &  border_corr_dome 
) const

Definition at line 811 of file PhotonVisibilityService.cc.

814  {
815  if (!fIsDomePDCorr) return;
816  GHvuvpars_dome = fGHvuvpars_dome;
817  border_corr_angulo_dome = fborder_corr_angulo_dome;
818  border_corr_dome = fborder_corr_dome;
819  }
void phot::PhotonVisibilityService::LoadGHFlat ( std::vector< std::vector< double >> &  GHvuvpars_flat,
std::vector< double > &  border_corr_angulo_flat,
std::vector< std::vector< double >> &  border_corr_flat 
) const

Definition at line 802 of file PhotonVisibilityService.cc.

805  {
806  if (!fIsFlatPDCorr) return;
807  GHvuvpars_flat = fGHvuvpars_flat;
808  border_corr_angulo_flat = fborder_corr_angulo_flat;
809  border_corr_flat = fborder_corr_flat;
810  }
void phot::PhotonVisibilityService::LoadLibrary ( ) const
void phot::PhotonVisibilityService::LoadLibrary ( ) const

Definition at line 148 of file PhotonVisibilityService.cc.

149  {
150  // Don't do anything if the library has already been loaded.
151 
152  if (fTheLibrary == 0) {
153 
154  if ((!fLibraryBuildJob) && (!fDoNotLoadLibrary)) {
155  std::string LibraryFileWithPath;
156  cet::search_path sp("FW_SEARCH_PATH");
157 
158  if (!sp.find_file(fLibraryFile, LibraryFileWithPath))
159  throw cet::exception("PhotonVisibilityService")
160  << "Unable to find photon library in " << sp.to_string() << "\n";
161 
162  if (!fParameterization) {
163  art::ServiceHandle<geo::Geometry const> geom;
164 
165  mf::LogInfo("PhotonVisibilityService")
166  << "PhotonVisibilityService Loading photon library from file " << LibraryFileWithPath
167  << " for " << GetVoxelDef().GetNVoxels() << " voxels and " << geom->NOpDets()
168  << " optical detectors." << std::endl;
169 
170  if (fHybrid) {
171  fTheLibrary = new PhotonLibraryHybrid(LibraryFileWithPath, GetVoxelDef());
172  }
173  else {
174  PhotonLibrary* lib = new PhotonLibrary;
175  fTheLibrary = lib;
176 
177  size_t NVoxels = GetVoxelDef().GetNVoxels();
178  lib->LoadLibraryFromFile(LibraryFileWithPath,
179  NVoxels,
181  fStoreReflT0,
184 
185  // if the library does not have metadata, we supply some;
186  // otherwise we check that it's compatible with the configured one
187  // (and shrug if it's not); overriding configured metadata
188  // from the one in the library is currently not supported
189  if (!lib->hasVoxelDef())
190  lib->SetVoxelDef(GetVoxelDef());
191  else if (GetVoxelDef() != lib->GetVoxelDef()) {
192  // this might become a fatal error in the future if some protocol
193  // is imposed... it may also be possible to check only the size
194  // rather than the coordinates, which may allow for translations
195  // of the geometry volumes in world space.
196  mf::LogWarning("PhotonVisbilityService")
197  << "Photon library reports the geometry:\n"
198  << lib->GetVoxelDef() << "while PhotonVisbilityService is configured with:\n"
199  << GetVoxelDef();
200  } // if metadata
201  }
202  }
203  }
204  else {
205  art::ServiceHandle<geo::Geometry const> geom;
206 
207  size_t NOpDets = geom->NOpDets();
208  size_t NVoxels = GetVoxelDef().GetNVoxels();
209  if (fLibraryBuildJob) {
210  mf::LogInfo("PhotonVisibilityService")
211  << " Vis service running library build job. Please ensure "
212  << " job contains LightSource, LArG4, SimPhotonCounter";
213  }
214 
215  art::TFileDirectory* pDir = nullptr;
216  try {
217  pDir = art::ServiceHandle<art::TFileService>().get();
218  }
219  catch (art::Exception const& e) {
220  if (e.categoryCode() != art::errors::ServiceNotFound) throw;
221  if (fLibraryBuildJob) {
222  throw art::Exception(e.categoryCode(), "", e)
223  << "PhotonVisibilityService: "
224  "service `TFileService` is required when building a photon library.\n";
225  }
226  }
227 
228  PhotonLibrary* lib = new PhotonLibrary(pDir);
229  fTheLibrary = lib;
230 
231  lib->CreateEmptyLibrary(NVoxels, NOpDets, fStoreReflected, fStoreReflT0, fParPropTime_npar);
232  lib->SetVoxelDef(GetVoxelDef());
233  }
234  }
235  }
unsigned int GetNVoxels() const
Returns the total number of voxels in the volume.
do i e
void phot::PhotonVisibilityService::LoadTimingsForVISPar ( std::vector< double > &  distances,
std::vector< double > &  radial_distances,
std::vector< std::vector< std::vector< double >>> &  cut_off,
std::vector< std::vector< std::vector< double >>> &  tau,
double &  vis_vmean,
double &  angle_bin_timing_vis 
) const

Definition at line 776 of file PhotonVisibilityService.cc.

void phot::PhotonVisibilityService::LoadTimingsForVUVPar ( std::vector< std::vector< double >>(&)  v[7],
double &  step_size,
double &  max_d,
double &  min_d,
double &  vuv_vgroup_mean,
double &  vuv_vgroup_max,
double &  inflexion_point_distance,
double &  angle_bin_timing_vuv 
) const

Definition at line 749 of file PhotonVisibilityService.cc.

757  {
758  v[0] = std::vector(1, fDistances_landau);
759  v[1] = fNorm_over_entries;
760  v[2] = fMpv;
761  v[3] = fWidth;
762  v[4] = std::vector(1, fDistances_exp);
763  v[5] = fSlope;
764  v[6] = fExpo_over_Landau_norm;
765 
766  step_size = fstep_size;
767  max_d = fmax_d;
768  min_d = fmin_d;
769  vuv_vgroup_mean = fvuv_vgroup_mean;
770  vuv_vgroup_max = fvuv_vgroup_max;
771  inflexion_point_distance = finflexion_point_distance;
772  angle_bin_timing_vuv = fangle_bin_timing_vuv;
773  }
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
void phot::PhotonVisibilityService::LoadVisParsDome ( std::vector< double > &  vis_distances_x_dome,
std::vector< double > &  vis_distances_r_dome,
std::vector< std::vector< std::vector< double >>> &  vispars_dome 
) const

Definition at line 835 of file PhotonVisibilityService.cc.

838  {
839  if (!fIsDomePDCorr) return;
840  vis_distances_x_dome = fvis_distances_x_dome;
841  vis_distances_r_dome = fvis_distances_r_dome;
842  vispars_dome = fvispars_dome;
843  }
std::vector< std::vector< std::vector< double > > > fvispars_dome
void phot::PhotonVisibilityService::LoadVisParsFlat ( std::vector< double > &  vis_distances_x_flat,
std::vector< double > &  vis_distances_r_flat,
std::vector< std::vector< std::vector< double >>> &  vispars_flat 
) const

Definition at line 826 of file PhotonVisibilityService.cc.

829  {
830  if (!fIsFlatPDCorr) return;
831  vis_distances_x_flat = fvis_distances_x_flat;
832  vis_distances_r_flat = fvis_distances_r_flat;
833  vispars_flat = fvispars_flat;
834  }
std::vector< std::vector< std::vector< double > > > fvispars_flat
void phot::PhotonVisibilityService::LoadVisSemiAnalyticProperties ( double &  delta_angulo_vis,
double &  radius 
) const
void phot::PhotonVisibilityService::LoadVUVSemiAnalyticProperties ( bool &  isFlatPDCorr,
bool &  isDomePDCorr,
double &  delta_angulo_vuv,
double &  radius 
) const
int phot::PhotonVisibilityService::NOpChannels ( ) const
inline
size_t phot::PhotonVisibilityService::NOpChannels ( ) const

Definition at line 703 of file PhotonVisibilityService.cc.

704  {
705  // the last word about the number of channels belongs to the mapping;
706  // this should be also the same answer as `geo::GeometryCore::NOpDets()`.
707  return fMapping->opDetMappingSize();
708  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
std::string phot::PhotonVisibilityService::ParPropTimeFormula ( ) const
inline
size_t phot::PhotonVisibilityService::ParPropTimeNpar ( ) const
inline
void phot::PhotonVisibilityService::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 257 of file PhotonVisibilityService.cc.

258  {
259 
260  art::ServiceHandle<geo::Geometry const> geom;
261 
262  // Library details
263  fLibraryBuildJob = p.get<bool>("LibraryBuildJob", false);
264  fParameterization = p.get<bool>("DUNE10ktParameterization", false);
265  fHybrid = p.get<bool>("HybridLibrary", false);
266  fLibraryFile = p.get<std::string>("LibraryFile", "");
267  fDoNotLoadLibrary = p.get<bool>("DoNotLoadLibrary");
268  fStoreReflected = p.get<bool>("StoreReflected", false);
269  fStoreReflT0 = p.get<bool>("StoreReflT0", false);
270  // Parametrizations (time and Nhits)
271  fIncludePropTime = p.get<bool>("IncludePropTime", false);
272  fUseNhitsModel = p.get<bool>("UseNhitsModel", false);
273  fApplyVISBorderCorrection = p.get<bool>("ApplyVISBorderCorrection", false);
274  fVISBorderCorrectionType = p.get<std::string>("VIS_BORDER_correction_type", "");
275 
276  // Voxel parameters
277  fUseCryoBoundary = p.get<bool>("UseCryoBoundary", false);
278  fInterpolate = p.get<bool>("Interpolate", false);
279  fReflectOverZeroX = p.get<bool>("ReflectOverZeroX", false);
280 
281  fParPropTime = p.get<bool>("ParametrisedTimePropagation", false);
282  fParPropTime_npar = p.get<size_t>("ParametrisedTimePropagationNParameters", 0);
283  fParPropTime_formula = p.get<std::string>("ParametrisedTimePropagationFittedFormula", "");
284  fParPropTime_MaxRange = p.get<int>("ParametrisedTimePropagationMaxRange", 200);
285 
286  if (!fParPropTime) { fParPropTime_npar = 0; }
287 
288  if (!fUseNhitsModel) {
289 
290  if (fUseCryoBoundary) {
291  double CryoBounds[6];
292  geom->CryostatBoundaries(CryoBounds);
293  fXmin = CryoBounds[0];
294  fXmax = CryoBounds[1];
295  fYmin = CryoBounds[2];
296  fYmax = CryoBounds[3];
297  fZmin = CryoBounds[4];
298  fZmax = CryoBounds[5];
299  }
300  else {
301  fXmin = p.get<double>("XMin");
302  fXmax = p.get<double>("XMax");
303  fYmin = p.get<double>("YMin");
304  fYmax = p.get<double>("YMax");
305  fZmin = p.get<double>("ZMin");
306  fZmax = p.get<double>("ZMax");
307  }
308 
309  fNx = p.get<int>("NX");
310  fNy = p.get<int>("NY");
311  fNz = p.get<int>("NZ");
312 
314  }
315 
316  if (fIncludePropTime) {
317 
318  // load VUV arrival time distribution parametrization (no detector dependent at first order)
319  std::cout << "Loading the VUV time parametrization" << std::endl;
320  fDistances_landau = p.get<std::vector<double>>("Distances_landau");
321  fNorm_over_entries = p.get<std::vector<std::vector<double>>>("Norm_over_entries");
322  fMpv = p.get<std::vector<std::vector<double>>>("Mpv");
323  fWidth = p.get<std::vector<std::vector<double>>>("Width");
324  fDistances_exp = p.get<std::vector<double>>("Distances_exp");
325  fSlope = p.get<std::vector<std::vector<double>>>("Slope");
326  fExpo_over_Landau_norm = p.get<std::vector<std::vector<double>>>("Expo_over_Landau_norm");
327  fstep_size = p.get<double>("step_size");
328  fmax_d = p.get<double>("max_d");
329  fmin_d = p.get<double>("min_d");
330  fvuv_vgroup_mean = p.get<double>("vuv_vgroup_mean");
331  fvuv_vgroup_max = p.get<double>("vuv_vgroup_max");
332  finflexion_point_distance = p.get<double>("inflexion_point_distance");
333  fangle_bin_timing_vuv = p.get<double>("angle_bin_timing_vuv");
334 
335  if (fStoreReflected) {
336 
337  // load VIS arrival time distribution paramterisation
338  std::cout << "Loading the VIS time paramterisation" << std::endl;
339  fDistances_refl = p.get<std::vector<double>>("Distances_refl");
340  fDistances_radial_refl = p.get<std::vector<double>>("Distances_radial_refl");
341  fCut_off = p.get<std::vector<std::vector<std::vector<double>>>>("Cut_off");
342  fTau = p.get<std::vector<std::vector<std::vector<double>>>>("Tau");
343  fvis_vmean = p.get<double>("vis_vmean");
344  fangle_bin_timing_vis = p.get<double>("angle_bin_timing_vis");
345  }
346  }
347 
348  if (fUseNhitsModel) {
349  std::cout << "Loading semi-analytic mode models" << std::endl;
350  // VUV
351  fIsFlatPDCorr = p.get<bool>("FlatPDCorr", false);
352  fIsDomePDCorr = p.get<bool>("DomePDCorr", false);
353  fdelta_angulo_vuv = p.get<double>("delta_angulo_vuv");
354  if(fIsFlatPDCorr) {
355  fGHvuvpars_flat = p.get<std::vector<std::vector<double>>>("GH_PARS_flat");
356  fborder_corr_angulo_flat = p.get<std::vector<double>>("GH_border_angulo_flat");
357  fborder_corr_flat = p.get<std::vector<std::vector<double>>>("GH_border_flat");
358  }
359  if(fIsDomePDCorr) {
360  fGHvuvpars_dome = p.get<std::vector<std::vector<double>>>("GH_PARS_dome");
361  fborder_corr_angulo_dome = p.get<std::vector<double>>("GH_border_angulo_dome");
362  fborder_corr_dome = p.get<std::vector<std::vector<double>>>("GH_border_dome");
363  }
364 
365  if (fStoreReflected) {
366  fdelta_angulo_vis = p.get<double>("delta_angulo_vis");
367  if(fIsFlatPDCorr) {
368  fvis_distances_x_flat = p.get<std::vector<double>>("VIS_distances_x_flat");
369  fvis_distances_r_flat = p.get<std::vector<double>>("VIS_distances_r_flat");
370  fvispars_flat = p.get<std::vector<std::vector<std::vector<double>>>>("VIS_correction_flat");
371  }
372  if(fIsDomePDCorr) {
373  fvis_distances_x_dome = p.get<std::vector<double>>("VIS_distances_x_dome");
374  fvis_distances_r_dome = p.get<std::vector<double>>("VIS_distances_r_dome");
375  fvispars_dome = p.get<std::vector<std::vector<std::vector<double>>>>("VIS_correction_dome");
376  }
377  }
378  // optical detector information
379  fradius = p.get<double>("PMT_radius", 10.16);
380  }
381 
382  return;
383  }
std::vector< std::vector< std::vector< double > > > fTau
pdgs p
Definition: selectors.fcl:22
Representation of a region of space diced into voxels.
std::vector< std::vector< std::vector< double > > > fCut_off
std::vector< std::vector< std::vector< double > > > fvispars_dome
std::vector< std::vector< std::vector< double > > > fvispars_flat
BEGIN_PROLOG could also be cout
void phot::PhotonVisibilityService::RetrieveLightProd ( int &  VoxID,
double &  N 
) const
void phot::PhotonVisibilityService::RetrieveLightProd ( int &  VoxID,
double &  N 
) const

Definition at line 502 of file PhotonVisibilityService.cc.

503  {
504  N = fCurrentValue;
505  VoxID = fCurrentVoxel;
506  }
process_name largeant stream1 can override from command line with o or output physics producers generator N
void phot::PhotonVisibilityService::SetDirectLightPropFunctions ( TF1 const *  functions[8],
double &  d_break,
double &  d_max,
double &  tf1_sampling_factor 
) const

Definition at line 712 of file PhotonVisibilityService.cc.

716  {
717  functions[0] = fparslogNorm;
718  functions[1] = fparsMPV;
719  functions[2] = fparsWidth;
720  functions[3] = fparsCte;
721  functions[4] = fparsSlope;
722  functions[5] = fparslogNorm_far;
723  functions[6] = fparsMPV_far;
724  functions[7] = fparsCte_far;
725 
726  d_break = fD_break;
727  d_max = fD_max;
728  tf1_sampling_factor = fTF1_sampling_factor;
729  }
void phot::PhotonVisibilityService::SetLibraryEntry ( int  VoxID,
int  OpChannel,
float  N 
)

Definition at line 301 of file PhotonVisibilityService.cxx.

302  {
303  if(fTheLibrary == 0)
304  LoadLibrary();
305 
306  fTheLibrary->SetCount(VoxID,OpChannel, N);
307  std::cout<< " PVS logging " << VoxID << " " << OpChannel<<std::endl;
308  }
process_name largeant stream1 can override from command line with o or output physics producers generator N
BEGIN_PROLOG could also be cout
void phot::PhotonVisibilityService::SetLibraryEntry ( int  VoxID,
OpDetID_t  libOpChannel,
float  N,
bool  wantReflected = false 
)

Definition at line 511 of file PhotonVisibilityService.cc.

512  {
513  if (fTheLibrary == 0) LoadLibrary();
514 
515  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
516 
517  if (!wantReflected)
518  lib->SetCount(VoxID, OpChannel, N);
519 
520  else
521  lib->SetReflCount(VoxID, OpChannel, N);
522 
523  //std::cout<< " PVS logging " << VoxID << " " << OpChannel<<std::endl;
524  MF_LOG_DEBUG("PhotonVisibilityService")
525  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
526  }
process_name largeant stream1 can override from command line with o or output physics producers generator N
void phot::PhotonVisibilityService::SetLibraryReflT0Entry ( int  VoxID,
int  OpChannel,
float  value 
)

Definition at line 593 of file PhotonVisibilityService.cc.

594  {
595  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
596  if (fTheLibrary == 0) LoadLibrary();
597 
598  lib->SetReflT0(VoxID, OpChannel, T0);
599 
600  MF_LOG_DEBUG("PhotonVisibilityService")
601  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
602  }
process_name opdaq physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator physics producers generator T0
Definition: gen_protons.fcl:45
void phot::PhotonVisibilityService::SetLibraryTimingParEntry ( int  VoxID,
int  OpChannel,
float  value,
size_t  parnum 
)

Definition at line 659 of file PhotonVisibilityService.cc.

663  {
664  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
665  if (fTheLibrary == 0) LoadLibrary();
666 
667  lib->SetTimingPar(VoxID, OpChannel, par, parnum);
668 
669  MF_LOG_DEBUG("PhotonVisibilityService")
670  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
671  }
void phot::PhotonVisibilityService::SetLibraryTimingTF1Entry ( int  VoxID,
int  OpChannel,
TF1 const &  func 
)

Definition at line 676 of file PhotonVisibilityService.cc.

677  {
678  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
679  if (fTheLibrary == 0) LoadLibrary();
680 
681  lib->SetTimingTF1(VoxID, OpChannel, func);
682 
683  MF_LOG_DEBUG("PhotonVisibilityService")
684  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
685  }
void phot::PhotonVisibilityService::SetReflectedCOLightPropFunctions ( TF1 const *  functions[5],
double &  t0_max,
double &  t0_break_point 
) const
template<typename Point >
static double phot::PhotonVisibilityService::SolidAngleFactor ( Point const &  p,
unsigned int  OpDet 
)
inlinestatic

Definition at line 58 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

59  {
61  }
pdgs p
Definition: selectors.fcl:22
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
static double SolidAngleFactorImpl(geo::Point_t const &p, unsigned int OpDet)
double phot::PhotonVisibilityService::SolidAngleFactorImpl ( geo::Point_t const &  p,
unsigned int  OpDet 
)
staticprivate

Definition at line 439 of file PhotonVisibilityService.cc.

440  {
441  art::ServiceHandle<geo::Geometry const> geom;
442  return geom->OpDetGeoFromOpDet(OpDet).CosThetaFromNormal(p);
443  }
pdgs p
Definition: selectors.fcl:22
void phot::PhotonVisibilityService::StoreLibrary ( )
void phot::PhotonVisibilityService::StoreLibrary ( )

Definition at line 239 of file PhotonVisibilityService.cc.

240  {
241  if (fTheLibrary == 0) LoadLibrary();
242 
243  if (fLibraryBuildJob) {
244 
245  if (fHybrid) {
246  std::cout << "This is would be building a Hybrid Library. Not defined. " << std::endl;
247  }
248  mf::LogInfo("PhotonVisibilityService") << " Vis service "
249  << " Storing Library entries to file..." << std::endl;
250  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
251  lib->StoreLibraryToFile(fLibraryFile, fStoreReflected, fStoreReflT0, fParPropTime_npar);
252  }
253  }
BEGIN_PROLOG could also be cout
void phot::PhotonVisibilityService::StoreLightProd ( int  VoxID,
double  N 
)
void phot::PhotonVisibilityService::StoreLightProd ( int  VoxID,
double  N 
)

Definition at line 491 of file PhotonVisibilityService.cc.

492  {
493  fCurrentVoxel = VoxID;
494  fCurrentValue = N;
495  mf::LogInfo("PhotonVisibilityService")
496  << " PVS notes production of " << N << " photons at Vox " << VoxID << std::endl;
497  }
process_name largeant stream1 can override from command line with o or output physics producers generator N
bool phot::PhotonVisibilityService::StoreReflected ( ) const
inline
bool phot::PhotonVisibilityService::StoreReflT0 ( ) const
inline
bool phot::PhotonVisibilityService::UseNhitsModel ( ) const
inline
bool phot::PhotonVisibilityService::UseParameterization ( ) const
inline
bool phot::PhotonVisibilityService::UseParameterization ( ) const
inline
std::string phot::PhotonVisibilityService::VISBorderCorrectionType ( ) const
inline
int phot::PhotonVisibilityService::VoxelAt ( geo::Point_t const &  p) const
inlineprivate

Definition at line 328 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

329  {
331  }
pdgs p
Definition: selectors.fcl:22
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
geo::Point_t LibLocation(geo::Point_t const &p) const

Member Data Documentation

PhotonVisibilityService * phot::PhotonVisibilityService::_me = nullptr
staticprivate
double phot::PhotonVisibilityService::fangle_bin_timing_vis
private
double phot::PhotonVisibilityService::fangle_bin_timing_vuv
private
bool phot::PhotonVisibilityService::fApplyVISBorderCorrection
private
std::vector<double> phot::PhotonVisibilityService::fborder_corr_angulo_dome
private
std::vector<double> phot::PhotonVisibilityService::fborder_corr_angulo_flat
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fborder_corr_dome
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fborder_corr_flat
private
double phot::PhotonVisibilityService::fCurrentValue
private
int phot::PhotonVisibilityService::fCurrentVoxel
private
std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fCut_off
private
double phot::PhotonVisibilityService::fD_break
private
double phot::PhotonVisibilityService::fD_max
private
double phot::PhotonVisibilityService::fdelta_angulo_vis
private
double phot::PhotonVisibilityService::fdelta_angulo_vuv
private
std::vector<double> phot::PhotonVisibilityService::fDistances_exp
private
std::vector<double> phot::PhotonVisibilityService::fDistances_landau
private
std::vector<double> phot::PhotonVisibilityService::fDistances_radial_refl
private
std::vector<double> phot::PhotonVisibilityService::fDistances_refl
private
bool phot::PhotonVisibilityService::fDoNotLoadLibrary
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fExpo_over_Landau_norm
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fGHvuvpars_dome
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fGHvuvpars_flat
private
bool phot::PhotonVisibilityService::fHybrid
private
bool phot::PhotonVisibilityService::fIncludePropTime
private
double phot::PhotonVisibilityService::finflexion_point_distance
private
bool phot::PhotonVisibilityService::fInterpolate
private
bool phot::PhotonVisibilityService::fIsDomePDCorr
private
bool phot::PhotonVisibilityService::fIsFlatPDCorr
private
bool phot::PhotonVisibilityService::fLibraryBuildJob
private
std::string phot::PhotonVisibilityService::fLibraryFile
private
std::unique_ptr<phot::IPhotonMappingTransformations> phot::PhotonVisibilityService::fMapping
private

Mapping of detector space into library space.

Definition at line 323 of file larsim/larsim/PhotonPropagation/PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fmax_d
private
double phot::PhotonVisibilityService::fmin_d
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fMpv
private
size_t phot::PhotonVisibilityService::fNOpDetChannels
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fNorm_over_entries
private
int phot::PhotonVisibilityService::fNx
private
int phot::PhotonVisibilityService::fNy
private
int phot::PhotonVisibilityService::fNz
private
bool phot::PhotonVisibilityService::fParameterization
private
bool phot::PhotonVisibilityService::fParPropTime
private
std::string phot::PhotonVisibilityService::fParPropTime_formula
private
int phot::PhotonVisibilityService::fParPropTime_MaxRange
private
size_t phot::PhotonVisibilityService::fParPropTime_npar
private
TF1* phot::PhotonVisibilityService::fparsCte = nullptr
private
TF1* phot::PhotonVisibilityService::fparsCte_far = nullptr
private
TF1* phot::PhotonVisibilityService::fparsCte_refl = nullptr
private
TF1* phot::PhotonVisibilityService::fparslogNorm = nullptr
private
TF1* phot::PhotonVisibilityService::fparslogNorm_far = nullptr
private
TF1* phot::PhotonVisibilityService::fparslogNorm_refl = nullptr
private
TF1* phot::PhotonVisibilityService::fparsMPV = nullptr
private
TF1* phot::PhotonVisibilityService::fparsMPV_far = nullptr
private
TF1* phot::PhotonVisibilityService::fparsMPV_refl = nullptr
private
TF1* phot::PhotonVisibilityService::fparsSlope = nullptr
private
TF1* phot::PhotonVisibilityService::fparsSlope_refl = nullptr
private
TF1* phot::PhotonVisibilityService::fparsWidth = nullptr
private
TF1* phot::PhotonVisibilityService::fparsWidth_refl = nullptr
private
double phot::PhotonVisibilityService::fradius
private
bool phot::PhotonVisibilityService::fReflectOverZeroX
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fSlope
private
double phot::PhotonVisibilityService::fstep_size
private
bool phot::PhotonVisibilityService::fStoreReflected
private
bool phot::PhotonVisibilityService::fStoreReflT0
private
double phot::PhotonVisibilityService::fT0_break_point
private
double phot::PhotonVisibilityService::fT0_max
private
std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fTau
private
double phot::PhotonVisibilityService::fTF1_sampling_factor
private
PhotonLibrary* phot::PhotonVisibilityService::fTheLibrary
mutableprivate
IPhotonLibrary* phot::PhotonVisibilityService::fTheLibrary
mutableprivate
bool phot::PhotonVisibilityService::fUseCryoBoundary
private
bool phot::PhotonVisibilityService::fUseNhitsModel
private
std::vector<double> phot::PhotonVisibilityService::fvis_distances_r_dome
private
std::vector<double> phot::PhotonVisibilityService::fvis_distances_r_flat
private
std::vector<double> phot::PhotonVisibilityService::fvis_distances_x_dome
private
std::vector<double> phot::PhotonVisibilityService::fvis_distances_x_flat
private
double phot::PhotonVisibilityService::fvis_vmean
private
std::string phot::PhotonVisibilityService::fVISBorderCorrectionType
private
std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fvispars_dome
private
std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fvispars_flat
private
sim::PhotonVoxelDef phot::PhotonVisibilityService::fVoxelDef
private
double phot::PhotonVisibilityService::fvuv_vgroup_max
private
double phot::PhotonVisibilityService::fvuv_vgroup_mean
private
std::vector<std::vector<double> > phot::PhotonVisibilityService::fWidth
private
float phot::PhotonVisibilityService::fXmax
private
float phot::PhotonVisibilityService::fXmin
private
float phot::PhotonVisibilityService::fYmax
private
float phot::PhotonVisibilityService::fYmin
private
float phot::PhotonVisibilityService::fZmax
private
float phot::PhotonVisibilityService::fZmin
private

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