-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix systematic misalignment tool #12313
Merged
cmsbuild
merged 3 commits into
cms-sw:CMSSW_8_0_X
from
hroskes:fix-systematic-misalignments-80X
Nov 10, 2015
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hroskes what is the reason to remove the possibility to write the APEs? I think it might still be useful even if it's not directly used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really see the use case. All it did was take the APEs from the GT (or input sqlite file if you want) and copy them to the output sqlite file. What would it even mean to "misalign" the APEs?
If you think it would be useful I can add it back.
I'd like to extend this soon by adding misalignment for surface deformations, but I want to understand them better first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use case is exactly this: take the APEs from the GT (or input sqlite file if you want) and copy them to the output sqlite file. Indeed it doesn't make sense to misalign the APE, but creating an APE payload that matches the misalignment you create makes a lot of sense to me. This functionality is not available but costs little effort to implement.