LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
phot::PhotonVisibilityService Class Reference

#include "PhotonVisibilityService.h"

Public Member Functions

 PhotonVisibilityService (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
void reconfigure (fhicl::ParameterSet const &p)
 
double GetQuenchingFactor (double dQdx) const
 
float GetVisibility (double const *xyz, unsigned int OpChannel, bool wantReflected=false) const
 
float const * GetAllVisibilities (double const *xyz, 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, int OpChannel, float N, bool wantReflected=false)
 
float GetLibraryEntry (int VoxID, int OpChannel, bool wantReflected=false) const
 
float const * GetLibraryEntries (int VoxID, bool wantReflected=false) const
 
float const * GetReflT0s (double const *xyz) const
 
void SetLibraryReflT0Entry (int VoxID, int OpChannel, float value)
 
float const * GetLibraryReflT0Entries (int VoxID) const
 
float GetLibraryReflT0Entry (int VoxID, int Channel) const
 
const std::vector< float > * GetTimingPar (double const *xyz) const
 
void SetLibraryTimingParEntry (int VoxID, int OpChannel, float value, size_t parnum)
 
const std::vector< float > * GetLibraryTimingParEntries (int VoxID) const
 
float GetLibraryTimingParEntry (int VoxID, int Channel, size_t npar) const
 
TF1 * GetTimingTF1 (double const *xyz) const
 
void SetLibraryTimingTF1Entry (int VoxID, int OpChannel, TF1 func)
 
TF1 * 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
 
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
 
const sim::PhotonVoxelDefGetVoxelDef () const
 
size_t NOpChannels () const
 

Static Public Member Functions

static double DistanceToOpDet (double const *xyz, unsigned int OpDet)
 
static double SolidAngleFactor (double const *xyz, unsigned int OpDet)
 

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 fParPropTime
 
size_t fParPropTime_npar
 
std::string fParPropTime_formula
 
bool fInterpolate
 
TF1 * fparslogNorm
 
TF1 * fparslogNorm_far
 
TF1 * fparsMPV
 
TF1 * fparsMPV_far
 
TF1 * fparsWidth
 
TF1 * fparsCte
 
TF1 * fparsCte_far
 
TF1 * fparsSlope
 
double fD_break
 
double fD_max
 
double fTF1_sampling_factor
 
TF1 * fparslogNorm_refl
 
TF1 * fparsMPV_refl
 
TF1 * fparsWidth_refl
 
TF1 * fparsCte_refl
 
TF1 * fparsSlope_refl
 
double fT0_max
 
double fT0_break_point
 
std::string fLibraryFile
 
IPhotonLibraryfTheLibrary
 
sim::PhotonVoxelDef fVoxelDef
 

Detailed Description

Definition at line 25 of file PhotonVisibilityService.h.

Constructor & Destructor Documentation

phot::PhotonVisibilityService::PhotonVisibilityService ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)

Definition at line 43 of file PhotonVisibilityService_service.cc.

References reconfigure().

43  :
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  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void reconfigure(fhicl::ParameterSet const &p)

Member Function Documentation

double phot::PhotonVisibilityService::DistanceToOpDet ( double const *  xyz,
unsigned int  OpDet 
)
static

Definition at line 327 of file PhotonVisibilityService_service.cc.

References geo::OpDetGeo::DistanceToPoint(), and geo::GeometryCore::OpDetGeoFromOpDet().

