Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary program to write KM3NETDAQ::JDAQTimeslice with random data.
- Author
- mdejong
Definition in file JRandomTimesliceWriter.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 39 of file JRandomTimesliceWriter.cc.
47 Long64_t numberOfEvents;
58 JParser<> zap(
"Auxiliary program to write time slices with random data.");
61 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
62 zap[
'a'] =
make_field(detectorFile,
"detecto.");
73 catch(
const exception &error) {
74 FATAL(error.what() << endl);
78 gRandom->SetSeed(seed);
85 if (pmtParameters.
getQE() != 1.0) {
87 WARNING(
"Correct background rates with global efficiency " << pmtParameters.
getQE() << endl);
92 DEBUG(
"PMT parameters: " << endl << pmtParameters << endl);
93 DEBUG(
"K40 rates: " << endl << rates_Hz << endl);
104 JPMTParametersMap::Throw(
false);
111 NOTICE(
"Using run-by-run:" << endl << runbyrun << endl);
114 FATAL(
"Run-by-run simulation yields no input." << endl);
132 NOTICE(
"Using fixed rates [Hz]: " << rates_Hz << endl);
145 JTimer timerco(
"constructor");
160 for ( ; count <= numberOfEvents; ++count) {
162 STATUS(
"event: " << setw(10) << count <<
'\r');
DEBUG(endl);
164 int frame_index = count;
170 summaryRouter.
correct(dynamic_cast<const JPMTDefaultSimulatorInterface&>(simbad.getPMTSimulator()));
194 const double factor = 1.0 / (double) (count - 1);
196 timerco.print(cout, factor);
197 timerIO.print(cout, factor);
void correct(const JPMTDefaultSimulatorInterface &simulator)
Correct measured singles rates for the probability that a hit survives the simulation of the PMT.
Default implementation of the simulation of K40 background.
Auxiliary class for CPU timing and usage.
virtual const pointer_type & next()
Get next element.
Data structure for UTC time.
double getQE(const JPMTIdentifier &id) const
Get QE of given PMT.
Empty structure for specification of parser element that is initialised (i.e.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
int getFrameIndex() const
Get frame index.
Utility class to parse command line options.
PMT simulation based on run-by-run information.
K40 simulation based on run-by-run information.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for K40 rates.
double getSinglesRate() const
Get singles rate.
Auxiliary class to handle run by run options.
Auxiliary class for map of PMT parameters.
Timeslice with random data.
Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the op...
bool is_valid()
Check validity of run by run options.
int getRunNumber() const
Get run number.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
unsigned int JTDC_t
leading edge [ns]
#define DEBUG(A)
Message macros.
void update(JDAQSummaryslice *ps)
Update router.
void correct(const double QE)
Correct rates for global efficiency,.
KM3NeT DAQ data structures and auxiliaries.
virtual bool hasNext()
Check availability of next element.
void setDAQLongprint(const bool option)
Set DAQ print option.
virtual const char * what() const
Get error message.
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.