Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-03 23:51:43

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 process = cms.Process("Test")
0006 options = VarParsing.VarParsing()
0007 options.register('isPhase2',
0008                  False, # default value
0009                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0010                  VarParsing.VarParsing.varType.bool, # string, int, or float
0011                  "change for phase2")
0012 options.register('isBPix',
0013                  False, # default value
0014                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0015                  VarParsing.VarParsing.varType.bool, # string, int, or float
0016                  "switch for BPix")
0017 options.register('isFPix',
0018                  False, # default value
0019                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0020                  VarParsing.VarParsing.varType.bool, # string, int, or float
0021                  "switch for FPix")
0022 options.register('isByModule',
0023                  False, # default value
0024                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0025                  VarParsing.VarParsing.varType.bool, # string, int, or float
0026                  "switch for by Module")
0027 options.parseArguments()
0028 
0029 process.maxEvents = cms.untracked.PSet(
0030     input = cms.untracked.int32(1)
0031 )
0032 process.source = cms.Source("EmptySource",
0033                             firstRun = cms.untracked.uint32(1)
0034                             )
0035 
0036 process.TFileService = cms.Service("TFileService",
0037                                    fileName = cms.string("siPixelLorentzAngle_histo.root")
0038                                    )
0039 
0040 process.MessageLogger = cms.Service("MessageLogger",
0041     cerr = cms.untracked.PSet(
0042         enable = cms.untracked.bool(False)
0043     ),
0044     cout = cms.untracked.PSet(
0045         enable = cms.untracked.bool(True),
0046         threshold = cms.untracked.string('WARNING')
0047     )
0048 )
0049 
0050 process.Timing = cms.Service("Timing")
0051 
0052 
0053 ## import the ESSource
0054 from CalibTracker.SiPixelESProducers.siPixelFakeLorentzAngleESSource_cfi import siPixelFakeLorentzAngleESSource
0055 
0056 BPIX_LAYER1=0.0595
0057 BPIX_LAYER_2_MODULE_1_4 = 0.0765
0058 BPIX_LAYER_2_MODULE_5_8 = 0.0805
0059 BPIX_LAYER_3_MODULE_1_4 = 0.0864
0060 BPIX_LAYER_3_MODULE_5_8 = 0.0929
0061 BPIX_LAYER_4_MODULE_1_4 = 0.0961
0062 BPIX_LAYER_4_MODULE_5_8 = 0.1036
0063 
0064 FPix_300V_RNG1_PNL1 = 0.0805
0065 FPix_300V_RNG1_PNL2 = 0.0788
0066 FPix_300V_RNG2_PNL1 = 0.0756
0067 FPix_300V_RNG2_PNL2 = 0.0736
0068 
0069 process.SiPixelFakeLorentzAngleESSource = siPixelFakeLorentzAngleESSource.clone()
0070 
0071 if(options.isPhase2):
0072     print(" ========> Testing Phase-2")
0073     process.SiPixelFakeLorentzAngleESSource.appendToDataLabel = cms.string("forPhase2")
0074     process.SiPixelFakeLorentzAngleESSource.bPixLorentzAnglePerTesla = cms.untracked.double(0.106)
0075     process.SiPixelFakeLorentzAngleESSource.fPixLorentzAnglePerTesla = cms.untracked.double(0.106)
0076     process.SiPixelFakeLorentzAngleESSource.file = 'SLHCUpgradeSimulations/Geometry/data/PhaseII/Tilted/PixelSkimmedGeometryT14.txt'
0077     process.SiPixelFakeLorentzAngleESSource.topologyInput = 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'
0078 else:
0079     if(options.isBPix):
0080         print("  ========> Testing BPix parameters")
0081         process.SiPixelFakeLorentzAngleESSource.BPixParameters = cms.VPSet(
0082             cms.PSet(layer = cms.int32(1), angle = cms.double(BPIX_LAYER1)),
0083             cms.PSet(layer = cms.int32(2), module = cms.int32(1), angle = cms.double(BPIX_LAYER_2_MODULE_1_4)),
0084             cms.PSet(layer = cms.int32(2), module = cms.int32(2), angle = cms.double(BPIX_LAYER_2_MODULE_1_4)),
0085             cms.PSet(layer = cms.int32(2), module = cms.int32(3), angle = cms.double(BPIX_LAYER_2_MODULE_1_4)),
0086             cms.PSet(layer = cms.int32(2), module = cms.int32(4), angle = cms.double(BPIX_LAYER_2_MODULE_1_4)),
0087             cms.PSet(layer = cms.int32(2), module = cms.int32(5), angle = cms.double(BPIX_LAYER_2_MODULE_5_8)),
0088             cms.PSet(layer = cms.int32(2), module = cms.int32(6), angle = cms.double(BPIX_LAYER_2_MODULE_5_8)),
0089             cms.PSet(layer = cms.int32(2), module = cms.int32(7), angle = cms.double(BPIX_LAYER_2_MODULE_5_8)),
0090             cms.PSet(layer = cms.int32(2), module = cms.int32(8), angle = cms.double(BPIX_LAYER_2_MODULE_5_8)),
0091             cms.PSet(layer = cms.int32(3), module = cms.int32(1), angle = cms.double(BPIX_LAYER_3_MODULE_1_4)),
0092             cms.PSet(layer = cms.int32(3), module = cms.int32(2), angle = cms.double(BPIX_LAYER_3_MODULE_1_4)),
0093             cms.PSet(layer = cms.int32(3), module = cms.int32(3), angle = cms.double(BPIX_LAYER_3_MODULE_1_4)),
0094             cms.PSet(layer = cms.int32(3), module = cms.int32(4), angle = cms.double(BPIX_LAYER_3_MODULE_1_4)),
0095             cms.PSet(layer = cms.int32(3), module = cms.int32(5), angle = cms.double(BPIX_LAYER_3_MODULE_5_8)),
0096             cms.PSet(layer = cms.int32(3), module = cms.int32(6), angle = cms.double(BPIX_LAYER_3_MODULE_5_8)),
0097             cms.PSet(layer = cms.int32(3), module = cms.int32(7), angle = cms.double(BPIX_LAYER_3_MODULE_5_8)),
0098             cms.PSet(layer = cms.int32(3), module = cms.int32(8), angle = cms.double(BPIX_LAYER_3_MODULE_5_8)),
0099             cms.PSet(layer = cms.int32(4), module = cms.int32(1), angle = cms.double(BPIX_LAYER_4_MODULE_1_4)),
0100             cms.PSet(layer = cms.int32(4), module = cms.int32(2), angle = cms.double(BPIX_LAYER_4_MODULE_1_4)),
0101             cms.PSet(layer = cms.int32(4), module = cms.int32(3), angle = cms.double(BPIX_LAYER_4_MODULE_1_4)),
0102             cms.PSet(layer = cms.int32(4), module = cms.int32(4), angle = cms.double(BPIX_LAYER_4_MODULE_1_4)),
0103             cms.PSet(layer = cms.int32(4), module = cms.int32(5), angle = cms.double(BPIX_LAYER_4_MODULE_5_8)),
0104             cms.PSet(layer = cms.int32(4), module = cms.int32(6), angle = cms.double(BPIX_LAYER_4_MODULE_5_8)),
0105             cms.PSet(layer = cms.int32(4), module = cms.int32(7), angle = cms.double(BPIX_LAYER_4_MODULE_5_8)),
0106             cms.PSet(layer = cms.int32(4), module = cms.int32(8), angle = cms.double(BPIX_LAYER_4_MODULE_5_8)),        
0107         )
0108     elif(options.isFPix):
0109         print("  ========> Testing FPix parameters")
0110         process.SiPixelFakeLorentzAngleESSource.FPixParameters = cms.VPSet(
0111             cms.PSet(
0112                 ring = cms.int32(1),
0113                 panel = cms.int32(1),
0114                 angle = cms.double(0.0805)
0115             ),
0116             cms.PSet(
0117                 ring = cms.int32(1),
0118                 panel = cms.int32(2),
0119                 angle = cms.double(0.0788)
0120             ),
0121             cms.PSet(
0122                 ring = cms.int32(2),
0123                 panel = cms.int32(1),
0124                 angle = cms.double(0.0756)
0125             ),
0126             cms.PSet(
0127                 ring = cms.int32(2),
0128                 panel = cms.int32(2),
0129                 angle = cms.double(0.0736)
0130             )
0131         )       
0132     elif(options.isByModule):
0133         print(" ========> Testing byModule")
0134         process.SiPixelFakeLorentzAngleESSource.ModuleParameters = cms.VPSet(
0135             cms.PSet( rawid=cms.uint32(352588804), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0136             cms.PSet( rawid=cms.uint32(352592900), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0137             cms.PSet( rawid=cms.uint32(352596996), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0138             cms.PSet( rawid=cms.uint32(352601092), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0139             cms.PSet( rawid=cms.uint32(352605188), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0140             cms.PSet( rawid=cms.uint32(352609284), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0141             cms.PSet( rawid=cms.uint32(352658436), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0142             cms.PSet( rawid=cms.uint32(352662532), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0143             cms.PSet( rawid=cms.uint32(352666628), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0144             cms.PSet( rawid=cms.uint32(352670724), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0145             cms.PSet( rawid=cms.uint32(352674820), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0146             cms.PSet( rawid=cms.uint32(344749060), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0147             cms.PSet( rawid=cms.uint32(344753156), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0148             cms.PSet( rawid=cms.uint32(344757252), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0149             cms.PSet( rawid=cms.uint32(344781828), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0150             cms.PSet( rawid=cms.uint32(344785924), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0151             cms.PSet( rawid=cms.uint32(344790020), angle=cms.double(FPix_300V_RNG1_PNL1) ),
0152             cms.PSet( rawid=cms.uint32(352589828), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0153             cms.PSet( rawid=cms.uint32(352593924), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0154             cms.PSet( rawid=cms.uint32(352598020), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0155             cms.PSet( rawid=cms.uint32(352602116), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0156             cms.PSet( rawid=cms.uint32(352606212), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0157             cms.PSet( rawid=cms.uint32(352610308), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0158             cms.PSet( rawid=cms.uint32(352659460), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0159             cms.PSet( rawid=cms.uint32(352663556), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0160             cms.PSet( rawid=cms.uint32(352667652), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0161             cms.PSet( rawid=cms.uint32(352671748), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0162             cms.PSet( rawid=cms.uint32(352675844), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0163             cms.PSet( rawid=cms.uint32(344750084), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0164             cms.PSet( rawid=cms.uint32(344754180), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0165             cms.PSet( rawid=cms.uint32(344758276), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0166             cms.PSet( rawid=cms.uint32(344782852), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0167             cms.PSet( rawid=cms.uint32(344786948), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0168             cms.PSet( rawid=cms.uint32(344791044), angle=cms.double(FPix_300V_RNG1_PNL2) ),
0169             cms.PSet( rawid=cms.uint32(344851460), angle=cms.double(FPix_300V_RNG2_PNL1) ),
0170             cms.PSet( rawid=cms.uint32(344855556), angle=cms.double(FPix_300V_RNG2_PNL1) ),
0171             cms.PSet( rawid=cms.uint32(344859652), angle=cms.double(FPix_300V_RNG2_PNL1) ),
0172             cms.PSet( rawid=cms.uint32(344863748), angle=cms.double(FPix_300V_RNG2_PNL1) ),
0173             cms.PSet( rawid=cms.uint32(344852484), angle=cms.double(FPix_300V_RNG2_PNL2) ),
0174             cms.PSet( rawid=cms.uint32(344856580), angle=cms.double(FPix_300V_RNG2_PNL2) ),
0175             cms.PSet( rawid=cms.uint32(344860676), angle=cms.double(FPix_300V_RNG2_PNL2) )
0176         )
0177     
0178 ##
0179 ## SiPixelLorentzAngleReader (from Event Setup)
0180 ##
0181 process.LorentzAngleReader = cms.EDAnalyzer("SiPixelLorentzAngleReader",
0182                                             printDebug = cms.untracked.uint32(10),
0183                                             useSimRcd = cms.bool(False),
0184                                             recoLabel = cms.string("forPhase2" if options.isPhase2 else "") # test the label
0185                                             )
0186 
0187 process.p = cms.Path(process.LorentzAngleReader)