Esempio n. 1
0
#from AthenaCommon.BeamFlags import jobproperties
#jobproperties.Beam.numberOfCollisions = 8.0


## configure object key store to recognize calo cells 
from RecExConfig.ObjKeyStore import ObjKeyStore, objKeyStore
oks = ObjKeyStore()
oks.addStreamESD('CaloCellContainer', ['AllCalo'] )

## re-do topo clusters on EM scale
from CaloRec.CaloTopoClusterFlags import jobproperties
jobproperties.CaloTopoClusterFlags.doTopoClusterLocalCalib = False
jobproperties.CaloTopoClusterFlags.doCellWeightCalib = False
from CaloRec.CaloClusterTopoGetter import CaloClusterTopoGetter
CaloClusterTopoGetter()

topSequence.CaloTopoCluster.TopoCalibMoments.MomentsNames += ["ENG_CALIB_OUT_L","ENG_CALIB_FRAC_EM"]
topSequence.CaloTopoCluster.TopoCalibMoments.MatchDmType = 1 # 1=loose, 2=medium (default), 3=tight

theApp.EvtMax = -1

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
MessageSvc = svcMgr.MessageSvc
MessageSvc.OutputLevel = Lvl.INFO
MessageSvc.infoLimit = 1000000
svcMgr.EventSelector.InputCollections = inFileName

if not 'doClassification' in dir():
Esempio n. 2
0
    def configure(self):
        mlog = logging.getLogger('CaloTopoTowerGetter::configure :')
        mlog.info('scheduled to output %s', self.output())

        # get handle to upstream CaloCells
        theCaloCellGetter = self.getInputGetter\
                            (jp.CaloRecFlags.clusterCellGetterName())

        # ----- get handle to upstream tower objects
        try:
            from CaloRec.CaloTowerCmbGetter import CaloTowerCmbGetter
            theCaloTowerCmbGetter = CaloTowerCmbGetter()
        except Exception:
            mlog.error("could not get handle to CaloTowerCmbGetter Quit")
            print(traceback.format_exc())
            return False

        if not theCaloTowerCmbGetter.usable():
            if not self.ignoreConfigError():
                mlog.error("CaloTowerCmbGetter unusable. Quit.")
                return False
            else:
                mlog.error(
                    "CaloTowerCmbGetter unusable. Continue nevertheless")

        # ------ get handle to upstream topo cluster object
        try:
            from CaloRec.CaloClusterTopoGetter import CaloClusterTopoGetter
            theCaloClusterTopoGetter = CaloClusterTopoGetter()
        except Exception:
            mlog.error("could not get handle to CaloClusterTopoGetter  Quit")
            print(traceback.format_exc())
            return False

        if not theCaloClusterTopoGetter.usable():
            if not self.ignoreConfigError():
                mlog.error("theCaloClusterTopoGetter unusable. Quit.")
                return False
            else:
                mlog.error(
                    "theCaloClusterTopoGetter unusable. Continue nevertheless")

        # ------ get handle to upstream topo cluster object
        try:
            from CaloRec.CaloClusterTopoGetter import CaloClusterTopoGetter
            CaloClusterTopoGetter()
            from CaloRec.CaloCell2ClusterMapperGetters import CaloCell2TopoClusterMapperGetter
            theCaloCell2TopoClusterMapperGetter = CaloCell2TopoClusterMapperGetter(
            )
        except Exception:
            mlog.error(
                "could not get handle to CaloCell2TopoClusterMapperGetter  Quit"
            )
            print(traceback.format_exc())
            return False

        if not theCaloCell2TopoClusterMapperGetter.usable():
            if not self.ignoreConfigError():
                mlog.error(
                    "theCaloCell2TopoClusterMapperGetter unusable. Quit.")
                return False
            else:
                mlog.error(
                    "theCaloCell2TopoClusterMapperGetter unusable. Continue nevertheless"
                )

        # now configure the algorithm, part of this could be done in a separate class
        # cannot have same name
        try:
            from CaloRec.CaloRecConf import CaloTopoTowerAlgorithm
            theCaloTopoTowerAlgorithm = CaloTopoTowerAlgorithm("TopoTowerBldr")
        except Exception:
            mlog.error("could not import CaloRec.CaloTopoTowerAlgorithm")
            print(traceback.format_exc())
            return False

        self._CaloTopoTowerAlgorithmHandle = theCaloTopoTowerAlgorithm

        # configure CaloTopoTowerAlgorithm here
        try:
            from CaloUtils.CaloUtilsConf import CaloTopoTowerBuilderTool
            theCaloTopoTowerBuilderTool = CaloTopoTowerBuilderTool(
                "TopoTowerTwrBldr")
        except Exception:
            mlog.error("could not get handle to CaloTopoTowerBuilderTool Quit")
            print(traceback.format_exc())
            return False

        theCaloTopoTowerAlgorithm.TowerBuilderTools += [
            theCaloTopoTowerBuilderTool.getFullName()
        ]

        ########################
        # extra cuts which can be applied at the topo tower level
        # set input keys
        theCaloTopoTowerAlgorithm.InputTowerContainerName = theCaloTowerCmbGetter.outputKey(
        )
        theCaloTopoTowerAlgorithm.ClusterContainerName = theCaloClusterTopoGetter.outputKey(
        )
        theCaloTopoTowerAlgorithm.CellContainerName = theCaloCellGetter.outputKey(
        )
        theCaloTopoTowerAlgorithm.Cell2ClusterMapName = theCaloCell2TopoClusterMapperGetter.outputKey(
        )

        # sets output key
        theCaloTopoTowerAlgorithm.OutputTowerContainerName = self.outputKey()

        theCaloTopoTowerAlgorithm.MinimumCellEnergy = -1000000000.0
        theCaloTopoTowerAlgorithm.MinimumClusterEnergy = -1000000000.0
        theCaloTopoTowerAlgorithm.CellEnergySignificance = -1.

        # noise tool
        theCaloTopoTowerAlgorithm.UseCaloNoiseTool = False

        ########################

        # add tool to alg . From now on theCaloClusterBuilderSW will point
        # on a COPY of the tool, so property cannot be further modified !

        theCaloTopoTowerAlgorithm += theCaloTopoTowerBuilderTool

        # register output in objKeyStore
        from RecExConfig.ObjKeyStore import objKeyStore
        objKeyStore.addStreamESD(self.outputType(), self.outputKey())

        # now add algorithm to topSequence
        # this should always come at the end

        mlog.info(" now adding to topSequence")

        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        topSequence += theCaloTopoTowerAlgorithm

        return True