Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![doxygen](https://img.shields.io/badge/doxygen-documentation-blue.svg)](https://dquserinterfaceoop.github.io/docs/html/)

This project includes python based user interface development for PWG-DQ Workflows based on nightly-20220912. You can follow the instructions and you can find tutorials in table of contents (For prerequisites, Installation guide for argcomplete and Some Informations good to know).
This project includes python based user interface development for PWG-DQ Workflows based on nightly-20220914. You can follow the instructions and you can find tutorials in table of contents (For prerequisites, Installation guide for argcomplete and Some Informations good to know).

## Contact
Ionut Cristian Arsene (Owner of [`O2DQWorkflows`](https://github.com/iarsene/O2DQworkflows))
Expand Down
55 changes: 55 additions & 0 deletions commondeps/trackselection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# -*- coding: utf-8 -*-

# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

# Orginal Task: https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/trackselection.cxx

import argparse

from argcomplete.completers import ChoicesCompleter

class TrackSelectionTask(object):
"""
Class for Interface -> trackselection.cxx.cxx Task -> Configurable, Process Functions

Args:
object (parser_args() object): trackselection.cxx.cxx Interface
"""

def __init__(self, parserTrackSelectionTask=argparse.ArgumentParser(add_help=False)):
super(TrackSelectionTask, self).__init__()
self.parserTrackSelectionTask = parserTrackSelectionTask

def addArguments(self):
"""
This function allows to add arguments for parser_args() function
"""

# Predefined Selections
itsMatchingSelections = ["0","1","2"]

# Interface
groupTrackSelectionTask = self.parserTrackSelectionTask.add_argument_group(title="Data processor options: track-selection")
groupTrackSelectionTask.add_argument("--itsMatching", help="condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSibAny, 2: Run3ITSallAny, 3: Run3ITSall7Layers)", action="store", type=str, choices=(itsMatchingSelections)).completer = ChoicesCompleter(itsMatchingSelections)


def parseArgs(self):
"""
This function allows to save the obtained arguments to the parser_args() function

Returns:
Namespace: returns parse_args()
"""

return self.parserTrackSelectionTask.parse_args()
3 changes: 2 additions & 1 deletion configs/configFilterPPDataRun2.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "false"
"isRun3": "false",
"itsMatching": "0"
}
}
3 changes: 2 additions & 1 deletion configs/configFilterPPDataRun3.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "true"
"isRun3": "true",
"itsMatching": "0"
}
}
3 changes: 2 additions & 1 deletion configs/configFlowDataRun2.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"processRun3": "false"
},
"track-selection": {
"isRun3": "false"
"isRun3": "false",
"itsMatching": "0"
},
"event-selection-task": {
"syst": "PbPb",
Expand Down
3 changes: 2 additions & 1 deletion configs/configFlowDataRun3.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"processRun3": "true"
},
"track-selection": {
"isRun3": "true"
"isRun3": "true",
"itsMatching": "0"
},
"event-selection-task": {
"syst": "PbPb",
Expand Down
3 changes: 2 additions & 1 deletion configs/configTableMakerDataRun2.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "false"
"isRun3": "false",
"itsMatching": "0"
},
"weak-decay-indices-cascades": "",
"v0-selector": {
Expand Down
3 changes: 2 additions & 1 deletion configs/configTableMakerDataRun3.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "true"
"isRun3": "true",
"itsMatching": "0"
},
"weak-decay-indices-cascades": "",
"v0-selector": {
Expand Down
3 changes: 2 additions & 1 deletion configs/configTableMakerMCRun2.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "false"
"isRun3": "false",
"itsMatching": "0"
},
"table-maker-m-c": {
"cfgEventCuts": "eventStandardNoINT7",
Expand Down
3 changes: 2 additions & 1 deletion configs/configTableMakerMCRun3.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "true"
"isRun3": "true",
"itsMatching": "0"
},
"table-maker-m-c": {
"cfgEventCuts": "eventStandardNoINT7",
Expand Down
3 changes: 2 additions & 1 deletion configs/configV0SelectorDataRun2.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "false"
"isRun3": "false",
"itsMatching": "0"
},
"weak-decay-indices-cascades": "",
"v0-selector": {
Expand Down
3 changes: 2 additions & 1 deletion configs/configV0SelectorDataRun3.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"processOnlyFT0": "false"
},
"track-selection": {
"isRun3": "true"
"isRun3": "true",
"itsMatching": "0"
},
"weak-decay-indices-cascades": "",
"v0-selector": {
Expand Down
4 changes: 2 additions & 2 deletions dqtasks/tableMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def addArguments(self):
# Interface

# table-maker configurables
groupTableMakerConfigs = self.parserTableMaker.add_argument_group(title="Data processor options: table-maker-m-c")
groupTableMakerConfigs = self.parserTableMaker.add_argument_group(title="Data processor options: table-maker")
groupTableMakerConfigs.add_argument("--cfgEventCuts", help="Space separated list of event cuts", nargs="*", action="store", type=str, metavar="CFGEVENTCUTS", choices=allAnalysisCuts).completer = ChoicesCompleterList(allAnalysisCuts)
groupTableMakerConfigs.add_argument("--cfgBarrelTrackCuts", help=" Space separated list of barrel track cuts", nargs="*", action="store", type=str, metavar="CFGBARRELTRACKCUTS", choices=allAnalysisCuts).completer = ChoicesCompleterList(allAnalysisCuts)
groupTableMakerConfigs.add_argument("--cfgMuonCuts", help="Space separated list of muon cuts in table-maker", action="store", nargs="*", type=str, metavar="CFGMUONCUTS", choices=allAnalysisCuts).completer = ChoicesCompleterList(allAnalysisCuts)
Expand All @@ -170,7 +170,7 @@ def addArguments(self):
groupTableMakerConfigs.add_argument("--cfgMinTpcSignal", help="Minimum TPC signal", action="store", type=str)
groupTableMakerConfigs.add_argument("--cfgMaxTpcSignal", help="Maximum TPC signal", action="store", type=str)

groupProcessTableMaker = self.parserTableMaker.add_argument_group(title="Data processor options: table-maker-m-c")
groupProcessTableMaker = self.parserTableMaker.add_argument_group(title="Data processor options: table-maker")
groupProcessTableMaker.add_argument("--process",help="Process Selection options for tableMaker/tableMakerMC Data Processing and Skimming", action="store", type=str, nargs="*", metavar="PROCESS", choices=tableMakerProcessSelectionsList).completer = ChoicesCompleterList(tableMakerProcessSelectionsList)
for key,value in tableMakerProcessSelections.items():
groupProcessTableMaker.add_argument(key, help=value, action="none")
Expand Down
2 changes: 1 addition & 1 deletion dqtasks/v0selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def addArguments(self):

# Interface
groupV0Selector = self.parserV0selector.add_argument_group(title="Data processor options: v0-selector")
groupV0Selector.add_argument("--d_bz_input", help="bz field in kG", action="store", type=str)
groupV0Selector.add_argument("--d_bz_input", help="bz field in kG, -999 is automatic", action="store", type=str)
groupV0Selector.add_argument("--v0cospa", help="v0cospa", action="store", type=str)
groupV0Selector.add_argument("--dcav0dau", help="DCA V0 Daughters", action="store", type=str)
groupV0Selector.add_argument("--v0Rmin", help="v0Rmin", action="store", type=str)
Expand Down
14 changes: 13 additions & 1 deletion runDQFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
from commondeps.pidTOFBeta import TofPidBeta
from commondeps.pidTPCTOFFull import TpcTofPidFull
from commondeps.trackPropagation import TrackPropagation
from commondeps.trackselection import TrackSelectionTask

from dqtasks.dqFlow import AnalysisQvector

from pycacheRemover import PycacheRemover
Expand Down Expand Up @@ -120,6 +122,7 @@ def __init__(self,
tofPidBeta =TofPidBeta(),
tpcTofPidFull=TpcTofPidFull(),
trackPropagation=TrackPropagation(),
trackSelection=TrackSelectionTask(),
debugOptions=DebugOptions()
):
super(RunAnalysisQvector, self).__init__()
Expand All @@ -132,6 +135,7 @@ def __init__(self,
self.tofPidBeta = tofPidBeta
self.tpcTofPidFull = tpcTofPidFull
self.trackPropagation = trackPropagation
self.trackSelection = trackSelection
self.debugOptions = debugOptions
self.parserRunAnalysisQvector.register("action", "none", NoAction)
self.parserRunAnalysisQvector.register("action", "store_choice", ChoicesAction)
Expand Down Expand Up @@ -198,6 +202,9 @@ def mergeArgs(self):

self.trackPropagation.parserTrackPropagation = self.parserRunAnalysisQvector
self.trackPropagation.addArguments()

self.trackSelection.parserTrackSelectionTask = self.parserRunAnalysisQvector
self.trackSelection.addArguments()

self.debugOptions.parserDebugOptions = self.parserRunAnalysisQvector
self.debugOptions.addArguments()
Expand Down Expand Up @@ -502,7 +509,12 @@ def mergeMultiArgs(self, *objects):
elif value != extrargs.FT0:
value2 = "false"
config[key][value] = value2
logging.debug(" - [%s] %s : %s",key,value,value2)
logging.debug(" - [%s] %s : %s",key,value,value2)

# track-selection
if extrargs.itsMatching:
config[key][value] = extrargs.itsMatching
logging.debug(" - [%s] %s : %s",key,value,extrargs.itsMatching)

# AOD File Checker
if extrargs.aod != None:
Expand Down
13 changes: 12 additions & 1 deletion runFilterPP.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from commondeps.pidTOFBeta import TofPidBeta
from commondeps.pidTPCTOFFull import TpcTofPidFull
from commondeps.trackPropagation import TrackPropagation
from commondeps.trackselection import TrackSelectionTask

from dqtasks.filterPP import DQFilterPPTask

Expand Down Expand Up @@ -127,6 +128,7 @@ def __init__(self,
tofPidBeta=TofPidBeta(),
tpcTofPidFull=TpcTofPidFull(),
trackPropagation=TrackPropagation(),
trackSelection=TrackSelectionTask(),
debugOptions=DebugOptions()
):
super(RunFilterPP, self).__init__()
Expand All @@ -138,6 +140,7 @@ def __init__(self,
self.tofPidBeta = tofPidBeta
self.tpcTofPidFull = tpcTofPidFull
self.trackPropagation = trackPropagation
self.trackSelection = trackSelection
self.debugOptions = debugOptions
self.parserRunFilterPP.register("action", "none", NoAction)
self.parserRunFilterPP.register("action", "store_choice", ChoicesAction)
Expand Down Expand Up @@ -201,6 +204,9 @@ def mergeArgs(self):

self.trackPropagation.parserTrackPropagation = self.parserRunFilterPP
self.trackPropagation.addArguments()

self.trackSelection.parserTrackSelectionTask = self.parserRunFilterPP
self.trackSelection.addArguments()

self.debugOptions.parserDebugOptions = self.parserRunFilterPP
self.debugOptions.addArguments()
Expand Down Expand Up @@ -551,7 +557,12 @@ def mergeMultiArgs(self, *objects):
elif value != extrargs.FT0:
value2 = "false"
config[key][value] = value2
logging.debug(" - [%s] %s : %s",key,value,value2)
logging.debug(" - [%s] %s : %s",key,value,value2)

# track-selection
if extrargs.itsMatching:
config[key][value] = extrargs.itsMatching
logging.debug(" - [%s] %s : %s",key,value,extrargs.itsMatching)


if value == "processDummy" and extrargs.autoDummy:
Expand Down
13 changes: 12 additions & 1 deletion runTableMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from commondeps.pidTOFBeta import TofPidBeta
from commondeps.pidTPCTOFFull import TpcTofPidFull
from commondeps.trackPropagation import TrackPropagation
from commondeps.trackselection import TrackSelectionTask

from dqtasks.tableMaker import TableMaker
from dqtasks.v0selector import V0selector
Expand Down Expand Up @@ -172,6 +173,7 @@ def __init__(self,
tofPidBeta =TofPidBeta(),
tpcTofPidFull=TpcTofPidFull(),
trackPropagation=TrackPropagation(),
trackSelection=TrackSelectionTask(),
v0selector = V0selector(),
tableMaker=TableMaker(),
debugOptions=DebugOptions()
Expand All @@ -185,6 +187,7 @@ def __init__(self,
self.tofPidBeta = tofPidBeta
self.tpcTofPidFull = tpcTofPidFull
self.trackPropagation = trackPropagation
self.trackSelection = trackSelection
self.v0selector = v0selector
self.tableMaker = tableMaker
self.debugOptions = debugOptions
Expand Down Expand Up @@ -256,6 +259,9 @@ def mergeArgs(self):
self.trackPropagation.parserTrackPropagation = self.parserRunTableMaker
self.trackPropagation.addArguments()

self.trackSelection.parserTrackSelectionTask = self.parserRunTableMaker
self.trackSelection.addArguments()

self.v0selector.parserV0selector = self.parserRunTableMaker
self.v0selector.addArguments()

Expand Down Expand Up @@ -930,7 +936,12 @@ def mergeMultiArgs(self, *objects):
config[key]["processStandard"] = "false"
config[key]["processCovariance"] = "true"
logging.debug(" - [%s] processStandart : false",key)
logging.debug(" - [%s] processCovariance : true",key)
logging.debug(" - [%s] processCovariance : true",key)

# track-selection
if extrargs.itsMatching:
config[key][value] = extrargs.itsMatching
logging.debug(" - [%s] %s : %s",key,value,extrargs.itsMatching)

# dummy automizer
if value == "processDummy" and extrargs.autoDummy and extrargs.runData:
Expand Down
13 changes: 12 additions & 1 deletion runTableMakerMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from commondeps.pidTOFBeta import TofPidBeta
from commondeps.pidTPCTOFFull import TpcTofPidFull
from commondeps.trackPropagation import TrackPropagation
from commondeps.trackselection import TrackSelectionTask

from dqtasks.tableMakerMC import TableMakerMC

Expand Down Expand Up @@ -176,6 +177,7 @@ def __init__(self,
tofPidBeta=TofPidBeta(),
tpcTofPidFull=TpcTofPidFull(),
trackPropagation=TrackPropagation(),
trackSelection=TrackSelectionTask(),
tableMakerMC=TableMakerMC(),
debugOptions=DebugOptions()
):
Expand All @@ -188,6 +190,7 @@ def __init__(self,
self.tofPidBeta = tofPidBeta
self.tpcTofPidFull = tpcTofPidFull
self.trackPropagation = trackPropagation
self.trackSelection = trackSelection
self.tableMakerMC = tableMakerMC
self.debugOptions = debugOptions
self.parserRunTableMakerMC.register("action", "none", NoAction)
Expand Down Expand Up @@ -261,6 +264,9 @@ def mergeArgs(self):
self.trackPropagation.parserTrackPropagation = self.parserRunTableMakerMC
self.trackPropagation.addArguments()

self.trackSelection.parserTrackSelectionTask = self.parserRunTableMakerMC
self.trackSelection.addArguments()

self.tableMakerMC.parserTableMakerMC = self.parserRunTableMakerMC
self.tableMakerMC.addArguments()

Expand Down Expand Up @@ -763,7 +769,12 @@ def mergeMultiArgs(self, *objects):
config[key]["processStandard"] = "false"
config[key]["processCovariance"] = "true"
logging.debug(" - [%s] processStandart : false",key)
logging.debug(" - [%s] processCovariance : true",key)
logging.debug(" - [%s] processCovariance : true",key)

# track-selection
if extrargs.itsMatching:
config[key][value] = extrargs.itsMatching
logging.debug(" - [%s] %s : %s",key,value,extrargs.itsMatching)

# Centrality table delete for pp processes
if extrargs.process and len(centSearch) != 0 and (extrargs.syst == "pp" or (extrargs.syst == None and config["event-selection-task"]["syst"] == "pp")):
Expand Down
Loading