1 #include <sevt/Station.h>
2 #include <det/Detector.h>
3 #include <sdet/SDetector.h>
4 #include <sdet/Station.h>
5 #include <sevt/IsLightning.h>
16 const int kLightningThreshold = 1000;
17 const int kLightningHysteresis = 4;
27 const auto& dStation = det::Detector::GetInstance().GetSDetector().GetStation(station);
34 PMTInfo activePMTs[dStation.GetNPMTs()];
39 for (
const auto& pmt : station.PMTsRange()) {
40 if (pmt.HasFADCTrace() && pmt.HasRecData()) {
41 const auto& pmtRec = pmt.GetRecData();
50 if (nActivePMTs == 3) {
53 bool cross[3] = {
true,
true,
true };
55 const int tracesize = dStation.GetFADCTraceLength();
57 for (
int pmt = 0; pmt < 3; ++pmt) {
59 const PMTInfo& pmti = activePMTs[pmt];
60 const TraceI& trace = *pmti.trace;
61 const TraceD& baseline = *pmti.baseline;
63 for (
int i = 0; i < tracesize; ++i) {
64 if (trace[i] > kLightningThreshold)
66 const double signal = trace[i] - baseline[i];
67 if (cross[pmt] && signal < -kLightningHysteresis) {
71 if (!cross[pmt] && signal > kLightningHysteresis)
77 if (count[0] > 2 && count[1] > 3 && count[2] > 3) {
79 info <<
'(' << count[0] <<
", " << count[1] <<
", " << count[2]
80 <<
") oscillations in station " << station.
GetId();
AxialVector cross(const Vector &l, const Vector &r)
vector cross product
int GetId() const
Get the station Id.
bool HasCalibData() const
Check whether calibration data object exists.
#define INFO(message)
Macro for logging informational messages.
class to hold data at Station level
bool IsLightning(const Station &station)