コード例 #1
0
 def _get_precisecalocalib(self):
     seq = []
     algo = None
     name = self._base_name
     thr = self._properties['threshold']
     if (self._properties['etcut']):
         if self._properties['ion']:
             algo = TrigEFCaloHypo_EtCut(
                 "TrigEFCaloHypo_" + name + "_EtCut_heavyIon", thr)
         else:
             algo = TrigEFCaloHypo_EtCut(
                 "TrigEFCaloHypo_" + name + "_EtCut", thr)
     elif (self._properties['perf']):
         if self._properties['ion']:
             algo = TrigEFCaloHypo_All(
                 "TrigEFCaloHypo_" + name + "_NoCut_heavyIon", thr)
         else:
             algo = TrigEFCaloHypo_All("TrigEFCaloHypo_" + name + "_NoCut",
                                       thr)
     elif self._properties['e']:
         algo = self._get_precisecalocalib_electron()
     elif self._properties['g']:
         algo = self._get_precisecalocalib_photon()
     else:
         log.error('Cannot configure precisecalocalib')
     seq = [algo]
     log.debug('precisecalocalib %s', seq)
     return seq
コード例 #2
0
 def _get_precisecalocalib_electron(self):
     algo = None
     name = self._base_name
     thr = self._properties['threshold']
     idinfo = self._properties['IDinfo']
     if self._properties['ion']:
         if self._properties['idperf']:
             algo = TrigEFCaloHypo_e_ID(
                 "TrigEFCaloHypo_e" + str(thr) + "_" + idinfo + "_heavyIon",
                 thr, idinfo)
         elif idinfo:
             algo = TrigEFCaloHypo_All(
                 "TrigEFCaloHypo_e" + str(thr) + "_heavyIon", thr)
         else:
             log.error(
                 "Cannot configure precisecalobcalib_electron for ion")
     elif self._properties['ringer']:
         algo = TrigEFCaloHypo_EtCut("TrigEFCaloHypo_" + name + "_EtCut",
                                     thr)
     elif idinfo:
         algo = TrigEFCaloHypo_e_ID(
             "TrigEFCaloHypo_e" + str(thr) + "_" + idinfo, thr, idinfo)
     else:
         log.error("Cannot configure precisecalobcalib_electron")
     return algo
コード例 #3
0
 def _get_precisecalocalib_photon(self):
     algo = None
     name = self._base_name
     thr = self._properties['threshold']
     idinfo = self._properties['IDinfo']
     if self._properties['hiptrt']:
         algo = TrigEFCaloHypo_All("TrigEFCaloHypo_g_hiptrt_NoCut", 0)
     elif self._properties['ion']:
         if idinfo:
             algo = TrigEFCaloHypo_EtCut(
                 "TrigEFCaloHypo_" + name + "_EtCut_heavyIon", thr)
     elif idinfo:
         algo = TrigEFCaloHypo_g_ID(
             "TrigEFCaloHypo_g" + str(thr) + "_" + idinfo, thr, idinfo)
     else:
         log.error("Cannot configure precisecalobcalib_photon")
     return algo
