CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
hgcalTriggerChains.HGCalTriggerChains Class Reference

Public Member Functions

def __init__ (self)
 
def create_sequences (self, process)
 
def register_backend1 (self, name, generator)
 
def register_backend2 (self, name, generator)
 
def register_chain (self, vfe, concentrator, backend1, backend2, selector='', ntuple='')
 
def register_concentrator (self, name, generator)
 
def register_ntuple (self, name, generator)
 
def register_selector (self, name, generator)
 
def register_vfe (self, name, generator)
 

Public Attributes

 backend1
 
 backend2
 
 chain
 
 concentrator
 
 ntuple
 
 selector
 
 vfe
 

Detailed Description

Definition at line 3 of file hgcalTriggerChains.py.

Constructor & Destructor Documentation

def hgcalTriggerChains.HGCalTriggerChains.__init__ (   self)

Member Function Documentation

def hgcalTriggerChains.HGCalTriggerChains.create_sequences (   self,
  process 
)

Definition at line 47 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.backend1, hgcalTriggerChains.HGCalTriggerChains.backend2, hgcalTriggerChains.HGCalTriggerChains.chain, edm::FileLocator::Rule.chain, hgcalTriggerChains.HGCalTriggerChains.concentrator, hgcalTriggerChains.HGCalTriggerChains.ntuple, DTOccupancyTest.ntuple, DTOccupancyTestML.ntuple, hgcalTriggerChains.HGCalTriggerChains.selector, RawDataSelector.selector, BPHMultiSelectBase< T >::SelectElement.selector, BPHRecoBuilder::BPHRecoSource.selector, and hgcalTriggerChains.HGCalTriggerChains.vfe.

47  def create_sequences(self, process):
48  if not hasattr(process, 'hgcalTriggerSelector'):
49  process.load('L1Trigger.L1THGCalUtilities.HGC3DClusterGenMatchSelector_cff')
50  tmp = cms.TaskPlaceholder("tmp")
51  tmpseq = cms.SequencePlaceholder("tmp")
52  vfe_task = cms.Task(tmp)
53  concentrator_task = cms.Task(tmp)
54  backend1_task = cms.Task(tmp)
55  backend2_task = cms.Task(tmp)
56  selector_sequence = cms.Sequence(tmpseq)
57  ntuple_sequence = cms.Sequence(tmpseq)
58  for vfe,concentrator,backend1,backend2,selector,ntuple in self.chain:
59  concentrator_name = '{0}{1}'.format(vfe, concentrator)
60  backend1_name = '{0}{1}{2}'.format(vfe, concentrator, backend1)
61  backend2_name = '{0}{1}{2}{3}'.format(vfe, concentrator, backend1, backend2)
62  selector_name = '{0}{1}{2}{3}{4}'.format(vfe, concentrator, backend1, backend2, selector)
63  ntuple_name = '{0}{1}{2}{3}{4}{5}'.format(vfe, concentrator, backend1, backend2, selector, ntuple)
64  if selector=='':
65  ntuple_inputs = [
66  concentrator_name+':HGCalConcentratorProcessorSelection',
67  backend1_name+':HGCalBackendLayer1Processor2DClustering',
68  backend2_name+':HGCalBackendLayer2Processor3DClustering'
69  ]
70  else:
71  ntuple_inputs = [
72  concentrator_name+':HGCalConcentratorProcessorSelection',
73  backend1_name+':HGCalBackendLayer1Processor2DClustering',
74  selector_name]
75  if not hasattr(process, vfe):
76  setattr(process, vfe, self.vfe[vfe](process))
77  vfe_task.add(getattr(process, vfe))
78  if not hasattr(process, concentrator_name):
79  setattr(process, concentrator_name, self.concentrator[concentrator](process, vfe))
80  concentrator_task.add(getattr(process, concentrator_name))
81  if not hasattr(process, backend1_name):
82  setattr(process, backend1_name, self.backend1[backend1](process, concentrator_name))
83  backend1_task.add(getattr(process, backend1_name))
84  if not hasattr(process, backend2_name):
85  setattr(process, backend2_name, self.backend2[backend2](process, backend1_name))
86  backend2_task.add(getattr(process, backend2_name))
87  if selector!='' and not hasattr(process, selector_name):
88  setattr(process, selector_name, self.selector[selector](process, backend2_name))
89  selector_sequence *= getattr(process, selector_name)
90  if ntuple!='' and not hasattr(process, ntuple_name):
91  setattr(process, ntuple_name, self.ntuple[ntuple](process, ntuple_inputs))
92  ntuple_sequence *= getattr(process, ntuple_name)
93  vfe_task.remove(tmp)
94  concentrator_task.remove(tmp)
95  backend1_task.remove(tmp)
96  backend2_task.remove(tmp)
97  selector_sequence.remove(tmpseq)
98  ntuple_sequence.remove(tmpseq)
99  process.globalReplace('hgcalVFE', vfe_task)
100  process.globalReplace('hgcalConcentrator', concentrator_task)
101  process.globalReplace('hgcalBackEndLayer1', backend1_task)
102  process.globalReplace('hgcalBackEndLayer2', backend2_task)
103  process.globalReplace('hgcalTriggerSelector', selector_sequence)
104  process.globalReplace('hgcalTriggerNtuples', ntuple_sequence)
105  return process
def hgcalTriggerChains.HGCalTriggerChains.register_backend1 (   self,
  name,
  generator 
)

