31std::vector<o2::dcs::DataPointCompositeObject>
generate(std::vector<std::string> aliases,
int val)
33 std::vector<o2::dcs::DataPointCompositeObject> dataPoints;
53 void fillAliasesStrobeDuration();
62 bool isStrobeDurationData =
false;
63 std::vector<std::string> mAliases;
64 std::vector<o2::dcs::test::HintType> mDataPointHints;
70void ITSDCSDataGenerator::fillAliasesStrobeDuration()
75 int nStaves[] = {12, 16, 20, 24, 30, 42, 48};
76 for (
int iL = 0; iL < 7; iL++) {
77 for (
int iS = 0; iS <
nStaves[iL]; iS++) {
79 mAliases.push_back(
"ITS_L" +
std::to_string(iL) +
"_" + stv +
"_STROBE");
88 isStrobeDurationData = ic.
options().
get<
bool>(
"generate-strobe-duration-data");
93 if (isStrobeDurationData) {
94 fillAliasesStrobeDuration();
101 uint64_t tfid = o2::header::get<o2::framework::DataProcessingHeader*>((*input).header)->startTime;
102 if (tfid >= mMaxTF) {
103 LOG(info) <<
"ITS DCS Data generator reached TF " << tfid <<
", stopping";
109 bool doGen = mTFs % mMaxCyclesNoFullMap == 0;
110 std::vector<o2::dcs::DataPointCompositeObject> dpcoms;
112 dpcoms =
generate(mAliases, mTFs > changeAfterTF ? valueB : valueA);
115 LOG(info) <<
"TF " << tfid <<
" has generated " << dpcoms.size() <<
" DPs";
117 auto timeNow = std::chrono::system_clock::now();
118 timingInfo.creation = std::chrono::duration_cast<std::chrono::milliseconds>(timeNow.time_since_epoch()).count();
129 std::string desc{detName};
130 desc +=
"DATAPOINTS";
137 "its-dcs-data-generator",
139 Outputs{{{
"outputDCS"},
"ITS", dd}},
142 {
"change-after-n-timeframes", VariantType::Int64, 99999999999ll, {
"change value generated after n timeframes: do not change val by default"}},
143 {
"value-a", VariantType::Int, 0, {
"First value to be generated, will change to value-b after nTF = change-after-n-timeframes"}},
144 {
"value-b", VariantType::Int, 1, {
"Second value to be generated, will be after value-a once nTF = change-after-n-timeframes has been reached"}},
145 {
"max-timeframes", VariantType::Int64, 99999999999ll, {
"max TimeFrames to generate"}},
146 {
"max-cycles-no-full-map", VariantType::Int64, 6000ll, {
"max num of cycles between the sending of 2 full maps"}},
147 {
"generate-strobe-duration-data", VariantType::Bool,
false, {
"enable generation of DCS data containing the strobe duration in BCs"}}}};
header::DataDescription description
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
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
virtual void init(InitContext &context)
virtual void run(ProcessingContext &context)=0
GLsizei const GLchar *const * string
o2::dcs::DataPointCompositeObject createDataPointCompositeObject(const std::string &alias, T val, uint32_t seconds, uint16_t msec, uint16_t flags=0)
@ Me
Only quit this data processor.
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
o2::framework::DataProcessorSpec getITSDCSDataGeneratorSpec(const char *detName="ITS")
std::vector< std::string > aliases(std::vector< MeasurementType > types={ MeasurementType::HV_V, MeasurementType::HV_I, MeasurementType::LV_V_FEE_ANALOG, MeasurementType::LV_V_FEE_DIGITAL, MeasurementType::LV_V_SOLAR})
void append(const char *msg, std::string &to)
TLorentzVector generate(Vec3D &vtx, std::vector< o2::track::TrackParCov > &vctr, float bz, TGenPhaseSpace &genPHS, double parMass, const std::vector< double > &dtMass, std::vector< int > forceQ)
std::string to_string(gsl::span< T, Size > span)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"