-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a unit test for createTrackerAlignmentRcds
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
72 changes: 72 additions & 0 deletions
72
Alignment/TrackerAlignment/test/createTrackerAlignmentRcds_Phase2_cfg.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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from __future__ import print_function | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
|
||
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings | ||
################################################################### | ||
# Setup 'standard' options | ||
################################################################### | ||
options = VarParsing.VarParsing() | ||
options.register('Scenario', | ||
_settings.DEFAULT_VERSION, # default value | ||
VarParsing.VarParsing.multiplicity.singleton, # singleton or list | ||
VarParsing.VarParsing.varType.string, # string, int, or float | ||
"geometry version to use") | ||
options.parseArguments() | ||
|
||
################################################################### | ||
# get Global Tag and ERA | ||
################################################################### | ||
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(options.Scenario) | ||
process = cms.Process("Alignment", ERA) | ||
|
||
process.load("Configuration.StandardSequences.MagneticField_cff") # B-field map | ||
if(options.Scenario == _settings.DEFAULT_VERSION): | ||
print("Loading default scenario: ", _settings.DEFAULT_VERSION) | ||
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff') | ||
else: | ||
process.load('Configuration.Geometry.GeometryExtended'+options.Scenario+'Reco_cff') | ||
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") # Global tag | ||
|
||
|
||
################################################################################ | ||
# parameters to configure: | ||
from Configuration.AlCa.GlobalTag import GlobalTag | ||
process.GlobalTag = GlobalTag(process.GlobalTag,GLOBAL_TAG) | ||
|
||
process.load("Alignment.TrackerAlignment.createIdealTkAlRecords_cfi") | ||
process.createIdealTkAlRecords.alignToGlobalTag = False | ||
################################################################################ | ||
|
||
usedGlobalTag = process.GlobalTag.globaltag.value() | ||
print("Using Global Tag:", usedGlobalTag) | ||
|
||
from CondCore.CondDB.CondDB_cfi import * | ||
process.PoolDBOutputService = cms.Service("PoolDBOutputService", | ||
CondDB, | ||
timetype = cms.untracked.string("runnumber"), | ||
toPut = cms.VPSet( | ||
cms.PSet( | ||
record = cms.string("TrackerAlignmentRcd"), | ||
tag = cms.string("Alignments") | ||
), | ||
cms.PSet( | ||
record = cms.string("TrackerAlignmentErrorExtendedRcd"), | ||
tag = cms.string("AlignmentErrorsExtended") | ||
), | ||
cms.PSet( | ||
record = cms.string("TrackerSurfaceDeformationRcd"), | ||
tag = cms.string("AlignmentSurfaceDeformations") | ||
), | ||
) | ||
) | ||
process.PoolDBOutputService.connect = \ | ||
("sqlite_file:tracker_alignment_payloads_"+ | ||
options.Scenario+("_reference.db" | ||
if process.createIdealTkAlRecords.createReferenceRcd | ||
else "_fromIdealGeometry.db")) | ||
|
||
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) | ||
process.source = cms.Source("EmptySource") | ||
|
||
process.p = cms.Path(process.createIdealTkAlRecords) |
7 changes: 7 additions & 0 deletions
7
Alignment/TrackerAlignment/test/testCreateReferenceRecords.sh
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
function die { echo $1: status $2 ; exit $2; } | ||
for test in $(ls $SCRAM_TEST_PATH | grep createTrackerAlignmentRcds); do | ||
echo -e "\n\nrunning unit test: " ${test} | ||
cmsRun $SCRAM_TEST_PATH/${test} || die "Failure running ${test}" $? | ||
done |