46{
50
51
52
56 JLimit_t& numberOfEvents = inputFile.getLimit();
57 string detectorFile;
58 double Tmax_s;
60
61 try {
62
63
64 JParser<> zap(
"Program to monitor variables for spark removal in offline files. The variable definition is given in JSparkSummary class.");
65
73
74 zap(argc, argv);
75 }
76 catch(const exception& error) {
77 FATAL(error.what() << endl);
78 }
79
81
82 try {
84 }
87 }
88
90
91 unique_ptr<JDynamics> dynamics;
92
93 try {
94
96
97 dynamics->load(calibrationFile);
98 }
99 catch(const exception& error) {
100 if (!calibrationFile.empty()) {
102 }
103 }
104
106
108
111
113
114 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
115
117
118 const Evt* evt = in.next();
119
124
125
127
128 for (
const Hit& hit : evt->
hits) {
129 bool valid = true;
130 if(router.hasModule(hit.
dom_id)){
131
134
138 !module.getPMT(hit.channel_id).has(PMT_DISABLE));
139
140 }
141 if(valid){
143
145 }
146
147 }
148
149 for (
const auto& [
dom_id, pmt_set] : snapshot) {
151
154
155 }
156 }
157
160
163
164 }
165 }
166
167
168
169 if (dynamics) {
170 dynamics->update(evt->
t.GetSec());
171 }
172
174
177
179
180 for (
const auto& module : (dynamics ? dynamics->getDetector() :
detector)) {
181
183
185
186 if (D < spark.
Dmin) {
187
190
191 }
192 }
193 }
194 }
195 }
197 }
198
200
204
205}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const JLocation & getLocation() const
Get location.
int getFloor() const
Get floor number.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
const JPosition3D & getPosition() const
Get position.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
Object reading from a list of files.
File router for fast addressing of summary data.
Template definition for direct access of elements in ROOT TChain.
Data storage class for rate measurements of all PMTs in one module.
Data structure for UTC time.
JTrack3E getTrack(const Trk &track)
Get track.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
bool getPMTStatus(const JStatus &status)
Test status of PMT.
KM3NeT DAQ data structures and auxiliaries.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
int frame_index
from the raw data
int run_id
DAQ run identifier.
std::vector< Hit > hits
list of hits
int det_id
detector identifier from DAQ
TTimeStamp t
UTC time of the timeslice, or the event_time for MC. (default: 01 Jan 1970 00:00:00)
int dom_id
module identifier from the data (unique in the detector).
ULong64_t trig
non-zero if the hit is a trigger hit.
unsigned int channel_id
PMT channel id {0,1, .., 30} local to moduke.
Dynamic detector calibration.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Struct for storing spark removal summary data.
int nMaxPMT_trigger_ModuleID
DOM ID with maximum number of PMT triggered.
size_t nMaxPMT_trigger
maximum number of PMT with at least one triggered hit in any DOM
size_t nMaxPMT_snapshot
maximum number of PMT with at least one hit in any DOM
double Dmin
Minimum distance from reconstructed shower vertex to any DOM [m].
int Dmin_ModuleID
DOM ID corresponding to the DOM at Dmin_DOM.
int nMaxPMT_snapshot_ModuleID
DOM ID with maximum number of PMT hits in the snapshot.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
int status
MC or reconstruction status code, see km3net-dataformat/definitions/trkmembers.csv for values.
static const int TRK_ST_UNDEFINED
MC or reco status was not defined for this track.