Definition at line 19 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.backend1.

19  def register_backend1(self, name, generator):
20  self.backend1[name] = generator
21 
def register_backend1(self, name, generator)
def hgcalTriggerChains.HGCalTriggerChains.register_backend2 (   self,
  name,
  generator 
)

Definition at line 22 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.backend2.

22  def register_backend2(self, name, generator):
23  self.backend2[name] = generator
24 
def register_backend2(self, name, generator)
def hgcalTriggerChains.HGCalTriggerChains.register_chain (   self,
  vfe,
  concentrator,
  backend1,
  backend2,
  selector = '',
  ntuple = '' 
)

Definition at line 31 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.backend1, hgcalTriggerChains.HGCalTriggerChains.backend2, hgcalTriggerChains.HGCalTriggerChains.concentrator, hgcalTriggerChains.HGCalTriggerChains.ntuple, DTOccupancyTest.ntuple, DTOccupancyTestML.ntuple, hgcalTriggerChains.HGCalTriggerChains.selector, RawDataSelector.selector, BPHMultiSelectBase< T >::SelectElement.selector, BPHRecoBuilder::BPHRecoSource.selector, and hgcalTriggerChains.HGCalTriggerChains.vfe.

31  def register_chain(self, vfe, concentrator, backend1, backend2, selector='', ntuple=''):
32  if not vfe in self.vfe:
33  raise KeyError('{} not registered as VFE producer'.format(vfe))
34  if not concentrator in self.concentrator:
35  raise KeyError('{} not registered as concentrator producer'.format(concentrator))
36  if not backend1 in self.backend1:
37  raise KeyError('{} not registered as backend1 producer'.format(backend1))
38  if not backend2 in self.backend2:
39  raise KeyError('{} not registered as backend2 producer'.format(backend2))
40  if selector!='' and not selector in self.selector:
41  raise KeyError('{} not registered as selector'.format(selector))
42  if ntuple!='' and not ntuple in self.ntuple:
43  raise KeyError('{} not registered as ntuplizer'.format(ntuple))
44  self.chain.append( (vfe, concentrator, backend1, backend2, selector, ntuple) )
45 
46 
def register_chain(self, vfe, concentrator, backend1, backend2, selector='', ntuple='')
def hgcalTriggerChains.HGCalTriggerChains.register_concentrator (   self,
  name,
  generator 
)

Definition at line 16 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.concentrator.

16  def register_concentrator(self, name, generator):
17  self.concentrator[name] = generator
18 
def register_concentrator(self, name, generator)
def hgcalTriggerChains.HGCalTriggerChains.register_ntuple (   self,
  name,
  generator 
)

Definition at line 28 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.ntuple, DTOccupancyTest.ntuple, and DTOccupancyTestML.ntuple.

28  def register_ntuple(self, name, generator):
29  self.ntuple[name] = generator
30 
def register_ntuple(self, name, generator)
def hgcalTriggerChains.HGCalTriggerChains.register_selector (   self,
  name,
  generator 
)
def hgcalTriggerChains.HGCalTriggerChains.register_vfe (   self,
  name,
  generator 
)

Definition at line 13 of file hgcalTriggerChains.py.

References hgcalTriggerChains.HGCalTriggerChains.vfe.

13  def register_vfe(self, name, generator):
14  self.vfe[name] = generator
15 
def register_vfe(self, name, generator)

Member Data Documentation