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