Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:23

0001 ########################################################################
0002 ###
0003 ###             Read out APEs from .db files and convert them to trees 
0004 ###             that can be read by the APE validation plot tools.
0005 ###
0006 ###             Intended to provide a straightforward comparison of 
0007 ###             measured APE values to values stored in .db files
0008 ###
0009 ########################################################################
0010 ###
0011 ###             HOW TO USE:
0012 ###                     1. Run the default setup procedure for the APE 
0013 ###                        tool (including creation of a TrackerTree)
0014 ###                     2. Configure the apeTreeCreateDefault tool below
0015 ###                        and run it with cmsRun
0016 ###                     3. Use output file in validation, for example in 
0017 ###                        macros/commandsDrawComparison.C
0018 ###
0019 ########################################################################
0020 
0021 import FWCore.ParameterSet.Config as cms
0022 from Alignment.APEEstimation.SectorBuilder_cff import *
0023 import os
0024 ##
0025 ## User options
0026 ##
0027 
0028 # Run number to use for data in case one uses a multi-IOV object
0029 theFirstRun = 1
0030 
0031 # Which global tag to use
0032 theGlobalTag = 'auto:phase1_2017_realistic'
0033 
0034 # Source from which to get the APE object
0035 theSource = 'frontier://FrontierProd/CMS_CONDITIONS'
0036 
0037 # Tag to extract the APE object
0038 theTag = 'TrackerAlignmentExtendedErrors_Upgrade2017_pseudoAsymptotic_v3'
0039 
0040 # Name and path of output File
0041 theOutputFile = 'defaultAPE.root'
0042 
0043 # Sector definitions, RecentSectors is the typical granularity
0044 theSectors = RecentSectors
0045 
0046 ##
0047 ## Process definition
0048 ##
0049 process = cms.Process("ApeTreeCreateDefault")
0050 
0051 
0052 
0053 ##
0054 ## Message Logger
0055 ##
0056 process.load("FWCore.MessageService.MessageLogger_cfi")
0057 process.MessageLogger.DefaultAPETree=dict()
0058 process.MessageLogger.SectorBuilder=dict()
0059 process.MessageLogger.cerr.INFO.limit = 0
0060 process.MessageLogger.cerr.default.limit = 0
0061 process.MessageLogger.cerr.DefaultAPETree = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0062 process.MessageLogger.cerr.SectorBuilder = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0063 
0064 
0065 
0066 ##
0067 ## Process options
0068 ##
0069 process.options = cms.untracked.PSet(
0070     wantSummary = cms.untracked.bool(True),
0071 )
0072 
0073 
0074 
0075 ##
0076 ## Input Files
0077 ##
0078 process.source = cms.Source("EmptySource", firstRun = cms.untracked.uint32(theFirstRun))
0079 
0080 
0081 
0082 ##
0083 ## Number of Events
0084 ##
0085 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0086 
0087 ### Load desired default APEs
0088 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0089 from Configuration.AlCa.GlobalTag import GlobalTag
0090 process.GlobalTag = GlobalTag(process.GlobalTag, theGlobalTag, '')
0091 
0092 from CondCore.CondDB.CondDB_cfi import *
0093 CondDBAlignmentError = CondDB.clone(connect = cms.string(theSource))
0094 process.myTrackerAlignmentErr = cms.ESSource("PoolDBESSource",
0095     CondDBAlignmentError,
0096     timetype = cms.string("runnumber"),
0097     toGet = cms.VPSet(
0098         cms.PSet(
0099             record = cms.string('TrackerAlignmentErrorExtendedRcd'),
0100             tag = cms.string(theTag)
0101         )
0102     )
0103 )
0104 process.es_prefer_trackerAlignmentErr = cms.ESPrefer("PoolDBESSource","myTrackerAlignmentErr")
0105 
0106 
0107 
0108 ##
0109 ## Define Sequence
0110 ##
0111 process.ApeTreeCreateDefaultSequence = cms.Sequence()
0112 
0113 process.ApeTreeCreateDefault = cms.EDAnalyzer('ApeTreeCreateDefault',
0114     resultFile = cms.string(theOutputFile),
0115     trackerTreeFile = cms.string(os.environ['CMSSW_BASE'] + '/src/Alignment/TrackerAlignment/hists/TrackerTree.root'),
0116     sectors = theSectors,
0117 )
0118                                                               
0119 
0120 process.ApeTreeCreateDefaultSequence *= process.ApeTreeCreateDefault
0121 
0122 
0123 
0124 ##
0125 ## Path
0126 ##
0127 process.p = cms.Path(
0128     process.ApeTreeCreateDefaultSequence
0129 )
0130 
0131 
0132 
0133 
0134 
0135