TelescopeSimulatorKG/TelescopeSimulator.cc
Go to the documentation of this file.
1 
12 #include <utl/config.h>
13 
14 #include "TelescopeSimulator.h"
15 #include "RayTracer.h"
16 
17 #include <utl/Reader.h>
18 #include <utl/ErrorLogger.h>
19 #include <utl/AugerUnits.h>
20 #include <utl/MathConstants.h>
21 #include <utl/Math.h>
22 #include <utl/PhysicalConstants.h>
23 #include <utl/PhysicalFunctions.h>
24 #include <utl/Point.h>
25 #include <utl/TabulatedFunction.h>
26 #include <utl/TabulatedFunctionErrors.h>
27 #include <utl/Trace.h>
28 #include <utl/MultiTabulatedFunction.h>
29 #include <utl/Photon.h>
30 #include <utl/RandomEngine.h>
31 #include <utl/UTMPoint.h>
32 
33 #include <fwk/CentralConfig.h>
34 #include <fwk/CoordinateSystemRegistry.h>
35 #include <fwk/RandomEngineRegistry.h>
36 
37 #include <det/Detector.h>
38 
39 #include <fdet/FDetector.h>
40 #include <fdet/Eye.h>
41 #include <fdet/Telescope.h>
42 #include <fdet/Camera.h>
43 #include <fdet/Pixel.h>
44 #include <fdet/Mirror.h>
45 #include <fdet/Filter.h>
46 #include <fdet/Corrector.h>
47 
48 #include <evt/Event.h>
49 
50 #include <fevt/FEvent.h>
51 #include <fevt/Eye.h>
52 #include <fevt/TelescopeSimData.h>
53 #include <fevt/Telescope.h>
54 #include <fevt/PixelSimData.h>
55 #include <fevt/Pixel.h>
56 
57 #include <boost/tuple/tuple.hpp>
58 
59 #include <TDirectory.h>
60 #include <TFile.h>
61 #include <TTree.h>
62 
63 #include <CLHEP/Random/Randomize.h>
64 
65 #include <iomanip>
66 #include <fstream>
67 #include <sstream>
68 
69 using namespace TelescopeSimulatorKG;
70 using namespace std;
71 using namespace utl;
72 using namespace evt;
73 using namespace fwk;
74 using namespace det;
75 using namespace fdet;
76 
77 using CLHEP::RandFlat;
78 
79 
80 
82  fVerbosityLevel(0)
83 {
84 }
85 
86 
88 {
89  fDrumMode = false;
90  fSpotMode = false;
91  fSpotPhotonList = 0;
92 
93  Branch topB =
94  CentralConfig::GetInstance()->GetTopBranch("TelescopeSimulatorKG");
95 
97  &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
98 
99  // --------------------- **OPTIONAL** ---------------------
100  fVerbosityLevel = 0;
101  if (topB.GetChild("verbosityLevel"))
102  topB.GetChild("verbosityLevel").GetData(fVerbosityLevel);
103 
104  // --------------------- **OPTIONAL** ---------------------
105  //
106  // Configure the ray tracing options
107  //
108  fDoNoShadow = false;
109  fDoNoShadowSupport = false;
110  fHasNoMercedes = false;
111  Branch optionsB = topB.GetChild("RayTracingOptions");
112  if (optionsB) {
113  optionsB.GetChild("DoNoShadow").GetData(fDoNoShadow);
114  optionsB.GetChild("DoNoShadowSupport").GetData(fDoNoShadowSupport);
115  optionsB.GetChild("HasNoMercedes").GetData(fHasNoMercedes);
116  }
117 
118  topB.GetChild("StoreLightComponentsAtPixels").GetData(fStoreLightComponentsAtPixels);
119 
120  // --------------------- **OPTIONAL** ---------------------
122  fDraw = false;
123  Branch drawingB = topB.GetChild("DrawingOptions");
124  if (drawingB) {
125  fDraw = true;
126  drawingB.GetChild("numberOfPhotons").GetData(fDrawNumberOfPhotons);
127  }
128 
129  // --------------------- **OPTIONAL** ---------------------
130  fShadowDataOutName = "shadow.root";
131  if (topB.GetChild("ShadowDataOut"))
132  topB.GetChild("ShadowDataOut").GetData(fShadowDataOutName);
133 
134 
135  // ------------------------------------------------
136  //
137  // do some final output
138 
139  // info output
140  ostringstream info;
141  info << " Version: " << GetVersionInfo(VModule::eRevisionNumber) << "\n"
142  << " Parameters:\n";
144  info << " camera body shadow: " << (!fDoNoShadow ? "yes" : "no") << "\n"
145  " camera support shadow: " << (!fDoNoShadowSupport ? "yes" : "no") << "\n"
146  " mercedes collectors: " << (!fHasNoMercedes ? "yes" : "no") << "\n";
147  }
148  info << " save light components: " << (fStoreLightComponentsAtPixels ? "yes" : "no") << '\n';
149  if (fDraw)
150  info << " save 3D plot with: " << fDrawNumberOfPhotons << " raytraced photons\n";
151 
152  INFO(info);
153 
154  // ---------------------------------------------------
155  // the model config signature
156  ostringstream configSS;
157  configSS << "TelescopeSimulatorKG";
159  configSS << "(camera-shadow / support-shadow / mercedes) = ("
160  << (!fDoNoShadow ? "yes" : "no") << " / "
161  << (!fDoNoShadowSupport ? "yes" : "no") << " / "
162  << (!fHasNoMercedes ? "yes" : "no") << ")";
163  fGeneralConfigSignature = configSS.str();
164 
165  return eSuccess;
166 }
167 
168 
171 {
172  if (!event.HasFEvent()) {
173  ERROR("Event has no FEvent.");
174  return eFailure;
175  }
176  fevt::FEvent& fEvent = event.GetFEvent();
177 
178  if (!event.HasSimShower() && !fSpotMode) {
179  /*
180  In drum mode (AND SPOT MODE) the handling of photons is different from normal mode.
181  While normaly photons are tracked with a weight, in drum mode photons are tracked
182  as physical objects that can only get absorbed - or not.
183  */
184  fDrumMode = true;
185  }
186 
187  const Detector& detector = Detector::GetInstance();
188  const FDetector& detFD = detector.GetFDetector();
189 
190  // loop eyes
192  iEye != fEvent.EyesEnd(fevt::ComponentSelector::eInDAQ); ++iEye) {
193 
194  if (iEye->GetStatus() == fevt::ComponentSelector::eDeSelected)
195  continue;
196 
197  const unsigned int eyeId = iEye->GetId();
198  fevt::Eye& eyeEvent = *iEye;
199 
200  // loop telescopes
202  iTel != eyeEvent.TelescopesEnd(fevt::ComponentSelector::eInDAQ); ++iTel) {
203 
204  const unsigned int telId = iTel->GetId();
205  fevt::Telescope& telEvent = *iTel;
206  const fdet::Telescope& detTel = detFD.GetTelescope(telEvent);
207 
208  const TabulatedFunction& telMeasEfficiency = detTel.GetMeasuredRelativeEfficiency();
209 
210  if (!telEvent.HasSimData())
211  continue;
212  fevt::TelescopeSimData& telSim = telEvent.GetSimData();
214 
215  const double normWavelength = detFD.GetReferenceLambda();
216  const TabulatedFunction& mirRef = detTel.GetMirror().GetReflectivity();
217  const TabulatedFunction& filtTrans = detTel.GetFilter().GetTransmittance();
218 
219  // corrector
220 
221  const fdet::Camera& detCamera = detTel.GetCamera();
222  const unsigned int telTraceNBins = telSim.GetNumberOfPhotonBins();
223  const double telTraceBinWidth = detCamera.GetFADCBinSize();
224 
225  const int nPhotons = telSim.GetNPhotons();
226 
227  if (!nPhotons)
228  continue;
229 
230  ostringstream info;
231  info << "Raytracing eye=" << eyeId
232  << ", telescope=" << telId
233  << ", rDia=" << setw(6) << detTel.GetDiaphragmRadius()
234  << ", nPhotons=" << nPhotons;
235  INFO(info);
236 
237  const double minWl = detFD.GetModelMinWavelength();
238  const double maxWl = detFD.GetModelMaxWavelength();
239 
240  map<int, int> rayTracerResults; // for verbose info output: [status:counts]
241 
242  const double drawPhotonProbablility = (double)fDrawNumberOfPhotons / nPhotons;
243  RayTracer rayTracer(detTel, *fRandomEngine,
245  fDraw, drawPhotonProbablility);
246 
247  const int index = telId + eyeId * 100;
248  fNHit[index] = 0;
249  fN_1[index] = 0;
250  fN_2[index] = 0;
251  fN_3[index] = 0;
252  fN_4[index] = 0;
253  fN_5[index] = 0;
254  fN_6[index] = 0;
255 
256  unsigned int countWlBoundary = 0;
257  unsigned int countFilterMirror = 0;
258 
259  map<int, TraceD*> traces;
261  iPhoton != telSim.PhotonsEnd(); ++iPhoton) {
262 
263  // RUDEBUG
264  /*
265  if (iPhoton->GetSource() == fevt::FdConstants::eCherDirect) {
266  static int ___n_dc = 0;
267  ostringstream __inf;
268  __inf << "direct-chernkov: " << ___n_dc++;
269  INFO(__inf);
270  TelescopeSimulatorKG::RayTracer::SetDebugLevel(10);
271  fVerbosityLevel = 100;
272  } else {
273  TelescopeSimulatorKG::RayTracer::SetDebugLevel(0);
274  fVerbosityLevel = 0;
275  }*/
276 
277  const double wavelength = iPhoton->GetWavelength();
278  const double inputWeight = iPhoton->GetWeight();
279 
280  if (wavelength < minWl || wavelength > maxWl) {
281  ++countWlBoundary;
282  continue;
283  }
284 
285  const double filterMirFactor = mirRef.Y(wavelength) * filtTrans.Y(wavelength);
286 
287  if (fDrumMode) {
288  if (RandFlat::shoot(&fRandomEngine->GetEngine(), 0., 1.) > filterMirFactor) {
289  countFilterMirror++;
290  continue; // photon absorbed
291  }
292  }
293 
294  utl::Photon photonOut;
295  int col = 0;
296  int row = 0;
297 
298  int nreflections = 0;
299  const RTResult status = rayTracer.Trace(*iPhoton, photonOut, nreflections, col, row);
300  const double weight = photonOut.GetWeight();
301 
302  // cout << " st=" << (status==eOK) << " " << weight << endl;
303 
304  if (status != eOK ) { // photon lost
305  rayTracerResults[status]++;
306  continue;
307  } else {
308  if (status == eOK && weight==0) {
309  rayTracerResults[eAbsorbed]++;
310  continue;
311  }
312  }
313 
314  if (fSpotMode) {
315  fSpotPhotonList->push_back(std::make_pair(photonOut, (int)status));
316  }
317 
318  if (fDrumMode) {
319  if (RandFlat::shoot(&fRandomEngine->GetEngine(), 0., 1.) > weight/iPhoton->GetWeight()) {
320  rayTracerResults[eAbsorbed]++;
321  continue; // photon absorbed
322  }
323  }
324 
325  rayTracerResults[status]++;
326 
327  const unsigned int pxlId = (col-1)*detTel.GetLastRow() + row;
328  const fdet::Pixel& detPix = detTel.GetPixel(pxlId);
329  const TabulatedFunction& qEff = detPix.GetQEfficiency();
330 
331  // !! this factor is to achive consistency to reconstruction !!
332  // the model wavelength dependence is tweaked to the data
333  double efficiencyWavelengthCorrection = 0;
334  if (!fDrumMode) {
335  const double modelRelEff = detTel.GetModelRelativeEfficiency(wavelength);
336  if (modelRelEff)
337  efficiencyWavelengthCorrection = telMeasEfficiency.Y(wavelength) / modelRelEff;
338  }
339 
340  const double time = photonOut.GetTime().GetInterval();
341  const int bin = int(time/telTraceBinWidth);
342 
343  if (fVerbosityLevel > 2) {
344  ostringstream dbg;
345  dbg << " bin=" << setw(4) << bin
346  << " time=" << setw(6) << time/ns
347  << " weight=" << setw(4) << weight
348  << " wl=" << setw(4) << wavelength/nanometer
349  << " col=" << setw(3) << col
350  << " row=" << setw(3) << row
351  << " pixelId=" << setw(3) << pxlId
352  << " telTraceBinWidth=" << setw(3) << telTraceBinWidth
353  << " telTraceNBins=" << setw(5) << telTraceNBins
354  << " EQ=" << qEff.Y(wavelength)/qEff.Y(normWavelength)
355  << " EC=" << efficiencyWavelengthCorrection;
356  INFO(dbg);
357  }
358 
359  if (bin < 0 || bin >= int(telTraceNBins)) {
360  if (fVerbosityLevel > 2) {
361  ostringstream err;
362  err << "Bin out of range. bin=" << bin
363  << " weight=" << weight;
364  ERROR(err);
365  }
366  continue;
367  }
368 
369  // In drum mode there is no weight. Photons can only get absorbed (or not).
370  // at _reference_ wavelengths
371  const double QEffCorrection = qEff.Y(wavelength) / qEff.Y(normWavelength);
372  const double photonWeight =
373  (fDrumMode ? 1 : (weight * filterMirFactor * QEffCorrection * efficiencyWavelengthCorrection));
374 
375  switch (nreflections) {
376  case 0: fNHit[index] += photonWeight; break; // direct hit
377  case 1: fN_1[index] += photonWeight; break;
378  case 2: fN_2[index] += photonWeight; break;
379  case 3: fN_3[index] += photonWeight; break;
380  case 4: fN_4[index] += photonWeight; break;
381  case 5: fN_5[index] += photonWeight; break;
382  case 6: fN_6[index] += photonWeight; break;
383  }
384 
385  // create pixels trace if not there yet
386  if (!traces.count(pxlId)) {
387  if (!telEvent.HasPixel(pxlId))
388  telEvent.MakePixel(pxlId);
389  fevt::Pixel& pixData = telEvent.GetPixel(pxlId);
390  if (!pixData.HasSimData())
391  pixData.MakeSimData();
392  fevt::PixelSimData& pixSimData = pixData.GetSimData();
393  if (!pixSimData.HasPhotonTrace(fevt::FdConstants::eTotal))
394  pixSimData.MakePhotonTrace(telTraceNBins, telTraceBinWidth, fevt::FdConstants::eTotal);
395  traces[pxlId] = &(pixSimData.GetPhotonTrace(fevt::FdConstants::eTotal));
396  }
397 
398  // add to pixel's trace
399  (*(traces[pxlId]))[bin] += photonWeight;
400 
402 
403  /*
404  This option is only for VISUAL inspect of the simulations.
405 
406  The idea is to compare the simulated light components of
407  the photon traces at each pixel to the corresponding
408  reconstructed photon trace. In reco, this is is units of
409  "ADC * caliconst", thus photons at the diaphragm.
410 
411  Thus, it is best to apply all optical, raytracing and
412  electronics effects to the photon signal and finally
413  divide by the "MC drum calibration factors" to get back to
414  units of "photons at the diaphragm".
415 
416  DIFFERENT APPROACH:
417 
418  Just save the "input weight" of the photons at the
419  diaphragm, if they hit a PMT.
420  */
421 
422  // consider the wavelength dependence
423  const double photonInputWeight = inputWeight * QEffCorrection * efficiencyWavelengthCorrection;
424 
425  /*
426  fevt::Pixel& pix = tel.GetPixel(pixelId);
427  const fdet::Pixel& detPixel = detFD.GetPixel(pix);
428  const fdet::Channel& detChannel = detFD.GetChannel(pix); // mapped channel
429  const TabulatedFunction& qEff = detPixel.GetQEfficiency();
430  const double absGain = detChannel.GetElectronicsGain();
431 
432  const string& configSignature = tel.GetSimData().GetConfigSignature();
433  const double calibCorrection = fThresholdMode ? 1.0 : detPixel.GetSimulatedEndToEndCalibration(configSignature) / caliconst;
434  */
435 
436  const fevt::FdConstants::LightSource lightSource =
437  (fevt::FdConstants::LightSource)iPhoton->GetSource();
438  fevt::PixelSimData& pixSimData = telEvent.GetPixel(pxlId).GetSimData();
439  if (!pixSimData.HasPhotonTrace(lightSource))
440  pixSimData.MakePhotonTrace(telTraceNBins, telTraceBinWidth, lightSource);
441  pixSimData.GetPhotonTrace(lightSource)[bin] += photonInputWeight;
442  if (!pixSimData.HasPhotonWeightSquareTrace(lightSource))
443  pixSimData.MakePhotonWeightSquareTrace(telTraceNBins, telTraceBinWidth, lightSource);
444  pixSimData.GetPhotonWeightSquareTrace(lightSource)[bin] += photonInputWeight*photonInputWeight;
445  }
446 
447  } // loop Photons
448 
449  if (fVerbosityLevel > 0) {
450  int debugTotal = 0;
451  ostringstream info;
452  info << "\n";
453  for(map<int, int>::const_iterator iRTR = rayTracerResults.begin();
454  iRTR != rayTracerResults.end(); ++iRTR) {
455  info << " RayTraceResult \"" << RTResultName[iRTR->first] << "\" occured " << iRTR->second << " times " << endl;
456  debugTotal += iRTR->second;
457  }
458  info << " RayTraceResult \"total\" number of photons is " << debugTotal << endl;
459  info << " RayTraceResult wl-boundaries: " << countWlBoundary << endl;
460  info << " RayTraceResult filt-mirror: " << countFilterMirror << endl;
461  info << " RayTraceResult grand-total: " << debugTotal + countFilterMirror + countWlBoundary;
462  INFO(info);
463  }
464 
465 
466  if (fVerbosityLevel > 2) {
467  // Output pixels with signal
468  for (map<int,TraceD*>::iterator iTrace = traces.begin();
469  iTrace != traces.end(); ++iTrace) {
470  const int pxlId = iTrace->first;
471  const int col = (pxlId - 1) / detTel.GetLastRow() + 1; // (col-1)*lastRow + row;
472  const int row = (pxlId - 1) % detTel.GetLastRow() + 1;
473 
474  ostringstream info;
475  info << "eyeId=" << eyeId << " telId=" << telId << " pixelId=" << pxlId
476  << " col=" << col << " row=" << row
477  << " trace:";
478 
479  double signal = 0;
480  for (unsigned int i = 0; i < telTraceNBins; ++i) {
481  if (fVerbosityLevel > 3) {
482  if ((*(iTrace->second))[i])
483  info << " i: " << i
484  << " val: " << (*(iTrace->second))[i]
485  << " |";
486  }
487  signal += (*(iTrace->second))[i];
488  }
489  info << " total signal " << signal;
490  INFO(info);
491  }
492  } // end verbose
493 
494  } // End loop over Telescopes
495 
496  } // End loop over Eyes
497 
498  return eSuccess;
499 } // end of Run
500 
501 
504 {
505  // -- shadow factor calculation --
506  if (fDrumMode) {
507 
508  TDirectory* save = gDirectory;
509  TFile output(fShadowDataOutName.c_str(), "UPDATE");
510  for (map<int, unsigned int>::const_iterator iter = fNHit.begin();
511  iter != fNHit.end(); ++iter)
512  {
513  const int index = iter->first;
514  ostringstream name;
515  name << "shadow_" << index;
516  TTree* tree = (TTree*) output.Get(name.str().c_str());
517  if (!tree) {
518  tree = new TTree(name.str().c_str(), "shadow info");
519  tree->Branch("direct", &fNHit[index], "direct/i");
520  tree->Branch("refl1", &fN_1[index], "refl1/i");
521  tree->Branch("refl2", &fN_2[index], "refl2/i");
522  tree->Branch("refl3", &fN_3[index], "refl3/i");
523  tree->Branch("refl4", &fN_4[index], "refl4/i");
524  tree->Branch("refl5", &fN_5[index], "refl5/i");
525  tree->Branch("refl6", &fN_6[index], "refl6/i");
526  } else {
527  tree->SetBranchAddress("direct", &fNHit[index]);
528  tree->SetBranchAddress("refl1", &fN_1[index]);
529  tree->SetBranchAddress("refl2", &fN_2[index]);
530  tree->SetBranchAddress("refl3", &fN_3[index]);
531  tree->SetBranchAddress("refl4", &fN_4[index]);
532  tree->SetBranchAddress("refl5", &fN_5[index]);
533  tree->SetBranchAddress("refl6", &fN_6[index]);
534  }
535  tree->Fill();
536  tree->Write();
537 
538  ostringstream info;
539  info << "\n\n ------------- SHADOW INFO (telId=" << index << ") -----------" << "\n"
540  << " Direct hit of focal surface: " << fNHit[index] << "\n"
541  << " 1 mercedes refl. : " << fN_1[index] << "\n"
542  << " 2 mercedes refl. : " << fN_2[index] << "\n"
543  << " 3 mercedes refl. : " << fN_3[index] << "\n"
544  << " 4 mercedes refl. : " << fN_4[index] << "\n"
545  << " 5 mercedes refl. : " << fN_5[index] << "\n"
546  << " 6 mercedes refl. : " << fN_6[index] << "\n";
547 
548  const double nTot = ((double)fN_1[index] +
549  (double)fN_2[index] +
550  (double)fN_3[index] +
551  (double)fN_4[index] +
552  (double)fN_5[index] +
553  (double)fN_6[index]);
554  const double nMercedes = ((double)fN_1[index] * 1. +
555  (double)fN_2[index] * 2. +
556  (double)fN_3[index] * 3. +
557  (double)fN_4[index] * 4. +
558  (double)fN_5[index] * 5. +
559  (double)fN_6[index] * 6.);
560  const double meanRefls = (double(nMercedes) / (fNHit[index] + nTot));
561  info << " Mean number of reflections from mercedes: " << meanRefls << " at tel=" << index << "\n";
562  info << " -----------------------------------------------------------------";
563  INFO(info);
564  }
565  output.Close();
566  gDirectory = save;
567  }
568 
569  return eSuccess;
570 }
571 
572 
573 void
575 {
576  fSpotPhotonList = &phList;
577  fSpotMode = true;
578 }
579 
580 
581 // --------------------------
582 // Wed Jul 26 10:51:33 CEST 2006
583 // this is for SG spot tables !!!!!!!!!
584 void
585 TelescopeSimulator::TransformToLocalCameraCoordinates(const double laz, const double lze, double& caz, double& cze)
586 {
587  const double phi0 = 16.*kPi/180.;
588 
589  const double llaz = lze + 0.5*kPi;
590  const double llze = laz + 0.5*kPi;
591 
592  const double xx = sin(llaz) * cos(llze);
593  const double yy = sin(llaz) * sin(llze);
594  const double zz = cos(llaz);
595 
596  const double x = xx;
597  const double y = yy * cos(phi0) - zz * sin(phi0);
598  const double z = yy * sin(phi0) + zz * cos(phi0);
599 
600  caz = asin(x);
601  cze = phi0 - atan(z/y);
602 }
603 
604 
605 // Configure (x)emacs for this file ...
606 // Local Variables:
607 // mode: c++
608 // compile-command: "cd $AUGER_BASE && make"
609 // End:
Branch GetTopBranch() const
Definition: Branch.cc:63
double GetModelRelativeEfficiency(const double wl) const
const std::string RTResultName[]
Definition: RTResult.h:28
unsigned int GetId() const
Definition: FEvent/Eye.h:54
bool HasPhotonWeightSquareTrace(const FdConstants::LightSource source) const
Check that trace of sums of squares of weights of simulated photons for source /par source is present...
Definition: PixelSimData.h:91
double GetFADCBinSize() const
Report success to RunController.
Definition: VModule.h:62
int GetNumberOfPhotonBins() const
Fluorescence Detector Eye Event.
Definition: FEvent/Eye.h:29
void MakePhotonWeightSquareTrace(unsigned int size, double binning, const FdConstants::LightSource source=FdConstants::eTotal)
Definition: PixelSimData.cc:54
RandomEngineType & GetEngine()
Definition: RandomEngine.h:32
std::list< std::pair< utl::Photon, int > > PhotonList
bool HasFEvent() const
Class to hold collection (x,y) points and provide interpolation between them.
const utl::TabulatedFunction & GetTransmittance() const
Average transmittance of the filter as a function of the wavelength.
bool HasSimShower() const
EyeIterator EyesEnd(const ComponentSelector::Status status)
Definition: FEvent.h:66
double GetDiaphragmRadius() const
double GetMeasuredRelativeEfficiency(const double wl) const
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
double GetWeight() const
weight assigned to the photon
Definition: Photon.h:21
double GetModelMinWavelength() const
Definition: FDetector.cc:291
PixelSimData & GetSimData()
Definition: FEvent/Pixel.h:35
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
boost::filter_iterator< ComponentSelector, AllEyeIterator > EyeIterator
selective Eye iterators
Definition: FEvent.h:55
const std::string & GetConfigSignatureStr(const std::string &module) const
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
bool HasPhotonTrace(const FdConstants::LightSource source) const
Check that trace for source /par source is present.
Definition: PixelSimData.h:51
std::string GetVersionInfo(const VersionInfoType v) const
Retrieve different sorts of module version info.
Definition: VModule.cc:26
void MakeSimData()
Definition: FEvent/Pixel.cc:10
PhotonIterator PhotonsEnd()
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
Detector description interface for FDetector-related data.
Definition: FDetector.h:44
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
constexpr double nanometer
Definition: AugerUnits.h:102
const Pixel & GetPixel(const unsigned int pixelId) const
Get Pixel by id, throw utl::NonExistentComponentException if n.a.
void SetConfigSignatureStr(const std::string &configSignatureStr)
void MakePixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Pixel telescopeId.
bool HasPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
Check if the pixel is in the event.
fevt::TelescopeSimData & GetSimData()
Description of simulated data for one Telescope.
Class representing a document branch.
Definition: Branch.h:107
LightSource
Possible light sources.
Definition: FdConstants.h:9
Fluorescence Detector Pixel event.
Definition: FEvent/Pixel.h:28
const utl::TabulatedFunction & GetQEfficiency() const
Average quantum efficiency as a function of the wavelength.
double GetModelMaxWavelength() const
Definition: FDetector.cc:312
const double ns
TelescopeIterator TelescopesEnd()
first available tel of status eHasData (DEPRECATED)
Definition: FEvent/Eye.cc:230
constexpr double kPi
Definition: MathConstants.h:24
Top of the hierarchy of the detector description interface.
Definition: Detector.h:81
EyeIterator EyesBegin(const ComponentSelector::Status status)
Definition: FEvent.h:58
const fdet::FDetector & GetFDetector() const
Definition: Detector.cc:131
bool HasSimData() const
Definition: FEvent/Pixel.h:38
utl::TraceD & GetPhotonWeightSquareTrace(const FdConstants::LightSource source=FdConstants::eTotal)
Trace of the sums of squares of simulated photon weights.
Definition: PixelSimData.h:78
boost::filter_iterator< ComponentSelector, AllTelescopeIterator > TelescopeIterator
selective Telescope iterators
Definition: FEvent/Eye.h:72
unsigned int GetLastRow() const
void GetData(bool &b) const
Overloads of the GetData member template function.
Definition: Branch.cc:644
Top of Fluorescence Detector event hierarchy.
Definition: FEvent.h:33
std::list< utl::Photon >::iterator PhotonIterator
const utl::TabulatedFunction & GetReflectivity() const
Average reflectivity of the segments as a function of the wavelength.
TelescopeIterator TelescopesBegin()
first available tel of status eHasData (DEPRECATED)
Definition: FEvent/Eye.cc:207
double GetInterval() const
Get the time interval as a double (in Auger base units)
Definition: TimeInterval.h:69
double GetReferenceLambda() const
Definition: FDetector.cc:332
Pixel & GetPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Pixel by Id, throw exception if not existent.
Simulates all ray tracing inside a telescope.
Definition: RayTracer.h:38
Detector description interface for Telescope-related data.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
const Telescope & GetTelescope(const fevt::Telescope &eventTel) const
Get fdet::Telescope from fevt::Telescope.
Definition: FDetector.cc:150
const Filter & GetFilter() const
Get the filter that belongs to the telescope.
PhotonIterator PhotonsBegin()
Description of a pixel.
utl::TraceD & GetPhotonTrace(const FdConstants::LightSource source=FdConstants::eTotal)
Simulated Photon Trace.
Definition: PixelSimData.h:37
const Mirror & GetMirror() const
Get the Mirror object that belongs to the telescope.
Report failure to RunController, causing RunController to terminate execution.
Definition: VModule.h:64
Fluorescence Detector Telescope Event.
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut, int &nreflections, int &col, int &row)
Raytracing through the telescope components.
Definition: RayTracer.cc:101
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
utl::TimeInterval GetTime() const
Definition: Photon.h:28
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
bool HasSimData() const
static void TransformToLocalCameraCoordinates(const double laz, const double lze, double &caz, double &cze)
Fluorescence Detector Pixel Simulated Data.
Definition: PixelSimData.h:28
Description of a camera.
void MakePhotonTrace(unsigned int size, double binning, const FdConstants::LightSource source=FdConstants::eTotal)
Definition: PixelSimData.cc:31

, generated on Tue Sep 26 2023.