コード例 #4
0
    def setup_electron(self):
        ''' 
        MC_pp_v7 onwards configuration method for electron chains 
        TrigEMCluster and Ringer reconstruction (same as photons)
        Fast Calo-only rejection (w/ ringer or cut-based)
        Full track reconstruction
        Fast electron reconstruction (optimize pt cut for low/high pt chains)
            Mark tracks which match to cluster
        Precise Calo
        MVA calibration + Et cut hypo on clusters
        Offline reco + hypo
        
        When moving to ringer default, need to make low et chains use cut-based
        Also the L2ElectronFex will have low/high et 
        To preserve backward compt, need to do all this here :(
        '''

        # define the ordered dictionary for sequences and TEs

        thr = self.chainPart['threshold']
        name = str(self.chainPart['threshold'])
        name = name.split('.')[0]
        dofastrecseq = TriggerFlags.EgammaSlice.doFastElectronFex
        if 'perf' in self.chainPartName:
            dofastrecseq = False
        log.debug('setup_electron %s, apply ringer %s for %s', self.chainName,
                  self._ringer_selection, thr)
        # Ringer chains not tuned for low-et
        # use standard hypo
        fastcalohypo = self.el_sequences['fastcalohypo']
        ringerfex, ringerhypo = TrigL2CaloRingerFexHypo_e_NoCut(thr)
        # To preserve backward compatibility just remove hypo from calibration step
        # Replace by Et cut (marks the clusters as passing)
        # Essentially breaks the class design :(
        # but
        algo = TrigEFCaloHypo_EtCut("TrigEFCaloHypo_e" + name + "_EtCut", thr)
        fastrec_algo = L2ElectronFex_Clean()
        fastrec_hypo = self.el_sequences['fastrec'][-1]
        precisecalocalib = self.el_sequences['precisecalocalib']
        precisecalocalib.pop()
        precisecalocalib.extend([algo])

        seq_dict = self.el_sequences
        seq_dict['precisecalocalib'] = precisecalocalib

        if not self._ringer_selection:
            seq_dict['fastringerhypo'] = [ringerfex, ringerhypo]
            seq_dict['fastcalorec'].extend(fastcalohypo)

        seq_te_dict = collections.OrderedDict()

        # Here we revert to the traditional sequence
        # But apply selection at L2Electron
        seq_dict['fastrec'] = [fastrec_algo, fastrec_hypo]
        log.debug('FastRec sequence %s' % seq_dict['fastrec'])
        if dofastrecseq:
            # remove track hypo from precisetrack step
            precisetrack = self.el_sequences['precisetrack']
            precisetrack.pop()
            seq_dict['precisetrack'] = precisetrack
            seq_te_dict['fastcalorec'] = ('L2_e_step1', 'cl')
            seq_te_dict['fastringerhypo'] = ('L2_e_step2', 'clhypo')
            seq_te_dict['fasttrack'] = ('L2_e_step3', 'ftf')
            seq_te_dict['fastrec'] = ('L2_e_step4', '')
            seq_te_dict['precisecalo'] = ('EF_e_step1', 'calo')
            seq_te_dict['precisecalocalib'] = ('EF_e_step2', 'calocalib')
            seq_te_dict['precisetrack'] = ('EF_e_step3', 'idtrig')
            if not self.doCaloIsolation:
                seq_te_dict['preciserec'] = ('EF_e_step4', '')
        else:
            seq_te_dict['fastcalorec'] = ('L2_e_step1', 'cl')
            seq_te_dict['fastringerhypo'] = ('L2_e_step2', 'clhypo')
            seq_te_dict['trackrec'] = ('L2_e_step3', 'trk')
            seq_te_dict['fastrec'] = ('L2_e_step4', '')
            seq_te_dict['precisecalo'] = ('EF_e_step1', 'cl')
            seq_te_dict['precisecalocalib'] = ('EF_e_step2', 'calocalib')
            if not self.doCaloIsolation:
                seq_te_dict['preciserec'] = ('EF_e_step3', '')

        self.setupFromDict(seq_te_dict, seq_dict)

        if self.doCaloIsolation:
            # full scan topo and merging w/ RoI TEs
            te_in = ''
            if dofastrecseq:
                pos = 3
                for step in self.fullScanSeqMap:
                    self.EFsequenceList.insert(
                        pos, [[te_in], self.fullScanSeqMap[step], step])
                    self.EFsignatureList.insert(pos, [[step]])
                    te_in = step
                    pos += 1

                self.EFsequenceList.insert(
                    pos, [['EF_e_step3', te_in], [self.DummyMergerAlgo],
                          'EF_eCache_step3'])
                self.EFsignatureList.insert(pos, [['EF_eCache_step3']])
                self.EFsequenceList.insert(
                    pos + 1, [['EF_eCache_step3'],
                              self.el_sequences['preciserec'], 'EF_e_step4'])
                self.EFsignatureList.insert(pos + 1,
                                            [['EF_e_step4'] * self.mult])
            else:
                pos = 2
                for step in self.fullScanSeqMap:
                    self.EFsequenceList.insert(
                        pos, [[te_in], self.fullScanSeqMap[step], step])
                    self.EFsignatureList.insert(pos, [[step]])
                    te_in = step
                    pos += 1

                self.EFsequenceList.insert(
                    pos, [['EF_e_step2', te_in], [self.DummyMergerAlgo],
                          'EF_eCache_step2'])
                self.EFsignatureList.insert(pos, [['EF_eCache_step2']])
                self.EFsequenceList.insert(
                    pos + 1, [['EF_eCache_step2'],
                              self.el_sequences['preciserec'], 'EF_e_step3'])
                self.EFsignatureList.insert(pos + 1,
                                            [['EF_e_step3'] * self.mult])

            ########### TE renaming ###########

            self.TErenamingDict['EF_full'] = mergeRemovingOverlap(
                'EF_', self.chainPartNameNoMult + '_fs')
            self.TErenamingDict['EF_full_cell'] = mergeRemovingOverlap(
                'EF_', self.chainPartNameNoMult + '_fscalocell')
            self.TErenamingDict['EF_FSTopoClusters'] = mergeRemovingOverlap(
                'EF_', self.chainPartNameNoMult + '_fscalotopo')
            self.TErenamingDict['EF_FSTopoClustersED'] = mergeRemovingOverlap(
                'EF_', self.chainPartNameNoMult + '_fscalotopoed')

            if dofastrecseq:
                self.TErenamingDict['EF_eCache_step3'] = mergeRemovingOverlap(
                    'EF_', self.chainPartNameNoMult + '_ED')
                self.TErenamingDict['EF_e_step4'] = mergeRemovingOverlap(
                    'EF_', self.chainPartNameNoMult)
            else:
                self.TErenamingDict['EF_eCache_step2'] = mergeRemovingOverlap(
                    'EF_', self.chainPartNameNoMult + '_ED')
                self.TErenamingDict['EF_e_step3'] = mergeRemovingOverlap(
                    'EF_', self.chainPartNameNoMult)