328  {
330  return geom->OpDetGeoFromOpDet(OpDet).DistanceToPoint(xyz);
331 
332  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Number of OpDets in the whole detector.
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
Definition: OpDetGeo.cxx:97
float const * phot::PhotonVisibilityService::GetAllVisibilities ( double const *  xyz,
bool  wantReflected = false 
) const

Definition at line 309 of file PhotonVisibilityService_service.cc.

References fInterpolate, fVoxelDef, GetLibraryEntries(), GetVisibility(), sim::PhotonVoxelDef::GetVoxelID(), and NOpChannels().

Referenced by cosmic::BeamFlashTrackMatchTaggerAlg::AddLightFromSegment(), opdet::FlashHypothesisCreator::CreateFlashHypothesesFromSegment(), larg4::OpFastScintillation::RecordPhotonsProduced(), and opdet::TrackTimeAssoc::ScanMIPHypotheses().

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  }
float const * GetLibraryEntries(int VoxID, bool wantReflected=false) const
int GetVoxelID(const TVector3 &) const
float GetVisibility(double const *xyz, unsigned int OpChannel, bool wantReflected=false) const
float const * phot::PhotonVisibilityService::GetLibraryEntries ( int  VoxID,
bool  wantReflected = false 
) const

Definition at line 413 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::IPhotonLibrary::GetCounts(), phot::IPhotonLibrary::GetReflCounts(), and LoadLibrary().

Referenced by GetAllVisibilities().

414  {
415  if(fTheLibrary == 0)
416  LoadLibrary();
417 
418  if(!wantReflected)
419  return fTheLibrary->GetCounts(VoxID);
420  else
421  return fTheLibrary->GetReflCounts(VoxID);
422  }
virtual const float * GetReflCounts(size_t Voxel) const =0
virtual const float * GetCounts(size_t Voxel) const =0
Returns a pointer to NOpChannels() visibility values, one per channel.
float phot::PhotonVisibilityService::GetLibraryEntry ( int  VoxID,
int  OpChannel,
bool  wantReflected = false 
) const

Definition at line 426 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::IPhotonLibrary::GetCount(), phot::IPhotonLibrary::GetReflCount(), and LoadLibrary().

Referenced by GetVisibility().

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  }
virtual float GetReflCount(size_t Voxel, size_t OpChannel) const =0
virtual float GetCount(size_t Voxel, size_t OpChannel) const =0
float const * phot::PhotonVisibilityService::GetLibraryReflT0Entries ( int  VoxID) const

Definition at line 450 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::IPhotonLibrary::GetReflT0s(), and LoadLibrary().

Referenced by GetReflT0s().

451  {
452  if(fTheLibrary == 0)
453  LoadLibrary();
454 
455  return fTheLibrary->GetReflT0s(VoxID);
456  }
virtual const float * GetReflT0s(size_t Voxel) const =0
float phot::PhotonVisibilityService::GetLibraryReflT0Entry ( int  VoxID,
int  Channel 
) const

Definition at line 473 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::IPhotonLibrary::GetReflT0(), and LoadLibrary().

474  {
475  if(fTheLibrary == 0)
476  LoadLibrary();
477 
478  return fTheLibrary->GetReflT0(VoxID, Channel);
479  }
virtual float GetReflT0(size_t Voxel, size_t OpChannel) const =0
const std::vector< float > * phot::PhotonVisibilityService::GetLibraryTimingParEntries ( int  VoxID) const

Definition at line 501 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::PhotonLibrary::GetTimingPars(), and LoadLibrary().

Referenced by GetTimingPar().

502  {
503  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
504  if(fTheLibrary == 0)
505  LoadLibrary();
506 
507  return lib->GetTimingPars(VoxID);
508  }
float phot::PhotonVisibilityService::GetLibraryTimingParEntry ( int  VoxID,
int  Channel,
size_t  npar 
) const

Definition at line 550 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::PhotonLibrary::GetTimingPar(), and LoadLibrary().

551  {
552  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
553  if(fTheLibrary == 0)
554  LoadLibrary();
555 
556  return lib->GetTimingPar(VoxID, Channel,npar);
557  }
TF1 * phot::PhotonVisibilityService::GetLibraryTimingTF1Entries ( int  VoxID) const

Definition at line 512 of file PhotonVisibilityService_service.cc.

References fTheLibrary, phot::PhotonLibrary::GetTimingTF1s(), and LoadLibrary().

