-
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 pull request #12314 from hroskes/fix-systematic-misalignments-76X
Backport of #12313: fix systematic misalignment tool
- Loading branch information
Showing
4 changed files
with
140 additions
and
96 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
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
18 changes: 18 additions & 0 deletions
18
Alignment/TrackerAlignment/test/testProduceAllMisalignments.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,18 @@ | ||
#! /bin/bash | ||
|
||
#to use: | ||
#set the input geometry and IOV in testProduceSystematicMisalignment_cfg.py | ||
#set the output file name to outputfile.db or folder/outputfile.db | ||
# (outputfile.db is replaced by (misalignment name).db) | ||
|
||
#set the magnitude for each one in the comment after the -999 | ||
#set the phases for the phi dependent misalignments | ||
|
||
#then cmsenv and run this | ||
#don't bother submitting to a queue, the whole thing takes less than 2 minutes | ||
|
||
for a in $(grep Epsilon testProduceSystematicMisalignment_cfg.py | grep 999 | sed "s/Epsilon.*//"); do | ||
sed -r -e "s/(${a}Epsilon.*)-999. *#/\1/" -e "s|outputfile.db|${a}.db|" testProduceSystematicMisalignment_cfg.py > ${a}_cfg.py | ||
cmsRun ${a}_cfg.py | ||
rm ${a}_cfg.py | ||
done |
128 changes: 77 additions & 51 deletions
128
Alignment/TrackerAlignment/test/testProduceSystematicMisalignment_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 |
---|---|---|
@@ -1,75 +1,101 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
#================================= | ||
#inputs | ||
globaltag = '74X_dataRun2_Prompt_v4' #APEs are copied from this GT (and IdealGeometry and TrackerTopology are used) | ||
inputsqlitefile = None #if None, uses the GT alignment | ||
alignmenttag = 'Alignments' #tag name for TrackerAlignmentRcd in the input file, also used for the output file | ||
runnumberalignmentIOV = 1 #any run number in the iov that you want to start from | ||
|
||
process = cms.Process("TEST") | ||
process.load("FWCore.MessageService.MessageLogger_cfi") | ||
outputfilename = 'outputfile.db' | ||
|
||
|
||
#misalignment amplitudes, -999 means no misalignment | ||
#the commented numbers are the default magnitudes, which produce a maximum movement of around 600 microns | ||
#see Alignment/TrackerAlignment/plugins/TrackerSystematicMisalignments.cc for definitions | ||
#see also https://twiki.cern.ch/twiki/bin/viewauth/CMS/SystematicMisalignmentsofTracker | ||
radialEpsilon = -999. # 5e-4 | ||
telescopeEpsilon = -999. # 5e-4 | ||
layerRotEpsilon = -999. # 9.43e-6 #cm^-1 | ||
bowingEpsilon = -999. # 6.77e-9 #cm^-2 | ||
zExpEpsilon = -999. # 2.02e-4 | ||
twistEpsilon = -999. # 2.04e-6 #cm^-1 | ||
ellipticalEpsilon = -999. # 5e-4 | ||
skewEpsilon = -999. # 5.5e-2 #cm | ||
sagittaEpsilon = -999. # 5.0e-4 | ||
|
||
#phases for phi dependent misalignments | ||
ellipticalDelta = 0. | ||
skewDelta = 0. | ||
sagittaDelta = 0. | ||
#================================= | ||
|
||
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") | ||
|
||
process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") | ||
|
||
#process.load("CondCore.DBCommon.CondDBSetup_cfi") | ||
from CondCore.DBCommon.CondDBSetup_cfi import * | ||
|
||
process.source = cms.Source("EmptySource") | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("TrackerSystematicMisalignments") | ||
process.load("FWCore.MessageService.MessageLogger_cfi") | ||
|
||
process.load("Configuration.Geometry.GeometryRecoDB_cff") | ||
|
||
process.load("CondCore.DBCommon.CondDBSetup_cfi") | ||
process.source = cms.Source("EmptySource", | ||
firstRun=cms.untracked.uint32(runnumberalignmentIOV), | ||
) | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(1) | ||
input = cms.untracked.int32(1) | ||
) | ||
|
||
# initial geom | ||
# configure the database file - use survey one for default | ||
from CondCore.DBCommon.CondDBSetup_cfi import * | ||
process.trackerGeom = cms.ESSource("PoolDBESSource", | ||
CondDBSetup, | ||
timetype = cms.string('runnumber'), | ||
toGet = cms.VPSet( | ||
cms.PSet( | ||
record = cms.string('TrackerAlignmentRcd'), | ||
tag = cms.string('Alignments') | ||
), | ||
cms.PSet( | ||
record = cms.string('TrackerAlignmentErrorExtendedRcd'), | ||
tag = cms.string('AlignmentErrorsExtended') | ||
)), | ||
connect = cms.string('sqlite_file:inputdbfile.db') | ||
) | ||
|
||
|
||
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") | ||
process.GlobalTag.globaltag=globaltag | ||
if inputsqlitefile is not None: | ||
process.GlobalTag.toGet = cms.VPSet( | ||
cms.PSet( | ||
record = cms.string('TrackerAlignmentRcd'), | ||
tag = cms.string(alignmenttag), | ||
connect = cms.untracked.string('sqlite_file:'+inputsqlitefile), | ||
), | ||
) | ||
|
||
|
||
# input | ||
process.load("Alignment.TrackerAlignment.TrackerSystematicMisalignments_cfi") | ||
process.TrackerSystematicMisalignments.fromDBGeom = True | ||
|
||
#uncomment one or more of these to apply the misalignment(s) | ||
|
||
#process.TrackerSystematicMisalignments.radialEpsilon = 5.00e-4 # default 5e-4 ~ 600 um | ||
#process.TrackerSystematicMisalignments.telescopeEpsilon = 5.00e-4 # default 5e-4 ~ 600 um | ||
#process.TrackerSystematicMisalignments.layerRotEpsilon = 9.43e-6 # 9.43e-6 | ||
#process.TrackerSystematicMisalignments.bowingEpsilon = 6.77e-9 # 6.77e-9 | ||
#process.TrackerSystematicMisalignments.zExpEpsilon = 2.02e-4 # 2.02e-4 | ||
#process.TrackerSystematicMisalignments.twistEpsilon = 2.04e-6 # 2.04e-6 | ||
#process.TrackerSystematicMisalignments.ellipticalEpsilon = 5.00e-4 # 5e-4 | ||
#process.TrackerSystematicMisalignments.skewEpsilon = 5.5e-2 # 5.5e-2 | ||
#process.TrackerSystematicMisalignments.sagittaEpsilon = 5.00e-4 # 5.0e-4 | ||
process.TrackerSystematicMisalignments.radialEpsilon = radialEpsilon | ||
process.TrackerSystematicMisalignments.telescopeEpsilon = telescopeEpsilon | ||
process.TrackerSystematicMisalignments.layerRotEpsilon = layerRotEpsilon | ||
process.TrackerSystematicMisalignments.bowingEpsilon = bowingEpsilon | ||
process.TrackerSystematicMisalignments.zExpEpsilon = zExpEpsilon | ||
process.TrackerSystematicMisalignments.twistEpsilon = twistEpsilon | ||
process.TrackerSystematicMisalignments.ellipticalEpsilon = ellipticalEpsilon | ||
process.TrackerSystematicMisalignments.skewEpsilon = skewEpsilon | ||
process.TrackerSystematicMisalignments.sagittaEpsilon = sagittaEpsilon | ||
|
||
#misalignment phases | ||
process.TrackerSystematicMisalignments.ellipticalDelta = 0 | ||
process.TrackerSystematicMisalignments.skewDelta = 0 | ||
process.TrackerSystematicMisalignments.sagittaDelta = 0 | ||
process.TrackerSystematicMisalignments.ellipticalDelta = ellipticalDelta | ||
process.TrackerSystematicMisalignments.skewDelta = skewDelta | ||
process.TrackerSystematicMisalignments.sagittaDelta = sagittaDelta | ||
|
||
# output | ||
process.PoolDBOutputService = cms.Service("PoolDBOutputService", | ||
CondDBSetup, | ||
toPut = cms.VPSet(cms.PSet( | ||
record = cms.string('TrackerAlignmentRcd'), | ||
tag = cms.string('Alignments') | ||
), | ||
cms.PSet( | ||
record = cms.string('TrackerAlignmentErrorExtendedRcd'), | ||
tag = cms.string('AlignmentErrorsExtended') | ||
)), | ||
connect = cms.string('sqlite_file:outputdbfile.db') | ||
process.CondDBSetup, | ||
toPut = cms.VPSet( | ||
cms.PSet( | ||
record = cms.string('TrackerAlignmentRcd'), | ||
tag = cms.string(alignmenttag), | ||
), | ||
cms.PSet( | ||
record = cms.string('TrackerAlignmentErrorExtendedRcd'), | ||
tag = cms.string('AlignmentErrorsExtended'), | ||
), | ||
), | ||
connect = cms.string('sqlite_file:'+outputfilename), | ||
) | ||
|
||
process.p = cms.Path( process.TrackerSystematicMisalignments ) | ||
|
||
|