PhotonVisibilityServiceS2_service.cc
Go to the documentation of this file.
1 // ////////////////////////////////////////////////////////////////////////
2 //
3 // \file PhotonVisibilityServiceS2_service.cc
4 //
5 ////////////////////////////////////////////////////////////////////////
6 
7 // LArSoft includes
16 
19 
20 #include "TF1.h"
21 
22 namespace phot{
23 
24  //--------------------------------------------------------------------
26 
27  fCurrentVoxel(0),
28  fCurrentValue(0.),
29  fXmin(0.),
30  fXmax(0.),
31  fYmin(0.),
32  fYmax(0.),
33  fZmin(0.),
34  fZmax(0.),
35  fNx(0),
36  fNy(0),
37  fNz(0),
38  fUseCryoBoundary(false),
39  fLibraryBuildJob(false),
40  fDoNotLoadLibrary(false),
41  fParameterization(false),
42  fHybrid(false),
43  fStoreReflected(false),
44  fStoreReflT0(false),
45  fIncludePropTime(false),
46  fParPropTime(false),
47  fTheLibrary(0)
48 
49  {
50  this->reconfigure(pset);
51  mf::LogInfo("PhotonVisibilityServiceS2")<<"PhotonVisbilityService initializing"<<std::endl;
52  }
53 
54  //--------------------------------------------------------------------
56  {
57  // Don't do anything if the library has already been loaded.
58 
59  if(fTheLibrary == 0) {
60 
62  std::string LibraryFileWithPath;
63  cet::search_path sp("FW_SEARCH_PATH");
64 
65  if( !sp.find_file(fLibraryFile, LibraryFileWithPath) )
66  throw cet::exception("PhotonVisibilityServiceS2") << "Unable to find photon library in " << sp.to_string() << "\n";
67 
68  if(!fParameterization) {
70 
71  mf::LogInfo("PhotonVisibilityServiceS2") << "PhotonVisibilityServiceS2 Loading photon library from file "
72  << LibraryFileWithPath
73  << " for "
74  << GetVoxelDef().GetNVoxels()
75  << " voxels and "
76  << geom->NOpDets()
77  << " optical detectors."
78  << std::endl;
79 
80  if(fHybrid){
81  fTheLibrary = new PhotonLibraryHybrid(LibraryFileWithPath,
82  GetVoxelDef());
83  }
84  else{
85  PhotonLibrary* lib = new PhotonLibrary;
86  fTheLibrary = lib;
87 
88  size_t NVoxels = GetVoxelDef().GetNVoxels();
89  lib->LoadLibraryFromFile(LibraryFileWithPath, NVoxels, fStoreReflected, fStoreReflT0, fParPropTime_npar);
90  }
91  }
92  }
93  else {
95 
96  size_t NOpDets = geom->NOpDets();
97  size_t NVoxels = GetVoxelDef().GetNVoxels();
98  mf::LogInfo("PhotonVisibilityServiceS2") << " Vis service running library build job. Please ensure "
99  << " job contains LightSource, LArG4, SimPhotonCounter"<<std::endl;
100  PhotonLibrary* lib = new PhotonLibrary;
101  fTheLibrary = lib;
102 
104  }
105 
106  }
107  }
108 
109  //--------------------------------------------------------------------
111  {
112  if(fTheLibrary == 0)
113  LoadLibrary();
114 
115  if(fLibraryBuildJob )
116  {
117 
118  if(fHybrid){
119  std::cout<< "This is would be building a Hybrid Library. Not defined. "<<std::endl;
120  }
121  mf::LogInfo("PhotonVisibilityServiceS2") << " Vis service "
122  << " Storing Library entries to file..." <<std::endl;
123  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
125  }
126  }
127 
128 
129  //--------------------------------------------------------------------
131  {
132 
134 
135  // Library details
136  fLibraryBuildJob = p.get< bool >("LibraryBuildJob" );
137  fParameterization = p.get< bool >("DUNE10ktParameterization", false);
138  fHybrid = p.get< bool >("HybridLibrary", false);
139  fLibraryFile = p.get< std::string >("LibraryFile" );
140  fDoNotLoadLibrary = p.get< bool >("DoNotLoadLibrary" );
141  fStoreReflected = p.get< bool >("StoreReflected", false);
142  fStoreReflT0 = p.get< bool >("StoreReflT0", false);
143  fIncludePropTime = p.get< bool >("IncludePropTime", false);
144  // Voxel parameters
145  fUseCryoBoundary = p.get< bool >("UseCryoBoundary" );
146  fInterpolate = p.get< bool >("Interpolate", false);
147 
148  fParPropTime = p.get< bool >("ParametrisedTimePropagation", false);
149  fParPropTime_npar = p.get< size_t >("ParametrisedTimePropagationNParameters", 0);
150  fParPropTime_formula = p.get< std::string >("ParametrisedTimePropagationFittedFormula","");
151 
152  if (!fParPropTime)
153  {
154  fParPropTime_npar=0;
155  }
156 
157  if(fUseCryoBoundary)
158  {
159  double CryoBounds[6];
160  geom->CryostatBoundaries(CryoBounds);
161  fXmin = CryoBounds[0];
162  fXmax = CryoBounds[1];
163  fYmin = CryoBounds[2];
164  fYmax = CryoBounds[3];
165  fZmin = CryoBounds[4];
166  fZmax = CryoBounds[5];
167  }
168  else
169  {
170  fXmin = p.get< double >("XMin" );
171  fXmax = p.get< double >("XMax" );
172  fYmin = p.get< double >("YMin" );
173  fYmax = p.get< double >("YMax" );
174  fZmin = p.get< double >("ZMin" );
175  fZmax = p.get< double >("ZMax" );
176  }
177 
178  fNx = p.get< int >("NX" );
179  fNy = p.get< int >("NY" );
180  fNz = p.get< int >("NZ" );
181 
183 
184  if(fIncludePropTime)
185  {
186  // Construct parameterized model parameter functions.
187  std::cout<< "Getting direct light parameters from .fcl file"<<std::endl;
188  std::vector<std::string> direct_functions = p.get<std::vector<std::string> >("Direct_functions");
189  //range of distances where the parametrization is valid
190  fD_break = p.get<double>("D_break");
191  fD_max = p.get<double>("D_max");
192 
193  fTF1_sampling_factor = p.get<double>("TF1_sampling_factor");
194 
195  std::vector<double> direct_landauNormpars = p.get<std::vector<double> >("Direct_landauNormpars");
196  fparslogNorm = new TF1("fparslogNorm", direct_functions[0].c_str(), 0., fD_break);
197  for(unsigned int i=0; i<direct_landauNormpars.size(); ++i)
198  fparslogNorm->SetParameter(i, direct_landauNormpars[i]);
199 
200  std::vector<double> direct_landauMPVpars = p.get<std::vector<double> >("Direct_landauMPVpars");
201  fparsMPV = new TF1("fparsMPV", direct_functions[1].c_str(), 0., fD_break);
202  for(unsigned int i=0; i<direct_landauMPVpars.size(); ++i)
203  fparsMPV->SetParameter(i, direct_landauMPVpars[i]);
204 
205  std::vector<double> direct_landauWidthpars = p.get<std::vector<double> >("Direct_landauWidthpars");
206  fparsWidth = new TF1("fparsWidth", direct_functions[2].c_str(), 0., fD_break);
207  for(unsigned int i=0; i<direct_landauWidthpars.size(); ++i)
208  fparsWidth->SetParameter(i, direct_landauWidthpars[i]);
209 
210  std::vector<double> direct_expoCtepars = p.get<std::vector<double> >("Direct_expoCtepars");
211  fparsCte = new TF1("fparsCte", direct_functions[3].c_str(), 0., fD_break);
212  for(unsigned int i=0; i<direct_expoCtepars.size(); ++i)
213  fparsCte->SetParameter(i, direct_expoCtepars[i]);
214 
215  std::vector<double> direct_expoSlopepars = p.get<std::vector<double> >("Direct_expoSlopepars");
216  fparsSlope = new TF1("fparsSlope", direct_functions[4].c_str(), 0., fD_break);
217  for(unsigned int i=0; i<direct_expoSlopepars.size(); ++i)
218  fparsSlope->SetParameter(i, direct_expoSlopepars[i]);
219 
220  std::vector<double> direct_landauNormpars_far = p.get<std::vector<double> >("Direct_landauNormpars_far");
221  fparslogNorm_far = new TF1("fparslogNorm_far", direct_functions[5].c_str(), fD_break, fD_max);
222  for(unsigned int i=0; i<direct_landauNormpars_far.size(); ++i)
223  fparslogNorm_far->SetParameter(i, direct_landauNormpars_far[i]);
224 
225  std::vector<double> direct_landauMPVpars_far = p.get<std::vector<double> >("Direct_landauMPVpars_far");
226  fparsMPV_far = new TF1("fparsMPV_far", direct_functions[6].c_str(), fD_break, fD_max);
227  for(unsigned int i=0; i<direct_landauMPVpars_far.size(); ++i)
228  fparsMPV_far->SetParameter(i, direct_landauMPVpars_far[i]);
229 
230  std::vector<double> direct_expoCtepars_far = p.get<std::vector<double> >("Direct_expoCtepars_far");
231  fparsCte_far = new TF1("fparsCte_far", direct_functions[7].c_str(), fD_break - 50., fD_max);
232  for(unsigned int i=0; i<direct_expoCtepars_far.size(); ++i)
233  fparsCte_far->SetParameter(i, direct_expoCtepars_far[i]);
234 
235  std::vector<std::string> reflected_functions = p.get<std::vector<std::string> >("Reflected_functions");
236  //times where the parametrizations are valid or change
237  fT0_max = p.get<double>("T0_max");
238  fT0_break_point = p.get<double>("T0_break_point");
239 
240  std::vector<double> reflected_landauNormpars = p.get<std::vector<double> >("Reflected_landauNormpars");
241  fparslogNorm_refl = new TF1("fparslogNorm_refl", reflected_functions[0].c_str(), 0., fT0_max);
242  for(unsigned int i=0; i<reflected_landauNormpars.size(); ++i)
243  fparslogNorm_refl->SetParameter(i, reflected_landauNormpars[i]);
244 
245  std::vector<double> reflected_landauMPVpars = p.get<std::vector<double> >("Reflected_landauMPVpars");
246  fparsMPV_refl = new TF1("fparsMPV_refl", reflected_functions[1].c_str(), 0., fT0_max);
247  for(unsigned int i=0; i<reflected_landauMPVpars.size(); ++i)
248  fparsMPV_refl->SetParameter(i, reflected_landauMPVpars[i]);
249 
250  std::vector<double> reflected_landauWidthpars = p.get<std::vector<double> >("Reflected_landauWidthpars");
251  fparsWidth_refl = new TF1("fparsWidth_refl", reflected_functions[2].c_str(), 0., fT0_max);
252  for(unsigned int i=0; i<reflected_landauWidthpars.size(); ++i)
253  fparsWidth_refl->SetParameter(i, reflected_landauWidthpars[i]);
254 
255  std::vector<double> reflected_expoCtepars = p.get<std::vector<double> >("Reflected_expoCtepars");
256  fparsCte_refl = new TF1("fparsCte_refl", reflected_functions[3].c_str(), 0., fT0_max);
257  for(unsigned int i=0; i<reflected_expoCtepars.size(); ++i)
258  fparsCte_refl->SetParameter(i, reflected_expoCtepars[i]);
259 
260  std::vector<double> reflected_expoSlopepars = p.get<std::vector<double> >("Reflected_expoSlopepars");
261  fparsSlope_refl = new TF1("fparsSlope_refl", reflected_functions[4].c_str(), 0., fT0_max);
262  for(unsigned int i=0; i<reflected_expoSlopepars.size(); ++i)
263  fparsSlope_refl->SetParameter(i, reflected_expoSlopepars[i]);
264 
265 
266  }
267 
268 
269  return;
270 
271  }
272 
273 
274 
275  //------------------------------------------------------
276 
277  // Eventually we will calculate the light quenching factor here
278  double PhotonVisibilityServiceS2::GetQuenchingFactor(double /* dQdx */) const
279  {
280  // for now, no quenching
281  return 1.0;
282 
283  }
284 
285 
286  //------------------------------------------------------
287 
288  // Get a vector of the relative visibilities of each OpDet
289  // in the event to a point xyz
290 
291  float const* PhotonVisibilityServiceS2::GetAllVisibilities(double const* xyz, bool wantReflected) const
292  {
293  if(fInterpolate){
294  static std::vector<float> ret;
295  if(ret.size() != NOpChannels()) ret.resize(NOpChannels());
296  for(unsigned int i = 0; i < NOpChannels(); ++i) ret[i] = GetVisibility(xyz, i, wantReflected);
297  return &ret.front();
298  }
299  else{
300  size_t VoxID = fVoxelDef.GetVoxelID(xyz);
301  return GetLibraryEntries(VoxID, wantReflected);
302  }
303  }
304 
305 
306  //------------------------------------------------------
307 
308  // Get distance to optical detector OpDet
309  double PhotonVisibilityServiceS2::DistanceToOpDet( double const* xyz, unsigned int OpDet )
310  {
312  return geom->OpDetGeoFromOpDet(OpDet).DistanceToPoint(xyz);
313 
314  }
315 
316 
317  //------------------------------------------------------
318 
319 
320  // Get the solid angle reduction factor for planar optical detector OpDet
321  double PhotonVisibilityServiceS2::SolidAngleFactor( double const* xyz, unsigned int OpDet )
322  {
324  return geom->OpDetGeoFromOpDet(OpDet).CosThetaFromNormal(xyz);
325  }
326 
327  //------------------------------------------------------
328 
329  float PhotonVisibilityServiceS2::GetVisibility(double const* xyz, unsigned int OpChannel, bool wantReflected) const
330  {
331  if(!fInterpolate) {
332  return GetLibraryEntry(fVoxelDef.GetVoxelID(xyz), OpChannel, wantReflected);
333  }
334 
335  // In case we're outside the bounding box we'll get a empty optional list.
336  auto const neis = fVoxelDef.GetNeighboringVoxelIDs(xyz);
337  if (!neis) return 0.0;
338 
339  // Sum up all the weighted neighbours to get interpolation behaviour
340  float vis = 0.0;
341  for(const sim::PhotonVoxelDef::NeiInfo& n: neis.value()) {
342  if (n.id < 0) continue;
343  vis += n.weight * GetLibraryEntry(n.id, OpChannel, wantReflected);
344  }
345  return vis;
346  }
347 
348 
349  //------------------------------------------------------
350 
352  {
353  fCurrentVoxel = VoxID;
354  fCurrentValue = N;
355  mf::LogInfo("PhotonVisibilityServiceS2") << " PVS notes production of " << N << " photons at Vox " << VoxID<<std::endl;
356  }
357 
358 
359  //------------------------------------------------------
360 
361 
362  void PhotonVisibilityServiceS2::RetrieveLightProd(int& VoxID, double& N) const
363  {
364  N = fCurrentValue;
365  VoxID = fCurrentVoxel;
366  }
367 
368  //------------------------------------------------------
369 
370  void PhotonVisibilityServiceS2::SetLibraryEntry(int VoxID, int OpChannel, float N, bool wantReflected)
371  {
372  if(fTheLibrary == 0)
373  LoadLibrary();
374 
375  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
376 
377  if(!wantReflected)
378  lib->SetCount(VoxID,OpChannel, N);
379 
380  else
381  lib->SetReflCount(VoxID,OpChannel, N);
382 
383  //std::cout<< " PVS logging " << VoxID << " " << OpChannel<<std::endl;
384  mf::LogDebug("PhotonVisibilityServiceS2") << " PVS logging " << VoxID << " " << OpChannel<<std::endl;
385  }
386 
387  //------------------------------------------------------
388 
389  float const* PhotonVisibilityServiceS2::GetLibraryEntries(int VoxID, bool wantReflected) const
390  {
391  if(fTheLibrary == 0)
392  LoadLibrary();
393 
394  if(!wantReflected)
395  return fTheLibrary->GetCounts(VoxID);
396  else
397  return fTheLibrary->GetReflCounts(VoxID);
398  }
399 
400  //------------------------------------------------------
401 
402  float PhotonVisibilityServiceS2::GetLibraryEntry(int VoxID, int Channel, bool wantReflected) const
403  {
404  if(fTheLibrary == 0)
405  LoadLibrary();
406 
407  if(!wantReflected)
408  return fTheLibrary->GetCount(VoxID, Channel);
409  else
410  return fTheLibrary->GetReflCount(VoxID, Channel);
411  }
412  // Methodes to handle the extra library parameter refl T0
413  //------------------------------------------------------
414 
415  // Get a vector of the refl <tfirst> of each OpDet
416  // in the event to a point xyz
417 
418  float const* PhotonVisibilityServiceS2::GetReflT0s(double const* xyz) const
419  {
420  int VoxID = fVoxelDef.GetVoxelID(xyz);
421  return GetLibraryReflT0Entries(VoxID);
422  }
423 
424  //------------------------------------------------------
425 
427  {
428  if(fTheLibrary == 0)
429  LoadLibrary();
430 
431  return fTheLibrary->GetReflT0s(VoxID);
432  }
433 
434  //------------------------------------------------------
435 
437  {
438  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
439  if(fTheLibrary == 0)
440  LoadLibrary();
441 
442  lib->SetReflT0(VoxID,OpChannel,T0);
443 
444  mf::LogDebug("PhotonVisibilityServiceS2") << " PVS logging " << VoxID << " " << OpChannel<<std::endl;
445  }
446 
447  //------------------------------------------------------
448 
449  float PhotonVisibilityServiceS2::GetLibraryReflT0Entry(int VoxID, int Channel) const
450  {
451  if(fTheLibrary == 0)
452  LoadLibrary();
453 
454  return fTheLibrary->GetReflT0(VoxID, Channel);
455  }
456 
457  //------------------------------------------------------
458 
459 
460 /////////////****////////////
461 
462  const std::vector<float>* PhotonVisibilityServiceS2::GetTimingPar(double const* xyz) const
463  {
464  int VoxID = fVoxelDef.GetVoxelID(xyz);
465  return GetLibraryTimingParEntries(VoxID);
466  }
467 
468  TF1* const PhotonVisibilityServiceS2::GetTimingTF1(double const* xyz)
469  {
470  int VoxID = fVoxelDef.GetVoxelID(xyz);
471  return GetLibraryTimingTF1Entries(VoxID);
472  }
473 
474 
475  //------------------------------------------------------
476 
477  const std::vector<float>* PhotonVisibilityServiceS2::GetLibraryTimingParEntries(int VoxID) const
478  {
479  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
480  if(fTheLibrary == 0)
481  LoadLibrary();
482 
483  return lib->GetTimingPars(VoxID);
484  }
485 
486  //------------------------------------------------------
487 
489  {
490  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
491  if(fTheLibrary == 0)
492  LoadLibrary();
493 
494  return lib->GetTimingTF1s(VoxID);
495  }
496 
497  //------------------------------------------------------
498 
499  void PhotonVisibilityServiceS2::SetLibraryTimingParEntry(int VoxID, int OpChannel, float par, size_t parnum)
500  {
501  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
502  if(fTheLibrary == 0)
503  LoadLibrary();
504 
505  lib->SetTimingPar(VoxID,OpChannel,par, parnum);
506 
507  mf::LogDebug("PhotonVisibilityServiceS2") << " PVS logging " << VoxID << " " << OpChannel<<std::endl;
508  }
509 
510  //------------------------------------------------------
511 
513  {
514  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
515  if(fTheLibrary == 0)
516  LoadLibrary();
517 
518  lib->SetTimingTF1(VoxID,OpChannel,func);
519 
520  mf::LogDebug("PhotonVisibilityServiceS2") << " PVS logging " << VoxID << " " << OpChannel<<std::endl;
521  }
522 
523 
524  //------------------------------------------------------
525 
526  float PhotonVisibilityServiceS2::GetLibraryTimingParEntry(int VoxID, int Channel, size_t npar) const
527  {
528  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
529  if(fTheLibrary == 0)
530  LoadLibrary();
531 
532  return lib->GetTimingPar(VoxID, Channel,npar);
533  }
534 
535  //------------------------------------------------------
536 
538  {
539  if(fTheLibrary == 0)
540  LoadLibrary();
541 
542  return fTheLibrary->NOpChannels();
543  }
544 
545  //------------------------------------------------------
546  void PhotonVisibilityServiceS2::SetDirectLightPropFunctions(TF1 const* functions[8], double& d_break, double& d_max, double& tf1_sampling_factor) const
547  {
548  functions[0] = fparslogNorm;
549  functions[1] = fparsMPV;
550  functions[2] = fparsWidth;
551  functions[3] = fparsCte;
552  functions[4] = fparsSlope;
553  functions[5] = fparslogNorm_far;
554  functions[6] = fparsMPV_far;
555  functions[7] = fparsCte_far;
556 
557  d_break = fD_break;
558  d_max = fD_max;
559  tf1_sampling_factor = fTF1_sampling_factor;
560  }
561 
562  //------------------------------------------------------
563  void PhotonVisibilityServiceS2::SetReflectedCOLightPropFunctions(TF1 const* functions[5], double& t0_max, double& t0_break_point) const
564  {
565  functions[0] = fparslogNorm_refl;
566  functions[1] = fparsMPV_refl;
567  functions[2] = fparsWidth_refl;
568  functions[3] = fparsCte_refl;
569  functions[4] = fparsSlope_refl;
570 
571  t0_max = fT0_max;
572  t0_break_point = fT0_break_point;
573  }
574 
575 } // namespace
576 
577 namespace phot{
578 
580 
581 } // namespace phot
Definitions of voxel data structures.
static double DistanceToOpDet(double const *xyz, unsigned int OpDet)
const std::vector< float > * GetTimingPar(double const *xyz) const
Index OpChannel(Index detNum, Index channel)
float const * GetLibraryReflT0Entries(int VoxID) const
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
virtual float GetReflT0(size_t Voxel, size_t OpChannel) const =0
std::string to_string() const
Definition: search_path.cc:161
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
Encapsulate the construction of a single cyostat.
void LoadLibraryFromFile(std::string LibraryFile, size_t NVoxels, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0, int maxrange=200)
static double SolidAngleFactor(double const *xyz, unsigned int OpDet)
void CreateEmptyLibrary(size_t NVoxels, size_t NChannels, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0)
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual float GetReflCount(size_t Voxel, size_t OpChannel) const =0
float const * GetLibraryEntries(int VoxID, bool wantReflected=false) const
Representation of a region of space diced into voxels.
Definition: PhotonVoxels.h:58
float GetLibraryTimingParEntry(int VoxID, int Channel, size_t npar) const
void SetLibraryReflT0Entry(int VoxID, int OpChannel, float value)
void StoreLibraryToFile(std::string LibraryFile, bool storeReflected=false, bool storeReflT0=false, size_t storeTiming=0) const
void SetCount(size_t Voxel, size_t OpChannel, float Count)
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
void CryostatBoundaries(double *boundaries, geo::CryostatID const &cid) const
Returns the boundaries of the specified cryostat.
art framework interface to geometry description
void SetTimingTF1(size_t Voxel, size_t OpChannel, TF1 func)
void SetLibraryTimingTF1Entry(int VoxID, int OpChannel, TF1 func)
void SetLibraryEntry(int VoxID, int OpChannel, float N, bool wantReflected=false)
const sim::PhotonVoxelDef & GetVoxelDef() const
float GetVisibility(double const *xyz, unsigned int OpChannel, bool wantReflected=false) const
void SetReflT0(size_t Voxel, size_t OpChannel, float reflT0)
float GetLibraryReflT0Entry(int VoxID, int Channel) const
std::void_t< T > n
virtual Counts_t GetReflCounts(size_t Voxel) const =0
T get(std::string const &key) const
Definition: ParameterSet.h:271
virtual float GetCount(size_t Voxel, size_t OpChannel) const =0
virtual Counts_t GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
void RetrieveLightProd(int &VoxID, double &N) const
p
Definition: test.py:223
void reconfigure(fhicl::ParameterSet const &p)
void SetDirectLightPropFunctions(TF1 const *functions[8], double &d_break, double &d_max, double &tf1_sampling_factor) const
TF1 * GetTimingTF1s(size_t Voxel) const
const std::vector< float > * GetTimingPars(size_t Voxel) const
void SetLibraryTimingParEntry(int VoxID, int OpChannel, float value, size_t parnum)
void SetReflectedCOLightPropFunctions(TF1 const *functions[5], double &t0_max, double &t0_break_point) const
unsigned int NOpDets() const
Number of OpDets in the whole detector.
virtual int NOpChannels() const =0
float const * GetReflT0s(double const *xyz) const
Encapsulate the geometry of an optical detector.
void SetTimingPar(size_t Voxel, size_t OpChannel, float Count, size_t parnum)
#define DEFINE_ART_SERVICE(svc)
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
Definition: OpDetGeo.cxx:123
General LArSoft Utilities.
std::optional< std::array< NeiInfo, 8U > > GetNeighboringVoxelIDs(Point const &v) const
Returns IDs of the eight neighboring voxels around v.
virtual T0s_t GetReflT0s(size_t Voxel) const =0
const std::vector< float > * GetLibraryTimingParEntries(int VoxID) const
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
float GetTimingPar(size_t Voxel, size_t OpChannel, size_t parnum) const
def func()
Definition: docstring.py:7
std::string find_file(std::string const &filename) const
Definition: search_path.cc:96
unsigned int GetNVoxels() const
Returns the total number of voxels in the volume.
PhotonVisibilityServiceS2(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
void SetReflCount(size_t Voxel, size_t OpChannel, float Count)
float GetLibraryEntry(int VoxID, int OpChannel, bool wantReflected=false) const
float const * GetAllVisibilities(double const *xyz, bool wantReflected=false) const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)