Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:10

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