Commit 91927081 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (ParticleBuilderOptions-00-03-11)

parent 1a5ada56
################################################################################
# Package: ParticleBuilderOptions
################################################################################
# Declare the package name:
atlas_subdir( ParticleBuilderOptions )
# Install files from the package:
atlas_install_python_modules( python/__init__.py python/AODFlags.py )
atlas_install_joboptions( share/*.py )
package ParticleBuilderOptions
author Tadashi Maeno <Tadashi.Maeno@cern.ch>
use AtlasPolicy AtlasPolicy-*
apply_pattern declare_joboptions files="*.py"
apply_pattern declare_python_modules files="__init__.py AODFlags.py"
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#=======================================================================
# File: ParticleBuilderOptions/python/AODFlags.py
#=======================================================================
""" AOD Building specific flags and job properties.
"""
#
# Based on previous ParticleBuilderOptions/python/AODFlags.py
# and on RecExConfig/python/RecFlags.py structure
#
__author__ = 'T. Beau'
__version__="$Revision: 03.02 $"
__doc__="AOD Building specific flags . "
#=======================================================================
# imports
#=======================================================================
from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
from AthenaCommon.JobProperties import jobproperties
from AthenaCommon.Constants import *
#=======================================================================
# Define AOD properties by class, keeping compatibily with
# previous flag names
#=======================================================================
class Photon(JobProperty):
""" If True, add Photon
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class Electron(JobProperty):
""" If True, add Electron
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class egammaTrackSlimmer(JobProperty):
""" If True, add egammaTrackSlimmer
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class Muon(JobProperty):
""" If True, add Muon
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class MuonTrackSlimmer(JobProperty):
""" If True, add MuonTrackSlimmer
"""
statusOn=True
allowedTypes=['bool']
StoredValue=False
class Tau(JobProperty):
""" If True, add Tau
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class TauTrackSlimmer(JobProperty):
""" If True, add TauTrackSlimmer
"""
statusOn=True
allowedTypes=['bool']
StoredValue=False
class TrackParticleSlimmer(JobProperty):
""" If True, add TrackParticleSlimmer which slims last hit
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class TrackParticleLastHitAndPerigeeSlimmer(JobProperty):
""" If True, add TrackParticleSlimmer which slims last hit and perigee
"""
statusOn=True
allowedTypes=['bool']
StoredValue=False
class ParticleJet(JobProperty):
""" If True, add ParticleJet
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class JetTag(JobProperty):
""" If True, add JetTag
"""
statusOn=True
allowedTypes=['bool']
# disable jet tagging since done at rdo->esd
StoredValue=False
class SpclMC(JobProperty):
""" If True, add SpclMC
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class TruthParticleJet(JobProperty):
""" If True, add TruthParticleJet
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class Trigger(JobProperty):
""" If True, add Trigger
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class Streaming(JobProperty):
""" If True, add Streaming
"""
statusOn=True
allowedTypes=['bool']
# disable Streaming - needed only for old streaming test
StoredValue=False
#fine-grained tau builder options
class TauRec(JobProperty):
""" If True, add TauRec
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
class Tau1p3p(JobProperty):
""" If True, add Tau1p3p
"""
statusOn=True
allowedTypes=['bool']
StoredValue=True
# Fast Simulation AOD Builder
class FastSimulation(JobProperty):
""" If True, add FastSimulation
"""
statusOn=True
allowedTypes=['bool']
StoredValue=False
class MissingEtTruth(JobProperty):
""" If True, add Streaming
"""
statusOn=True
allowedTypes=['bool']
# disable MissingEtTruth.
# should be ON only if fasst AOD produced in standalone mode
StoredValue=False
class FastTrackParticle(JobProperty):
""" If True, add Streaming
"""
statusOn=True
allowedTypes=['bool']
# disable FastTrackParticle - needed only for b-physics samples
StoredValue=False
# Key for McEventCollection
class McEventKeyStr(JobProperty):
""" Key for McEventCollection
"""
statusOn=True
allowedTypes=['str']
StoredValue="TruthEvent"
# --------------------------------------------------
# Defines the container for the reconstruction flags
# --------------------------------------------------
class AODFlagsContainer(JobPropertyContainer):
""" The AOD building flag/job propertycontainer.
"""
JobProperty._log.info("AODFlags:: now uses JobProperty mechanisms")
# Key member for McEventCollection, but overloaded by McEventKeyStr
# via __getattribute__ and __setattr__ methods : see bellow
McEventKey="DummyStringValue"
def __getattribute__(self, name):
if name == "McEventKey":
self._log.warning("AODFlags.McEventKey:: McEventKey is obsolete, " \
"but still maintained for compatibility. Should "\
"be replaced by McEventKeyStr. Please update.")
return self.McEventKeyStr()
else:
return JobPropertyContainer.__getattribute__(self,name)
def __setattr__(self,name,value):
if name == "McEventKey":
self._log.warning("AODFlags.McEventKey:: McEventKey is obsolete, " \
"but still maintained for compatibility. Should "\
"be replaced by McEventKeyStr. Please update.")
return JobPropertyContainer.__setattr__(self,"McEventKeyStr",value)
else:
return JobPropertyContainer.__setattr__(self,name,value)
# Add backward compatibility functions
def Print(self):
#self.print_JobProperties()
self._log.warning("AODFlags:: please use print_JobProperties() " \
"instead of Print() which becomes obsolete.")
format = "%18s : %s"
for k in self.__dict__.keys():
o=self.__dict__.get(k)
if hasattr(o,'StoredValue'):
if o.statusOn and o.allowedTypes==['bool']:
if o.get_Value()==True:
print format % (o.__name__, "ON")
else:
print format % (o.__name__, "--")
def allSetOff(self):
self._log.info("AODFlags:: using allSetOff method. Is it usefull ?")
for k in self.__dict__.keys():
o=self.__dict__.get(k)
if hasattr(o,'StoredValue'):
if o.statusOn and o.allowedTypes==['bool']:
o.set_Value(False)
o.set_On()
def allSetOn(self):
self._log.info("AODFlags:: using allSetOn method. Is it usefull ?")
for k in self.__dict__.keys():
o=self.__dict__.get(k)
if hasattr(o,'StoredValue'):
if o.statusOn and o.allowedTypes==['bool']:
o.set_Value(True)
def fastSetOn(self):
self._log.info("AODFlags:: using fastSetOn method. Is it usefull ?")
self.FastSimulation.set_Value(True)
self.MissingEtTruth.set_Value(True)
self.FastTrackParticle.set_Value(True)
# add the aod flags container to the top container
jobproperties.add_Container(AODFlagsContainer)
# I want always the following flags in the AOD container
_list_AOD=[ \
Photon,Electron,egammaTrackSlimmer, \
Muon,MuonTrackSlimmer, \
Tau,TauTrackSlimmer, \
TrackParticleSlimmer, TrackParticleLastHitAndPerigeeSlimmer, \
ParticleJet,JetTag, \
SpclMC,TruthParticleJet, \
Trigger,Streaming, \
TauRec,Tau1p3p, \
FastSimulation,MissingEtTruth,FastTrackParticle, \
McEventKeyStr ]
for j in _list_AOD:
jobproperties.AODFlagsContainer.add_JobProperty(j)
del _list_AOD
# Now the usefull short name
AODFlags=jobproperties.AODFlagsContainer
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.Resilience import treatException,protectedInclude
from ParticleBuilderOptions.AODFlags import AODFlags
from AthenaCommon.GlobalFlags import globalflags
if AODFlags.JetTag:
protectedInclude( "BTagging/BTagging_jobOptions.py" )
#if AODFlags.SpclMC:
# protectedInclude( "McParticleAlgs/TruthParticleBuilder_jobOptions.py" )
# Fast Simulation AOD
if AODFlags.FastSimulation:
try:
include( "ParticleBuilderOptions/runFastSim.py" )
from AtlfastAlgs.GlobalEventDataGetter import Atlfast__GlobalEventDataGetter
GlobalEventDataMaker = Atlfast__GlobalEventDataGetter().AlgHandle()
GlobalEventDataMaker.McLocation = AODFlags.McEventKeyStr()
include( "AtlfastConversionAlgs/AtlfastConversion_jobOptions.py" )
if AODFlags.MissingEtTruth or AODFlags.FastTrackParticle:
protectedInclude( "RecAthenaPool/RecAthenaPool_joboptions.py" )
if AODFlags.MissingEtTruth:
protectedInclude( "ParticleBuilderOptions/MissingEtTruth_jobOptions.py" )
except Exception:
treatException("Could not load FastSim" )
from FastSimulationConfig.FastSimulationFlags import jobproperties
if jobproperties.FastSimulation.doAtlfastICorrection == True:
include ( "AtlfastCorrectionAlgs/AtlfastCDivide.py" )
# run Fake HLT for streaming
if AODFlags.Streaming:
protectedInclude( "AnalysisTriggerAlgs/FakeHLT_jobOptions.py" )
from CaloRec.CaloCellFlags import jobproperties
if jobproperties.CaloCellFlags.doFastCaloSim.statusOn:
protectedInclude ("AtlfastAlgs/Atlfast_FastCaloSim_MuonFragment.py")
from ParticleBuilderOptions.AODFlags import AODFlags
from AthenaCommon.DetFlags import DetFlags
print "ERROR ERROR ERROR ERROR ERROR ERROR"
print "ERROR AOD_OutputList_joboptins.py is OBSOLETE and will be REMOVED"
print "ERROR Please use RecExPers/RecoOutputAODList_jobOptions.py"
print "ERROR Or for a copy/merging StreamAOD.TakeItemsFromInput=True"
# list of output objects
AOD_ItemList = []
# Event Info
AOD_ItemList+=["EventInfo#*"]
# Special MC AOD with HepMC Navigation
AOD_ItemList+=["McEventCollection#GEN_AOD"]
# TrackRecordCollection - muons at the entrance of the spectrometer
AOD_ItemList+=["TrackRecordCollection#MuonEntryLayerFilter"]
# slimmed Inner Detector tracks associated to Muons, Egammas and Taus
if AODFlags.egammaTrackSlimmer or AODFlags.MuonTrackSlimmer or AODFlags.TauTrackSlimmer:
AOD_ItemList+=["TrackCollection#Tracks"]
# IParticles
AOD_ItemList += [ "egammaContainer#AtlfastElectronCollection" ]
AOD_ItemList += [ "egammaContainer#AtlfastPhotonCollection" ]
AOD_ItemList += [ "egammaContainer#ElectronAODCollection" ]
AOD_ItemList += [ "egammaContainer#PhotonAODCollection" ]
AOD_ItemList += [ "egDetailContainer#egDetailAOD" ]
AOD_ItemList+=["Analysis::MuonContainer#MuidMuonCollection"]
AOD_ItemList+=["Analysis::MuonContainer#StacoMuonCollection"]
AOD_ItemList+=["Analysis::MuonContainer#CaloMuonCollection"]
# Muon Spectrometer Slimmed Track Collection
AOD_ItemList+=["TrackCollection#MuonSlimmedTrackCollection"]
AOD_ItemList+=["Analysis::MuonContainer#AtlfastMuonCollection"]
AOD_ItemList+=["Analysis::MuonContainer#AtlfastNonIsoMuonCollection"]
AOD_ItemList+=["Analysis::MuonContainer#AtlfastMuonFCSCollection"]
AOD_ItemList+=["Analysis::TauJetContainer#Tau1P3PContainer"]
AOD_ItemList+=["Analysis::TauJetContainer#TauRecContainer"]
AOD_ItemList+=["Analysis::TauJetContainer#AtlfastTauJetContainer"]
AOD_ItemList+=["Analysis::TauJetContainer#AtlfastTauJet1p3pContainer"]
AOD_ItemList+=["Analysis::TauDetailsContainer#TauRecDetailsContainer"]
AOD_ItemList+=["Analysis::TauDetailsContainer#Tau1P3PDetailsContainer"]
## Jets
AOD_ItemList+=["JetCollection#AtlfastJetContainer"]
AOD_ItemList+=["TruthParticleContainer#SpclMC"]
AOD_ItemList += [ "JetKeyDescriptor#JetKeyMap" ]
AOD_ItemList += [ "JetCollection#*"]
# INav4MomAssocs: many-to-many associations of INavigable4Momentum objects
AOD_ItemList += [ "INav4MomAssocs#*" ]
# MissingET
AOD_ItemList+=["MissingET#*"]
AOD_ItemList+=["MissingETSig#METSig"]
AOD_ItemList+=["MissingETSigHypoContainer#EtMissHypoCollection"]
AOD_ItemList+=["MissingETSigObjContainer#EtMissObjCollection"]
# TrackParticle
AOD_ItemList+=["Rec::TrackParticleContainer#*"]
AOD_ItemList+=["TrackParticleTruthCollection#*"]
# MuonSpectrometer Shower and SegmentParticle
AOD_ItemList+=["Rec::MuonSpShowerContainer#*"]
#Segments
AOD_ItemList+=["Trk::SegmentCollection#ConvertedMBoySegments"]
AOD_ItemList+=["Trk::SegmentCollection#MooreSegments"]
AOD_ItemList+=["Trk::SegmentCollection#MuGirlSegments"]
# VxContainer
AOD_ItemList+=["VxContainer#VxPrimaryCandidate"]
AOD_ItemList+=["VxContainer#ConversionCandidate"]
AOD_ItemList+=["V0Container#V0Candidates"]
# cells
AOD_ItemList+=["CaloCellContainer#AODCellContainer"]
# CaloClusters
CaloClusterItemList=[]
CaloClusterKeys=[]
CaloClusterKeys+=["CaloCalTopoCluster"]
CaloClusterKeys+=["CombinedCluster"]
CaloClusterKeys+=["EMTopoCluster"]
# reshuffl em
#CaloClusterKeys+=["LArClusterEM"]
CaloClusterKeys+=["egClusterCollection"]
#CaloClusterKeys+=["LArClusterEM35"]
#CaloClusterKeys+=["LArClusterEM37"]
#CaloClusterKeys+=["LArClusterEMgam"]
#CaloClusterKeys+=["LArClusterEMgam35"]
#CaloClusterKeys+=["LArClusterEMgam37"]
CaloClusterKeys+=["LArClusterEMSofte"]
if DetFlags.detdescr.Calo_on():
CaloClusterKeys+=["MuonClusterCollection"]
for theKey in CaloClusterKeys:
CaloClusterItemList+=["CaloClusterContainer#"+theKey]
# write the link only for egClusterColl
CaloClusterItemList+=["CaloCellLinkContainer#egClusterCollection_Link"]
if DetFlags.detdescr.Calo_on():
CaloClusterItemList+=["CaloCellLinkContainer#MuonClusterCollection_Link"]
AOD_ItemList+=CaloClusterItemList
if DetFlags.detdescr.Calo_on():
AOD_ItemList+=["MuonCaloEnergyContainer#MuonCaloEnergyCollection"]
AOD_ItemList+=["CaloClusterContainer#Tau1P3PPi0ClusterContainer"]
# TileCell
AOD_ItemList+=["TileMuContainer#TileMuObj"]
AOD_ItemList+=["TileCellContainer#MBTSContainer"]
# MC Truth for PileUp
AOD_ItemList+=["PileUpEventInfo#*"]
#obsolete AOD_ItemList+=[ "DetStatusMap#DetectorStatus" ]
if AODFlags.Trigger:
include ("TriggerRelease/TriggerOutputItemListAOD_jobOptions.py")
# now merge the explicit AOD list to the one coming from ObjKeyStore
# (more and more will be taken from ObjKeyStore)
from AthenaCommon.KeyStore import CfgItemList, CfgKeyStore
theCKS=CfgKeyStore("KeyStore")
CILMergeAOD=CfgItemList("AODMerge",allowWildCard=True)
CILMergeAOD.add(AOD_ItemList)
CILMergeAOD.add(theCKS.streamAOD())
#now prune the itemlist from the object which are soft linked
# this doe not work CILMergeAOD.remove("DataVector<INavigable4Momentum>")
#this does
for k in CILMergeAOD('DataVector<INavigable4Momentum>'):
CILMergeAOD.removeItem(k)
# The only items declared in StreamESD are those written here.
# Note the use of "=" instead of "+=" is deliberate
#StreamESD.ItemList = fullESDList()
AOD_ItemList = CILMergeAOD()
#print "ESD Output list is :",StreamESD.ItemList
# POOL converters
include( "ParticleEventAthenaPool/ParticleEventAthenaPool_joboptions.py" )
include( "AnalysisTriggerEventAthenaPool/AnalysisTriggerEventAthenaPool_joboptions.py" )
include( "ParticleBuilderOptions/AOD_PoolCnv_jobOptions.py")
include( "ParticleBuilderOptions/AOD_Builder_jobOptions.py")
include( "ParticleBuilderOptions/AOD_OutputList_jobOptions.py")
# for McTruth
include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py")
# set output item list
Stream1.ItemList = AOD_ItemList
#---------------MC Truth
include( "PartPropSvc/PartPropSvc.py" )
include.block( "PartPropSvc/PartPropSvc.py" )
include( "G4SimAthenaPOOL/G4SimAthenaPOOL_joboptions.py" )
include( "GeneratorObjectsAthenaPool/GeneratorObjectsAthenaPool_joboptions.py" )
#---------------Inner Detector - Tracking
#include( "InDetEventCnvTools/InDetEventCnvTools_jobOptions.py" )
include( "InDetEventAthenaPool/InDetEventAthenaPool_joboptions.py" )
#include( "TrkEventAthenaPool/TrkEventAthenaPool_joboptions.py" )
#---------------Calorimeter
from AthenaCommon.AppMgr import ToolSvc
include( "LArAthenaPool/LArAthenaPool_joboptions.py" )
#ToolSvc.LArTowerEMHEC.IncludedCalos = ["LAREM","LARHEC"]
from LArRecUtils.LArRecUtilsConf import LArTowerBuilderTool
ToolSvc += LArTowerBuilderTool("LArTowerEMHEC",
IncludedCalos = ["LAREM","LARHEC"])
include( "TileEventAthenaPool/TileEventAthenaPool_joboptions.py" )
#---------------Muon
include( "MuonEventCnvTools/MuonEventCnvTools_jobOptions.py" )
#---------------Trigger
include( "TrigT1EventAthenaPool/TrigT1EventAthenaPool_joboptions.py" )
include( "TrigEventAthenaPool/TrigEventAthenaPool_joboptions.py" )
include ("ParticleBuilderOptions/optESDtoAOD.py")
# AOD Flags are set here - comment otu and set appropriately
from ParticleBuilderOptions.AODFlags import AODFlags
#AODFlags.FastSimulation = False
AODFlags.Streaming = False
# DetFlags modifications are best set here (uncomment RecExCommon_flags first)
# include ("RecExCommon/RecExCommon_flags.py")
# switch off ID, calo, or muons
# DetFlags.ID_setOff()
# DetFlags.Calo_setOff()
# DetFlags.Muon_setOff()
# main jobOption
include ("RecExCommon/RecExCommon_topOptions.py")
include ("ParticleBuilderOptions/optESDtoAOD.py")
# AOD Flags are set here - comment otu and set appropriately
from ParticleBuilderOptions.AODFlags import AODFlags
AODFlags.FastSimulation = True