O2-DQ User Interface 1.0.0
Loading...
Searching...
No Matches
trackselection.py
Go to the documentation of this file.
1#!/usr/bin/env python
2# PYTHON_ARGCOMPLETE_OK
3# -*- coding: utf-8 -*-
4
5# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
6# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
7# All rights not expressly granted are reserved.
8#
9# This software is distributed under the terms of the GNU General Public
10# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
11#
12# In applying this license CERN does not waive the privileges and immunities
13# granted to it by virtue of its status as an Intergovernmental Organization
14# or submit itself to any jurisdiction.
15
16# Orginal Task: https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/trackselection.cxx
17
18import argparse
19
20from argcomplete.completers import ChoicesCompleter
21
22
23class TrackSelectionTask(object):
24
25 """
26 Class for Interface -> trackselection.cxx.cxx Task -> Configurable, Process Functions
27
28 Args:
29 object (parser_args() object): trackselection.cxx.cxx Interface
30 """
31
32 def __init__(self, parserTrackSelectionTask = argparse.ArgumentParser(add_help = False)):
33 super(TrackSelectionTask, self).__init__()
34 self.parserTrackSelectionTask = parserTrackSelectionTask
35
36 def addArguments(self):
37 """
38 This function allows to add arguments for parser_args() function
39 """
40
41 # Predefined Selections
42 itsMatchingSelections = ["0", "1", "2"]
43
44 # Interface
45 groupTrackSelectionTask = self.parserTrackSelectionTask.add_argument_group(title = "Data processor options: track-selection")
46 groupTrackSelectionTask.add_argument(
47 "--itsMatching",
48 help = "condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSibAny, 2: Run3ITSallAny, 3: Run3ITSall7Layers)",
49 action = "store", type = str, choices = (itsMatchingSelections),
50 ).completer = ChoicesCompleter(itsMatchingSelections)
51
52 def parseArgs(self):
53 """
54 This function allows to save the obtained arguments to the parser_args() function
55
56 Returns:
57 Namespace: returns parse_args()
58 """
59
60 return self.parserTrackSelectionTask.parse_args()
def __init__(self, parserTrackSelectionTask=argparse.ArgumentParser(add_help=False))