Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MillePede: force user to specify cosmics-related settings #29838

Merged
merged 2 commits into from
May 19, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 33 additions & 19 deletions Alignment/MillePedeAlignmentAlgorithm/scripts/mps_alisetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,25 @@ def _create_mille_jobs(self):
tmpFile = re.sub(collection_regex,
'setupCollection = \"'+dataset["collection"]+'\"',
tmpFile)
if dataset['cosmicsZeroTesla']:
tmpFile = re.sub(czt_regex,
'setupCosmicsZeroTesla = True',
tmpFile)
if dataset['cosmicsDecoMode']:
tmpFile = re.sub(cdm_regex,
'setupCosmicsDecoMode = True',
tmpFile)
if "ALCARECOTkAlCosmics" in dataset["collection"]:
if dataset['cosmicsZeroTesla']:
tmpFile = re.sub(czt_regex,
'setupCosmicsZeroTesla = True',
tmpFile)
else :
tmpFile = re.sub(czt_regex,
'setupCosmicsZeroTesla = False',
tmpFile)

if dataset['cosmicsDecoMode']:
tmpFile = re.sub(cdm_regex,
'setupCosmicsDecoMode = True',
tmpFile)
else:
tmpFile = re.sub(cdm_regex,
'setupCosmicsDecoMode = False',
tmpFile)

if dataset['primaryWidth'] > 0.0:
tmpFile = re.sub(pw_regex,
'setupPrimaryWidth = '+str(dataset["primaryWidth"]),
Expand Down Expand Up @@ -339,8 +350,7 @@ def _create_mille_jobs(self):
print("-"*75)
print("Baseconfig: ", dataset["configTemplate"])
print("Collection: ", dataset["collection"])
if dataset["collection"] in ("ALCARECOTkAlCosmicsCTF0T",
"ALCARECOTkAlCosmicsInCollisions"):
if "ALCARECOTkAlCosmics" in dataset["collection"]:
print("cosmicsDecoMode: ", dataset["cosmicsDecoMode"])
print("cosmicsZeroTesla: ", dataset["cosmicsZeroTesla"])
print("Globaltag: ", dataset["globaltag"])
Expand Down Expand Up @@ -777,15 +787,19 @@ def _fetch_datasets(self):
sys.exit(1)

# extract non-essential options
self._datasets[name]["cosmicsZeroTesla"] = False
if config["config"].has_option(section,"cosmicsZeroTesla"):
self._datasets[name]["cosmicsZeroTesla"] \
= config["config"].getboolean(section,"cosmicsZeroTesla")

self._datasets[name]["cosmicsDecoMode"] = False
if config["config"].has_option(section,"cosmicsDecoMode"):
self._datasets[name]["cosmicsDecoMode"] \
= config["config"].getboolean(section,"cosmicsDecoMode")
if "ALCARECOTkAlCosmics" in self._datasets[name]["collection"]:
try:
self._datasets[name]["cosmicsZeroTesla"] \
= config["config"].getboolean(section,"cosmicsZeroTesla")
except ConfigParser.NoOptionError:
print("No option cosmicsZeroTesla found in", section,"even though it is required for dataset type", self._datasets[name]["collection"], ". Please check ini-file.")
sys.exit(1)
try:
self._datasets[name]["cosmicsDecoMode"] \
= config["config"].getboolean(section,"cosmicsDecoMode")
except ConfigParser.NoOptionError:
print("No option cosmicsDecoMode found in", section,"even though it is required for dataset type", self._datasets[name]["collection"], ".Please check ini-file.")
sys.exit(1)

self._datasets[name]["primaryWidth"] = -1.0
if config["config"].has_option(section,"primaryWidth"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,18 @@ FirstRunForStartGeometry = 0
;# inputFileList: Path to the list of datafiles. You can use the string ${datasetdir} which
;# is later replaced by the value of the datasetdir-variable in the general section.
;#
;# REQUIRED FOR COSMICS ONLY:
;# cosmicsDecoMode: Toggle deconvolution mode for cosmics. Was called apvmode before.
;#
;# cosmicsZeroTesla: Set to "true" for cosmics at 0T. Set to "false" for cosmics at 3.8T.
;#
;###############################################################################
;# OPTIONAL VARIABLES:
;#
;# njobs: Overwrite the number of jobs. Per default mps_alisetup.py counts the number of
;# files listed in the Inputfilelist and submits this number as njobs. You can overwrite this
;# with any lower number. If the number of jobs here exceeds the default, the default is used.
;#
;# cosmicsDecoMode: Toggle deconvolution mode for cosmics. Was called apvmode before.
;# Default is "false".
;#
;# cosmicsZeroTesla: Set to "true" for cosmics at 0T. Set to "false" for cosmics at 3.8T.
;# Default is "false".
;#
;# primarywidth: Set a different primaryWidth for the AlignmentProducer.
;# Usage: primaryWidth = <somefloat>
;# Useful for di-muon collections (from Z/Upsilon) to tune this value.
Expand Down