Referenced by GetTimingTF1().

513  {
514  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
515  if(fTheLibrary == 0)
516  LoadLibrary();
517 
518  return lib->GetTimingTF1s(VoxID);
519  }
double phot::PhotonVisibilityService::GetQuenchingFactor ( double  dQdx) const

Definition at line 296 of file PhotonVisibilityService_service.cc.

297  {
298  // for now, no quenching
299  return 1.0;
300 
301  }
float const * phot::PhotonVisibilityService::GetReflT0s ( double const *  xyz) const

Definition at line 442 of file PhotonVisibilityService_service.cc.

References fVoxelDef, GetLibraryReflT0Entries(), and sim::PhotonVoxelDef::GetVoxelID().

Referenced by larg4::OpFastScintillation::RecordPhotonsProduced().

443  {
444  int VoxID = fVoxelDef.GetVoxelID(xyz);
445  return GetLibraryReflT0Entries(VoxID);
446  }
float const * GetLibraryReflT0Entries(int VoxID) const
int GetVoxelID(const TVector3 &) const
const std::vector< float > * phot::PhotonVisibilityService::GetTimingPar ( double const *  xyz) const

Definition at line 486 of file PhotonVisibilityService_service.cc.

References fVoxelDef, GetLibraryTimingParEntries(), and sim::PhotonVoxelDef::GetVoxelID().

487  {
488  int VoxID = fVoxelDef.GetVoxelID(xyz);
489  return GetLibraryTimingParEntries(VoxID);
490  }
const std::vector< float > * GetLibraryTimingParEntries(int VoxID) const
int GetVoxelID(const TVector3 &) const
TF1 * phot::PhotonVisibilityService::GetTimingTF1 ( double const *  xyz) const

Definition at line 492 of file PhotonVisibilityService_service.cc.

References fVoxelDef, GetLibraryTimingTF1Entries(), and sim::PhotonVoxelDef::GetVoxelID().

Referenced by larg4::OpFastScintillation::RecordPhotonsProduced().

493  {
494  int VoxID = fVoxelDef.GetVoxelID(xyz);
495  return GetLibraryTimingTF1Entries(VoxID);
496  }
int GetVoxelID(const TVector3 &) const
float phot::PhotonVisibilityService::GetVisibility ( double const *  xyz,
unsigned int  OpChannel,
bool  wantReflected = false 
) const

Definition at line 347 of file PhotonVisibilityService_service.cc.

References fInterpolate, fVoxelDef, GetLibraryEntry(), sim::PhotonVoxelDef::GetNeighboringVoxelIDs(), sim::PhotonVoxelDef::GetVoxelID(), and n.

Referenced by phot::CreateHybridLibrary::CreateHybridLibrary(), and GetAllVisibilities().

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  }
void GetNeighboringVoxelIDs(const TVector3 &v, std::vector< NeiInfo > &ret) const
int GetVoxelID(const TVector3 &) const
Char_t n[5]
float GetLibraryEntry(int VoxID, int OpChannel, bool wantReflected=false) const
const sim::PhotonVoxelDef& phot::PhotonVisibilityService::GetVoxelDef ( ) const
inline
bool phot::PhotonVisibilityService::IncludeParPropTime ( ) const
inline
bool phot::PhotonVisibilityService::IncludePropTime ( ) const
inline
bool phot::PhotonVisibilityService::IsBuildJob ( ) const
inline
void phot::PhotonVisibilityService::LoadLibrary ( ) const

Definition at line 73 of file PhotonVisibilityService_service.cc.

References phot::PhotonLibrary::CreateEmptyLibrary(), fDoNotLoadLibrary, fHybrid, fLibraryBuildJob, fLibraryFile, fParameterization, fParPropTime_npar, fStoreReflected, fStoreReflT0, fTheLibrary, sim::PhotonVoxelDef::GetNVoxels(), GetVoxelDef(), phot::PhotonLibrary::LoadLibraryFromFile(), and geo::GeometryCore::NOpDets().

