Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
phot::PhotonVisibilityServiceS2 Class Reference

#include <PhotonVisibilityServiceS2.h>

Public Member Functions

 PhotonVisibilityServiceS2 (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 *const GetTimingTF1 (double const *xyz)
 
void SetLibraryTimingTF1Entry (int VoxID, int OpChannel, TF1 func)
 
TF1 *const GetLibraryTimingTF1Entries (int VoxID)
 
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 28 of file PhotonVisibilityServiceS2.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file PhotonVisibilityServiceS2_service.cc.

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

Member Function Documentation

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

Definition at line 309 of file PhotonVisibilityServiceS2_service.cc.

310  {
312  return geom->OpDetGeoFromOpDet(OpDet).DistanceToPoint(xyz);
313 
314  }
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
Definition: OpDetGeo.cxx:123
float const * phot::PhotonVisibilityServiceS2::GetAllVisibilities ( double const *  xyz,
bool  wantReflected = false 
) const

Definition at line 291 of file PhotonVisibilityServiceS2_service.cc.

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  }
float const * GetLibraryEntries(int VoxID, bool wantReflected=false) const
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
float GetVisibility(double const *xyz, unsigned int OpChannel, bool wantReflected=false) const
float const * phot::PhotonVisibilityServiceS2::GetLibraryEntries ( int  VoxID,
bool  wantReflected = false 
) const

Definition at line 389 of file PhotonVisibilityServiceS2_service.cc.

390  {
391  if(fTheLibrary == 0)
392  LoadLibrary();
393 
394  if(!wantReflected)
395  return fTheLibrary->GetCounts(VoxID);
396  else
397  return fTheLibrary->GetReflCounts(VoxID);
398  }
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::PhotonVisibilityServiceS2::GetLibraryEntry ( int  VoxID,
int  OpChannel,
bool  wantReflected = false 
) const

Definition at line 402 of file PhotonVisibilityServiceS2_service.cc.

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  }
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::PhotonVisibilityServiceS2::GetLibraryReflT0Entries ( int  VoxID) const

Definition at line 426 of file PhotonVisibilityServiceS2_service.cc.

427  {
428  if(fTheLibrary == 0)
429  LoadLibrary();
430 
431  return fTheLibrary->GetReflT0s(VoxID);
432  }
virtual T0s_t GetReflT0s(size_t Voxel) const =0
float phot::PhotonVisibilityServiceS2::GetLibraryReflT0Entry ( int  VoxID,
int  Channel 
) const

Definition at line 449 of file PhotonVisibilityServiceS2_service.cc.

450  {
451  if(fTheLibrary == 0)
452  LoadLibrary();
453 
454  return fTheLibrary->GetReflT0(VoxID, Channel);
455  }
virtual float GetReflT0(size_t Voxel, size_t OpChannel) const =0
const std::vector< float > * phot::PhotonVisibilityServiceS2::GetLibraryTimingParEntries ( int  VoxID) const

Definition at line 477 of file PhotonVisibilityServiceS2_service.cc.

478  {
479  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
480  if(fTheLibrary == 0)
481  LoadLibrary();
482 
483  return lib->GetTimingPars(VoxID);
484  }
float phot::PhotonVisibilityServiceS2::GetLibraryTimingParEntry ( int  VoxID,
int  Channel,
size_t  npar 
) const

Definition at line 526 of file PhotonVisibilityServiceS2_service.cc.

527  {
528  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
529  if(fTheLibrary == 0)
530  LoadLibrary();
531 
532  return lib->GetTimingPar(VoxID, Channel,npar);
533  }
TF1 *const phot::PhotonVisibilityServiceS2::GetLibraryTimingTF1Entries ( int  VoxID)

Definition at line 488 of file PhotonVisibilityServiceS2_service.cc.

