Aim of introducing a new interface of the python scripts

  • Unify the way we configure HLT chains across all slices
  • Easy way of introducing a new chain with different threshold
  • Avoid changing the configuration of other chains accidentally by a change in a particular chain

Data needed to instantiate HLT chains

sig_id signature ID, used to specify which chains go into a particular menu
chain_name name of the chain
chain_counter chain counter (an integer)
lower_chain_name lower chain name
inputTEs Input TriggerElements (e.g. RoIs)
config Details about the algorithm configuration (hypo configurables)

The basic structure of the chain (which Fex and Hypo algorithms are run in which order) must be defined somewhere. Define one class for each type of chain, for example, all L2_j[X] chains are instantiated from the same class which defines the structure of the chain. To create an instance of a chain, one should be able to do so in one place by providing the above information.

Class defining the structure of the chain

  • config object
    • Holds the configurable objects for hypothesis algorithms used in this chain. Also keeps the suffix to be used to distinguish the hypo algorithm instance and TriggerElement names
    • Each type of chain has its own config object class
  • defineSequences(config)
    • Defines the algorithms used in the chain. All FEX algorithms should be configured in the same way while the hypothesis algorithm parameters are taken from the config object
  • defineSignatures()
  • defineStreamGroupTriggerType()
  • defineTErenaming()

Examples

Example of a single object trigger: L2EFChain_j (L2 and EF chains for the jet slice)

The code below is not complete yet, since the parameters of the configurables may not be correct. This example, defines L2Config object and EFConfig object and the main Config object which holds these two.
class L2EFChain_j(L2EFChainDef):
    class L2Config:
        def __init__(self, suffix, 
                     TrigL2JetHypo_1=None):
            self.suffix = suffix
            self.TrigL2JetHypo_1 = TrigL2JetHypo_1 or TrigL2JetHypo('TrigL2JetHypo'+suffix)
            pass
        def create1(suffix, par1):
            config = L2EFChain_j.L2Config(suffix)
            config.TrigL2JetHypo_1.Etcut_L2 = par1
            return config
        create1 = staticmethod(create1)
        
    class EFConfig:
        def __init__(self, suffix, 
                     TrigL2JetHypo_1=None):
            self.suffix = suffix
            self.TrigL2JetHypo_1 = TrigL2JetHypo_1 or TrigL2JetHypo('TrigL2JetHypo'+suffix)
            pass
        def create1(suffix, par1):
            config = L2EFChain_j.L2Config(suffix)
            config.TrigL2JetHypo_1.Etcut_L2 = par1
            return config
        create1 = staticmethod(create1)
        
    class Config:
        def __init__(self, l2config, efconfig):
            self.suffix = ''
            self.L2Config = l2config
            self.EFConfig = efconfig
            pass

    def __init__(self, sig_id, 
                 l2_chain_name, l2_chain_counter, l2_lower_chain_name,
                 ef_chain_name, ef_chain_counter, 
                 l2_inputTEs, config):
        L2EFChainDef.__init__(self, sig_id,
                              l2_chain_name, l2_chain_counter, l2_lower_chain_name,
                              ef_chain_name, ef_chain_counter, 
                              l2_inputTEs, config)

    def defineSequences(self, config):
        # Step 1
        self.addL2Sequence(self.inputTEs,
                           [T2CaloJet(), config.L2Config.TrigL2JetHypo_1],
                           'L2_j')
        self.addEFSequence('L2_j', 
                           [T2CaloJet(), config.EFConfig.TrigL2JetHypo_1],
                           'EF_j')

    def defineSignatures(self):
        self.addL2Signature(['L2_j'])
        self.addEFSignature(['EF_j'])

    def defineStreamGroupTriggerType(self):
        self.physics_streams = ['physics']
        self.calib_streams = []
        self.groups = ['all']
        self.trigger_type = []

    def defineTErenaming(self):
        self.TErenamingMap = {
            'L2_j': mergeRemovingOverlap('L2_j', self.config.L2Config.suffix),
            'EF_j': mergeRemovingOverlap('EF_j', self.config.EFConfig.suffix),
            }

Example of a combined chain : 4-jet trigger (L2Chain_4j)