Referenced by GetLibraryEntries(), GetLibraryEntry(), GetLibraryReflT0Entries(), GetLibraryReflT0Entry(), GetLibraryTimingParEntries(), GetLibraryTimingParEntry(), GetLibraryTimingTF1Entries(), NOpChannels(), SetLibraryEntry(), SetLibraryReflT0Entry(), SetLibraryTimingParEntry(), SetLibraryTimingTF1Entry(), and StoreLibrary().

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 
121  lib->CreateEmptyLibrary(NVoxels, NOpDets, fStoreReflected, fStoreReflT0, fParPropTime_npar);
122  }
123 
124  }
125  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
int GetNVoxels() const
unsigned int NOpDets() const
Number of OpDets in the whole detector.
const sim::PhotonVoxelDef & GetVoxelDef() const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string phot::PhotonVisibilityService::ParPropTimeFormula ( ) const
inline

Definition at line 74 of file PhotonVisibilityService.h.

References fParPropTime_formula.

size_t phot::PhotonVisibilityService::ParPropTimeNpar ( ) const
inline

Definition at line 73 of file PhotonVisibilityService.h.

References fParPropTime_npar.

void phot::PhotonVisibilityService::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 148 of file PhotonVisibilityService_service.cc.

References geo::GeometryCore::CryostatBoundaries(), fD_break, fD_max, fDoNotLoadLibrary, fHybrid, fIncludePropTime, fInterpolate, fLibraryBuildJob, fLibraryFile, fNx, fNy, fNz, fParameterization, fParPropTime, fParPropTime_formula, fParPropTime_npar, fparsCte, fparsCte_far, fparsCte_refl, fparslogNorm, fparslogNorm_far, fparslogNorm_refl, fparsMPV, fparsMPV_far, fparsMPV_refl, fparsSlope, fparsSlope_refl, fparsWidth, fparsWidth_refl, fStoreReflected, fStoreReflT0, fT0_break_point, fT0_max, fTF1_sampling_factor, fUseCryoBoundary, fVoxelDef, fXmax, fXmin, fYmax, fYmin, fZmax, fZmin, and fhicl::ParameterSet::get().

Referenced by PhotonVisibilityService().

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  }
void CryostatBoundaries(double *boundaries, geo::CryostatID const &cid) const
Returns the boundaries of the specified cryostat.
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 570 of file PhotonVisibilityService_service.cc.

References fD_break, fD_max, fparsCte, fparsCte_far, fparslogNorm, fparslogNorm_far, fparsMPV, fparsMPV_far, fparsSlope, fparsWidth, and fTF1_sampling_factor.

Referenced by larg4::OpFastScintillation::OpFastScintillation().

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  }
void phot::PhotonVisibilityService::SetLibraryEntry ( int  VoxID,
int  OpChannel,
float  N,
bool  wantReflected = false 
)

Definition at line 394 of file PhotonVisibilityService_service.cc.

References fTheLibrary, LoadLibrary(), LOG_DEBUG, phot::PhotonLibrary::SetCount(), and phot::PhotonLibrary::SetReflCount().

Referenced by opdet::SimPhotonCounter::analyze().

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  }
#define LOG_DEBUG(id)
void phot::PhotonVisibilityService::SetLibraryReflT0Entry ( int  VoxID,
int  OpChannel,
float  value 
)

Definition at line 460 of file PhotonVisibilityService_service.cc.

References fTheLibrary, LoadLibrary(), LOG_DEBUG, and phot::PhotonLibrary::SetReflT0().

Referenced by opdet::SimPhotonCounter::analyze().

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  }
#define LOG_DEBUG(id)
void phot::PhotonVisibilityService::SetLibraryTimingParEntry ( int  VoxID,
int  OpChannel,
float  value,
size_t  parnum 
)

Definition at line 523 of file PhotonVisibilityService_service.cc.

