Project
Loading...
Searching...
No Matches
CTFHelper.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#include "MIDCTF/CTFHelper.h"
18
19using namespace o2::mid;
20
22{
23 uint32_t nDone = 0, idx[NEvTypes] = {};
28 uint64_t rofBC[NEvTypes] = {};
29 auto fillNextROFBC = [&nDone, &rofBC, &idx, &sizes, this](int it) {
30 if (idx[it] < sizes[it]) {
31 rofBC[it] = this->rofData[it][idx[it]].interactionRecord.toLong();
32 } else {
33 rofBC[it] = -1;
34 nDone++;
35 }
36 };
37 for (uint32_t it = 0; it < NEvTypes; it++) {
38 fillNextROFBC(it);
39 }
40 while (nDone < NEvTypes) { // find next ROFRecord with smallest BC, untill all 3 spans are traversed
41 int selT = rofBC[0] <= rofBC[1] ? (rofBC[0] <= rofBC[2] ? 0 : 2) : (rofBC[1] <= rofBC[2] ? 1 : 2);
42 if (!irSelector.isSet() || irSelector.check(rofData[selT][idx[selT]].interactionRecord) >= 0) {
43 rofDataRefs.emplace_back(idx[selT], selT);
44 for (uint32_t ic = rofData[selT][idx[selT]].firstEntry; ic < rofData[selT][idx[selT]].getEndIndex(); ic++) {
45 colDataRefs.emplace_back(ic, selT); // register indices of corresponding column data
46 }
47 }
48 ++idx[selT]; // increment used index
49 fillNextROFBC(selT);
50 }
51}
unsigned int uint32_t
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
Class to check if give InteractionRecord or IRFrame is selected by the external IRFrame vector.
Helper for MID CTF creation.
long check(o2::dataformats::IRFrame fr, size_t bwd=0, size_t fwd=0)
GLsizeiptr size
Definition glcorearb.h:659
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
Definition glcorearb.h:2595
constexpr uint32_t NEvTypes
Definition ROFRecord.h:37
std::vector< OrderRef > rofDataRefs
Definition CTFHelper.h:41
std::array< gsl::span< const o2::mid::ROFRecord >, NEvTypes > rofData
Definition CTFHelper.h:43
void buildReferences(o2::utils::IRFrameSelector &irSelector)
Definition CTFHelper.cxx:21
std::vector< OrderRef > colDataRefs
Definition CTFHelper.h:40
o2::utils::IRFrameSelector irSelector