CMS 3D CMS Logo

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