CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customHGCdigitizer_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 """
4 implement here different variations for testing purposes
5 """
6 def customHGCdigitizer(process, version='simple0', debug=False):
7 
8  #configure digitizer model
9  if version.find('femodel')>=0:
10  print 'Adapting for FE model'
11  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(1)
12  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.shaperN = cms.double(8.02)
13  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.shaperTau = cms.double(3.26)
14  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(1)
15  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.shaperN = cms.double(8.02)
16  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.shaperTau = cms.double(3.26)
17  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
18  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperN = cms.double(1)
19  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperTau = cms.double(10)
20  if version=='femodel-v0':
21  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(0)
22  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(0)
23  if version=='femodel-v1':
24  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(12.5)
25  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(12.5)
26  if version=='femodel-v2':
27  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(25)
28  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcTransferDelay = cms.double(25)
29 
30 
31  elif version.find('simple')>=0 :
32  tau=float(version.replace('simple',''))
33  print 'Adapting simple pulse shape with tau=%f'%tau
34  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
35  process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
36  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
37  process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
38  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.fwVersion = cms.uint32(0)
39  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperN = cms.double(1)
40  process.mix.digitizers.hgchebackDigitizer.digiCfg.feCfg.shaperTau = cms.double(tau)
41 
42  #save all the time samples to the output
43  if debug:
44  process.mix.digitizers.hgceeDigitizer.digiCfg.doTimeSamples = cms.bool(True)
45  process.mix.digitizers.hgchefrontDigitizer.digiCfg.doTimeSamples = cms.bool(True)
46  process.mix.digitizers.hgchebackDigitizer.digiCfg.doTimeSamples = cms.bool(True)