11 #include <fwk/CentralConfig.h>
12 #include <fwk/RunController.h>
14 #include <utl/config.h>
15 #include <utl/Reader.h>
16 #include <utl/ErrorLogger.h>
17 #include <utl/AugerUnits.h>
19 #include <evt/Event.h>
21 #include <fevt/FEvent.h>
23 #include <fevt/Header.h>
24 #include <fevt/EyeHeader.h>
25 #include <fevt/EyeTriggerData.h>
26 #include <fevt/Telescope.h>
27 #include <fevt/Channel.h>
28 #include <fevt/ChannelRecData.h>
29 #include <fevt/Pixel.h>
30 #include <fevt/PixelRecData.h>
31 #include <fevt/PixelTriggerData.h>
32 #include <fevt/TelescopeTriggerData.h>
33 #include <fevt/SLTData.h>
35 #include <det/Detector.h>
38 #include <fdet/Telescope.h>
39 #include <fdet/Camera.h>
40 #include <fdet/Channel.h>
41 #include <fdet/Pixel.h>
42 #include <fdet/FDetector.h>
44 #include <utl/Trace.h>
45 #include <utl/TraceAlgorithm.h>
47 #include <AugerEvent.h>
48 #include <EyeEvent.hh>
49 #include <EyeEventHeader.hh>
50 #include <EyeT3Data.hh>
51 #include <FadcData.hh>
52 #include <FdNumbering.hh>
53 #include <FDEventLibVersion.hh>
59 using namespace FdCalibratorOG;
73 ERROR(
"Could not find branch FdCalibrator");
81 topB.
GetChild(
"recoverSaturatedTraces").
GetData(fRecoverSaturatedTraces);
86 if (fCalibrationCorrection.size() != 5) {
87 ERROR(
"Calibration Correction must have size of 5!");
94 " Version: " << GetVersionInfo(VModule::eRevisionNumber) <<
"\n"
96 " correct times: " << fCorrectTimes <<
"\n"
97 " first mean slot: " << fFirstMeanSlot <<
"\n"
98 " last mean slot: " << fLastMeanSlot <<
"\n"
99 " saturation recovery is " << (fRecoverSaturatedTraces ?
"on" :
"off") <<
"\n"
100 "Calibration correction: ";
101 for (
unsigned int i = 0; i < fCalibrationCorrection.size(); ++i)
102 info << fCalibrationCorrection[i] <<
' ';
105 for (
unsigned int i = 0; i < fCalibrationCorrection.size(); ++i) {
107 if (fCalibrationCorrection[i] != 1 && (i+1) != 5) {
109 warn <<
"Calibration correction of " << fCalibrationCorrection[i] <<
" "
110 "is applied to eye: " << i+1 <<
". "
115 if ((i+1) == 5 && fCalibrationCorrection[i] == 0)
116 INFO(
"HEAT calbration correction will be esimated using a parametrization");
126 return eContinueLoop;
128 AugerEvent& rawEvent =
event.GetRawEvent();
130 if (rawEvent.EyesBegin() != rawEvent.EyesEnd())
131 ++RunController::GetInstance().GetRunData().GetNamedCounters()[
"FdCalibrator/FdEvents"];
133 for (AugerEvent::EyeIterator eyeIter = rawEvent.EyesBegin();
134 eyeIter != rawEvent.EyesEnd(); ++eyeIter) {
136 TEyeEvent& eyeEvent = *eyeIter;
137 const unsigned int eyeNo = eyeEvent.GetEventHeader()->GetEyeNo();
138 #if FDEVENTLIB_VERSION_CODE < ModuleVersionCode(4, 0, 0)
142 msg <<
"Trying to read data with eye ids > 4 (HEAT) using an "
143 "FDEventLib older than v4r0. Old FDEventLibs do not support "
144 "HEAT data. I will skip this eye (id=" << eyeNo <<
").";
150 if (eyeNo == 5 && fCalibrationCorrection[eyeNo-1] == 0) {
151 const unsigned int gpsSec =
152 eyeEvent.GetEventHeader()->GetTimeStamp()->GetGPSSec();
153 fCalibrationCorrection[eyeNo-1] = GetHeatCalibrationCorrection(gpsSec);
156 if (ApplyTimeCorrections(event, eyeEvent)) {
157 FillTriggerData(event, eyeEvent);
158 FillChannelRecData(event, eyeEvent);
159 FillCalibratedPixels(event, eyeEvent);
160 FillDAQInformation(event, eyeEvent);
180 TEyeT3Data*
const t3Data = eyeEvent.GetT3Data();
181 TEyeEventHeader*
const eyeHeader = eyeEvent.GetEventHeader();
182 const int eyeId = eyeEvent.GetEventHeader()->GetEyeNo();
183 FEvent& fevent =
event.GetFEvent();
194 const TEyeEventHeader::EEventClass eventClass =
195 eyeHeader->GetEventClass();
196 const string eventClassString =
197 string(TEyeEventHeader::GetVerboseEventClass(eventClass));
203 t3Data->GetTimeAtGround());
209 WARNING(
"T3 time at ground seems to have an invalid value. "
210 "Setting it to zero.");
214 eyeTrig.
SetT3SDP(t3Data->GetSDPTheta(),
216 t3Data->GetAzimuthAtGround());
222 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
224 TEyePixelData* eyePixelData = eyeEvent.GetPixelData();
229 const unsigned int mirrorId = telIter->
GetId();
231 if (eyeHeader->IsMirrorDataPresent(mirrorId)) {
240 info <<
"Fill trigger-info for mirror: " << mirrorId;
247 warn <<
" Mirror " << mirrorId <<
" has already trigger-data. Skipping.";
262 vector<fevt::SLTData> sltData;
263 TMirrorPixelData*
const miPixelData = eyePixelData->GetPixelData(mirrorId);
265 for (
unsigned int t2bin = 0; t2bin < sltNumberOfBins; ++t2bin) {
267 for (
unsigned int col = 1; col <= 20; ++col) {
268 TMirrorPixelData::PixelDataWord word = miPixelData->GetPixelData(col, t2bin);
271 sltData.push_back(sltDataCol);
277 const unsigned int kNMultiplicityBins = 1000;
278 const double kMultiplicityBinSize = 100*
ns;
281 TMirrorPixelData::MultiplicityDataWord multiplicityData =
282 miPixelData->GetMultiplicityData();
286 info <<
"TLT multiplicity: ";
287 for (
unsigned int tbin = 0; tbin < kNMultiplicityBins; ++tbin) {
288 info << multiplicityData[tbin] <<
", ";
289 multiplicityTrace[tbin] = multiplicityData[tbin];
302 TEyePixelList*
const eyePixelList = eyeEvent.GetPixelList();
303 TEyeFADCData*
const eyeFADCData = eyeEvent.GetFADCData();
304 const unsigned int npixels = eyePixelList->GetNumPixels();
306 const int eyeId = eyeEvent.GetEventHeader()->GetEyeNo();
307 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
310 FEvent& fdEvent =
event.GetFEvent();
313 for (
unsigned int iPixel = 0; iPixel < npixels; ++iPixel) {
317 info <<
"copying trace for pixel: " << iPixel;
321 FdUtil::Fd::FdPixelNumber pixelNumber = eyePixelList->GetPixel(iPixel);
323 const unsigned int mirrorId = FdUtil::Fd::GetEyeMirrorNo(pixelNumber);
324 const unsigned int mirrorChannelId = FdUtil::Fd::GetMirrorPixelNo(pixelNumber);
331 const TFADCData*
const fadcData = eyeFADCData->GetFADCData(pixelNumber);
337 TFADCData::FADCDataWord fadcword = fadcData->GetFADCTrace();
345 const int adcOverFlow = (1 << fadcDynamicRange) - 1;
349 utl::TraceI rawFADCTrace(fadcBinLength, fadcBinSize);
351 const unsigned int startBin = fadcData->GetTraceStartBin();
352 const unsigned int endBin = fadcData->GetTraceEndBin();
362 bool isSaturated =
false;
363 bool firstSatBinSet =
false;
368 info <<
"trace data: ";
369 for (
unsigned int pos = startBin; pos <= endBin; ++pos) {
371 rawFADCTrace[pos] = int(FADCDataWordGetData(&fadcword[pos]));
373 if (rawFADCTrace[pos] >= adcOverFlow) {
375 if (!firstSatBinSet) {
376 firstSatBinSet =
true;
382 info << rawFADCTrace[pos] <<
", ";
411 WARNING(
"channel recdata exists! Not overwriting....");
425 TEyePixelList*
const eyePixelList = eyeEvent.GetPixelList();
426 TEyeFADCData*
const eyeFADCData = eyeEvent.GetFADCData();
427 TEyePixelData*
const eyePixelData = eyeEvent.GetPixelData();
428 const unsigned int npixels = eyePixelList->GetNumPixels();
430 const int eyeId = eyeEvent.GetEventHeader()->GetEyeNo();
431 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
434 FEvent& fdEvent =
event.GetFEvent();
438 info <<
"Eye " << eyeId <<
": nPixels=" << npixels;
439 int countSaturated = 0;
441 int countVirtuals = 0;
442 int countNoCalib = 0;
443 int countCalibrated = 0;
445 for (
unsigned int iPixel = 0; iPixel < npixels; ++iPixel) {
447 FdUtil::Fd::FdPixelNumber pixelNumber = eyePixelList->GetPixel(iPixel);
449 const unsigned int mirrorId = FdUtil::Fd::GetEyeMirrorNo(pixelNumber);
450 const unsigned int mirrorChannelId = FdUtil::Fd::GetMirrorPixelNo(pixelNumber);
468 const TFADCData*
const fadcData = eyeFADCData->GetFADCData(pixelNumber);
476 TFADCData::FADCDataWord fadcword = fadcData->GetFADCTrace();
481 const int adcOverFlow = (1 << fadcDynamicRange) - 1;
485 utl::TraceI rawFADCTrace(fadcBinLength, fadcBinSize);
486 utl::TraceB rawFLTtrace(fadcBinLength, fadcBinSize);
488 const unsigned int startBin = fadcData->GetTraceStartBin();
489 const unsigned int endBin = fadcData->GetTraceEndBin();
500 bool hasSaturated =
false;
503 for (
unsigned int pos = startBin; pos <= endBin; ++pos) {
505 #if FDEVENTLIB_VERSION_CODE >= ModuleVersionCode(4, 0, 5)
506 rawFLTtrace[pos] = bool(FADCDataWordGetPixelTrigger(&fadcword[pos]));
508 rawFLTtrace[pos] = bool(FADCDataWordPixelTrigger(&fadcword[pos]));
510 rawFADCTrace[pos] = int(FADCDataWordGetData(&fadcword[pos]));
512 if (rawFADCTrace[pos] >= adcOverFlow)
518 unsigned int pixelId = detChannel.
GetPixelId();
519 if (mirrorChannelId != pixelId) {
521 info <<
"remapped pixel during calibration: channel=" << mirrorChannelId
522 <<
" -> pixel=" << pixelId;
533 if (fRecoverSaturatedTraces)
534 RecoverSaturatedTrace(rawFADCTrace, pixel, tel);
543 triggerdata.
SetThreshold(fadcData->GetActualThreshold());
546 triggerdata.
SetMean(fadcData->GetMean());
548 triggerdata.
SetRate(fadcData->GetActualRate());
552 if (!ApplyCalibration(rawFADCTrace, pixel)) {
553 pixel.
SetStatus(ComponentSelector::eBadCalibration);
563 const TMirrorPixelData*
const miPixelData =
564 eyePixelData->GetPixelData(mirrorId);
567 ERROR(
"No TMirrorPixelData available in TEyePixelData!");
573 const int triggerpos =
574 miPixelData->GetFirstTriggeredTimeBin(FdUtil::Fd::GetColumnNo(FdUtil::Fd::GetPixelNumber(pixelNumber)),
575 FdUtil::Fd::GetRowNo(FdUtil::Fd::GetPixelNumber(pixelNumber)));
580 info <<
", nCal=" << countCalibrated <<
", nSat=" << countSaturated <<
", nNoCal=" << countNoCalib
581 <<
", nErr=" << countErrors <<
", nVirt=" << countVirtuals;
589 FEvent& fevent =
event.GetFEvent();
591 TEyeEventHeader*
const eyeHeader = eyeEvent.GetEventHeader();
592 const int eyeId = eyeHeader->GetEyeNo();
598 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
604 const unsigned int telId = iTel->
GetId();
606 if (eyeHeader->IsMirrorPresent(telId) &&
619 FEvent& fevent =
event.GetFEvent();
621 TEyeEventHeader*
const eyeHeader = eyeEvent.GetEventHeader();
622 const int eyeId = eyeHeader->GetEyeNo();
624 if (!fevent.
HasEye(eyeId))
628 if (eyeHeader->GetEventType() != TEyeEventHeader::kSimulated) {
630 #if FDEVENTLIB_VERSION_CODE >= ModuleVersionCode(2, 6, 0)
631 TEyeEventHeader::ETimeCorrectionQuality corrQuality =
632 eyeHeader->GetTimeCorrectionQuality();
633 const bool badCorrection = (corrQuality < TEyeEventHeader::kFullQuality);
636 eyeHeader->GetTimeCorrectionParameters(&t10, &offset);
637 const bool badCorrection = (t10 < 50 || t10 > 150);
646 CorrectFDTime(eyeHeader);
648 const unsigned int sec = eyeHeader->GetTimeStamp()->GetGPSSec();
649 const unsigned int nsec = eyeHeader->GetTimeStamp()->GetNanoSec();
662 FdRoot::TTimeStamp uninitializedTimeStamp(FdRoot::TTimeStamp::FromGPS(0, 0));
663 if (eyeHeader->GetTimeStamp()->GetUnixSec() <= uninitializedTimeStamp.GetUnixSec()) {
666 info <<
"correcting GPS second=" << eyeHeader->GetTimeStamp()->GetSec()
670 AdjustMirrorTimes(eyeHeader, fevent, fevent.
GetEye(eyeId));
672 info <<
" corrected GPS time: "
673 << eyeHeader->GetTimeStamp()->GetSec() <<
'\n';
676 if (eyeHeader->GetTimeStamp()->GetSec() <= uninitializedTimeStamp.GetUnixSec()) {
677 info <<
" ==> GPS correction failed - skipping eye!";
686 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
690 unsigned int sec = eyeHeader->GetTimeStamp()->GetGPSSec();
691 const unsigned int nsec = eyeHeader->GetTimeStamp()->GetNanoSec() + int(SD_FD_Offset);
695 if (sec >= 820374477 && sec < 822020847)
713 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
717 const int eyeId = detPixel.
GetEyeId();
718 const int pixelId = detPixel.
GetId();
731 if (!calibration || !calibration->
GetNPoints()) {
733 err <<
"Could not find calibration for eye " << eyeId
734 <<
" tel " << telId <<
" pix " << pixelId;
742 warn <<
" bad calibration data for eye " << eyeId
743 <<
" tel " << telId <<
" pix " << pixelId <<
" channel " << channelId
749 err <<
" unknown calibration status for eye " << eyeId
750 <<
" tel " << telId <<
" pix " << pixelId <<
" channel " << channelId
768 const TraceD baselineSubtractedTrace = (rawtrace - baseline);
776 WARNING(
"Pixel already calibrated ! Skipping!");
780 recdata.
MakePhotonTrace(baselineSubtractedTrace * bestCalibConst * fCalibrationCorrection[eyeId-1]);
798 const int eyeId = eyeHeader->GetEyeNo();
807 const unsigned int sec = eyeHeader->GetTimeStamp()->GetGPSSec();
808 const unsigned int nsec = eyeHeader->GetTimeStamp()->GetNanoSec();
823 eyeHeader->GetTimeStamp()->GetDate(kTRUE, 0, &year, &month, &day);
824 double iMonth = month + (year - 2004) * 12;
827 if (iMonth < timeCorrection.
GetX(0)) {
828 INFO(
"Warning - request for time correction before 2004");
829 iMonth = timeCorrection.
GetX(0);
830 }
else if (iMonth > timeCorrection.
GetX(timeCorrection.
GetNPoints() - 1)) {
831 INFO(
"Warning - request for time correction ouside range");
836 const float t_10 = (1. - timeCorrection.
Y(iMonth)) * 100.;
837 const float offset = 4.*
utl::ns;
839 cerr <<
" CorrectFDTime(): " << year <<
'/' << month <<
'/' << day <<
"\n"
840 " --> field: " << iMonth <<
" value: " << t_10 <<
"\n"
841 " before : " << eyeHeader->GetTimeStamp()->GetGPSSec()
842 <<
" s" << eyeHeader->GetTimeStamp()->GetNanoSec() <<
" ns\n";
844 eyeHeader->SetTimeCorrectionParameters(t_10, offset);
845 eyeHeader->AdjustMirrorTimes();
847 cerr <<
" after : " << eyeHeader->GetTimeStamp()->GetGPSSec()
848 <<
" s" << eyeHeader->GetTimeStamp()->GetNanoSec() <<
" ns" << endl;
858 FdRoot::TTimeStamp first(time_t(INT_MAX), 0);
859 UInt_t first_mirror = 0;
863 for (UInt_t i = 0; i < FdUtil::Fd::kEYE_NMIRRORS; ++i) {
864 const UInt_t j = i + FdUtil::Fd::kEYE_FIRST_MIRROR;
865 if (eyeHeader->IsMirrorDataPresent(j)) {
867 const FdRoot::TTimeStamp mirrorTimeStamp =
868 *eyeHeader->GetRawMirrorTimeStamp(j);
870 cerr <<
"\t FdCalibrator::AdjustMirrorTimes() -- mirror "
872 <<
", raw mirror time stamp "
873 << mirrorTimeStamp << endl;
875 if (mirrorTimeStamp < first) {
876 first = mirrorTimeStamp;
884 UInt_t sec_out, nsec_out;
886 eyeHeader->DoTimeCorrection(first.GetSec(), first.GetNanoSec(), &sec_out, &nsec_out);
890 FdRoot::TTimeStamp corrected(FdRoot::TTimeStamp::FromGPS(sec_out, nsec_out));
891 eyeHeader->SetTimeStamp(corrected);
893 const unsigned int sec = eyeHeader->GetTimeStamp()->GetGPSSec();
894 const unsigned int nsec = eyeHeader->GetTimeStamp()->GetNanoSec();
906 for (UInt_t i = 0; i < FdUtil::Fd::kEYE_NMIRRORS; ++i) {
908 const UInt_t j = i + FdUtil::Fd::kEYE_FIRST_MIRROR;
910 if (eyeHeader->IsMirrorDataPresent(j) && i != first_mirror) {
912 const FdRoot::TTimeStamp mirrorTimeStamp =
913 *eyeHeader->GetRawMirrorTimeStamp(j);
914 eyeHeader->DoTimeCorrection(mirrorTimeStamp.GetSec(),
915 mirrorTimeStamp.GetNanoSec(), &sec_out, &nsec_out);
918 UInt_t mirrorTimeOffset;
920 if (sec_out > UInt_t(eyeHeader->GetTimeStamp()->GetSec()))
921 mirrorTimeOffset = 1000000000 + nsec_out - eyeHeader->GetTimeStamp()->GetNanoSec();
923 mirrorTimeOffset = nsec_out - eyeHeader->GetTimeStamp()->GetNanoSec();
937 const unsigned int eyeId = telEvent.
GetEyeId();
938 const unsigned int telId = telEvent.
GetId();
940 const fdet::FDetector& detFD = det::Detector::GetInstance().GetFDetector();
946 const int adcOverFlow = (1 << fadcDynamicRange) - 1;
949 const unsigned int channelId = detChannel.
GetId();
961 vector<const ChannelRecData*> otherChannels;
962 vector<double> electronicGains;
967 const unsigned int thisChannelId = chanIter->GetId();
968 if (!chanIter->HasRecData())
975 if (thisChannelId == virtualChannelId) {
979 if ((startBin <= t1 && t1 <= endBin) ||
980 (startBin <= t2 && t2 <= endBin)) {
981 WARNING(
"trace recovery failed because virtual channel"
987 vChannelRecData = &recData;
990 }
else if (thisChannelId != channelId) {
992 const unsigned int thisVirtualChannelId =
995 if (thisVirtualChannelId == virtualChannelId) {
999 if ((startBin <= t1 && t1 <= endBin) ||
1000 (startBin <= t2 && t2 <= endBin)) {
1001 WARNING(
"more than one saturated channels in same time range!!");
1005 otherChannels.push_back(&recData);
1011 if (!vChannelRecData) {
1012 ERROR(
"Missing virtual channel data!!");
1021 for (
unsigned int pos = startBin; pos <= endBin; ++pos) {
1022 const int adcValue = rawFADCTrace[pos];
1023 if (adcValue >= adcOverFlow) {
1024 double otherChannelADCSum = 0;
1025 for (
unsigned int i = 0; i < otherChannels.size(); ++i) {
1027 const double adcValue = thisTrace[pos] - otherChannels[i]->GetBaseLine();
1028 otherChannelADCSum += adcValue/electronicGains[i];
1030 const double vADCBaseLineSub = virtualTrace[pos] - vChannelRecData->
GetBaseLine();
1031 const double recoveredSignal =
1032 (vADCBaseLineSub/virtualChannelGain - otherChannelADCSum) * channelGain;
1033 rawFADCTrace[pos] = int(recoveredSignal + 0.5);
1046 for (
unsigned int i = 0; i < fHeatCaliEpochs.size(); ++i) {
1047 if (fHeatCaliEpochs[i] > gpsSecond) {
1053 int lastBin = fHeatCaliEpochs.size() - 2;
1055 std::vector<double>
p;
1056 if (thisBin == -1) {
1057 for (
unsigned int i = 0; i < 3; ++i)
1058 p.push_back(fHeatCalibration[3*lastBin + i]);
1060 for (
unsigned int i = 0; i < 3; ++i)
1061 p.push_back(fHeatCalibration[3*thisBin + i]);
1069 unsigned int lastEpoch = fHeatCaliEpochs[lastBin+1];
1073 x = gpsSecond - 1016048411;
1075 x = lastEpoch - 1016048411;
1077 const double HEATcali =
1078 p[0] + p[1] * x + p[2] *
pow(x, 2);
Telescope & GetTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Telescope by Id, throw exception if not existent.
Branch GetTopBranch() const
Status GetStatus() const
Get the pixel status flag.
double StandardDeviation(const std::vector< double > &v, const double mean)
ChannelIterator ChannelsBegin()
void FillChannelRecData(evt::Event &event, TEyeEvent &eyeEvent)
unsigned int GetId() const
By default from 1..440.
Trigger data for an fevt::Eye.
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
unsigned int GetNPoints() const
void SetStop(const SizeType stop)
Set valid data stop bin.
double GetFADCBinSize() const
Description of trigger data for one Telescope.
Description of the electronic channel for the 480 channels of the crate.
bool HasTriggerData() const
const utl::TabulatedFunction & GetTimeCorrectionFactors() const
fevt::EyeHeader & GetHeader()
Header for this Eye Event.
unsigned int GetTelescopeId() const
1..6 for normal FD, 1..3 for HEAT
ChannelRecData & GetRecData()
Fluorescence Detector Eye Event.
const utl::TabulatedFunction & GetEndToEndCalibrationConstant() const
end to end calibration function
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
void SetThreshold(const int t)
utl::TimeStamp GetTime() const
Get time pertaining to the detector description.
Fluorescence Detector Pixel Trigger Data.
Class to hold collection (x,y) points and provide interpolation between them.
int GetADCDynamicRange() const
void SetT3Accepted(bool is)
void SetTimeOffset(const unsigned int toffset)
PixelTriggerData & GetTriggerData()
void SetT3SDP(double theta, double phi, double azimuthAtGround)
unsigned int GetEyeId() const
int GetLastSatBin() const
find last saturated bin for this channel
ChannelIterator ChannelsEnd()
const Channel & GetChannel(const unsigned int channelId) const
Get Channel by id, throw utl::NonExistentComponentException if n.a.
double GetEndToEndCalibrationAtReferenceWavelength() const
#define INFO(message)
Macro for logging informational messages.
void MakeEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Base class for exceptions trying to access non-existing components.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Detector description interface for Eye-related data.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
double pow(const double x, const unsigned int i)
void MakeTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Make Telescope telescopeId.
double GetElectronicsGain() const
void SetT3NPixels(unsigned int n)
void SetLowGainSaturation()
void SetRate(const double r)
const Camera & GetCamera() const
Get the Camera object that belongs to the telescope.
void SetT3Time(const utl::TimeStamp &time)
Detector description interface for FDetector-related data.
A TimeStamp holds GPS second and nanosecond for some event.
utl::TraceI & GetFADCTrace(const FdConstants::LightSource source=FdConstants::eTotal)
utl::TraceI & GetMultiplicity()
Exception for reporting variable out of valid range.
const Pixel & GetPixel(const unsigned int pixelId) const
Get Pixel by id, throw utl::NonExistentComponentException if n.a.
void RecoverSaturatedTrace(utl::TraceI &rawFADCTrace, fevt::Pixel &pixel, fevt::Telescope &telEvent)
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.
Class representing a document branch.
Exception to use in case requested data not found in the database with detailed printout.
utl::TraceD & GetPhotonTrace(const FdConstants::LightSource source=FdConstants::eTotal)
Channel & GetChannel(const unsigned int channelId)
void MakeMultiplicity(const unsigned int size=0, const double binSize=0)
void SetBaseLine(double baseline)
set baseline
Fluorescence Detector Pixel event.
unsigned int GetChannelId() const
TelescopeIterator TelescopesBegin() const
Beginning of the collection of telescopes.
const Telescope & GetTelescope(const unsigned int telescopeId) const
Find Telescope by numerical Id.
Top of the hierarchy of the detector description interface.
void SetStart(const SizeType start)
Set valid data start bin.
unsigned int GetId() const
Eye numerical Id.
bool HasPhotonTrace(const FdConstants::LightSource source=FdConstants::eTotal) const
Check that trace for source /par source is present.
void SetLastSatBin(const int lsb)
set last saturated bin for this channel
const fdet::FDetector & GetFDetector() const
unsigned int GetId() const
void SetT3Class(const std::string &label)
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
#define WARNING(message)
Macro for logging warning messages.
Fluorescence Detector Channel Event.
bool HasTriggerData() const
void GetData(bool &b) const
Overloads of the GetData member template function.
void MakeFADCTrace(unsigned int size, double binning, const FdConstants::LightSource source=FdConstants::eTotal)
bool ApplyTimeCorrections(evt::Event &event, TEyeEvent &eyeEvent)
bool ChannelIsSaturated() const
check saturation flag for this channel
Top of Fluorescence Detector event hierarchy.
Eye & GetEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData)
return Eye by id
void SetFirstTriggeredTimeBin(const int bin)
returns the first triggerd time bin of trace (T1)
void SetChannelSaturated()
set saturation flag for this channel
void SetMean(const double m)
void MakeChannel(const unsigned int channelId)
void MakePhotonTrace(unsigned int size, double binning, const FdConstants::LightSource source=FdConstants::eTotal)
double GetInterval() const
Get the time interval as a double (in Auger base units)
double GetHeatCalibrationCorrection(const unsigned int gpsSecond) const
void SetStatus(ComponentSelector::Status status)
boost::filter_iterator< TelIsCommissioned, InternalConstTelescopeIterator > TelescopeIterator
An iterator over telescopes.
void AddDeSaturatedBin(const int bin)
Add one de-saturated bin to this trace.
Pixel & GetPixel(const unsigned int pixelId, const ComponentSelector::Status status=ComponentSelector::eHasData)
Retrieve Pixel by Id, throw exception if not existent.
void MakeFLTTrace(const utl::TraceB &flt)
int GetFirstSatBin() const
find first saturated bin for this channel
void SetFirstSatBin(const int fsb)
set first saturated bin for this channel
bool HasEye(const unsigned int eyeId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
const utl::TimeInterval & GetSDTimeOffset() const
Time Offset of this eye with respect to SD.
void SetPreviousThreshold(const int t)
Fluorescence Detector Channel Reconstructed Data Event.
void SetTLTAccepted(const bool is)
Detector description interface for Telescope-related data.
ResultFlag
Flag returned by module methods to the RunController.
bool HasChannel(const unsigned int channelId) const
int GetSLTTraceLength() const
void FillCalibratedPixels(evt::Event &event, TEyeEvent &eyeEvent)
unsigned long GetGPSSecond() const
GPS second.
unsigned int GetId() const
void SetSLTDataWord(unsigned int col, const unsigned int sltDataWord)
bool ApplyCalibration(const utl::TraceI &rawtrace, fevt::Pixel &pixel) const
void SetVariance(const double v)
bool HasTelescope(const unsigned int telescopeId, const ComponentSelector::Status status=ComponentSelector::eHasData) const
Check if the telescope is in the event.
boost::indirect_iterator< InternalConstChannelIterator, const Channel & > ConstChannelIterator
An iterator over available channles for read.
unsigned int GetVirtualChannelId() const
void SetHighGainSaturation()
total (shower and background)
const double & GetX(const unsigned int idx) const
Exception thrown when trying to access invalid bounds in Trace.
TelescopeIterator TelescopesEnd() const
End of the collection of telescopes.
double GetBaseLine() const
get baseline
void SetSLTData(const std::vector< fevt::SLTData > &s)
fevt::EyeTriggerData & GetTriggerData()
Trigger data for this eye.
void SetSaturationRecovered()
void SetRMS(const double rms)
void FillDAQInformation(evt::Event &event, TEyeEvent &eyeEvent)
Fluorescence Detector Telescope Event.
double Mean(const std::vector< double > &v)
void SetBaseline(const double bl)
void SetThresholdChanged(const bool changed=true)
Description of trigger data for one Telescope.
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
void FillTriggerData(evt::Event &event, TEyeEvent &eyeEvent)
void AdjustMirrorTimes(TEyeEventHeader *eyeheader, fevt::FEvent &theFEvent, fevt::Eye &theEye)
#define ERROR(message)
Macro for logging error messages.
bool HasFADCTrace(const FdConstants::LightSource source) const
Check that source /par source is present.
fevt::TelescopeTriggerData & GetTriggerData()
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
void CorrectFDTime(TEyeEventHeader *eyeheader)
Fluorescence Detector Pixel Reconstructed Data.
int GetFADCTraceLength() const
const std::string & GetMessage() const
Retrieve the message from the exception.
unsigned int GetEyeId() const
1..5 (4x normal FD, 1x HEAT)
PixelRecData & GetRecData()
bool HasTriggerData() const
unsigned int GetPixelId() const