References fTheLibrary, LoadLibrary(), LOG_DEBUG, and phot::PhotonLibrary::SetTimingPar().

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  }
#define LOG_DEBUG(id)
void phot::PhotonVisibilityService::SetLibraryTimingTF1Entry ( int  VoxID,
int  OpChannel,
TF1  func 
)

Definition at line 536 of file PhotonVisibilityService_service.cc.

References fTheLibrary, LoadLibrary(), LOG_DEBUG, and phot::PhotonLibrary::SetTimingTF1().

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  }
#define LOG_DEBUG(id)
void phot::PhotonVisibilityService::SetReflectedCOLightPropFunctions ( TF1 const *  functions[5],
double &  t0_max,
double &  t0_break_point 
) const
double phot::PhotonVisibilityService::SolidAngleFactor ( double const *  xyz,
unsigned int  OpDet 
)
static

Definition at line 339 of file PhotonVisibilityService_service.cc.

References geo::OpDetGeo::CosThetaFromNormal(), and geo::GeometryCore::OpDetGeoFromOpDet().

340  {
342  return geom->OpDetGeoFromOpDet(OpDet).CosThetaFromNormal(xyz);
343  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Number of OpDets in the whole detector.
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 phot::PhotonVisibilityService::StoreLibrary ( )

Definition at line 128 of file PhotonVisibilityService_service.cc.

References fHybrid, fLibraryBuildJob, fLibraryFile, fParPropTime_npar, fStoreReflected, fStoreReflT0, fTheLibrary, LoadLibrary(), and phot::PhotonLibrary::StoreLibraryToFile().

Referenced by opdet::SimPhotonCounter::endJob().

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);
142  lib->StoreLibraryToFile(fLibraryFile, fStoreReflected, fStoreReflT0, fParPropTime_npar);
143  }
144  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void phot::PhotonVisibilityService::StoreLightProd ( int  VoxID,
double  N 
)

Definition at line 375 of file PhotonVisibilityService_service.cc.

References fCurrentValue, and fCurrentVoxel.

Referenced by evgen::LightSource::produce().

376  {
377  fCurrentVoxel = VoxID;
378  fCurrentValue = N;
379  mf::LogInfo("PhotonVisibilityService") << " PVS notes production of " << N << " photons at Vox " << VoxID<<std::endl;
380  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
bool phot::PhotonVisibilityService::StoreReflected ( ) const
inline
bool phot::PhotonVisibilityService::StoreReflT0 ( ) const
inline
bool phot::PhotonVisibilityService::UseParameterization ( ) const
inline

Definition at line 69 of file PhotonVisibilityService.h.

References fParameterization.

Member Data Documentation

double phot::PhotonVisibilityService::fCurrentValue
private

Definition at line 84 of file PhotonVisibilityService.h.

Referenced by RetrieveLightProd(), and StoreLightProd().

int phot::PhotonVisibilityService::fCurrentVoxel
private

Definition at line 83 of file PhotonVisibilityService.h.

Referenced by RetrieveLightProd(), and StoreLightProd().

double phot::PhotonVisibilityService::fD_break
private

Definition at line 117 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

double phot::PhotonVisibilityService::fD_max
private

Definition at line 117 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

bool phot::PhotonVisibilityService::fDoNotLoadLibrary
private

Definition at line 96 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), and reconfigure().

bool phot::PhotonVisibilityService::fHybrid
private

Definition at line 98 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), reconfigure(), and StoreLibrary().

bool phot::PhotonVisibilityService::fIncludePropTime
private

Definition at line 101 of file PhotonVisibilityService.h.

Referenced by IncludePropTime(), and reconfigure().

bool phot::PhotonVisibilityService::fInterpolate
private

Definition at line 107 of file PhotonVisibilityService.h.

Referenced by GetAllVisibilities(), GetVisibility(), and reconfigure().

bool phot::PhotonVisibilityService::fLibraryBuildJob
private

