3 #include <fwk/CentralConfig.h>
5 #include <utl/Reader.h>
6 #include <utl/ErrorLogger.h>
9 #include <evt/Header.h>
11 #include <sevt/SEvent.h>
12 #include <sevt/Header.h>
13 #include <sevt/Station.h>
14 #include <sevt/StationSimData.h>
16 #include <sevt/PMTCalibData.h>
17 #include <sevt/PMTRecData.h>
18 #include <sevt/StationGPSData.h>
19 #include <sevt/StationTriggerData.h>
20 #include <sevt/StationCalibData.h>
21 #include <sevt/StationRecData.h>
22 #include <sevt/EventTrigger.h>
31 using namespace SdInspectorOG;
46 : fOs(os), fIndent(ind) { }
48 ostream&
GetOs() {
return fOs; }
51 {
for (
int i = bits - 1; i >= 0; --i) fOs << (value & (1<<i) ?
'1':
'0'); }
57 {
for (
int i = 0; i < fIndent; ++i) fOs <<
' ';
return fOs << t; }
72 auto topBranch = CentralConfig::GetInstance()->GetTopBranch(
"SdInspector");
74 const auto str = topBranch.GetChild(
"infoLevel").Get<
string>();
76 fInfoLevel = eInfoNone;
77 if (str.find_first_of(
"aA") != string::npos)
78 fInfoLevel = eInfoAll;
79 else if (str.find_first_of(
"pP") != string::npos)
80 fInfoLevel = eInfoPMT;
81 else if (str.find_first_of(
"sS") != string::npos)
82 fInfoLevel = eInfoStation;
83 else if (str.find_first_of(
"eE") != string::npos)
84 fInfoLevel = eInfoEvent;
86 topBranch.GetChild(
"showSimData").GetData(fShowSimData);
89 fEventSecondUnbounded = !bool(topBranch.GetChild(
"eventSecondRange"));
91 if (!fEventSecondUnbounded)
92 topBranch.GetChild(
"eventSecondRange").GetData(fEventSecondRange);
95 info <<
"Parameters:\n"
96 " infoLevel: " << fInfoLevel <<
"\n"
97 " showSimData: " << fShowSimData <<
"\n"
99 if (fEventSecondUnbounded)
100 info <<
"unbounded\n";
102 info <<
'[' << fEventSecondRange.first <<
", " << fEventSecondRange.second <<
"]\n";
112 if (fInfoLevel == eInfoNone)
115 const Event&
event = ev;
130 if (!fEventSecondUnbounded)
131 if(headSec < fEventSecondRange.first ||
132 headSec > fEventSecondRange.second)
137 iout <<
"Event.Header.Id: " <<
event.GetHeader().GetId() <<
nl;
138 iout <<
"SEvent:" <<
nl;
144 iout <<
"+ Header:" <<
nl;
146 iout <<
"Id: " << head.
GetId() <<
nl;
147 iout <<
"Time: " << headTime <<
nl;
166 iout <<
"+ EventTrigger:" <<
nl;
168 iout <<
"Id: " << trig.
GetId() <<
nl;
174 iout <<
"Time: " << trig.
GetTime() <<
nl;
177 iout <<
"- EventTrigger" <<
nl;
179 if (fInfoLevel >= eInfoStation) {
185 iout <<
"* Station Collection:" << nl <<
nl;
192 iout <<
"StationId: " << sIt->GetId() <<
nl;
194 iout <<
"Saturation: ";
197 if (sIt->IsHighGainSaturation()) {
198 iout.
GetOs() <<
"HighGain";
201 if (sIt->IsLowGainSaturation()) {
202 iout.
GetOs() << sep <<
"LowGain";
205 iout.
GetOs() << (sep.length() ?
"\n" :
"None\n");
211 if (sIt->IsCandidate()) {
213 iout.
GetOs() <<
"Candidate";
216 if (sIt->IsSilent()) {
218 iout.
GetOs() << sep <<
"Silent";
221 if (sIt->IsRejected())
222 iout.
GetOs() << sep <<
"Rejected:" << sIt->GetRejectionStatus();
265 if (sIt->HasGPSData()) {
267 iout <<
"+ GPSData:" <<
nl;
283 iout <<
"- GPSData" <<
nl;
285 iout <<
"TraceStartTime: " << sIt->GetTraceStartTime() <<
nl;
286 if (sIt->HasVEMTrace())
287 iout <<
"+ VEMTrace: " << sIt->GetVEMTrace().GetSize() <<
" (size)" <<
nl;
289 iout <<
"- VEMTrace" <<
nl;
291 if (sIt->HasTriggerData()) {
294 iout <<
"+ TriggerData:" <<
nl;
300 iout.
GetOs() <<
" (mask)" <<
nl;
304 iout <<
"- TriggerData" <<
nl;
306 if (sIt->HasCalibData()) {
309 iout <<
"+ StationCalibData:" <<
nl;
314 iout <<
"NT1: " << calib.
GetNT1() <<
nl;
315 iout <<
"NT2: " << calib.
GetNT2() <<
nl;
316 iout <<
"NTot: " << calib.
GetNTot() <<
nl;
338 iout << (mSize ?
'+':
'-') <<
" MuonChargeHisto: " << mSize <<
" (size)" << nl;
353 iout <<
"- StationCalibData" <<
nl;
355 if (sIt->HasRecData()) {
357 iout <<
"+ StationRecData:" <<
nl;
364 iout <<
"RiseTime: " << rec.
GetRiseTime() <<
" +/- "
366 iout <<
"FallTime: " << rec.
GetFallTime() <<
" +/- "
376 iout <<
"- StationRecData" <<
nl;
379 if (sIt->HasSimData()) {
381 iout <<
"+ StationSimData:" <<
nl;
384 unsigned int nParticles = 0;
389 iout <<
"NParticles: " << nParticles <<
nl;
393 iout <<
"- StationSimData" <<
nl;
396 if (fInfoLevel >= eInfoPMT) {
397 iout <<
"* PMT Collection:" << nl <<
nl;
399 for (Station::ConstPMTIterator pmtIt = sIt->PMTsBegin();
400 pmtIt != sIt->PMTsEnd();
403 iout <<
"Id: " << pmtIt->GetId() <<
nl;
404 if (pmtIt->HasFADCTrace()) {
405 const int fadcSize = pmtIt->GetFADCTrace().GetSize();
406 iout <<
"+ FADCTrace: " << fadcSize <<
" (size)" <<
nl;
408 iout <<
"- FADCTrace" <<
nl;
410 if (pmtIt->HasCalibData()) {
412 iout <<
"+ PMTCalibData:" <<
nl;
426 iout << (mBaseSize ?
'+':
'-') <<
" MuonBaseHisto: " << mBaseSize <<
" (size)" << nl;
428 iout << (mPeakSize ?
'+':
'-') <<
" MuonPeakHisto: " << mPeakSize <<
" (size)" << nl;
430 iout << (mChargeSize ?
'+':
'-') <<
" MuonChargeHisto: " << mChargeSize <<
" (size)" << nl;
432 iout << (mShapeSize ?
'+':
'-') <<
" MuonShapeHisto: " << mShapeSize <<
" (size)" << nl;
434 iout <<
"Evolution: " << evolution <<
" \"";
435 for (
int i = 0; i < 16; i+=2)
436 switch ((evolution>>i) & 3) {
437 case 0: iout.
GetOs() <<
'=';
break;
438 case 1: iout.
GetOs() <<
'-';
break;
439 case 2: iout.
GetOs() <<
'+';
break;
440 default: iout.
GetOs() <<
'?';
break;
446 iout <<
"- PMTCalibData" <<
nl;
449 if (pmtIt->HasRecData()) {
451 iout <<
"+ PMTRecData:" <<
nl;
455 iout <<
"+ VEMTrace: " << vemSize <<
" (size)" <<
nl;
457 iout <<
"- VEMTrace" <<
nl;
468 iout <<
"- PMTRecData" <<
nl;
481 iout <<
"^ Station statistics:" <<
nl;
482 iout <<
"| NStations: " << nStations <<
nl;
483 iout <<
"| NCandidates: " << nCandidates <<
nl;
484 iout <<
"| NSilent: " << nSilent << nl << endl;
495 SdInspector::Finish()
double GetVEMCharge() const
Class to access station level reconstructed data.
double GetHighGainDelayChi2() const
double GetFallTimeRMS() const
RMS of the fall time from the PMTs.
double GetPeakAmplitude() const
Amplitude of signal Peak in VEM-Peak unit,averaged over pmts.
Station Level Simulated Data
StationIterator StationsEnd()
End of all stations.
utl::TraceD & GetVEMTrace(const StationConstants::SignalComponent source=StationConstants::eTotal)
Traces calibrated in VEM Peak.
double GetTotalCharge() const
Total charge.
int operator++(const int)
double GetRiseTime() const
Rise time averaged over PMTs.
double GetBaselineRMS(const sdet::PMTConstants::PMTGain gain=sdet::PMTConstants::eHighGain) const
double GetHighGainDelayRMS() const
int GetOffsetMicroSecond() const
double GetRiseTime() const
Average rise time from the PMTs.
IndentOut(ostream &os=cout, const int ind=0)
int GetCurrent100() const
int GetNumberOfStations() const
Get total number of stations in the event.
unsigned int GetNTubesOk() const
get numbers of tubes with calibration
Interface class to access to the SD part of an event.
const std::vector< int > & GetMuonChargeHisto() const
histogram of the sum of muon charges (not really used anywhere)
unsigned int GetNT1() const
number of T1 received during calibration
const utl::TimeStamp & GetPlaneFrontTime() const
Get Shower front plane arrival time.
double GetFallTime() const
Average fall time from the PMTs.
const std::vector< int > & GetMuonChargeHisto() const
Muon charge histogram.
int operator--(const int)
unsigned int GetId() const
Get Id of the trigger.
EventTrigger & GetTrigger()
Get the object with central trigger data, throw if n.a.
unsigned int GetSecond() const
Get end of traces raw time.
double GetLDFResidual() const
Residual of lateral fit.
#define INFO(message)
Macro for logging informational messages.
const std::vector< int > & GetMuonPeakHisto() const
Muon peak histogram.
unsigned int GetNT2() const
number of T2 received during calibration
void Init()
Initialise the registry.
const std::string & GetAlgorithmName() const
const std::vector< int > & GetMuonShapeHisto() const
Average shape of a muon.
unsigned int GetPreviousId() const
Get Id of the FD trigger that contains data for this event.
void OutputBinary(const int value, const int bits=8) const
const std::vector< int > & GetMuonBaseHisto() const
Muon base histogram.
double GetFallTime() const
Fall time averaged over PMTs.
A TimeStamp holds GPS second and nanosecond for some event.
unsigned int GetTick() const
double GetMuonComponent() const
Muon signal [number of muons].
double GetResidual() const
Residual of geometry fit.
class to hold reconstructed data at PMT level
utl::TimeStamp GetSignalStartTime() const
Start time of the signal.
int GetOffset() const
Get GPS offset compared to a reference.
ostream & operator<<(const T &t)
Interface class to access the Event Trigger (T3)
double GetGainRatioRMS() const
double GetRiseTimeRMS() const
RMS of the rise time from the PMTs.
double GetTotalSignal() const
Total integrated signal in VEM unit, averaged over pmts.
ParticleVector::const_iterator ConstParticleIterator
bool HasTrigger() const
check whether the central trigger object exists
double GetHighGainDelay() const
delay relative to low gain
unsigned int GetSignalStartSlot() const
Start time of the signal in time slots from beginning of trace.
unsigned int GetNTot() const
total number of triggers recevied during calibration
double GetShapeParameter() const
Shape parameter averaged over PMTs.
unsigned int GetCorrectedNanosecond() const
Get corrected trigger nanosecond.
int GetNErrorZeroStations() const
Get number of error zero stations (mapped over from IoSdEvent)
int operator-=(const int i)
void SetIndent(const int ind)
unsigned int GetSignalEndSlot() const
End time of the signal in time slots from beginning of trace.
int GetWindowMicroSecond() const
double GetShapeParameterRMS() const
ShapeParameter spread.
double GetRiseTimeRMS() const
Rise time spread.
int GetPreviousST() const
double GetBaseline(const sdet::PMTConstants::PMTGain gain=sdet::PMTConstants::eHighGain) const
ParticleIterator ParticlesBegin()
Beginning of simulated particles entering the station.
unsigned int GetNStations() const
Get number of stations in the trigger.
unsigned int GetStartSecond() const
GPS second of start of calibration.
utl::TimeStamp GetTime() const
Get time of the trigger.
ResultFlag
Flag returned by module methods to the RunController.
unsigned long GetGPSSecond() const
GPS second.
unsigned int GetEndSecond() const
GPS second of end of calibration.
Station Trigger Data description
StationIterator StationsBegin()
Beginning of all stations.
double GetSPDistance() const
Distance from core in shower plane coordinates.
int GetVersion() const
version of the onboard calibration
sevt::Header & GetHeader()
std::string GetAlgorithm() const
Get algorithm of the trigger.
double GetOnlineCharge() const
Online estimate of VEM_charge [adc*time_bin].
double GetFallTimeRMS() const
Fall time spread.
double GetPeakAmplitude() const
Peak Amplitude.
bool HasVEMTrace(const StationConstants::SignalComponent source=StationConstants::eTotal) const
boost::indirect_iterator< InternalConstStationIterator, const Station & > ConstStationIterator
ParticleIterator ParticlesEnd()
End of simulated particles entering the station.
int operator+=(const int i)
double GetOnlinePeak() const
Online estimate of VEM_peak [adc].
double GetVEMPeak() const
unsigned int GetTickFall() const
sevt::SEvent & GetSEvent()
std::string GetSender() const
Get sender of the trigger.
double GetAreaOverPeak() const
Area over peak.
PLDType GetPLDTrigger() const
double GetSDPAngle() const
Get SDPAngle of the trigger.
double GetGainRatio() const
double GetGainRatio() const