489  {
490  PhotonLibrary* lib = dynamic_cast<PhotonLibrary*>(fTheLibrary);
491  if(fTheLibrary == 0)
492  LoadLibrary();
493 
494  return lib->GetTimingTF1s(VoxID);
495  }
double phot::PhotonVisibilityServiceS2::GetQuenchingFactor ( double  dQdx) const

Definition at line 278 of file PhotonVisibilityServiceS2_service.cc.

279  {
280  // for now, no quenching
281  return 1.0;
282 
283  }
float const * phot::PhotonVisibilityServiceS2::GetReflT0s ( double const *  xyz) const

Definition at line 418 of file PhotonVisibilityServiceS2_service.cc.

419  {
420  int VoxID = fVoxelDef.GetVoxelID(xyz);
421  return GetLibraryReflT0Entries(VoxID);
422  }
float const * GetLibraryReflT0Entries(int VoxID) const
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
const std::vector< float > * phot::PhotonVisibilityServiceS2::GetTimingPar ( double const *  xyz) const

Definition at line 462 of file PhotonVisibilityServiceS2_service.cc.

463  {
464  int VoxID = fVoxelDef.GetVoxelID(xyz);
465  return GetLibraryTimingParEntries(VoxID);
466  }
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
const std::vector< float > * GetLibraryTimingParEntries(int VoxID) const
TF1 *const phot::PhotonVisibilityServiceS2::GetTimingTF1 ( double const *  xyz)

Definition at line 468 of file PhotonVisibilityServiceS2_service.cc.

469  {
470  int VoxID = fVoxelDef.GetVoxelID(xyz);
471  return GetLibraryTimingTF1Entries(VoxID);
472  }
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
float phot::PhotonVisibilityServiceS2::GetVisibility ( double const *  xyz,
unsigned int  OpChannel,
bool  wantReflected = false 
) const

Definition at line 329 of file PhotonVisibilityServiceS2_service.cc.

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  }
Index OpChannel(Index detNum, Index channel)
int GetVoxelID(Point const &p) const
Returns the ID of the voxel containing p, or -1 if none.
Definition: PhotonVoxels.h:234
std::void_t< T > n
std::optional< std::array< NeiInfo, 8U > > GetNeighboringVoxelIDs(Point const &v) const
Returns IDs of the eight neighboring voxels around v.
float GetLibraryEntry(int VoxID, int OpChannel, bool wantReflected=false) const
const sim::PhotonVoxelDef& phot::PhotonVisibilityServiceS2::GetVoxelDef ( ) const
inline

Definition at line 81 of file PhotonVisibilityServiceS2.h.

81 {return fVoxelDef; }
bool phot::PhotonVisibilityServiceS2::IncludeParPropTime ( ) const
inline
bool phot::PhotonVisibilityServiceS2::IncludePropTime ( ) const
inline
bool phot::PhotonVisibilityServiceS2::IsBuildJob ( ) const
inline
void phot::PhotonVisibilityServiceS2::LoadLibrary ( ) const

Definition at line 55 of file PhotonVisibilityServiceS2_service.cc.

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 
103  lib->CreateEmptyLibrary(NVoxels, NOpDets, fStoreReflected, fStoreReflT0, fParPropTime_npar);
104  }
105 
106  }
107  }
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const sim::PhotonVoxelDef & GetVoxelDef() const
unsigned int NOpDets() const
Number of OpDets in the whole detector.
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)
size_t phot::PhotonVisibilityServiceS2::NOpChannels ( ) const

Definition at line 537 of file PhotonVisibilityServiceS2_service.cc.

538  {
539  if(fTheLibrary == 0)
540  LoadLibrary();
541 
542  return fTheLibrary->NOpChannels();
543  }
virtual int NOpChannels() const =0
std::string phot::PhotonVisibilityServiceS2::ParPropTimeFormula ( ) const
inline

Definition at line 77 of file PhotonVisibilityServiceS2.h.

