CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
concentrator.py
Go to the documentation of this file.
1 
2 import FWCore.ParameterSet.Config as cms
4 from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, custom_conc_proc, autoEncoder_conc_proc
5 
6 
7 def create_supertriggercell(process, inputs,
8  stcSize=supertc_conc_proc.stcSize,
9  type_energy_division=supertc_conc_proc.type_energy_division,
10  fixedDataSizePerHGCROC=supertc_conc_proc.fixedDataSizePerHGCROC,
11  coarsenTriggerCells=supertc_conc_proc.coarsenTriggerCells,
12  ctcSize=supertc_conc_proc.ctcSize,
13  ):
14  producer = process.hgcalConcentratorProducer.clone(
15  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
16  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
17  )
18  producer.ProcessorParameters = supertc_conc_proc.clone(
19  stcSize = stcSize,
20  type_energy_division = type_energy_division,
21  fixedDataSizePerHGCROC = fixedDataSizePerHGCROC,
22  coarsenTriggerCells = coarsenTriggerCells,
23  ctcSize = ctcSize,
24  )
25  return producer
26 
27 
28 def create_threshold(process, inputs,
29  threshold_silicon=threshold_conc_proc.threshold_silicon, # in mipT
30  threshold_scintillator=threshold_conc_proc.threshold_scintillator # in mipT
31  ):
32  producer = process.hgcalConcentratorProducer.clone(
33  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
34  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
35  )
36  producer.ProcessorParameters = threshold_conc_proc.clone(
37  threshold_silicon = threshold_silicon, # MipT
38  threshold_scintillator = threshold_scintillator # MipT
39  )
40  return producer
41 
42 
43 def create_bestchoice(process, inputs,
44  triggercells=best_conc_proc.NData,
45  coarsenTriggerCells=best_conc_proc.coarsenTriggerCells,
46  ctcSize=best_conc_proc.ctcSize,
47  ):
48  producer = process.hgcalConcentratorProducer.clone(
49  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
50  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
51  )
52  producer.ProcessorParameters = best_conc_proc.clone(
53  NData = triggercells,
54  coarsenTriggerCells = coarsenTriggerCells,
55  ctcSize=ctcSize,
56  )
57  return producer
58 
59 
60 def create_autoencoder(process, inputs,
61  cellRemap = autoEncoder_conc_proc.cellRemap,
62  cellRemapNoDuplicates = autoEncoder_conc_proc.cellRemapNoDuplicates,
63  nBitsPerInput = autoEncoder_conc_proc.nBitsPerInput,
64  maxBitsPerOutput = autoEncoder_conc_proc.maxBitsPerOutput,
65  bitsPerLink = autoEncoder_conc_proc.bitsPerLink,
66  modelFiles = autoEncoder_conc_proc.modelFiles,
67  linkToGraphMap = autoEncoder_conc_proc.linkToGraphMap,
68  encoderShape = autoEncoder_conc_proc.encoderShape,
69  decoderShape = autoEncoder_conc_proc.decoderShape,
70  zeroSuppresionThreshold = autoEncoder_conc_proc.zeroSuppresionThreshold,
71  saveEncodedValues = autoEncoder_conc_proc.saveEncodedValues,
72  preserveModuleSum = autoEncoder_conc_proc.preserveModuleSum,
73  scintillatorMethod = 'thresholdSelect',
74  ):
75  producer = process.hgcalConcentratorProducer.clone(
76  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
77  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
78  )
79  producer.ProcessorParameters = autoEncoder_conc_proc.clone(
80  cellRemap = cellRemap,
81  cellRemapNoDuplicates = cellRemapNoDuplicates,
82  nBitsPerInput = nBitsPerInput,
83  maxBitsPerOutput = maxBitsPerOutput,
84  bitsPerLink = bitsPerLink,
85  modelFiles = modelFiles,
86  linkToGraphMap = linkToGraphMap,
87  encoderShape = encoderShape,
88  decoderShape = decoderShape,
89  zeroSuppresionThreshold = zeroSuppresionThreshold,
90  saveEncodedValues = saveEncodedValues,
91  preserveModuleSum = preserveModuleSum,
92  Method = cms.vstring(['autoEncoder','autoEncoder', scintillatorMethod]),
93  )
94  return producer
95 
96 
97 def create_onebitfraction(process, inputs,
98  stcSize=coarsetc_onebitfraction_proc.stcSize,
99  fixedDataSizePerHGCROC=coarsetc_onebitfraction_proc.fixedDataSizePerHGCROC
100  ):
101  producer = process.hgcalConcentratorProducer.clone(
102  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
103  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
104  )
105  producer.ProcessorParameters = coarsetc_onebitfraction_proc.clone(
106  stcSize = stcSize,
107  fixedDataSizePerHGCROC = fixedDataSizePerHGCROC
108  )
109  return producer
110 
111 
112 def create_mixedfeoptions(process, inputs,
113  stcSize=custom_conc_proc.stcSize,
114  type_energy_division=custom_conc_proc.type_energy_division,
115  fixedDataSizePerHGCROC=custom_conc_proc.fixedDataSizePerHGCROC,
116  triggercells=custom_conc_proc.NData
117  ):
118  producer = process.hgcalConcentratorProducer.clone(
119  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
120  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
121  )
122  producer.ProcessorParameters = custom_conc_proc.clone(
123  stcSize = stcSize,
124  type_energy_division = type_energy_division,
125  fixedDataSizePerHGCROC = fixedDataSizePerHGCROC,
126  NData = triggercells,
127  Method = cms.vstring('bestChoiceSelect','superTriggerCellSelect','superTriggerCellSelect'),
128  )
129  return producer
130 
131 
132 def create_custom(process, inputs,
133  stcSize=custom_conc_proc.stcSize,
134  type_energy_division=custom_conc_proc.type_energy_division,
135  fixedDataSizePerHGCROC=custom_conc_proc.fixedDataSizePerHGCROC,
136  triggercells=custom_conc_proc.NData,
137  threshold_silicon=custom_conc_proc.threshold_silicon, # in mipT
138  threshold_scintillator=custom_conc_proc.threshold_scintillator, # in mipT
139  Method = custom_conc_proc.Method,
140  coarsenTriggerCells=custom_conc_proc.coarsenTriggerCells,
141  ctcSize=custom_conc_proc.ctcSize,
142  ):
143  producer = process.hgcalConcentratorProducer.clone(
144  InputTriggerCells = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs)),
145  InputTriggerSums = cms.InputTag('{}:HGCalVFEProcessorSums'.format(inputs))
146  )
147  producer.ProcessorParameters = custom_conc_proc.clone(
148  stcSize = stcSize,
149  type_energy_division = type_energy_division,
150  fixedDataSizePerHGCROC = fixedDataSizePerHGCROC,
151  NData = triggercells,
152  threshold_silicon = threshold_silicon, # MipT
153  threshold_scintillator = threshold_scintillator, # MipT
154  Method = Method,
155  coarsenTriggerCells=coarsenTriggerCells,
156  ctcSize = ctcSize,
157  )
158  return producer
159 
def create_supertriggercell
Definition: concentrator.py:13
def create_onebitfraction
def create_autoencoder
Definition: concentrator.py:74
def create_mixedfeoptions
def create_threshold
Definition: concentrator.py:31
def create_bestchoice
Definition: concentrator.py:47