8 #include <utl/ErrorLogger.h>
9 #include <utl/Reader.h>
10 #include <utl/TimeStamp.h>
11 #include <utl/UTCDateTime.h>
12 #include <utl/TabulatedFunction.h>
13 #include <utl/MathConstants.h>
14 #include <utl/String.h>
16 #include <fwk/CentralConfig.h>
18 #include <evt/Event.h>
20 #include <evt/DefaultShowerGeometryProducer.h>
22 #include <fevt/FEvent.h>
24 #include <fevt/Telescope.h>
25 #include <fevt/TelescopeSimData.h>
26 #include <fevt/PixelSimData.h>
27 #include <fevt/Pixel.h>
29 #include <det/Detector.h>
31 #include <fdet/FDetector.h>
33 #include <fdet/Telescope.h>
34 #include <fdet/Pixel.h>
35 #include <fdet/Camera.h>
37 using namespace MeanNpeFillerKG;
59 info <<
"Npelevels must be set! Abort Simulation.";
75 ostringstream configSS;
76 configSS <<
"TelescopeSimulatorKG";
78 configSS <<
"(camera-shadow / support-shadow / mercedes) = ("
79 << (
true ?
"yes" :
"no") <<
" / "
80 << (
true ?
"yes" :
"no") <<
" / "
81 << (
true ?
"yes" :
"no") <<
")";
82 fGeneralConfigSignature = configSS.str();
86 if (fVerbosityLevel) {
87 info <<
"verbosity level: " << fVerbosityLevel <<
"\n"
88 "Used Npe values: " <<
Join(
" ", fNpe);
92 Detector::GetInstance().Update(
UTCDateTime(2012,1,1,0,0,0).GetTimeStamp());
101 if (fRunNumber > fMaxRunNumber){
103 msg <<
"Reached maximum run number. Exit!";
108 const double meanPe = fNpe[(fRunNumber-1) % fNpe.size()];
110 if (fVerbosityLevel >= 1) {
112 msg <<
"This is run number: " << fRunNumber <<
" meanPe = " << meanPe;
124 const Detector& detector = Detector::GetInstance();
127 FEvent& fEvent =
event.GetFEvent();
129 if (fVerbosityLevel >= 1) {
131 msg <<
"Eye: "<< fEye <<
" Tel: "<< fTel;
149 for (
unsigned int pixelId = 1; pixelId <= 440; ++pixelId) {
156 const double qEffAtNormWavelength = qEff.
Y(normWavelength);
159 const double backphotons = meanPe / qEffAtNormWavelength;
Telescope & GetTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Telescope by Id, throw exception if not existent.
Branch GetTopBranch() const
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
Class to hold collection (x,y) points and provide interpolation between them.
bool HasSimShower() const
#define INFO(message)
Macro for logging informational messages.
PixelSimData & GetSimData()
void MakeEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
const std::string & GetConfigSignatureStr(const std::string &module) const
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
void MakeTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Telescope telescopeId.
Detector description interface for FDetector-related data.
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
void SetMeanBgPhotonFlux(const double mean)
Set mean bg photon flux.
void SetConfigSignatureStr(const std::string &configSignatureStr)
oss<< "0b";oss<< ((x >> i)&1);return oss.str();}template< class S, class V > std::string Join(const S &sep, const V &v)
void MakePixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Pixel telescopeId.
fevt::TelescopeSimData & GetSimData()
Description of simulated data for one Telescope.
Class representing a document branch.
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
Fluorescence Detector Pixel event.
const utl::TabulatedFunction & GetQEfficiency() const
Average quantum efficiency as a function of the wavelength.
Top of the hierarchy of the detector description interface.
const fdet::FDetector & GetFDetector() const
void GetData(bool &b) const
Overloads of the GetData member template function.
Top of Fluorescence Detector event hierarchy.
Eye & GetEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
return Eye by id
double GetReferenceLambda() const
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.
ResultFlag
Flag returned by module methods to the RunController.
const Telescope & GetTelescope(const fevt::Telescope &eventTel) const
Get fdet::Telescope from fevt::Telescope.
void MakeSimShower(const evt::VShowerGeometryProducer &p)
Fluorescence Detector Telescope Event.
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.
Fluorescence Detector Pixel Simulated Data.