17 #include <utl/Reader.h>
18 #include <utl/ErrorLogger.h>
19 #include <utl/AugerUnits.h>
20 #include <utl/MathConstants.h>
22 #include <utl/PhysicalConstants.h>
23 #include <utl/RandomEngine.h>
24 #include <utl/TabulatedFunction.h>
25 #include <utl/TabulatedFunctionErrors.h>
26 #include <utl/Trace.h>
27 #include <utl/TraceAlgorithm.h>
28 #include <utl/MultiTabulatedFunction.h>
29 #include <utl/AugerException.h>
30 #include <utl/Md5Signature.h>
32 #include <fwk/CentralConfig.h>
33 #include <fwk/RandomEngineRegistry.h>
35 #include <det/Detector.h>
36 #include <fdet/FDetector.h>
38 #include <fdet/Telescope.h>
39 #include <fdet/Channel.h>
40 #include <fdet/Pixel.h>
41 #include <fdet/Mirror.h>
42 #include <fdet/Filter.h>
43 #include <fdet/Camera.h>
45 #include <evt/Event.h>
47 #include <fevt/FEvent.h>
49 #include <fevt/Telescope.h>
50 #include <fevt/TelescopeSimData.h>
51 #include <fevt/PixelSimData.h>
52 #include <fevt/Pixel.h>
53 #include <fevt/ChannelSimData.h>
54 #include <fevt/Channel.h>
56 #include <CLHEP/Random/RandPoisson.h>
57 #include <CLHEP/Random/RandGauss.h>
61 using namespace FdElectronicsSimulatorOG;
71 using CLHEP::RandGauss;
72 using CLHEP::RandPoisson;
78 fUseMonitoring(false),
79 fThresholdBoxCarReducedInMon(true),
80 fUseNewThreshold(false),
81 fThresholdMode(false),
97 &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
100 if (topB.
GetChild(
"verbosityLevel"))
104 if (topB.
GetChild(
"NoPeFluctuations")) {
110 if (topB.
GetChild(
"NoAntiAliasingFilter")) {
115 if (topB.
GetChild(
"thresholdMode")) {
119 if (topB.
GetChild(
"useNewThreshold"))
129 string configSignature = thresholdSignature.begin()->second;
130 fSimThresholdValues.insert(std::pair<string, TabulatedFunction>(configSignature, thresholdValues));
138 if (topB.
GetChild(
"thresholdBoxCarReducedInMon")) {
151 info <<
" PE fluctuations: OFF\n";
153 info <<
" Anti-aliasing filer: OFF\n";
166 ERROR (
"Event has no FEvent.");
173 INFO (
"Drum calibration mode!");
176 FEvent& fEvent =
event.GetFEvent();
186 bool eyeHasAtLeastOneGoodTelescope =
false;
190 info <<
" Eye=" << eyeEvent.
GetId();
203 info <<
" Eye=" << eyeEvent.
GetId() <<
" Tel=" << telEvent.
GetId();
217 info <<
" Eye=" << eyeEvent.
GetId()
218 <<
" Tel=" << telEvent.
GetId()
219 <<
" Pix=" << iPixel->GetId();
223 if (iPixel->HasSimData()) {
228 eyeHasAtLeastOneGoodTelescope =
true;
239 if (!eyeHasAtLeastOneGoodTelescope)
262 bool telHasAtLeastOneValidPixel =
false;
272 map<int, double> gainOfPixel;
273 for (
unsigned int pixelId=1; pixelId<=nPixels; pixelId++) {
285 gainOfPixel[pixelId] = absGain;
294 for (
unsigned int pixelId=1; pixelId<=nPixels; pixelId++) {
313 ostringstream errorMsg;
314 errorMsg<<
"Could not find calibration for eye=" << pix.
GetEyeId()
323 warn <<
" bad calibration data for eye " << pix.
GetEyeId()
326 warn <<
" setting fevt::PixelStatus to DeSelected..."<<endl;
331 telHasAtLeastOneValidPixel =
true;
333 const double caliconst =
335 const double opticalEfficiencyCorrection =
340 err <<
"\n **************************************************************************\n"
341 <<
" **************************************************************************\n"
342 <<
" ERROR caliconst=0 of pixelId=" << pixelId
344 <<
" **************************************************************************\n"
345 <<
" **************************************************************************";
352 const double backphotons =
357 const double absGain = gainOfPixel[pixelId];
361 <<
" PeToADC=" << absGain
362 <<
" hasCorrector=" << hasCorrector
363 <<
" caliconst=" << caliconst
391 meanBgPe /= calibCorrection * calibCorrection;
401 double threshold = 0;
408 threshold = (int) detChannel.
GetThreshold()*fltBoxCarSize;
416 ADCVar = ( meanBgPe * (1 + gainVariance) * absGain*absGain )
420 const double baseN = baseline * fltBoxCarSize;
421 const double sigmaN =
sqrt(ADCVar * fltBoxCarSize);
422 const double referenceADCBinSize = 100*
ns;
426 const unsigned int equivalentBoxCarSize =
427 fltBoxCarSize * (cameraADCBinSize/referenceADCBinSize);
428 const double equivalentMeanPe =
431 equivalentBoxCarSize,
432 gainVariance) + baseN;
436 threshold += fltBoxCarSize * baseline;
441 threshold = baseline*fltBoxCarSize +
sqrt(ADCVar)*3 + 1;
450 threshold = int(baseline*fltBoxCarSize + (threshold-baseline*fltBoxCarSize)*calibCorrection + .5);
451 ADCVar *= calibCorrection * calibCorrection;
461 cout <<
" pixelId=" << pixelId
462 <<
" gain=" << absGain
464 <<
" base=" << baseline
465 <<
" thresh=" << threshold
466 <<
" ph_bg=" << backphotons
467 <<
" meanPE=" << meanBgPe
468 <<
" num=" << fltBoxCarSize
469 <<
" caliCorr=" << calibCorrection
477 if (!telHasAtLeastOneValidPixel)
480 warn <<
"********** All pixels of tel=" << tel.
GetId() <<
" at eye=" << tel.
GetEyeId()
481 <<
" have invalid calibration constants -> switch OFF telescope **********";
503 const unsigned int adcTriggerBin = (
unsigned int)(SLTbin / adcBinsPer100ns);
510 + (fadcTraceLength-adcTriggerBin);
514 const unsigned int workTraceSize = traceSize + 2*nSafety;
516 const unsigned int binShift = adcTriggerBin + nSafety;
526 map<unsigned int, vector<double>> traceMap;
529 for (
unsigned int pixelId=1; pixelId<=detTel.
GetLastPixelId(); pixelId++) {
541 const unsigned int channelId = detChannel.
GetId();
552 <<
" telId=" << tel.
GetId()
553 <<
" pixelId=" << pixelId
554 <<
" channelId=" << channelId
555 <<
" SLTbin=" << SLTbin
556 <<
" FADClength=" << fadcTraceLength
558 <<
" simElecTrace=" << traceSize
564 if (traceMap.count(channelId)!=0) {
565 ERROR(
"*** normal camera channel is used twice !!! ***");
567 vector<double> originalChannelTrace(workTraceSize, 0);
568 traceMap[channelId] = originalChannelTrace;
570 vector<double> originalChannelTraceVirtual(workTraceSize, 0);
571 if (traceMap.count(virtualChannelId)==0) {
572 traceMap[virtualChannelId] = originalChannelTraceVirtual;
576 vector<double>& tracePix = traceMap[channelId];
577 vector<double>& traceVPix = traceMap[virtualChannelId];
582 vector<double> gaussRandomArray(workTraceSize);
584 &gaussRandomArray.front(), 0., 1.);
587 TraceD const * photonTraceOrg = 0;
588 unsigned int photonSize = 0;
591 photonSize = photonTraceOrg->
GetSize();
593 cout <<
"photonSize=" << photonSize << endl;
594 if (photonSize+binShift > workTraceSize) {
595 ERROR (
" ***** simulated photon trace will be truncated!!!! ****");
600 for (
unsigned int ti=0; ti<workTraceSize; ti++) {
604 if (photonTraceOrg && ti>=binShift) {
605 const unsigned int ti_shift = ti-binShift;
606 if (ti_shift<photonSize) {
607 nPePh = (*photonTraceOrg)[ti_shift] * quantEff;
615 double nPe = nPePh + meanPeBgr;
618 cout <<
"pe-noise: channelId=" << channelId
619 <<
" virt-channelId=" << virtualChannelId
622 <<
" nPePh=" << nPePh
623 <<
" meanPeBgr=" << meanPeBgr
625 <<
" gauss=" << gaussRandomArray[ti]
626 <<
" gainVariance=" << gainVariance
634 nPe += gaussRandomArray[ti] *
sqrt(nPe * gainVariance);
638 traceVPix[ti] += nPe;
655 const int maxADC = (1<<fadcDynamicRange) - 1;
657 for (
auto& iChannelMap : traceMap) {
659 const unsigned int channelId = iChannelMap.first;
660 vector<double>& channelTrace = iChannelMap.second;
661 const unsigned int binMax = channelTrace.size();
667 const double noiseEqBdw = 0.5*cutoffFrequency*
sqrt(
kPi/log(2.0));
668 const double samplingFrequency = 1./timeBinSize;
669 const double analogElectronicsFactor = 2. * noiseEqBdw / samplingFrequency;
671 const double sqrtNoiseVar =
sqrt(elecNoiseVariance / analogElectronicsFactor *
676 cout <<
"channelId=" << channelId
677 <<
" sqrtNoiseVar=" << sqrtNoiseVar
678 <<
" workTraceSize=" << workTraceSize
679 <<
" nSafety=" << nSafety
680 <<
" binMax=" << binMax
681 <<
" fadcConvert=" << fadcConvert
686 vector<double> elecNoiseArray(workTraceSize);
688 &elecNoiseArray.front(), 0., sqrtNoiseVar);
691 for (
unsigned int ti=0; ti<binMax; ti++) {
692 channelTrace[ti] *= fadcConvert;
693 channelTrace[ti] += elecNoiseArray[ti];
697 vector<double> convolutedPMTTrace(traceSize, 0.);
702 for (
unsigned int ti=0; ti<traceSize; ti++) {
703 convolutedPMTTrace[ti] = channelTrace[ti+nSafety];
709 double calibCorrection = 1;
714 baseline = pxsimdata.
GetMean();
718 for (
unsigned int ti=0; ti<traceSize; ti++) {
719 convolutedPMTTrace[ti] *= calibCorrection;
739 for (
unsigned int ti=0; ti<traceSize; ti++) {
740 digitTrace[ti] = min(
max(0,
int(convolutedPMTTrace[ti] + baseline + 0.5)), maxADC);
755 const double tau =
sqrt(log(2.)) / (
kTwoPi * cutoffFrequency);
756 const double noiseEqBdw = 0.5 * cutoffFrequency *
sqrt(
kPi/log(2.));
757 const double samplingFrequency = 1./timeBinSize;
758 const double analogElectronicsFactor = 2 * noiseEqBdw / samplingFrequency;
762 const double epsilon = 1e-6;
763 const int maxIter = 50;
767 double sumESquare = 0.;
770 while ( sumE < 1 - epsilon &&
773 const double t1 = (iter - 0.5) * timeBinSize;
774 const double t2 = (iter + 0.5) * timeBinSize;
776 const double E1 = 0.5 * erf(t1 / (
sqrt(2.)*tau));
777 const double E2 = 0.5 * erf(t2 / (
sqrt(2.)*tau));
778 const double E = E2 - E1;
796 msg <<
" Error filling fErrFuncFactors !!! iter="
797 << iter <<
", sumE=" << sumE;
811 vector<double>& convolutedTrace,
812 unsigned int timeOffset)
814 const int convolutedTraceSize = convolutedTrace.size();
815 const int originialTraceSize = originalTrace.size();
819 if ( originialTraceSize-convolutedTraceSize < 2*(nConv-1) ) {
822 msg <<
" Trace size mismatch!!! "
823 << convolutedTraceSize <<
" " << originialTraceSize <<
" " <<
fErrFuncFactors.size();
828 for (
int i=-nConv+1; i<nConv; ++i ) {
830 for (
int tConv = 0; tConv<convolutedTraceSize; ++tConv ) {
831 const int tOrig = tConv + timeOffset + i;
832 convolutedTrace[tConv] += w * originalTrace[tOrig];
849 const int peTableSize = 12;
850 const double maxNpe = 10000.0;
851 const double vecNpe[peTableSize] = { 2.0, 3.0, 5.0, 10.0, 20.0, 30.0, 50.0, 100.0, 200.0, 500.0, 2000.0, 10000.0};
854 const int maxSamples = 20;
855 const double fgThrFactPG00[maxSamples][peTableSize] = {
856 {5.62553, 5.47466, 5.22473, 4.95916, 4.76080, 4.67745, 4.58724, 4.49212, 4.42888, 4.36924, 4.31726, 4.27359},
857 {5.33020, 5.14876, 4.95916, 4.76080, 4.62016, 4.55890, 4.49212, 4.42888, 4.38149, 4.33885, 4.30203, 4.26984},
858 {5.14876, 4.97170, 4.83641, 4.67745, 4.55890, 4.50640, 4.45387, 4.39864, 4.36009, 4.32552, 4.29530, 4.26818},
859 {5.01369, 4.88375, 4.76080, 4.62016, 4.52161, 4.47194, 4.42888, 4.38149, 4.34717, 4.31726, 4.29122, 4.26718},
860 {4.95916, 4.83641, 4.71542, 4.58724, 4.49212, 4.45387, 4.41152, 4.36924, 4.33885, 4.31192, 4.28845, 4.26650},
861 {4.88375, 4.78669, 4.67745, 4.55890, 4.47194, 4.43772, 4.39864, 4.36009, 4.33231, 4.30772, 4.28642, 4.26600},
862 {4.83906, 4.75062, 4.64813, 4.53423, 4.45954, 4.42361, 4.38857, 4.35303, 4.32738, 4.30466, 4.2848, 4.26562},
863 {4.81387, 4.71102, 4.62016, 4.52161, 4.44715, 4.41481, 4.38149, 4.34717, 4.32337, 4.30203, 4.28353, 4.26531},
864 {4.78669, 4.69794, 4.60003, 4.50640, 4.43772, 4.40640, 4.37459, 4.34290, 4.32022, 4.30000, 4.28248, 4.26505},
865 {4.76080, 4.67745, 4.58724, 4.49212, 4.42889, 4.39864, 4.36924, 4.33885, 4.31726, 4.29813, 4.28158, 4.26483},
866 {4.73603, 4.65687, 4.56868, 4.48066, 4.42147, 4.39268, 4.36448, 4.33546, 4.31500, 4.29665, 4.28079, 4.26465},
867 {4.71102, 4.63861, 4.55890, 4.47194, 4.41482, 4.38738, 4.36009, 4.33231, 4.31285, 4.29530, 4.28011, 4.26449},
868 {4.69514, 4.62323, 4.54854, 4.46522, 4.40773, 4.38301, 4.35605, 4.32974, 4.31094, 4.29409, 4.27952, 4.26435},
869 {4.68729, 4.61054, 4.53423, 4.45954, 4.40377, 4.37855, 4.35303, 4.32738, 4.30918, 4.29303, 4.27898, 4.26422},
870 {4.67745, 4.60003, 4.52760, 4.45387, 4.39865, 4.37460, 4.35001, 4.32552, 4.30772, 4.29210, 4.27851, 4.26410},
871 {4.66370, 4.59111, 4.52161, 4.44715, 4.39506, 4.37123, 4.34717, 4.32337, 4.30649, 4.29122, 4.27809, 4.26400},
872 {4.64398, 4.58317, 4.51415, 4.44087, 4.39013, 4.36829, 4.34518, 4.32175, 4.30512, 4.29046, 4.27769, 4.26391},
873 {4.63861, 4.57557, 4.50640, 4.43772, 4.38739, 4.36546, 4.34290, 4.32022, 4.30409, 4.28970, 4.27734, 4.26382},
874 {4.63335, 4.56769, 4.49896, 4.43135, 4.38454, 4.36238, 4.34077, 4.31873, 4.30305, 4.28904, 4.27700, 4.26374},
875 {4.62016, 4.55890, 4.49212, 4.42888, 4.38149, 4.36009, 4.33885, 4.31726, 4.30203, 4.28845, 4.27670, 4.26367}
880 const double fgThrFactPG41[maxSamples][peTableSize] = {
881 {5.47757, 5.18121, 4.90285, 4.69526, 4.55630, 4.50512, 4.45118, 4.39478, 4.35642, 4.32268, 4.29289, 4.27359},
882 {5.16834, 4.92291, 4.74034, 4.56101, 4.47433, 4.43379, 4.39478, 4.35647, 4.32962, 4.30570, 4.28452, 4.26984},
883 {4.99797, 4.83452, 4.64616, 4.50969, 4.43384, 4.40344, 4.37184, 4.33990, 4.31792, 4.29814, 4.28077, 4.26818},
884 {4.92332, 4.74995, 4.60145, 4.47870, 4.41033, 4.38180, 4.35648, 4.32966, 4.31063, 4.29349, 4.27855, 4.26718},
885 {4.87796, 4.71279, 4.56867, 4.45550, 4.39485, 4.37185, 4.34742, 4.32287, 4.30584, 4.29056, 4.27699, 4.26650},
886 {4.80947, 4.67208, 4.54720, 4.43799, 4.38185, 4.36244, 4.33991, 4.31796, 4.30203, 4.28824, 4.27589, 4.26600},
887 {4.79474, 4.65794, 4.53000, 4.42349, 4.37572, 4.35394, 4.33437, 4.31401, 4.29925, 4.28651, 4.27502, 4.26562},
888 {4.75745, 4.63742, 4.51394, 4.41430, 4.36841, 4.34784, 4.32967, 4.31068, 4.29710, 4.28511, 4.27431, 4.26531},
889 {4.72165, 4.61372, 4.50083, 4.40739, 4.36249, 4.34402, 4.32560, 4.30817, 4.29538, 4.28396, 4.27372, 4.26505},
890 {4.71184, 4.60127, 4.48892, 4.39867, 4.35654, 4.33992, 4.32288, 4.30589, 4.29363, 4.28298, 4.27324, 4.26483},
891 {4.69720, 4.58849, 4.47548, 4.39364, 4.35292, 4.33668, 4.32026, 4.30401, 4.29233, 4.28209, 4.27282, 4.26465},
892 {4.68197, 4.56997, 4.46975, 4.38555, 4.34789, 4.33354, 4.31797, 4.30207, 4.29126, 4.28137, 4.27244, 4.26449},
893 {4.66760, 4.56238, 4.46344, 4.38306, 4.34539, 4.33087, 4.31584, 4.30070, 4.29019, 4.28071, 4.27212, 4.26435},
894 {4.65437, 4.55571, 4.45383, 4.37930, 4.34268, 4.32835, 4.31402, 4.29930, 4.28931, 4.28013, 4.27182, 4.26422},
895 {4.64203, 4.54710, 4.45082, 4.37543, 4.33997, 4.32561, 4.31219, 4.29833, 4.28839, 4.27959, 4.27157, 4.26410},
896 {4.63008, 4.53821, 4.44349, 4.37190, 4.33721, 4.32432, 4.31069, 4.29714, 4.28761, 4.27915, 4.27134, 4.26400},
897 {4.61792, 4.52983, 4.43929, 4.36876, 4.33495, 4.32208, 4.30926, 4.29630, 4.28699, 4.27872, 4.27112, 4.26391},
898 {4.60487, 4.52228, 4.43568, 4.36588, 4.33359, 4.32067, 4.30817, 4.29542, 4.28640, 4.27829, 4.27092, 4.26382},
899 {4.59857, 4.51564, 4.42911, 4.36302, 4.33156, 4.31938, 4.30699, 4.29457, 4.28581, 4.27794, 4.27074, 4.26374},
900 {4.59471, 4.50988, 4.42631, 4.35986, 4.32972, 4.31798, 4.30589, 4.29368, 4.28526, 4.27759, 4.27058, 4.26367}
903 if ( nSamp > maxSamples ) {
905 msg <<
" number of samples to large "
906 << nSamp <<
" max=" << maxSamples;
911 if ( npe > maxNpe ) {
913 msg <<
" number of photo electrons to high "
914 << npe <<
" max=" << maxNpe;
921 for (
int i=0; i<peTableSize; i++)
927 if (i2 == peTableSize)
931 double fac00 = (fgThrFactPG00[nSamp-1][i2]
932 - fgThrFactPG00[nSamp-1][i1])/(log(vecNpe[i2])
933 - log(vecNpe[i1])) * (log(npe) - log(vecNpe[i1]));
935 fac00 += fgThrFactPG00[nSamp-1][i1];
937 double fac41 = (fgThrFactPG41[nSamp-1][i2] - fgThrFactPG41[nSamp-1][i1])
938 /(log(vecNpe[i2]) - log(vecNpe[i1]))*(log(npe) - log(vecNpe[i1]));
940 fac41 += fgThrFactPG41[nSamp-1][i1];
942 const double fac = fac00 + (fac41 - fac00)*gainVariance/0.41;
std::vector< double > fErrFuncFactors
Status GetStatus() const
Get the pixel status flag.
unsigned int GetId() const
void MakeFADCTrace(unsigned int size, double binning, const FdConstants::LightSource source=FdConstants::eTotal)
double GetThreshold() const
bool InitCamera(fevt::Telescope &tel)
unsigned int GetNPoints() const
ComponentSelector::Status GetStatus() const
double GetFADCBinSize() const
double GetBaseline() const
void SetNumSamples(const int nSamp)
Set the no. of samples for running sums.
Description of the electronic channel for the 480 channels of the crate.
void DoTimeConvolution(const std::vector< double > &originalTrace, std::vector< double > &convolutedTrace, unsigned int timeOffset)
Report success to RunController.
bool fDoAntiAliasingFilter
int GetNumberOfPhotonBins() const
Base class for all exceptions used in the auger offline code.
Fluorescence Detector Eye Event.
const utl::TabulatedFunction & GetEndToEndCalibrationConstant() const
end to end calibration function
RandomEngineType & GetEngine()
void SetStatus(const ComponentSelector::Status status)
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
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.
int GetADCDynamicRange() const
void PrepareTimeConvolution(const fdet::Telescope &detTel)
double GetElectronicNoiseVariance() const
double GetCutoffFrequency() const
double GetMeanBgPhotonFlux() const
Get mean bg photon flux.
std::map< int, double > fCalibCorrection
std::map< std::string, std::string > AttributeMap
EyeIterator EyesEnd(const ComponentSelector::Status status)
unsigned int GetEyeId() const
double GetSimulatedEndToEndCalibration(const std::string &configSignature) const
for the simulated end-to-end calibration constant
const Channel & GetChannel(const unsigned int channelId) const
Get Channel by id, throw utl::NonExistentComponentException if n.a.
#define INFO(message)
Macro for logging informational messages.
PixelSimData & GetSimData()
bool HasFADCTrace(const FdConstants::LightSource source) const
Check that source /par source is present.
boost::filter_iterator< ComponentSelector, AllEyeIterator > EyeIterator
selective Eye iterators
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
bool HasPhotonTrace(const FdConstants::LightSource source) const
Check that trace for source /par source is present.
Fluorescence Detector Channel Simulated Data Event.
double GetEndToEndCalibrationConstantAtReferenceWavelength() const
calA(+drum) constant is returned
std::string GetVersionInfo(const VersionInfoType v) const
Retrieve different sorts of module version info.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
double GetElectronicsGain() const
ChannelSimData & GetSimData()
void SetStatus(const ComponentSelector::Status status)
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
int GetFLTBoxcarSumLength() const
PixelIterator PixelsEnd()
iterator pointing to end of available pixels of status eHasData (DEPRECATED)
Detector description interface for FDetector-related data.
bool HasCorrectorRing() const
flag for corrector ring presence
std::map< std::string, utl::TabulatedFunction > fSimThresholdValues
Exception for reporting variable out of valid range.
AttributeMap GetAttributes() const
Get a map<string, string> containing all the attributes of this Branch.
void ElecSim(fevt::Telescope &tel)
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.
unsigned int GetLastPixelId() const
Channel & GetChannel(const unsigned int channelId)
utl::RandomEngine * fRandomEngine
Fluorescence Detector Pixel event.
const utl::TabulatedFunction & GetQEfficiency() const
Average quantum efficiency as a function of the wavelength.
std::map< int, double > fPeBgNoiseTable
TelescopeIterator TelescopesEnd()
first available tel of status eHasData (DEPRECATED)
double abs(const SVector< n, T > &v)
void SetMean(const double mean)
Set the ADC baseline.
std::map< int, double > fQEffAtNormWavelength
std::map< int, double > fOpticalEfficiencyCorrection
EyeIterator EyesBegin(const ComponentSelector::Status status)
const Channel & GetChannel(const fevt::Channel &eventChannel) const
Get fdet::Channel from fevt::Channel.
const std::string & GetConfigSignature() const
unsigned int GetId() const
utl::TraceI & GetFADCTrace(const FdConstants::LightSource source=FdConstants::eTotal)
boost::filter_iterator< ComponentSelector, AllTelescopeIterator > TelescopeIterator
selective Telescope iterators
#define WARNING(message)
Macro for logging warning messages.
Fluorescence Detector Channel Event.
void GetData(bool &b) const
Overloads of the GetData member template function.
Top of Fluorescence Detector event hierarchy.
TelescopeIterator TelescopesBegin()
first available tel of status eHasData (DEPRECATED)
double GetGainVariance() const
unsigned int GetEyeId() const
void MakeChannel(const unsigned int channelId)
double GetReferenceLambda() const
unsigned int GetTelescopeId() const
void SetStatus(ComponentSelector::Status status)
bool fThresholdBoxCarReducedInMon
void SetThreshold(const int thr)
Set the simulated trigger threshold of the pixel.
Pixel & GetPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Pixel by Id, throw exception if not existent.
double EvalRedThreshold(double npe, int nSamp, double gainVariance)
boost::filter_iterator< ComponentSelector, AllPixelIterator > PixelIterator
selective Pixel iterators
Detector description interface for Telescope-related data.
ResultFlag
Flag returned by module methods to the RunController.
bool HasChannel(const unsigned int channelId) const
const Telescope & GetTelescope(const fevt::Telescope &eventTel) const
Get fdet::Telescope from fevt::Telescope.
unsigned int GetId() const
void SetRMS(const double rms)
Set the ADC variance.
double GetMean() const
Get the ADC baseline.
unsigned int GetVirtualChannelId() const
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
utl::TraceD & GetPhotonTrace(const FdConstants::LightSource source=FdConstants::eTotal)
Simulated Photon Trace.
Report failure to RunController, causing RunController to terminate execution.
Main configuration utility.
double GetADCVariance() const
Branch GetFirstChild() const
Get first child of this Branch.
Fluorescence Detector Telescope Event.
PixelIterator PixelsBegin()
iterator pointing to first available pixel of status eHasData (DEPRECATED)
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
std::string GetThresholdConfigSignature() const
#define ERROR(message)
Macro for logging error messages.
int GetFADCTraceLength() const
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
int GetSLTTriggerBin() const
Fluorescence Detector Pixel Simulated Data.
~FdElectronicsSimulator()
double GetOpticalEfficiencyCorrectionAtReferenceWavelength() const
optical efficiency correction is returned
unsigned int GetPixelId() const