size_t phot::PhotonVisibilityServiceS2::ParPropTimeNpar ( ) const
inline
void phot::PhotonVisibilityServiceS2::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 130 of file PhotonVisibilityServiceS2_service.cc.

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  }
std::string string
Definition: nybbler.cc:12
Representation of a region of space diced into voxels.
Definition: PhotonVoxels.h:58
void CryostatBoundaries(double *boundaries, geo::CryostatID const &cid) const
Returns the boundaries of the specified cryostat.
p
Definition: test.py:223
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityServiceS2::RetrieveLightProd ( int &  VoxID,
double &  N 
) const
void phot::PhotonVisibilityServiceS2::SetDirectLightPropFunctions ( TF1 const *  functions[8],
double &  d_break,
double &  d_max,
double &  tf1_sampling_factor 
) const

Definition at line 546 of file PhotonVisibilityServiceS2_service.cc.

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

Definition at line 370 of file PhotonVisibilityServiceS2_service.cc.

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  }
Index OpChannel(Index detNum, Index channel)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityServiceS2::SetLibraryReflT0Entry ( int  VoxID,
int  OpChannel,
float  value 
)

Definition at line 436 of file PhotonVisibilityServiceS2_service.cc.

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  }
Index OpChannel(Index detNum, Index channel)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityServiceS2::SetLibraryTimingParEntry ( int  VoxID,
int  OpChannel,
float  value,
size_t  parnum 
)

Definition at line 499 of file PhotonVisibilityServiceS2_service.cc.

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  }
Index OpChannel(Index detNum, Index channel)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityServiceS2::SetLibraryTimingTF1Entry ( int  VoxID,
int  OpChannel,
TF1  func 
)

Definition at line 512 of file PhotonVisibilityServiceS2_service.cc.

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  }
Index OpChannel(Index detNum, Index channel)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
def func()
Definition: docstring.py:7
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityServiceS2::SetReflectedCOLightPropFunctions ( TF1 const *  functions[5],
double &  t0_max,
double &  t0_break_point 
) const
double phot::PhotonVisibilityServiceS2::SolidAngleFactor ( double const *  xyz,
unsigned int  OpDet 
)
static

Definition at line 321 of file PhotonVisibilityServiceS2_service.cc.

322  {
324  return geom->OpDetGeoFromOpDet(OpDet).CosThetaFromNormal(xyz);
325  }
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
void phot::PhotonVisibilityServiceS2::StoreLibrary ( )

Definition at line 110 of file PhotonVisibilityServiceS2_service.cc.

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);
124  lib->StoreLibraryToFile(fLibraryFile, fStoreReflected, fStoreReflT0, fParPropTime_npar);
125  }
126  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
QTextStream & endl(QTextStream &s)
void phot::PhotonVisibilityServiceS2::StoreLightProd ( int  VoxID,
double  N 
)

Definition at line 351 of file PhotonVisibilityServiceS2_service.cc.