The config object for a combined chain is just a list of config objects of the basic chains. This allows to set different thresholds for multi-object triggers.
class L2Chain_4j(HltChainDef):
    class Config:
        def __init__(self,
                     L2Chain_j_1,
                     L2Chain_j_2,
                     L2Chain_j_3,
                     L2Chain_j_4):
            self.L2Chain_j_1 = L2Chain_j_1
            self.L2Chain_j_2 = L2Chain_j_2
            self.L2Chain_j_3 = L2Chain_j_3
            self.L2Chain_j_4 = L2Chain_j_4
            self.suffix = ''

    def __init__(self, sig_id, 
                 chain_name, chain_counter, lower_chain_name, 
                 inputTEs, config):
        HltChainDef.__init__(self, sig_id,
                             chain_name, chain_counter, 'L2', lower_chain_name,
                             inputTEs, config)
    def defineCombinedChain(self, combined_config):
        self.combined_chains = [
            chainConfig(L2Chain_j, combined_config.L2Chain_j_1, self.inputTEs[0]), 
            chainConfig(L2Chain_j, combined_config.L2Chain_j_2, self.inputTEs[1]), 
            chainConfig(L2Chain_j, combined_config.L2Chain_j_3, self.inputTEs[2]), 
            chainConfig(L2Chain_j, combined_config.L2Chain_j_4, self.inputTEs[3]), 
            ]

    def defineStreamGroupTriggerType(self):
        self.physics_streams = ['physics']
        self.calib_streams = []
        self.groups = ['all']
        self.trigger_type = []
        
    def defineTErenaming(self):
        pass

Once above classes are written, creating a chain would be a simple task.

Jets = [
    L2Chain_j('j20', 
              'L2_j10', 400, 'L1_J5', ['J5'], 
              L2Chain_j.Config.create1('_j10_L1J5', 10*1000)), 
    L2Chain_j('j30', 
              'L2_j20', 401, 'L1_J10', ['J10'], 
              L2Chain_j.Config.create1('_j20_L1J10', 20*1000)), 
    L2EFChain_j('j80', 
                'L2_j40', 433, 'L1_J10',
                'EF_j80', 433, 
                ['J10'], 
                L2EFChain_j.Config(L2EFChain_j.L2Config.create1('_j40', 40*1000), 
                                   L2EFChain_j.EFConfig.create1('_j80', 80*1000))), 
    L2Chain_j('j50', 
              'L2_j50', 421, 'L1_J10', ['J10'], 
              L2Chain_j.Config.create1('_j50', 50*1000)), 

    L2Chain_4j('2j40_2j50',
               'L2_2j40_2j50', 411, 'L1_4J10', ['J10', 'J10', 'J10', 'J20'], 
               L2Chain_4j.Config(L2Chain_j.Config.create1('_j40_L1J10', 40*1000),
                                 L2Chain_j.Config.create1('_j40_L1J10', 40*1000),
                                 L2Chain_j.Config.create1('_j50_L1J10', 50*1000),
                                 L2Chain_j.Config.create1('_j50_L1J20', 50*1000))),
    L2Chain_4j('4j50',
               'L2_4j50', 412, 'L1_4J10', ['J10', 'J10', 'J10', 'J10'], 
               L2Chain_4j.Config(findChain('L2_j50').config,
                                 findChain('L2_j50').config,
                                 findChain('L2_j50').config,
                                 findChain('L2_j50').config)), 
    ]
If one wants to specify the configurable object,
Taus = [
    L2Chain_tau('tau10',
                'L2_tau10', 333, 'L1_TAU6', ['TAU6'],
                L2Chain_tau.Config(T2CaloTauHypo(),
                                   T2IDTauHypo(),
                                   T2TauHypo(), '_tau10')),
    L2Chain_tau('tau20i',
                'L2_tau20i', 335, 'L1_TAU6', ['TAU6'],
                L2Chain_tau.Config(T2CaloTauHypo(),
                                   T2IDTauHypo(),
                                   T2TauHypo(), '_tau20i')),
    L2Chain_tau('tau30i_loose',
                'L2_tau30_loose', 336,  'L1_TAU6', ['TAU6'],
                L2Chain_tau.Config.create1('_tau30i_loose', par1=30))
    ]


-- TakanoriKono - 26 Jun 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt test1.py.txt r1 manage 463.6 K 2008-07-10 - 11:00 TakanoriKono HLT Chain templates
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2008-07-10 - TakanoriKono
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback