Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | 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
 

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)
 

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::IPhotonMappingTransformationsfMapping
 Mapping of detector space into library space. More...
 

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 32 of file PhotonVisibilityService.h.

Member Typedef Documentation

Type of optical library index.

Definition at line 35 of file PhotonVisibilityService.h.

Constructor & Destructor Documentation

phot::PhotonVisibilityService::~PhotonVisibilityService ( )

Definition at line 49 of file PhotonVisibilityService_service.cc.

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

Definition at line 68 of file PhotonVisibilityService_service.cc.

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

Member Function Documentation

bool phot::PhotonVisibilityService::ApplyVISBorderCorrection ( ) const
inline

Definition at line 206 of file PhotonVisibilityService.h.

207  {
209  }
template<typename Point >
static double phot::PhotonVisibilityService::DistanceToOpDet ( Point const &  p,
unsigned int  OpDet 
)
inlinestatic

Definition at line 47 of file PhotonVisibilityService.h.

48  {
50  }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
p
Definition: test.py:223
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 428 of file PhotonVisibilityService_service.cc.

429  {
431  return geom->OpDetGeoFromOpDet(OpDet).DistanceToPoint(p);
432  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
p
Definition: test.py:223
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
Definition: OpDetGeo.cxx:123
auto phot::PhotonVisibilityService::doGetAllVisibilities ( geo::Point_t const &  p,
bool  wantReflected = false 
) const
private

Definition at line 400 of file PhotonVisibilityService_service.cc.

402  {
404 
405  // first we fill a container of visibilities in the library index space
406  // (it is directly the values of the library unless interpolation is
407  // requested)
408  if (fInterpolate) {
409  // this is a punch into multithreading face:
410  static std::vector<float> ret;
411  ret.resize(fMapping->libraryMappingSize(p));
412  for (std::size_t libIndex = 0; libIndex < ret.size(); ++libIndex) {
413  ret[libIndex] = doGetVisibilityOfOpLib(p, LibraryIndex_t(libIndex), wantReflected);
414  }
415  data = &ret.front();
416  }
417  else {
418  auto const VoxID = VoxelAt(p);
419  data = GetLibraryEntries(VoxID, wantReflected);
420  }
421  return fMapping->applyOpDetMapping(p, data);
422  }
phot::IPhotonLibrary::Counts_t GetLibraryEntries(int VoxID, bool wantReflected=false) const
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
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
int VoxelAt(geo::Point_t const &p) const
p
Definition: test.py:223
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 571 of file PhotonVisibilityService_service.cc.

572  {
573  // both the input and the output go through mapping to apply needed symmetries.
574  int const VoxID = VoxelAt(p);
576  return fMapping->applyOpDetMapping(p, data);
577  }
phot::IPhotonLibrary::Counts_t GetLibraryReflT0Entries(int VoxID) const
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
int VoxelAt(geo::Point_t const &p) const
p
Definition: test.py:223
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 618 of file PhotonVisibilityService_service.cc.

619  {
620  int const VoxID = VoxelAt(p);
622  return fMapping->applyOpDetMapping(p, params);
623  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
int VoxelAt(geo::Point_t const &p) const
p
Definition: test.py:223
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 626 of file PhotonVisibilityService_service.cc.

627  {
628  int const VoxID = VoxelAt(p);
630  return fMapping->applyOpDetMapping(p, functions);
631  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
int VoxelAt(geo::Point_t const &p) const
p
Definition: test.py:223
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 478 of file PhotonVisibilityService_service.cc.

481  {
482  // here we quietly confuse op. det. channel (interface) and op. det. (library)
483  LibraryIndex_t const libIndex = fMapping->opDetToLibraryIndex(p, OpChannel);
484  return doGetVisibilityOfOpLib(p, libIndex, wantReflected);
485  }
Index OpChannel(Index detNum, Index channel)
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
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
p
Definition: test.py:223
float phot::PhotonVisibilityService::doGetVisibilityOfOpLib ( geo::Point_t const &  p,
LibraryIndex_t  libIndex,
bool  wantReflected = false 
) const
private

Definition at line 447 of file PhotonVisibilityService_service.cc.

450  {
451  if (!fInterpolate) { return GetLibraryEntry(VoxelAt(p), libIndex, wantReflected); }
452 
453  // In case we're outside the bounding box we'll get a empty optional list.
454  auto const neis = GetVoxelDef().GetNeighboringVoxelIDs(LibLocation(p));
455  if (!neis) return 0.0;
456 
457  // Sum up all the weighted neighbours to get interpolation behaviour
458  float vis = 0.0;
459  for (const sim::PhotonVoxelDef::NeiInfo& n : neis.value()) {
460  if (n.id < 0) continue;
461  vis += n.weight * GetLibraryEntry(n.id, libIndex, wantReflected);
462  }
463  return vis;
464  }
float GetLibraryEntry(int VoxID, OpDetID_t libOpChannel, bool wantReflected=false) const
int VoxelAt(geo::Point_t const &p) const
geo::Point_t LibLocation(geo::Point_t const &p) const
std::void_t< T > n
p
Definition: test.py:223
const sim::PhotonVoxelDef & GetVoxelDef() 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 469 of file PhotonVisibilityService_service.cc.

471  {
472  return HasLibraryEntries(VoxelAt(p), wantReflected);
473  }
bool HasLibraryEntries(int VoxID, bool wantReflected=false) const
int VoxelAt(geo::Point_t const &p) const
p
Definition: test.py:223
template<typename Point >
MappedCounts_t phot::PhotonVisibilityService::GetAllVisibilities ( Point const &  p,
bool  wantReflected = false 
) const
inline

Definition at line 74 of file PhotonVisibilityService.h.

75  {
76  return doGetAllVisibilities(geo::vect::toPoint(p), wantReflected);
77  }
MappedCounts_t doGetAllVisibilities(geo::Point_t const &p, bool wantReflected=false) const
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
p
Definition: test.py:223
phot::IPhotonLibrary::Counts_t phot::PhotonVisibilityService::GetLibraryEntries ( int  VoxID,
bool  wantReflected = false 
) const

Definition at line 530 of file PhotonVisibilityService_service.cc.

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

Definition at line 553 of file PhotonVisibilityService_service.cc.

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

Definition at line 582 of file PhotonVisibilityService_service.cc.

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

Definition at line 606 of file PhotonVisibilityService_service.cc.

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

Definition at line 636 of file PhotonVisibilityService_service.cc.

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

Definition at line 689 of file PhotonVisibilityService_service.cc.

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

Definition at line 647 of file PhotonVisibilityService_service.cc.

648  {
649  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
650  if (fTheLibrary == 0) LoadLibrary();
651 
652  return lib->GetTimingTF1s(VoxID);
653  }
double phot::PhotonVisibilityService::GetQuenchingFactor ( double  dQdx) const

Definition at line 388 of file PhotonVisibilityService_service.cc.

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

Definition at line 92 of file PhotonVisibilityService.h.

93  {
95  }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
p
Definition: test.py:223
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 102 of file PhotonVisibilityService.h.

103  {
105  }
MappedParams_t doGetTimingPar(geo::Point_t const &p) const
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
p
Definition: test.py:223
template<typename Point >
MappedFunctions_t phot::PhotonVisibilityService::GetTimingTF1 ( Point const &  p) const
inline

Definition at line 112 of file PhotonVisibilityService.h.

113  {
115  }
::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
p
Definition: test.py:223
template<typename Point >
float phot::PhotonVisibilityService::GetVisibility ( Point const &  p,
unsigned int  OpChannel,
bool  wantReflected = false 
) const
inline

Definition at line 67 of file PhotonVisibilityService.h.

68  {
69  return doGetVisibility(geo::vect::toPoint(p), OpChannel, wantReflected);
70  }
Index OpChannel(Index detNum, Index channel)
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
p
Definition: test.py:223
float doGetVisibility(geo::Point_t const &p, unsigned int OpChannel, bool wantReflected=false) const
const sim::PhotonVoxelDef& phot::PhotonVisibilityService::GetVoxelDef ( ) const
inline

Definition at line 217 of file PhotonVisibilityService.h.

218  {
219  return fVoxelDef;
220  }
bool phot::PhotonVisibilityService::HasLibraryEntries ( int  VoxID,
bool  wantReflected = false 
) const

Definition at line 543 of file PhotonVisibilityService_service.cc.

545  {
546  if (!fTheLibrary) LoadLibrary();
547  return fTheLibrary->isVoxelValid(VoxID);
548  }
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 60 of file PhotonVisibilityService.h.

61  {
62  return doHasVisibility(geo::vect::toPoint(p), wantReflected);
63  }
::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
p
Definition: test.py:223
bool phot::PhotonVisibilityService::IncludeParPropTime ( ) const
inline

Definition at line 180 of file PhotonVisibilityService.h.

181  {
182  return fParPropTime;
183  }
bool phot::PhotonVisibilityService::IncludePropTime ( ) const
inline

Definition at line 196 of file PhotonVisibilityService.h.

197  {
198  return fIncludePropTime;
199  }
bool phot::PhotonVisibilityService::IsBuildJob ( ) const
inline

Definition at line 160 of file PhotonVisibilityService.h.

161  {
162  return fLibraryBuildJob;
163  }
geo::Point_t phot::PhotonVisibilityService::LibLocation ( geo::Point_t const &  p) const
private

Definition at line 850 of file PhotonVisibilityService_service.cc.

851  {
852  return fMapping->detectorToLibrary(p);
853  }
std::unique_ptr< phot::IPhotonMappingTransformations > fMapping
Mapping of detector space into library space.
p
Definition: test.py:223
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 810 of file PhotonVisibilityService_service.cc.

813  {
814  if (!fIsDomePDCorr) return;
815  GHvuvpars_dome = fGHvuvpars_dome;
816  border_corr_angulo_dome = fborder_corr_angulo_dome;
817  border_corr_dome = fborder_corr_dome;
818  }
std::vector< std::vector< double > > fGHvuvpars_dome
std::vector< std::vector< double > > fborder_corr_dome
std::vector< double > fborder_corr_angulo_dome
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 801 of file PhotonVisibilityService_service.cc.

804  {
805  if (!fIsFlatPDCorr) return;
806  GHvuvpars_flat = fGHvuvpars_flat;
807  border_corr_angulo_flat = fborder_corr_angulo_flat;
808  border_corr_flat = fborder_corr_flat;
809  }
std::vector< std::vector< double > > fborder_corr_flat
std::vector< std::vector< double > > fGHvuvpars_flat
std::vector< double > fborder_corr_angulo_flat
void phot::PhotonVisibilityService::LoadLibrary ( ) const

Definition at line 147 of file PhotonVisibilityService_service.cc.

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

781  {
782  distances = fDistances_refl;
783  radial_distances = fDistances_radial_refl;
784  cut_off = fCut_off;
785  tau = fTau;
786 
787  vis_vmean = fvis_vmean;
788  angle_bin_timing_vis = fangle_bin_timing_vis;
789  }
std::vector< std::vector< std::vector< double > > > fTau
std::vector< std::vector< std::vector< double > > > fCut_off
std::vector< double > fDistances_radial_refl
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 748 of file PhotonVisibilityService_service.cc.

756  {
757  v[0] = std::vector(1, fDistances_landau);
758  v[1] = fNorm_over_entries;
759  v[2] = fMpv;
760  v[3] = fWidth;
761  v[4] = std::vector(1, fDistances_exp);
762  v[5] = fSlope;
763  v[6] = fExpo_over_Landau_norm;
764 
765  step_size = fstep_size;
766  max_d = fmax_d;
767  min_d = fmin_d;
768  vuv_vgroup_mean = fvuv_vgroup_mean;
769  vuv_vgroup_max = fvuv_vgroup_max;
770  inflexion_point_distance = finflexion_point_distance;
771  angle_bin_timing_vuv = fangle_bin_timing_vuv;
772  }
std::vector< std::vector< double > > fWidth
struct vector vector
std::vector< std::vector< double > > fExpo_over_Landau_norm
std::vector< std::vector< double > > fMpv
std::vector< std::vector< double > > fNorm_over_entries
std::vector< std::vector< double > > fSlope
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 834 of file PhotonVisibilityService_service.cc.

837  {
838  if (!fIsDomePDCorr) return;
839  vis_distances_x_dome = fvis_distances_x_dome;
840  vis_distances_r_dome = fvis_distances_r_dome;
841  vispars_dome = fvispars_dome;
842  }
std::vector< double > fvis_distances_x_dome
std::vector< double > fvis_distances_r_dome
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 825 of file PhotonVisibilityService_service.cc.

828  {
829  if (!fIsFlatPDCorr) return;
830  vis_distances_x_flat = fvis_distances_x_flat;
831  vis_distances_r_flat = fvis_distances_r_flat;
832  vispars_flat = fvispars_flat;
833  }
std::vector< double > fvis_distances_r_flat
std::vector< double > fvis_distances_x_flat
std::vector< std::vector< std::vector< double > > > fvispars_flat
void phot::PhotonVisibilityService::LoadVisSemiAnalyticProperties ( double &  delta_angulo_vis,
double &  radius 
) const

Definition at line 819 of file PhotonVisibilityService_service.cc.

821  {
822  delta_angulo_vis = fdelta_angulo_vis;
823  radius = fradius;
824  }
void phot::PhotonVisibilityService::LoadVUVSemiAnalyticProperties ( bool isFlatPDCorr,
bool isDomePDCorr,
double &  delta_angulo_vuv,
double &  radius 
) const

Definition at line 791 of file PhotonVisibilityService_service.cc.

795  {
796  isFlatPDCorr = fIsFlatPDCorr;
797  isDomePDCorr = fIsDomePDCorr;
798  delta_angulo_vuv = fdelta_angulo_vuv;
799  radius = fradius;
800  }
size_t phot::PhotonVisibilityService::NOpChannels ( ) const

Definition at line 702 of file PhotonVisibilityService_service.cc.

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

Definition at line 190 of file PhotonVisibilityService.h.

191  {
192  return fParPropTime_formula;
193  }
size_t phot::PhotonVisibilityService::ParPropTimeNpar ( ) const
inline

Definition at line 185 of file PhotonVisibilityService.h.

186  {
187  return fParPropTime_npar;
188  }
void phot::PhotonVisibilityService::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 256 of file PhotonVisibilityService_service.cc.

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

Definition at line 711 of file PhotonVisibilityService_service.cc.

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

Definition at line 510 of file PhotonVisibilityService_service.cc.

511  {
512  if (fTheLibrary == 0) LoadLibrary();
513 
514  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
515 
516  if (!wantReflected)
517  lib->SetCount(VoxID, OpChannel, N);
518 
519  else
520  lib->SetReflCount(VoxID, OpChannel, N);
521 
522  //std::cout<< " PVS logging " << VoxID << " " << OpChannel<<std::endl;
523  MF_LOG_DEBUG("PhotonVisibilityService")
524  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
525  }
Index OpChannel(Index detNum, Index channel)
#define MF_LOG_DEBUG(id)
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityService::SetLibraryReflT0Entry ( int  VoxID,
int  OpChannel,
float  value 
)

Definition at line 592 of file PhotonVisibilityService_service.cc.

593  {
594  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
595  if (fTheLibrary == 0) LoadLibrary();
596 
597  lib->SetReflT0(VoxID, OpChannel, T0);
598 
599  MF_LOG_DEBUG("PhotonVisibilityService")
600  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
601  }
Index OpChannel(Index detNum, Index channel)
#define MF_LOG_DEBUG(id)
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityService::SetLibraryTimingParEntry ( int  VoxID,
int  OpChannel,
float  value,
size_t  parnum 
)

Definition at line 658 of file PhotonVisibilityService_service.cc.

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

Definition at line 675 of file PhotonVisibilityService_service.cc.

676  {
677  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
678  if (fTheLibrary == 0) LoadLibrary();
679 
680  lib->SetTimingTF1(VoxID, OpChannel, func);
681 
682  MF_LOG_DEBUG("PhotonVisibilityService")
683  << " PVS logging " << VoxID << " " << OpChannel << std::endl;
684  }
Index OpChannel(Index detNum, Index channel)
#define MF_LOG_DEBUG(id)
def func()
Definition: docstring.py:7
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityService::SetReflectedCOLightPropFunctions ( TF1 const *  functions[5],
double &  t0_max,
double &  t0_break_point 
) const

Definition at line 732 of file PhotonVisibilityService_service.cc.

735  {
736  functions[0] = fparslogNorm_refl;
737  functions[1] = fparsMPV_refl;
738  functions[2] = fparsWidth_refl;
739  functions[3] = fparsCte_refl;
740  functions[4] = fparsSlope_refl;
741 
742  t0_max = fT0_max;
743  t0_break_point = fT0_break_point;
744  }
template<typename Point >
static double phot::PhotonVisibilityService::SolidAngleFactor ( Point const &  p,
unsigned int  OpDet 
)
inlinestatic

Definition at line 53 of file PhotonVisibilityService.h.

54  {
56  }
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
p
Definition: test.py:223
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 438 of file PhotonVisibilityService_service.cc.

439  {
441  return geom->OpDetGeoFromOpDet(OpDet).CosThetaFromNormal(p);
442  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
double CosThetaFromNormal(geo::Point_t const &point) const
Get cos(angle) to normal of this detector - used for solid angle calcs.
Definition: OpDetGeo.cxx:138
p
Definition: test.py:223
void phot::PhotonVisibilityService::StoreLibrary ( )

Definition at line 238 of file PhotonVisibilityService_service.cc.

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

Definition at line 490 of file PhotonVisibilityService_service.cc.

491  {
492  fCurrentVoxel = VoxID;
493  fCurrentValue = N;
494  mf::LogInfo("PhotonVisibilityService")
495  << " PVS notes production of " << N << " photons at Vox " << VoxID << std::endl;
496  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
QTextStream & endl(QTextStream &s)
bool phot::PhotonVisibilityService::StoreReflected ( ) const
inline

Definition at line 170 of file PhotonVisibilityService.h.

171  {
172  return fStoreReflected;
173  }
bool phot::PhotonVisibilityService::StoreReflT0 ( ) const
inline

Definition at line 175 of file PhotonVisibilityService.h.

176  {
177  return fStoreReflT0;
178  }
bool phot::PhotonVisibilityService::UseNhitsModel ( ) const
inline

Definition at line 201 of file PhotonVisibilityService.h.

202  {
203  return fUseNhitsModel;
204  }
bool phot::PhotonVisibilityService::UseParameterization ( ) const
inline

Definition at line 165 of file PhotonVisibilityService.h.

166  {
167  return fParameterization;
168  }
std::string phot::PhotonVisibilityService::VISBorderCorrectionType ( ) const
inline

Definition at line 211 of file PhotonVisibilityService.h.

212  {
214  }
int phot::PhotonVisibilityService::VoxelAt ( geo::Point_t const &  p) const
inlineprivate

Definition at line 323 of file PhotonVisibilityService.h.

324  {
326  }
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
geo::Point_t LibLocation(geo::Point_t const &p) const
p
Definition: test.py:223

Member Data Documentation

double phot::PhotonVisibilityService::fangle_bin_timing_vis
private

Definition at line 284 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fangle_bin_timing_vuv
private

Definition at line 278 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fApplyVISBorderCorrection
private

Definition at line 244 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fborder_corr_angulo_dome
private

Definition at line 296 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fborder_corr_angulo_flat
private

Definition at line 292 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fborder_corr_dome
private

Definition at line 297 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fborder_corr_flat
private

Definition at line 293 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fCurrentValue
private

Definition at line 225 of file PhotonVisibilityService.h.

int phot::PhotonVisibilityService::fCurrentVoxel
private

Definition at line 224 of file PhotonVisibilityService.h.

std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fCut_off
private

Definition at line 282 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fD_break
private

Definition at line 262 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fD_max
private

Definition at line 262 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fdelta_angulo_vis
private

Definition at line 300 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fdelta_angulo_vuv
private

Definition at line 289 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fDistances_exp
private

Definition at line 275 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fDistances_landau
private

Definition at line 271 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fDistances_radial_refl
private

Definition at line 281 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fDistances_refl
private

Definition at line 280 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fDoNotLoadLibrary
private

Definition at line 237 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fExpo_over_Landau_norm
private

Definition at line 277 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fGHvuvpars_dome
private

Definition at line 295 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fGHvuvpars_flat
private

Definition at line 291 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fHybrid
private

Definition at line 239 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fIncludePropTime
private

Definition at line 242 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::finflexion_point_distance
private

Definition at line 278 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fInterpolate
private

Definition at line 251 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fIsDomePDCorr
private

Definition at line 287 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fIsFlatPDCorr
private

Definition at line 287 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fLibraryBuildJob
private

Definition at line 236 of file PhotonVisibilityService.h.

std::string phot::PhotonVisibilityService::fLibraryFile
private

Definition at line 313 of file PhotonVisibilityService.h.

std::unique_ptr<phot::IPhotonMappingTransformations> phot::PhotonVisibilityService::fMapping
private

Mapping of detector space into library space.

Definition at line 318 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fmax_d
private

Definition at line 278 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fmin_d
private

Definition at line 278 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fMpv
private

Definition at line 273 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fNorm_over_entries
private

Definition at line 272 of file PhotonVisibilityService.h.

int phot::PhotonVisibilityService::fNx
private

Definition at line 232 of file PhotonVisibilityService.h.

int phot::PhotonVisibilityService::fNy
private

Definition at line 232 of file PhotonVisibilityService.h.

int phot::PhotonVisibilityService::fNz
private

Definition at line 232 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fParameterization
private

Definition at line 238 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fParPropTime
private

Definition at line 247 of file PhotonVisibilityService.h.

std::string phot::PhotonVisibilityService::fParPropTime_formula
private

Definition at line 249 of file PhotonVisibilityService.h.

int phot::PhotonVisibilityService::fParPropTime_MaxRange
private

Definition at line 250 of file PhotonVisibilityService.h.

size_t phot::PhotonVisibilityService::fParPropTime_npar
private

Definition at line 248 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsCte = nullptr
private

Definition at line 259 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsCte_far = nullptr
private

Definition at line 260 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsCte_refl = nullptr
private

Definition at line 266 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparslogNorm = nullptr
private

Definition at line 254 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparslogNorm_far = nullptr
private

Definition at line 255 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparslogNorm_refl = nullptr
private

Definition at line 263 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsMPV = nullptr
private

Definition at line 256 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsMPV_far = nullptr
private

Definition at line 257 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsMPV_refl = nullptr
private

Definition at line 264 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsSlope = nullptr
private

Definition at line 261 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsSlope_refl = nullptr
private

Definition at line 267 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsWidth = nullptr
private

Definition at line 258 of file PhotonVisibilityService.h.

TF1* phot::PhotonVisibilityService::fparsWidth_refl = nullptr
private

Definition at line 265 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fradius
private

Definition at line 311 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fReflectOverZeroX
private

Definition at line 252 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fSlope
private

Definition at line 276 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fstep_size
private

Definition at line 278 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fStoreReflected
private

Definition at line 240 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fStoreReflT0
private

Definition at line 241 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fT0_break_point
private

Definition at line 268 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fT0_max
private

Definition at line 268 of file PhotonVisibilityService.h.

std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fTau
private

Definition at line 283 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fTF1_sampling_factor
private

Definition at line 262 of file PhotonVisibilityService.h.

IPhotonLibrary* phot::PhotonVisibilityService::fTheLibrary
mutableprivate

Definition at line 314 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fUseCryoBoundary
private

Definition at line 234 of file PhotonVisibilityService.h.

bool phot::PhotonVisibilityService::fUseNhitsModel
private

Definition at line 243 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fvis_distances_r_dome
private

Definition at line 307 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fvis_distances_r_flat
private

Definition at line 303 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fvis_distances_x_dome
private

Definition at line 306 of file PhotonVisibilityService.h.

std::vector<double> phot::PhotonVisibilityService::fvis_distances_x_flat
private

Definition at line 302 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fvis_vmean
private

Definition at line 284 of file PhotonVisibilityService.h.

std::string phot::PhotonVisibilityService::fVISBorderCorrectionType
private

Definition at line 245 of file PhotonVisibilityService.h.

std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fvispars_dome
private

Definition at line 308 of file PhotonVisibilityService.h.

std::vector<std::vector<std::vector<double> > > phot::PhotonVisibilityService::fvispars_flat
private

Definition at line 304 of file PhotonVisibilityService.h.

sim::PhotonVoxelDef phot::PhotonVisibilityService::fVoxelDef
private

Definition at line 315 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fvuv_vgroup_max
private

Definition at line 278 of file PhotonVisibilityService.h.

double phot::PhotonVisibilityService::fvuv_vgroup_mean
private

Definition at line 278 of file PhotonVisibilityService.h.

std::vector<std::vector<double> > phot::PhotonVisibilityService::fWidth
private

Definition at line 274 of file PhotonVisibilityService.h.

float phot::PhotonVisibilityService::fXmax
private

Definition at line 229 of file PhotonVisibilityService.h.

float phot::PhotonVisibilityService::fXmin
private

Definition at line 229 of file PhotonVisibilityService.h.

float phot::PhotonVisibilityService::fYmax
private

Definition at line 230 of file PhotonVisibilityService.h.

float phot::PhotonVisibilityService::fYmin
private

Definition at line 230 of file PhotonVisibilityService.h.

float phot::PhotonVisibilityService::fZmax
private

Definition at line 231 of file PhotonVisibilityService.h.

float phot::PhotonVisibilityService::fZmin
private

Definition at line 231 of file PhotonVisibilityService.h.


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