352  {
353  fCurrentVoxel = VoxID;
354  fCurrentValue = N;
355  mf::LogInfo("PhotonVisibilityServiceS2") << " PVS notes production of " << N << " photons at Vox " << VoxID<<std::endl;
356  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
QTextStream & endl(QTextStream &s)
bool phot::PhotonVisibilityServiceS2::StoreReflected ( ) const
inline
bool phot::PhotonVisibilityServiceS2::StoreReflT0 ( ) const
inline
bool phot::PhotonVisibilityServiceS2::UseParameterization ( ) const
inline

Member Data Documentation

double phot::PhotonVisibilityServiceS2::fCurrentValue
private

Definition at line 87 of file PhotonVisibilityServiceS2.h.

int phot::PhotonVisibilityServiceS2::fCurrentVoxel
private

Definition at line 86 of file PhotonVisibilityServiceS2.h.

double phot::PhotonVisibilityServiceS2::fD_break
private

Definition at line 120 of file PhotonVisibilityServiceS2.h.

double phot::PhotonVisibilityServiceS2::fD_max
private

Definition at line 120 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fDoNotLoadLibrary
private

Definition at line 99 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fHybrid
private

Definition at line 101 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fIncludePropTime
private

Definition at line 104 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fInterpolate
private

Definition at line 110 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fLibraryBuildJob
private

Definition at line 98 of file PhotonVisibilityServiceS2.h.

std::string phot::PhotonVisibilityServiceS2::fLibraryFile
private

Definition at line 128 of file PhotonVisibilityServiceS2.h.

int phot::PhotonVisibilityServiceS2::fNx
private

Definition at line 94 of file PhotonVisibilityServiceS2.h.

int phot::PhotonVisibilityServiceS2::fNy
private

Definition at line 94 of file PhotonVisibilityServiceS2.h.

int phot::PhotonVisibilityServiceS2::fNz
private

Definition at line 94 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fParameterization
private

Definition at line 100 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fParPropTime
private

Definition at line 106 of file PhotonVisibilityServiceS2.h.

std::string phot::PhotonVisibilityServiceS2::fParPropTime_formula
private

Definition at line 108 of file PhotonVisibilityServiceS2.h.

size_t phot::PhotonVisibilityServiceS2::fParPropTime_npar
private

Definition at line 107 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsCte
private

Definition at line 117 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsCte_far
private

Definition at line 118 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsCte_refl
private

Definition at line 124 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparslogNorm
private

Definition at line 112 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparslogNorm_far
private

Definition at line 113 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparslogNorm_refl
private

Definition at line 121 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsMPV
private

Definition at line 114 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsMPV_far
private

Definition at line 115 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsMPV_refl
private

Definition at line 122 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsSlope
private

Definition at line 119 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsSlope_refl
private

Definition at line 125 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsWidth
private

Definition at line 116 of file PhotonVisibilityServiceS2.h.

TF1* phot::PhotonVisibilityServiceS2::fparsWidth_refl
private

Definition at line 123 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fStoreReflected
private

Definition at line 102 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fStoreReflT0
private

Definition at line 103 of file PhotonVisibilityServiceS2.h.

double phot::PhotonVisibilityServiceS2::fT0_break_point
private

Definition at line 126 of file PhotonVisibilityServiceS2.h.

double phot::PhotonVisibilityServiceS2::fT0_max
private

Definition at line 126 of file PhotonVisibilityServiceS2.h.

double phot::PhotonVisibilityServiceS2::fTF1_sampling_factor
private

Definition at line 120 of file PhotonVisibilityServiceS2.h.

IPhotonLibrary* phot::PhotonVisibilityServiceS2::fTheLibrary
mutableprivate

Definition at line 129 of file PhotonVisibilityServiceS2.h.

bool phot::PhotonVisibilityServiceS2::fUseCryoBoundary
private

Definition at line 96 of file PhotonVisibilityServiceS2.h.

sim::PhotonVoxelDef phot::PhotonVisibilityServiceS2::fVoxelDef
private

Definition at line 130 of file PhotonVisibilityServiceS2.h.

float phot::PhotonVisibilityServiceS2::fXmax
private

Definition at line 91 of file PhotonVisibilityServiceS2.h.

float phot::PhotonVisibilityServiceS2::fXmin
private

Definition at line 91 of file PhotonVisibilityServiceS2.h.

float phot::PhotonVisibilityServiceS2::fYmax
private

Definition at line 92 of file PhotonVisibilityServiceS2.h.

float phot::PhotonVisibilityServiceS2::fYmin
private

Definition at line 92 of file PhotonVisibilityServiceS2.h.

float phot::PhotonVisibilityServiceS2::fZmax
private

Definition at line 93 of file PhotonVisibilityServiceS2.h.

float phot::PhotonVisibilityServiceS2::fZmin
private

Definition at line 93 of file PhotonVisibilityServiceS2.h.


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