28#define QCONFIG_INTERNAL
30#undef QCONFIG_INTERNAL
36#define QCONFIG_PARSER_CXX
37#define QCONFIG_INSTANCE
39#undef QCONFIG_INSTANCE
44static inline const char* getOptName(
const char** argv,
int32_t i)
46 while (
i > 1 && argv[
i][0] !=
'-') {
63template <
typename... X>
79 if ((
retVal = qAddOptionMinMax<T>(
settings,
ref, iOrg < argc ? argv[iOrg] :
""))) {
92template <
typename T,
int32_t index = 0,
int32_t left = std::tuple_size_v<T>>
96 auto&
ref = std::get<index>(tup);
100 printf(
"Invalid number of arguments for option %s\n", getOptName(argv,
i));
108template <
typename T,
int32_t index>
112template <
typename... X>
122 template <
typename... Args>
129 template <
typename... Args>
136 T tmp = T(),
def = T();
142 if (
i == iFirst ||
i != iLast) {
145 }
while (
i != iLast);
149 template <
typename... Args>
156 T tmp = T(),
def = T();
162 if (
i - iFirst >=
count) {
163 printf(
"Too many values provided for option %s\n", getOptName(argv,
i));
166 if (
i == iFirst ||
i != iLast) {
167 ref[
i - iFirst] = tmp;
169 }
while (
i != iLast);
173 template <
typename... Args>
174 static inline void qConfigHelpOption(
const char*
name,
const char*
type,
const char*
def,
const char* optname,
char optnameshort,
const char* preopt,
char preoptshort,
int32_t optionType,
const char* help, Args&&... args)
177 const bool boolType = optionType != 1 && std::is_same_v<T, bool>;
178 const char*
arguments =
settings.doSet ?
" (" : ((
settings.doDefault || optionType == 1 || boolType) ?
" [arg] (" : (optionType == 2 ?
" [...] (" :
" arg ("));
179 char argBuffer[4] = {0};
181 if (optnameshort && preoptshort) {
182 argBuffer[argBufferPos++] =
'-';
185 argBuffer[argBufferPos++] = preoptshort == 0 ?
'-' : preoptshort;
186 argBuffer[argBufferPos++] = optnameshort;
188 std::cout <<
"\t" <<
name <<
": " << argBuffer << (optnameshort == 0 ?
"" :
arguments) <<
"--";
189 if (optname[0] == 0) {
190 std::cout << preopt <<
name;
192 std::cout << optname;
194 std::cout << (optnameshort == 0 ?
arguments :
", ") <<
"type: " <<
type;
195 if (optionType == 0) {
196 std::cout <<
", default: " <<
def;
198 if (optionType == 1) {
199 std::cout <<
", sets " <<
name <<
" to " <<
def;
202 std::cout <<
", minimum: " <<
settings.min;
205 std::cout <<
", maximum: " <<
settings.max;
207 std::cout <<
")\n\t\t" << help <<
".\n";
209 std::cout <<
"\t\tSets " <<
name <<
" to " <<
settings.set <<
".\n";
211 std::cout <<
"\t\tIf no argument is supplied, " <<
name <<
" is set to " <<
settings.set <<
".\n";
212 }
else if (boolType) {
213 std::cout <<
"\t\tIf no argument is supplied, " <<
name <<
" is set to true.\n";
215 if (optionType == 2) {
216 std::cout <<
"\t\tCan be set multiple times, accepts multiple arguments.\n";
222static inline const char* getArg(
int32_t&
i,
const char** argv,
const int argc,
bool allowOption =
false)
224 if (
i + 1 < argc && argv[
i + 1][0] && ((allowOption && argv[
i + 1][0] ==
'-' && argv[
i + 1][1] !=
'-') || argv[
i + 1][0] !=
'-')) {
231static inline int32_t qAddOptionGeneric(qConfigSettings<T>&
settings, T&
ref,
int32_t&
i,
const char** argv,
const int argc, T
def, std::function<
T(
const char*)>
func,
bool allowDefault =
false)
233 const char* arg = getArg(
i, argv, argc, !allowDefault);
237 }
else if (allowDefault) {
242 printf(
"Argument missing for option %s!\n", getOptName(argv,
i));
251 return qAddOptionGeneric<bool>(
260 return qAddOptionGeneric<int8_t>(
269 return qAddOptionGeneric<uint8_t>(
278 return qAddOptionGeneric<int32_t>(
287 return qAddOptionGeneric<uint32_t>(
289 return strtoul(a, nullptr, 0);
296 return qAddOptionGeneric<int16_t>(
305 return qAddOptionGeneric<uint16_t>(
307 return strtoul(a, nullptr, 0);
314 return qAddOptionGeneric<int64_t>(
316 return strtoll(a, nullptr, 0);
323 return qAddOptionGeneric<uint64_t>(
325 return strtoull(a, nullptr, 0);
332 return qAddOptionGeneric<float>(
334 return (float)atof(a);
341 return qAddOptionGeneric<double>(
350 return qAddOptionGeneric<const char*>(
359 return qAddOptionGeneric<std::string>(
368static inline int32_t qAddOptionMinMax(qConfigSettings<T>&
settings, T&
ref,
const char* arg)
371 std::cout <<
"Invalid setting for " << arg <<
": minimum threshold exceeded (" <<
ref <<
" < " <<
settings.min <<
")!\n";
375 std::cout <<
"Invalid setting for " << arg <<
": maximum threshold exceeded (" <<
ref <<
" > " <<
settings.max <<
")!\n";
391 std::string
msg = std::string(
settings.message) +
"\n";
392 printf(
msg.c_str(), tmp.c_str());
396static inline void qConfigHelp(
const char* subConfig =
nullptr,
int32_t followSub = 0)
399 printf(
"Usage Info:");
413 const char* thisoption = argv[
i];
419 if (found ==
false) {
420 printf(
"Invalid argument: %s\n", argv[
i]);
428#include "qconfig_print.inc"
432 for (
auto&
f : qprint_global) {
438#include "qconfig_genrtti.inc"
441std::tuple<std::vector<qConfigRTTIentry>, std::vector<std::string>>
qConfigGenRTTI(
const std::vector<std::string>* configStructs) {
return internal::qConfigGenRTTI(configStructs); }
unsigned short int uint16_t
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h internal
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
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder Print launch bounds used for RTC code as debugging for exit after def(1)) AddOption(allowOptimizedSlaveReconstruction
configStandalone Reconstruction settings
GLuint const GLchar * name
GLint GLint GLsizei GLint GLenum GLenum type
GLboolean GLboolean GLboolean GLboolean a
bpo::variables_map arguments
int32_t qAddOptionType< float >(qConfigSettings< float > &settings, float &ref, int32_t &i, const char **argv, const int argc, float)
int32_t qAddOptionType< int8_t >(qConfigSettings< int8_t > &settings, int8_t &ref, int32_t &i, const char **argv, const int argc, int8_t)
int32_t qAddOptionType< uint32_t >(qConfigSettings< uint32_t > &settings, uint32_t &ref, int32_t &i, const char **argv, const int argc, uint32_t)
int32_t qAddOptionType< std::string >(qConfigSettings< std::string > &settings, std::string &ref, int32_t &i, const char **argv, const int argc, std::string)
int32_t qAddOptionType< int64_t >(qConfigSettings< int64_t > &settings, int64_t &ref, int32_t &i, const char **argv, const int argc, int64_t)
int32_t qAddOptionType< uint16_t >(qConfigSettings< uint16_t > &settings, uint16_t &ref, int32_t &i, const char **argv, const int argc, uint16_t)
int32_t qAddOptionType< int16_t >(qConfigSettings< int16_t > &settings, int16_t &ref, int32_t &i, const char **argv, const int argc, int16_t)
int32_t qAddOptionType< uint8_t >(qConfigSettings< uint8_t > &settings, uint8_t &ref, int32_t &i, const char **argv, const int argc, uint8_t)
int32_t qAddOptionType< uint64_t >(qConfigSettings< uint64_t > &settings, uint64_t &ref, int32_t &i, const char **argv, const int argc, uint64_t)
int32_t qAddOptionType< bool >(qConfigSettings< bool > &settings, bool &ref, int32_t &i, const char **argv, const int argc, bool)
int32_t qAddOptionType< double >(qConfigSettings< double > &settings, double &ref, int32_t &i, const char **argv, const int argc, double)
int32_t qAddOptionType< const char * >(qConfigSettings< const char * > &settings, const char *&ref, int32_t &i, const char **argv, const int argc, const char *)
int32_t qConfigParse(int argc, const char **argv, const char *)
int32_t qAddOptionType< int32_t >(qConfigSettings< int32_t > &settings, int32_t &ref, int32_t &i, const char **argv, const int argc, int32_t)
std::string print_type(T val, bool precise=false)
int32_t qAddOptionMinMax< bool >(qConfigSettings< bool > &, bool &, const char *)
std::tuple< std::vector< qConfigRTTIentry >, std::vector< std::string > > qConfigGenRTTI(const std::vector< std::string > *configStructs)
static int32_t qAddOptionMainTuple(qConfigSettings< typename qSettingsType< T >::settingsType >, T &, int32_t &, const char **, const int32_t)
static int32_t qAddOptionMainTuple(qConfigSettings< typename qSettingsType< T >::settingsType > settings, T &tup, int32_t &i, const char **argv, const int argc)
static auto qConfigGetSettings(Args &... args)
static int32_t qAddOptionMain(qConfigSettings< T > &settings, T &ref, int32_t &i, const char **argv, const int argc, T def)
static int32_t qAddOption(T &ref, int32_t &i, const char **argv, const int argc, T def, const char *, Args &&... args)
static int32_t qAddOptionArray(T *ref, int32_t count, int32_t &i, const char **argv, const int argc, const char *, Args &&... args)
static int32_t qAddOptionVec(std::vector< T > &ref, int32_t &i, const char **argv, const int argc, const char *, Args &&... args)
static void qConfigHelpOption(const char *name, const char *type, const char *def, const char *optname, char optnameshort, const char *preopt, char preoptshort, int32_t optionType, const char *help, Args &&... args)
uint64_t const void const *restrict const msg