#include #include #include #include "TRandom3.h" #include "km3net-dataformat/offline/Head.hh" #include "km3net-dataformat/offline/Evt.hh" #include "JSupport/JFileRecorder.hh" #include "JSupport/JSupport.hh" #include "JSupport/JLimit.hh" #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to write Monte Carlo events. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JFileRecorder outputFile; counter_type numberOfEvents; UInt_t seed; int debug; try { JParser<> zap("Auxiliary program to write Monte Carlo events."); zap['o'] = make_field(outputFile, "list of files"); zap['n'] = make_field(numberOfEvents, "number of events to write to file") ; zap['S'] = make_field(seed) = 0; zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } gRandom->SetSeed(seed); outputFile.open(); Evt evt; for (counter_type i = 0; i != numberOfEvents; ++i) { evt.mc_event_time = TTimeStamp(gRandom->Uniform(0, numberOfEvents)); outputFile.put(evt); } outputFile.close(); }