DrumPhotonGenerator.cc
Go to the documentation of this file.
1 
11 #include "DrumPhotonGenerator.h"
12 
13 #include <utl/config.h>
14 #include <utl/Reader.h>
15 #include <utl/ErrorLogger.h>
16 #include <utl/AugerUnits.h>
17 #include <utl/MathConstants.h>
18 #include <utl/Math.h>
19 #include <utl/PhysicalConstants.h>
20 #include <utl/PhysicalFunctions.h>
21 #include <utl/Point.h>
22 #include <utl/TabulatedFunction.h>
23 #include <utl/TabulatedFunctionErrors.h>
24 #include <utl/Trace.h>
25 #include <utl/MultiTabulatedFunction.h>
26 #include <utl/Photon.h>
27 #include <utl/RandomEngine.h>
28 #include <utl/UTMPoint.h>
29 #include <utl/SaveCurrentTDirectory.h>
30 
31 #include <fwk/CentralConfig.h>
32 #include <fwk/CoordinateSystemRegistry.h>
33 #include <fwk/RandomEngineRegistry.h>
34 #include <fwk/GITGlobalRevision.h>
35 
36 #include <det/Detector.h>
37 
38 #include <fdet/FDetector.h>
39 #include <fdet/Eye.h>
40 #include <fdet/Telescope.h>
41 #include <fdet/Camera.h>
42 #include <fdet/Pixel.h>
43 #include <fdet/Channel.h>
44 #include <fdet/Mirror.h>
45 #include <fdet/Filter.h>
46 #include <fdet/Corrector.h>
47 
48 #include <evt/Event.h>
49 #include <evt/ShowerSimData.h>
50 #include <evt/LaserData.h> // Modified by D'Urso & Valore 02/03/06
51 
52 #include <fevt/FEvent.h>
53 #include <fevt/Eye.h>
54 #include <fevt/TelescopeSimData.h>
55 #include <fevt/Telescope.h>
56 #include <fevt/PixelSimData.h>
57 #include <fevt/Pixel.h>
58 
59 #include <atm/ProfileResult.h>
60 #include <atm/InclinedAtmosphericProfile.h>
61 
62 #include <CLHEP/Random/Randomize.h>
63 
64 #include <boost/tuple/tuple.hpp>
65 
66 #include <TDirectory.h>
67 #include <TFile.h>
68 #include <TTree.h>
69 
70 #include <iomanip>
71 #include <fstream>
72 #include <sstream>
73 
74 using namespace DrumPhotonGeneratorOG;
75 using namespace std;
76 using namespace utl;
77 using namespace evt;
78 using namespace fwk;
79 using namespace det;
80 using namespace fdet;
81 using namespace atm;
82 
83 using CLHEP::RandFlat;
84 
85 
87 { }
88 
89 
91 { }
92 
93 
96 {
97  CentralConfig* cc = CentralConfig::GetInstance();
98  Branch topB = cc->GetTopBranch("DrumPhotonGenerator");
99 
100  if (!topB) {
101  ostringstream err;
102  err << "Missing configuration file for DrumPhotonGenerator";
103  ERROR(err);
104  return eFailure;
105  }
106 
107  fRandomEngine = &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
108 
109  // Initialize the drum simulation mode
110 
111  topB.GetChild("minAccuracy").GetData(fMinAccuracy);
112  topB.GetChild("NDrumPhotons").GetData(fNDrumPhotons);
113  topB.GetChild("nCos").GetData(fDrumNCos);
114  topB.GetChild("MinThetaPhotons").GetData(fThetaMinDrumPhotons);
115  topB.GetChild("MaxThetaPhotons").GetData(fThetaMaxDrumPhotons);
116  topB.GetChild("MinPhiPhotons").GetData(fPhiMinDrumPhotons);
117  topB.GetChild("MaxPhiPhotons").GetData(fPhiMaxDrumPhotons);
118  topB.GetChild("MinRDiaPhotons").GetData(fRDiaMin);
119  topB.GetChild("MaxBin").GetData(fMaxBin);
120  topB.GetChild("MinBin").GetData(fMinBin);
121  topB.GetChild("DrumDataOut").GetData(fDrumDataOutName);
122 
123  // ------------------------------------------------
124  //
125  // do some final output
126 
127  // info output
128  ostringstream info;
129  info << " Version: "
130  << GetVersionInfo(VModule::eRevisionNumber) << "\n"
131  " Parameters:\n"
132  " min accuracy: " << fMinAccuracy << "\n"
133  " number of photons: " << fNDrumPhotons << "\n"
134  " nCos: " << fDrumNCos;
135  if (fDrumNCos == 0)
136  info << " (isotropic)\n";
137  if (fDrumNCos == 1)
138  info << " (lambertian)\n";
139  info << " min theta: " << setw(3) << fThetaMinDrumPhotons/deg << "deg\n"
140  " max theta: " << setw(3) << fThetaMaxDrumPhotons/deg << "deg\n"
141  " min phi: " << setw(3) << fPhiMinDrumPhotons/deg << "deg\n"
142  " max phi: " << setw(3) << fPhiMaxDrumPhotons/deg << "deg\n"
143  " min radius: " << setw(3) << fRDiaMin/m << "m\n"
144  " min bin: " << fMinBin << "\n"
145  " max bin: " << fMaxBin << "\n"
146  " drum-data output: " << fDrumDataOutName;
147  INFO(info);
148 
149  fInit = false;
150  fStatus = eGeneratePhotons;
151 
152  return eSuccess;
153 }
154 
155 
158 {
159  Detector& detector = Detector::GetInstance();
160  const FDetector& detFD = detector.GetFDetector();
161 
162  if (!event.HasFEvent()) { // initialize event
163  ERROR("No FEvent. Check your ModuleSequence.");
164  return eBreakLoop;
165  }
166 
167  fevt::FEvent& fEvent = event.GetFEvent();
168 
169  if (!fInit) {
170  INFO("Creating FEvent");
171  fInit = true;
172 
173  const TimeStamp& simTime = detector.GetTime();
174 
175  // set the FD event times
176  fEvent.GetHeader().SetTime(simTime);
177  event.GetHeader().SetTime(simTime);
178  ostringstream idStr;
179  //idStr << "DrumSimulation_" << fEventCounter;
180  event.GetHeader().SetId(idStr.str());
181 
182  for (FDetector::EyeIterator iEye = detFD.EyesBegin();
183  iEye != detFD.EyesEnd() ; ++iEye) {
184  const unsigned int eyeId = iEye->GetId();
185 
187 
188  fevt::Eye& eyeEvent = fEvent.GetEye(eyeId, fevt::ComponentSelector::eInDAQ);
189  for (fdet::Eye::TelescopeIterator iTel = iEye->TelescopesBegin();
190  iTel != iEye->TelescopesEnd(); ++iTel) {
191  const unsigned int telId = iTel->GetId();
192 
193  if (eyeEvent.HasTelescope(telId, fevt::ComponentSelector::eInDAQ)) {
194  ERROR("Telescope already there");
195  }
196 
197  const int index = Index(eyeId, telId);
198  fTotalGeneratedPhotonsPerTelescope[index] = 0;
199 
201  fevt::Telescope& telEvent = eyeEvent.GetTelescope(telId, fevt::ComponentSelector::eInDAQ);
202  telEvent.MakeSimData();
203 
204  fevt::TelescopeSimData& telSim = telEvent.GetSimData();
205  telSim.SetPhotonsStartTime(simTime);
206  telSim.SetNumberOfPhotonBins(fMaxBin);
207 
208  }
209  }
210  } // end creating FEvent
211 
212  if (CalculateCalibrationConstants(event))
213  return eSuccess;
214  else if (DoDrum(event))
215  return eSuccess;
216  return eBreakLoop;
217 }
218 
219 
220 // -----------------------------------------------------------------------
221 bool
223 {
224  fevt::FEvent& fEvent = event.GetFEvent();
225 
226  bool accuracyNotYetReached = false;
227 
229  iEye != fEvent.EyesEnd(fevt::ComponentSelector::eInDAQ); ++iEye) {
230  const int eyeId = iEye->GetId();
231 
232  for (fevt::Eye::TelescopeIterator iTel = iEye->TelescopesBegin(fevt::ComponentSelector::eInDAQ);
233  iTel != iEye->TelescopesEnd(fevt::ComponentSelector::eInDAQ); ++iTel) {
234  const int telId = iTel->GetId();
235  const int index = Index(eyeId, telId);
236 
237  fevt::TelescopeSimData& telSim = iTel->GetSimData();
238  telSim.ClearPhotons();
239 
240  ostringstream info1;
241  info1 << "calibrating eye: " << eyeId << ", telescope: " << telId
242  << ", nTotalPhotons: " << fTotalGeneratedPhotonsPerTelescope[index] ;
243  INFO(info1);
244 
245  map<int, CalibResult> constants = CalibrateTelescope(*iTel);
246 
247  // check for current precision (-> photon statistics at the pixels)
248  double meanAccuracy = 100.;
249  double minAccuracy = 100.;
250  double maxAccuracy = 100.;
251  double meanCal = 100.;
252  double minCal = 100.;
253  double maxCal = 100.;
254  bool firstAccuracy = true;
255 
256  int countPixels = 0;
257  for (map<int, CalibResult>::const_iterator iCal = constants.begin();
258  iCal != constants.end(); ++iCal) {
259 
260  if (iCal->second.calib <= 0)
261  continue;
262 
263  ++countPixels;
264  const double accuracy = iCal->second.calibErr / iCal->second.calib;
265 
266  if (firstAccuracy) {
267  firstAccuracy = false;
268  meanAccuracy = accuracy;
269  minAccuracy = accuracy;
270  maxAccuracy = accuracy;
271  meanCal = iCal->second.calib;
272  minCal = iCal->second.calib;
273  maxCal = iCal->second.calib;
274  } else {
275  meanAccuracy += accuracy;
276  if (accuracy < minAccuracy)
277  minAccuracy = accuracy;
278  if (accuracy > maxAccuracy)
279  maxAccuracy = accuracy;
280  meanCal += iCal->second.calib;
281  if (iCal->second.calib < minCal)
282  minCal = iCal->second.calib;
283  if (iCal->second.calib > maxCal)
284  maxCal = iCal->second.calib;
285  }
286  }
287 
288  if (countPixels) {
289  meanAccuracy /= countPixels;
290  meanCal /= countPixels;
291 
292  ostringstream info2, info3;
293  info2 << "-> accuracy (min/max/mean): " << minAccuracy << " / " << maxAccuracy << " / " << meanAccuracy;
294  info3 << "-> calib (min/max/mean): " << minCal << " / " << maxCal << " / " << meanCal;
295  INFO(info2);
296  INFO(info3);
297  }
298 
299  if (maxAccuracy > fMinAccuracy) {
300  telSim.ClearConfigSignature();
301  GenerateDrumPhotons(*iTel);
302  accuracyNotYetReached = true;
303  } else {
304  ostringstream info2;
305  info2 << "===> Accuracy in this telescope is reached. Switching it off now. ";
306  INFO(info2);
307 
308  // this telescope is done -> take it out of DAQ
309  iTel->SetStatus(fevt::ComponentSelector::eExists);
310  }
311 
312  } // end loop tels
313 
314  } // End loop over Eyes
315 
316  if (accuracyNotYetReached)
317  return true;
318 
319  INFO("Drum photon precision achieved.");
320  fStatus = eCalibrate;
321 
322  return false; // calibration need no more photons
323 }
324 
325 
326 void
328 {
329  ostringstream info;
330  info << "Generating " << fNDrumPhotons << " photons from drum";
331  INFO(info);
332 
333  const unsigned int telId = tel.GetId();
334  const int index = Index(tel.GetEyeId(), telId);
335 
336  Detector& detector = Detector::GetInstance();
337  const FDetector& detFD = detector.GetFDetector();
338 
339  const fdet::Telescope& detTel = detFD.GetTelescope(tel);
340  const double rDia = detTel.GetDiaphragmRadius();
341  const double binWidth = detTel.GetCamera().GetFADCBinSize();
342  const double normWavelength = detFD.GetReferenceLambda();
343 
344  fevt::TelescopeSimData& telSim = tel.GetSimData();
345 
346  const CoordinateSystemPtr& telCS = detTel.GetTelescopeCoordinateSystem();
347 
348  fTotalGeneratedPhotonsPerTelescope[index] += fNDrumPhotons;
349 
350  map<int, TraceD*> traces;
351  for (int i = 0; i < fNDrumPhotons; i++) {
352  // Generating random point on the diaphragm
353  double diaPh = RandFlat::shoot(&fRandomEngine->GetEngine(), 0.0, 2*kPi);
354  double diaR = sqrt(RandFlat::shoot(&fRandomEngine->GetEngine(),
355  fRDiaMin*fRDiaMin, rDia*rDia));
356 
357  double xDia = diaR*cos(diaPh);
358  double yDia = diaR*sin(diaPh);
359  Point pIn(xDia, yDia, 0.0, telCS);
360 
361  // Generating random direction on the diaphragm
362  double phi = RandFlat::shoot(&fRandomEngine->GetEngine(),
363  fPhiMinDrumPhotons, fPhiMaxDrumPhotons);
364  double ncos = fDrumNCos; // th goes like cos^NCOS * d(cos)
365  double theta_1 = std::pow(cos(fThetaMinDrumPhotons), ncos+1);
366  double theta_2 = std::pow(cos(fThetaMaxDrumPhotons), ncos+1);
367  // th goes like cos^NCOS * d(cos)
368  double tmp = (theta_2-theta_1) * RandFlat::shoot(&fRandomEngine->GetEngine(),
369  0.0, 1.0) + theta_1;
370 
371  double theta;
372  if (ncos == 0) theta = acos(tmp);
373  else if (ncos == 1) theta = acos(sqrt(tmp));
374  else theta = acos(exp(log(tmp) / (1.+ncos) ) );
375 
376  Vector nIn (1., theta, phi, telCS, Vector::kSpherical);
377  nIn = -1.*nIn;
378 
379  double time = binWidth * RandFlat::shoot(&fRandomEngine->GetEngine(), fMinBin, fMaxBin);
380  const double weight = 1.0;
381  utl::Photon photonIn(pIn, nIn, normWavelength, weight);
382  photonIn.SetTime(TimeInterval(time));
383  telSim.AddPhoton(photonIn);
384 
385  } // loop over raytraces
386 }
387 
388 
389 bool
391 {
392  if (fStatus == eGeneratePhotons)
393  return false;
394  if (fStatus == eCalibrated) {
395  ERROR(" CANNOT RE-CALIBRATE CALIBRATED TELESCOPE !!!!!!!!!!!!!!!!!!!!! ");
396  return false;
397  }
398  fStatus = eCalibrated;
399 
400  INFO("Calibrate telescopes ....");
401 
402  fevt::FEvent& fEvent = event.GetFEvent();
403 
404  Detector& detector = Detector::GetInstance();
405  const FDetector& detFD = detector.GetFDetector();
406 
407  ofstream calibXml("FSimulationCalibConfig.generated.xml.in");
408  calibXml << "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n\n"
409  "<FSimulationCalibConfig\n"
410  " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
411  " xsi:noNamespaceSchemaLocation='@XMLSCHEMALOCATION@/FSimulationCalibConfig.xsd'>\n\n"
412  " <!-- these are used for the flatfielding -->\n\n";
413 
414  const SaveCurrentTDirectory save;
415  TFile* const drumDataFile = TFile::Open(fDrumDataOutName.c_str(), "UPDATE");
416  drumDataFile->cd();
417  TTree* const runInfo = new TTree("runInfo", "runInfo");
418 
420  iEye != fEvent.EyesEnd(fevt::ComponentSelector::eInDAQ); ++iEye) {
421  const int eyeId = iEye->GetId();
422 
423  for (fevt::Eye::TelescopeIterator iTel = iEye->TelescopesBegin(fevt::ComponentSelector::eExists);
424  iTel != iEye->TelescopesEnd(fevt::ComponentSelector::eExists); ++iTel) {
425  const int telId = iTel->GetId();
426  const int index = Index(eyeId, telId);
427 
428  const fevt::TelescopeSimData& telSim = iTel->GetSimData();
429  const string configList = telSim.GetConfigSignatureStr();
430  const string md5 = telSim.GetConfigSignature();
431 
432  calibXml << " <!-- \n"
433  " This set of calibration constants was generated using Offline revision "
434  << fwk::GITGlobalRevision::GetInstance().GetId() << "\n"
435  " with the following set of configuration parameters:\n"
436  "\"" << configList << "\"\n"
437  " The following Md5-hex-digest encodes this list:\n"
438  " -->\n"
439  " <EndToEnd signature=\"" << md5 << "\"> \n"
440  " <calibration>" << endl;
441 
442  drumDataFile->cd();
443  ostringstream treeName;
444  treeName << "drumData_" << index;
445  TTree* const drumData = new TTree(treeName.str().c_str(), treeName.str().c_str());
446  int drumData_id;
447  double drumData_nGen, drumData_nPix, drumData_calib, drumData_calibErr, drumData_elecFact;
448  drumData->Branch("id", &drumData_id, "id/I");
449  drumData->Branch("nGen", &drumData_nGen, "nGen/D");
450  drumData->Branch("nPix", &drumData_nPix, "nPix/D");
451  drumData->Branch("calib", &drumData_calib, "calib/D");
452  drumData->Branch("calibErr", &drumData_calibErr, "calibErr/D");
453  drumData->Branch("electronicsFactor", &drumData_elecFact, "electronicsFactor/D");
454 
455  map<int, CalibResult> constants = CalibrateTelescope(*iTel);
456 
457  const fdet::Telescope& detTel = detFD.GetTelescope(*iTel);
458  const double diaArea = detTel.GetDiaphragmArea();
459 
460  // const double solidAngle = 2. * M_PI * (1. - cos(fThetaMaxDrumPhotons));
461  const double meanPixelSolid = 5.94e-4 * sr;
462 
463  // flux of drum vertical to axis (for lambertian)
464  const double flux_drum_perp =
465  fTotalGeneratedPhotonsPerTelescope[index] / (diaArea * M_PI * (1 - pow(cos(fThetaMaxDrumPhotons), 2)));
466 
467  ostringstream info1, info2;
468  info1 << " Eye: " << eyeId << ", Telescope: " << telId
469  << ", Has lens: " << (detTel.HasCorrectorRing() ? "yes" : "no")
470  << ", Signature: " << md5 << "\n"
471  "total number of ph.: " << fTotalGeneratedPhotonsPerTelescope[index] << " photons\n"
472  " perp. drum flux: " << flux_drum_perp * cm2 * sr << "1/(cm^2 deg^2)" << "\n"
473  " mean pixel photons: " << flux_drum_perp * diaArea * meanPixelSolid << " photons ";
474  INFO(info1);
475  info2 << '\n';
476 
477  // copy first to local string not to take address of a temporary
478  const string tree_rev = fwk::GITGlobalRevision::GetInstance().GetId();
479  if (!runInfo->GetBranch("index")) {
480  runInfo->Branch("index", const_cast<int*>(&index), "index/I");
481  runInfo->Branch("nPhotonsTot", &fTotalGeneratedPhotonsPerTelescope[index], "nPhotonsTot/i");
482  runInfo->Branch("md5", const_cast<char*>(md5.c_str()), "md5/C");
483  runInfo->Branch("offline_rev", const_cast<char*>(tree_rev.c_str()), "offline_rev/C");
484  runInfo->Branch("config", const_cast<char*>(configList.c_str()), "config/C");
485  } else {
486  runInfo->SetBranchAddress("index", const_cast<int*>(&index));
487  runInfo->SetBranchAddress("nPhotonsTot", &fTotalGeneratedPhotonsPerTelescope[index]);
488  runInfo->SetBranchAddress("md5", const_cast<char*>(md5.c_str()));
489  runInfo->SetBranchAddress("offline_rev", const_cast<char*>(tree_rev.c_str()));
490  runInfo->SetBranchAddress("config", const_cast<char*>(configList.c_str()));
491  }
492 
493  runInfo->Fill();
494 
495  for (unsigned int iPix = detTel.GetFirstPixelId(); iPix <= detTel.GetLastPixelId(); ++iPix) {
496 
497  const int pixelId = iPix;
498 
499  const double calib = constants[pixelId].calib;
500  const double calibErr = constants[pixelId].calibErr;
501 
502  info2 << " pixel id=" << setw(4) << pixelId
503  << " s=" << setw(10) << fixed << calib
504  << " +- " << setw(10) << calibErr << " [ph/ADC]"
505  "\n";
506 
507  calibXml << " " << setprecision(16) << setw(18) << calib
508  << " <!-- +- " << setw(18) << calibErr << " -->\n";
509 
510  drumData_id = pixelId;
511  drumData_nGen = constants[pixelId].nPhotGen;
512  drumData_nPix = constants[pixelId].nPhotPixel;
513  drumData_calib = constants[pixelId].calib;
514  drumData_calibErr = constants[pixelId].calibErr;
515  drumData_elecFact = constants[pixelId].electronicsFactor;
516  drumData->Fill();
517 
518  } // end loop pixels
519 
520  INFO(info2);
521 
522  calibXml << " </calibration>\n"
523  " </EndToEnd>\n\n";
524 
525  // drumData->Write();
526 
527  } // end loop telescopes
528  } // end loop eyes
529 
530  calibXml << "</FSimulationCalibConfig>\n";
531 
532  //runInfo->Write();
533 
534  drumDataFile->Write();
535  drumDataFile->Close();
536 
537  INFO("Telescope(s) calibrated! Output in file \"FSimulationCalibConfig.generated.xml.in\".");
538 
539  return true;
540 }
541 
542 
543 map<int, DrumPhotonGenerator::CalibResult>
545 {
546  const int telId = tel.GetId();
547  const int eyeId = tel.GetEyeId();
548  const int index = Index(eyeId, telId);
549 
550  Detector& detector = Detector::GetInstance();
551  const FDetector& detFD = detector.GetFDetector();
552  const double normWavelength = detFD.GetReferenceLambda();
553 
554  const fdet::Telescope& detTel = detFD.GetTelescope(tel);
555  const double diaArea = detTel.GetDiaphragmArea();
556 
557  // flux of drum vertical to axis (for lambertian)
558  const double flux_drum_perp = fTotalGeneratedPhotonsPerTelescope[index] /
559  (diaArea * M_PI * (1 - pow(cos(fThetaMaxDrumPhotons), 2)));
560 
561  map<int, CalibResult> constants;
562  if (fTotalGeneratedPhotonsPerTelescope[index] == 0)
563  return constants;
564 
565  for (unsigned int iPix = detTel.GetFirstPixelId();
566  iPix <= detTel.GetLastPixelId(); ++iPix) {
567 
568  const fevt::Pixel& pixel = tel.GetPixel(iPix);
569  const fdet::Pixel& detPixel = detFD.GetPixel(pixel);
570  const fdet::Channel& detChannel = detFD.GetChannel(pixel); // mapped channel
571 
572  const double pixelSolid = detPixel.GetSolidAngle();
573  const double qEff = detPixel.GetQEfficiency().Y(normWavelength);
574  const double gain = detChannel.GetElectronicsGain();
575 
576  const fevt::PixelSimData& pixelSimData = pixel.GetSimData();
577  const TraceD& photonTrace = pixelSimData.GetPhotonTrace(fevt::FdConstants::eTotal);
578 
579  double pixelPhotons = 0;
580  for (unsigned int i = 0; i < photonTrace.GetSize(); ++i)
581  pixelPhotons += photonTrace[i];
582 
583  // this is really: nGenPhotons/cos(theta)
584  const double nGenPhotons = flux_drum_perp * diaArea * pixelSolid;
585 
586  const double epsilon = pixelPhotons / nGenPhotons;
587  const double epsilonErr = sqrt((epsilon - epsilon*epsilon) / nGenPhotons);
588 
589  // const double pixelSignal = pixelPhotons * qEff * gain; // add electronics [ph -> ADC]
590  // const double calib = flux_drum_perp * diaArea * pixelSolid / pixelSignal;
591 
592  const double calib = 1 / (epsilon * qEff * gain);
593  const double calibErr = epsilonErr / (epsilon * epsilon * qEff * gain);
594 
595  constants[iPix].calib = calib;
596  constants[iPix].calibErr = calibErr;
597  constants[iPix].nPhotGen = nGenPhotons;
598  constants[iPix].nPhotPixel = pixelPhotons;
599  constants[iPix].electronicsFactor = qEff * gain;
600  }
601  return constants;
602 }
603 
604 
607 {
608  return eSuccess;
609 }
610 
611 
612 // Configure (x)emacs for this file ...
613 // Local Variables:
614 // mode:c++
615 // compile-command: "make -C .. -k"
616 // End:
Telescope & GetTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Telescope by Id, throw exception if not existent.
Definition: FEvent/Eye.cc:57
unsigned int GetId() const
Definition: FEvent/Eye.h:54
double GetFADCBinSize() const
Point object.
Definition: Point.h:32
Description of the electronic channel for the 480 channels of the crate.
Header & GetHeader()
Definition: FEvent.h:92
Fluorescence Detector Eye Event.
Definition: FEvent/Eye.h:29
bool HasFEvent() const
unsigned int GetFirstPixelId() const
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
Definition: FDetector.cc:198
utl::TimeStamp GetTime() const
Get time pertaining to the detector description.
Definition: Detector.h:134
const std::string & GetConfigSignatureStr() const
EyeIterator EyesEnd(const ComponentSelector::Status status)
Definition: FEvent.h:66
double GetDiaphragmRadius() const
unsigned int GetEyeId() const
std::map< int, CalibResult > CalibrateTelescope(fevt::Telescope &tel)
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
PixelSimData & GetSimData()
Definition: FEvent/Pixel.h:35
void AddPhoton(const utl::Photon &p)
void MakeEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Definition: FEvent.cc:115
EyeIterator EyesBegin(const FDetComponentSelector::Type type=FDetComponentSelector::ePhysical) const
iterator pointing to first eye of given type (ePhysical, eVirtual, eAll)
Definition: FDetector.h:72
boost::filter_iterator< ComponentSelector, AllEyeIterator > EyeIterator
selective Eye iterators
Definition: FEvent.h:55
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
int gain
Definition: dump1090.h:241
double pow(const double x, const unsigned int i)
void MakeTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Telescope telescopeId.
Definition: FEvent/Eye.cc:102
double GetElectronicsGain() const
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
Detector description interface for FDetector-related data.
Definition: FDetector.h:44
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
bool HasCorrectorRing() const
flag for corrector ring presence
constexpr double deg
Definition: AugerUnits.h:140
void SetPhotonsStartTime(const utl::TimeStamp &ts)
double GetSolidAngle() const
The solid angle viewed by this pixel.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
fevt::TelescopeSimData & GetSimData()
Description of simulated data for one Telescope.
Class representing a document branch.
Definition: Branch.h:107
unsigned int GetLastPixelId() const
utl::CoordinateSystemPtr GetTelescopeCoordinateSystem() const
void SetTime(const utl::TimeStamp &time)
Definition: FEvent/Header.h:29
boost::filter_iterator< FDetComponentSelector, AllEyeIterator > EyeIterator
Definition: FDetector.h:69
Fluorescence Detector Pixel event.
Definition: FEvent/Pixel.h:28
const utl::TabulatedFunction & GetQEfficiency() const
Average quantum efficiency as a function of the wavelength.
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 Channel & GetChannel(const fevt::Channel &eventChannel) const
Get fdet::Channel from fevt::Channel.
Definition: FDetector.cc:161
const fdet::FDetector & GetFDetector() const
Definition: Detector.cc:131
const std::string & GetConfigSignature() const
boost::filter_iterator< ComponentSelector, AllTelescopeIterator > TelescopeIterator
selective Telescope iterators
Definition: FEvent/Eye.h:72
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
SizeType GetSize() const
Definition: Trace.h:156
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
Eye & GetEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
return Eye by id
Definition: FEvent.cc:70
double GetReferenceLambda() const
Definition: FDetector.cc:332
boost::filter_iterator< TelIsCommissioned, InternalConstTelescopeIterator > TelescopeIterator
An iterator over telescopes.
Definition: FDetector/Eye.h:76
Pixel & GetPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Pixel by Id, throw exception if not existent.
Detector description interface for Telescope-related data.
A TimeInterval is used to represent time elapsed between two events.
Definition: TimeInterval.h:43
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
unsigned int GetId() const
double GetDiaphragmArea() const
bool HasTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
Check if the telescope is in the event.
Definition: FEvent/Eye.cc:117
Description of a pixel.
utl::TraceD & GetPhotonTrace(const FdConstants::LightSource source=FdConstants::eTotal)
Simulated Photon Trace.
Definition: PixelSimData.h:37
Vector object.
Definition: Vector.h:30
constexpr double sr
Definition: AugerUnits.h:139
Main configuration utility.
Definition: CentralConfig.h:51
Fluorescence Detector Telescope Event.
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
void SetTime(const utl::TimeInterval &t)
Definition: Photon.h:36
void SetNumberOfPhotonBins(const int n)
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
constexpr double m
Definition: AugerUnits.h:121
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
map< int, CalibResult > CalibrateTelescope(TChain *data)
Definition: DrumCalib.cc:210
Fluorescence Detector Pixel Simulated Data.
Definition: PixelSimData.h:28
constexpr double cm2
Definition: AugerUnits.h:118
EyeIterator EyesEnd(const FDetComponentSelector::Type type=FDetComponentSelector::ePhysical) const
iterator pointing to end of available eyes of given type (ePhysical, eVirtual, eAll) ...
Definition: FDetector.h:76

, generated on Tue Sep 26 2023.