|
1 | 1 | #! /usr/bin/env cmsRun |
2 | 2 | # Author: Marco Musich (October 2021) |
3 | 3 | import FWCore.ParameterSet.Config as cms |
4 | | -process = cms.Process("TEST") |
| 4 | +import FWCore.ParameterSet.VarParsing as VarParsing |
| 5 | + |
| 6 | +################################################################### |
| 7 | +# Set default phase-2 settings |
| 8 | +################################################################### |
| 9 | +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings |
| 10 | +_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION) |
| 11 | + |
| 12 | +process = cms.Process("TEST",_PH2_ERA) |
| 13 | +options = VarParsing.VarParsing('analysis') |
| 14 | +options.register('fromESSource', |
| 15 | + False, # default value |
| 16 | + VarParsing.VarParsing.multiplicity.singleton, |
| 17 | + VarParsing.VarParsing.varType.bool, |
| 18 | + "Populate SiPhase2OuterTrackerLorentzAngleRcd from the ESSource") |
| 19 | +options.parseArguments() |
5 | 20 |
|
6 | 21 | ################################################################### |
7 | 22 | # Messages |
|
20 | 35 | ), |
21 | 36 | SiPhase2OuterTrackerLorentzAngleReader = cms.untracked.PSet( limit = cms.untracked.int32(-1)), |
22 | 37 | SiPhase2OuterTrackerLorentzAngle = cms.untracked.PSet( limit = cms.untracked.int32(-1)), |
| 38 | + SiPhase2OuterTrackerFakeLorentzAngleESSource = cms.untracked.PSet( limit = cms.untracked.int32(-1)) |
23 | 39 | ) |
24 | 40 |
|
25 | 41 | ################################################################### |
|
36 | 52 | ################################################################### |
37 | 53 | # Input data |
38 | 54 | ################################################################### |
39 | | -tag = 'SiPhase2OuterTrackerLorentzAngle_T33' |
40 | | -suffix = 'v0' |
41 | | -inFile = tag+'_'+suffix+'.db' |
42 | | -inDB = 'sqlite_file:'+inFile |
| 55 | +if(options.fromESSource): |
| 56 | + process.load("Configuration.Geometry.GeometryExtended2026Default_cff") |
| 57 | + process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff') |
| 58 | + process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") |
| 59 | + from Configuration.AlCa.GlobalTag import GlobalTag |
| 60 | + process.GlobalTag = GlobalTag(process.GlobalTag, _PH2_GLOBAL_TAG, '') |
| 61 | + |
| 62 | + # process.SiPhase2OTFakeLorentzAngleESSource = cms.ESSource('SiPhase2OuterTrackerFakeLorentzAngleESSource', |
| 63 | + # LAValue = cms.double(0.014), |
| 64 | + # recordName = cms.string("LorentzAngle")) |
| 65 | + # process.es_prefer_fake_LA = cms.ESPrefer("SiPhase2OuterTrackerFakeLorentzAngleESSource","SiPhase2OTFakeLorentzAngleESSource") |
| 66 | + |
| 67 | + from CalibTracker.SiPhase2TrackerESProducers.SiPhase2OuterTrackerFakeLorentzAngleESSource_cfi import SiPhase2OTFakeLorentzAngleESSource |
| 68 | + process.mySiPhase2OTFakeLorentzAngleESSource = SiPhase2OTFakeLorentzAngleESSource.clone(LAValue = cms.double(0.14)) |
| 69 | + process.es_prefer_fake_LA = cms.ESPrefer("SiPhase2OuterTrackerFakeLorentzAngleESSource","mySiPhase2OTFakeLorentzAngleESSource") |
| 70 | +else: |
| 71 | + tag = 'SiPhase2OuterTrackerLorentzAngle_T33' |
| 72 | + suffix = 'v0' |
| 73 | + inFile = tag+'_'+suffix+'.db' |
| 74 | + inDB = 'sqlite_file:'+inFile |
43 | 75 |
|
44 | | -process.load("CondCore.CondDB.CondDB_cfi") |
45 | | -# input database (in this case the local sqlite file) |
46 | | -process.CondDB.connect = inDB |
| 76 | + process.load("CondCore.CondDB.CondDB_cfi") |
| 77 | + # input database (in this case the local sqlite file) |
| 78 | + process.CondDB.connect = inDB |
47 | 79 |
|
48 | | -process.PoolDBESSource = cms.ESSource("PoolDBESSource", |
49 | | - process.CondDB, |
50 | | - DumpStat=cms.untracked.bool(True), |
51 | | - toGet = cms.VPSet(cms.PSet(record = cms.string("SiPhase2OuterTrackerLorentzAngleRcd"), |
52 | | - tag = cms.string(tag)) |
53 | | - ) |
54 | | - ) |
| 80 | + process.PoolDBESSource = cms.ESSource("PoolDBESSource", |
| 81 | + process.CondDB, |
| 82 | + DumpStat=cms.untracked.bool(True), |
| 83 | + toGet = cms.VPSet(cms.PSet(record = cms.string("SiPhase2OuterTrackerLorentzAngleRcd"), |
| 84 | + tag = cms.string(tag)) |
| 85 | + ) |
| 86 | + ) |
55 | 87 |
|
56 | 88 | ################################################################### |
57 | 89 | # check the ES data getter |
|
0 commit comments