-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'CMSSW_14_2_X_2024-11-11-2300' into CMSSW_14_1_0_pre3_LST_X…
…_LSTCore_realfiles
- Loading branch information
Showing
110 changed files
with
13,258 additions
and
2,486 deletions.
There are no files selected for viewing
35 changes: 30 additions & 5 deletions
35
Alignment/MillePedeAlignmentAlgorithm/python/alignmentsetup/GeneralSetup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,54 @@ | ||
from __future__ import print_function | ||
def setup(process, global_tag, zero_tesla = False): | ||
import re | ||
|
||
def setup(process, global_tag, zero_tesla=False, geometry=""): | ||
"""General setup of an alignment process. | ||
Arguments: | ||
- `process`: cms.Process object | ||
- `global_tag`: global tag to be used | ||
- `zero_tesla`: if 'True' the B-field map for 0T is enforced | ||
- `geometry`: geometry to be used (default is an empty string for the standard geometry) | ||
""" | ||
|
||
# MessageLogger for convenient output | ||
# -------------------------------------------------------------------------- | ||
process.load('Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.myMessageLogger_cff') | ||
|
||
# Load the conditions | ||
# Load the magnetic field configuration | ||
# -------------------------------------------------------------------------- | ||
if zero_tesla: | ||
# actually only needed for 0T MC samples, but does not harm for 0T data: | ||
# For 0T MC samples or data | ||
process.load("Configuration.StandardSequences.MagneticField_0T_cff") | ||
else: | ||
process.load('Configuration.StandardSequences.MagneticField_cff') | ||
process.load('Configuration.Geometry.GeometryRecoDB_cff') | ||
|
||
# Load the geometry | ||
# -------------------------------------------------------------------------- | ||
if geometry == "": | ||
# Default geometry | ||
print(f"Using Geometry from DB") | ||
process.load('Configuration.Geometry.GeometryRecoDB_cff') | ||
else: | ||
# Check if the geometry string matches the format "Extended<X>", e.g. Extended2026D110 | ||
if re.match(r"^Extended\w+$", geometry): | ||
# Dynamically load the specified geometry | ||
geometry_module = f"Configuration.Geometry.Geometry{geometry}Reco_cff" | ||
try: | ||
process.load(geometry_module) | ||
print(f"Using Geometry: {geometry_module}") | ||
except Exception as e: | ||
print(f"Error: Unable to load the geometry module '{geometry_module}'.\n{e}") | ||
raise | ||
else: | ||
raise ValueError(f"Invalid geometry format: '{geometry}'. Expected format is 'Extended<X>'.") | ||
|
||
# Load the conditions (GlobalTag) | ||
# -------------------------------------------------------------------------- | ||
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") | ||
|
||
from Configuration.AlCa.GlobalTag import GlobalTag | ||
process.GlobalTag = GlobalTag(process.GlobalTag, global_tag) | ||
print("Using Global Tag:", process.GlobalTag.globaltag._value) | ||
|
||
return process # not required because the cms.Process is modified in place | ||
return process # Not required since the cms.Process object is modified in place |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.