Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:46

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 """
0005 implement here different variations for testing purposes
0006 """
0007 def customHGCdigitizer(process, version='simple0', debug=False):
0008     
0009     #configure digitizer model
0010     if version.find('femodel')>=0:
0011         print('Adapting for FE model')
0012         process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(1)
0013         process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.shaperN = cms.double(8.02)
0014         process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.shaperTau = cms.double(3.26)
0015         process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(1)
0016         process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.shaperN = cms.double(8.02)
0017         process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.shaperTau = cms.double(3.26)
0018         process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
0019         process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperN = cms.double(1)
0020         process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperTau = cms.double(10)
0021         process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(1)
0022         process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.shaperN = cms.double(8.02)
0023         process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.shaperTau = cms.double(3.26)
0024         if version=='femodel-v0':
0025             process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(0)
0026             process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(0)
0027             process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(0)
0028         if version=='femodel-v1':
0029             process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(12.5)
0030             process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(12.5)
0031             process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(12.5)
0032         if version=='femodel-v2':
0033             process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(25)
0034             process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(25)
0035             process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(25)
0036 
0037 
0038     elif version.find('simple')>=0 :
0039         tau=float(version.replace('simple',''))
0040         print('Adapting simple pulse shape with tau=%f'%tau)
0041         process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
0042         process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
0043         process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
0044         process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
0045         process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
0046         process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperN = cms.double(1)
0047         process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
0048         process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
0049         process.mix.digitizers.hfnoseDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
0050 
0051     #save all the time samples to the output
0052     if debug:
0053         process.mix.digitizers.hgceeDigitizer.digiCfg.doTimeSamples      = cms.bool(True)
0054         process.mix.digitizers.hgchefrontDigitizer.digiCfg.doTimeSamples = cms.bool(True)
0055         process.mix.digitizers.hgchebackDigitizer.digiCfg.doTimeSamples  = cms.bool(True)
0056         process.mix.digitizers.hfnoseDigitizer.digiCfg.doTimeSamples      = cms.bool(True)