12#include "../Framework/Core/src/ArrowSupport.h"
14#include "Monitoring/Monitoring.h"
22#include <TStopwatch.h>
50 std::unique_ptr<o2::eventgen::GeneratorService>
genservice;
64 LOG(
error) <<
"Could not parse vtxMode";
72 if (
nEvents <= std::numeric_limits<unsigned int>::max()) {
73 unsigned int castNEvents =
static_cast<unsigned int>(
nEvents);
82 LOG(warn) <<
"Not yet supported. This needs definition of a timestamp and fetching of the MeanVertex CCDB object";
88 outfile.reset(
new TFile(kineoutfilename.c_str(),
"RECREATE"));
89 outtree.reset(
new TTree(
"o2sim",
"o2sim"));
102 for (
auto i = 0U;
i < batch; ++
i) {
107 genservice->generateEvent_MCTracks(*mctracks, *mcheader);
110 auto mctrack_ptr = mctracks;
113 br->SetAddress(&mctrack_ptr);
123 pc.
services().
get<o2::monitoring::Monitoring>().send(o2::monitoring::Metric{(
uint64_t)
tfCounter,
"df-sent"}.addTag(o2::monitoring::tags::Key::Subsystem, o2::monitoring::tags::Value::DPL));
125 bool time_expired =
false;
128 time_expired =
timer.RealTime() >
ttl;
131 LOG(info) <<
"TTL expired after " <<
eventCounter <<
" events ... sending end-of-stream";
153 auto spec = adaptAnalysisTask<GeneratorTask>(cfgc);
154 spec.outputs.emplace_back(
"MC",
"MCHEADER", 0, Lifetime::Timeframe);
155 spec.outputs.emplace_back(
"MC",
"MCTRACKS", 0, Lifetime::Timeframe);
Definition of the Detector class.
Definition of the Names Generator class.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
char error[CURL_ERROR_SIZE]
Definition of the MCTrack class.
static std::string getMCKinematicsFileName(const std::string_view prefix=STANDARDSIMPREFIX)
static void updateFromFile(std::string const &, std::string const ¶msList="", bool unchangedOnly=false)
static void updateFromString(std::string const &)
static bool parseVertexModeString(std::string const &vertexstring, o2::conf::VertexMode &mode)
A class offering convenient generator configuration and encapsulation of lower level classes....
static void setTotalNEvents(unsigned int &n)
decltype(auto) make(const Output &spec, Args... args)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
ServiceRegistryRef services()
The services registry associated with this processing context.
static ULong_t setGRandomSeed(ULong_t seed=0)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
This function hooks up the the workflow specifications into the DPL driver.
GLenum const GLfloat * params
TBranch * getOrMakeBranch(TTree &tree, const char *brname, T *ptr)
Defining ITS Vertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< T, fair::mq::pmr::polymorphic_allocator< T > > vector
Configurable< int > aggregate
Configurable< std::string > outputPrefix
void run(o2::framework::ProcessingContext &pc)
std::vector< o2::dataformats::MCEventHeader * > mcheader_vector
std::unique_ptr< TTree > outtree
std::unique_ptr< o2::eventgen::GeneratorService > genservice
std::vector< o2::pmr::vector< o2::MCTrack > * > mctracks_vector
Configurable< long > seed
Configurable< std::string > trigger
Configurable< GenCount > eventNum
Configurable< int64_t > ttl
Configurable< std::string > iniFile
Configurable< std::string > generator
void init(o2::framework::InitContext &)
Configurable< std::string > vtxModeArg
std::unique_ptr< TFile > outfile
static ServiceSpec arrowBackendSpec()
static AlgorithmSpec wrapWithRateLimiting(AlgorithmSpec spec)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"