Definition at line 95 of file PhotonVisibilityService.h.

Referenced by IsBuildJob(), LoadLibrary(), reconfigure(), and StoreLibrary().

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

Definition at line 125 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), reconfigure(), and StoreLibrary().

int phot::PhotonVisibilityService::fNx
private

Definition at line 91 of file PhotonVisibilityService.h.

Referenced by reconfigure().

int phot::PhotonVisibilityService::fNy
private

Definition at line 91 of file PhotonVisibilityService.h.

Referenced by reconfigure().

int phot::PhotonVisibilityService::fNz
private

Definition at line 91 of file PhotonVisibilityService.h.

Referenced by reconfigure().

bool phot::PhotonVisibilityService::fParameterization
private

Definition at line 97 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), reconfigure(), and UseParameterization().

bool phot::PhotonVisibilityService::fParPropTime
private

Definition at line 103 of file PhotonVisibilityService.h.

Referenced by IncludeParPropTime(), and reconfigure().

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

Definition at line 105 of file PhotonVisibilityService.h.

Referenced by ParPropTimeFormula(), and reconfigure().

size_t phot::PhotonVisibilityService::fParPropTime_npar
private

Definition at line 104 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), ParPropTimeNpar(), reconfigure(), and StoreLibrary().

TF1* phot::PhotonVisibilityService::fparsCte
private

Definition at line 114 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsCte_far
private

Definition at line 115 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsCte_refl
private

Definition at line 121 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparslogNorm
private

Definition at line 109 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparslogNorm_far
private

Definition at line 110 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparslogNorm_refl
private

Definition at line 118 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsMPV
private

Definition at line 111 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsMPV_far
private

Definition at line 112 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsMPV_refl
private

Definition at line 119 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsSlope
private

Definition at line 116 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsSlope_refl
private

Definition at line 122 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsWidth
private

Definition at line 113 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

TF1* phot::PhotonVisibilityService::fparsWidth_refl
private

Definition at line 120 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

bool phot::PhotonVisibilityService::fStoreReflected
private

Definition at line 99 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), reconfigure(), StoreLibrary(), and StoreReflected().

bool phot::PhotonVisibilityService::fStoreReflT0
private

Definition at line 100 of file PhotonVisibilityService.h.

Referenced by LoadLibrary(), reconfigure(), StoreLibrary(), and StoreReflT0().

double phot::PhotonVisibilityService::fT0_break_point
private

Definition at line 123 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

double phot::PhotonVisibilityService::fT0_max
private

Definition at line 123 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetReflectedCOLightPropFunctions().

double phot::PhotonVisibilityService::fTF1_sampling_factor
private

Definition at line 117 of file PhotonVisibilityService.h.

Referenced by reconfigure(), and SetDirectLightPropFunctions().

bool phot::PhotonVisibilityService::fUseCryoBoundary
private

Definition at line 93 of file PhotonVisibilityService.h.

Referenced by reconfigure().

sim::PhotonVoxelDef phot::PhotonVisibilityService::fVoxelDef
private
float phot::PhotonVisibilityService::fXmax
private

Definition at line 88 of file PhotonVisibilityService.h.

Referenced by reconfigure().

float phot::PhotonVisibilityService::fXmin
private

Definition at line 88 of file PhotonVisibilityService.h.

Referenced by reconfigure().

float phot::PhotonVisibilityService::fYmax
private

Definition at line 89 of file PhotonVisibilityService.h.

Referenced by reconfigure().

float phot::PhotonVisibilityService::fYmin
private

Definition at line 89 of file PhotonVisibilityService.h.

Referenced by reconfigure().

float phot::PhotonVisibilityService::fZmax
private

Definition at line 90 of file PhotonVisibilityService.h.

Referenced by reconfigure().

float phot::PhotonVisibilityService::fZmin
private

Definition at line 90 of file PhotonVisibilityService.h.

Referenced by reconfigure().


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