O2-DQ User Interface 1.0.0
Loading...
Searching...
No Matches
multiplicityTable.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/multiplicityTable.cxx
17
18import argparse
19
20from argcomplete.completers import ChoicesCompleter
21
22
23class MultiplicityTable(object):
24
25 """
26 Class for Interface -> multiplicityTable.cxx Task -> Configurable, Process Functions
27
28 Args:
29 object (parser_args() object): multiplicityTable.cxx Interface
30 """
31
32 def __init__(self, parserMultiplicityTable = argparse.ArgumentParser(add_help = False)):
33 super(MultiplicityTable, self).__init__()
34 self.parserMultiplicityTable = parserMultiplicityTable
35
36 def addArguments(self):
37 """
38 This function allows to add arguments for parser_args() function
39 """
40
41 # Predefined Selections
42 booleanSelections = ["true", "false"]
43
44 # Interface
45 groupMultiplicityTable = self.parserMultiplicityTable.add_argument_group(title = "Data processor options: multiplicity-table")
46 groupMultiplicityTable.add_argument(
47 "--isVertexZeq", help = "if true: do vertex Z eq mult table", action = "store", type = str.lower, choices = (booleanSelections),
48 ).completer = ChoicesCompleter(booleanSelections)
49
50 def parseArgs(self):
51 """
52 This function allows to save the obtained arguments to the parser_args() function
53
54 Returns:
55 Namespace: returns parse_args()
56 """
57
58 return self.parserMultiplicityTable.parse_args()
def __init__(self, parserMultiplicityTable=argparse.ArgumentParser(add_help=False))