if not rec.doInDet() \ and ( not cfgKeyStore.isInTransient("xAOD::VertexContainer_v1","PrimaryVertices") \ or not cfgKeyStore.isInTransient('xAOD::TrackParticleContainer_v1','InDetTrackParticles') ): jetFlags.useTracks = False jetlog.info( " Tracks enabled ? jetFlags.useTracks == %s", jetFlags.useTracks() ) #skip muon segment if not built if not rec.doMuon() or not rec.doMuonCombined() : jetFlags.useMuonSegments = False print rec.doMuon() , rec.doMuonCombined() jetlog.info( " MuonSegments enabled ? jetFlags.useMuonSegments == %s", jetFlags.useMuonSegments() ) #skip cluster if not built if not rec.doCalo(): jetFlags.useTopo = False jetlog.info( " TopCluster enabled ? jetFlags.useTopo == %s", jetFlags.useTopo() ) # The following can be used to exclude tools from reconstruction. if 0: jetFlags.skipTools = ["comshapes"] jetlog.info( "Skipped tools: %s", jetFlags.skipTools()) # Import the jet tool manager. from JetRec.JetRecStandard import jtm #-------------------------------------------------------------- # Define the finders and groomers. # Each line configures a finder or groomer and its associated jetrec tool. # The first argument is the name of the output collection and the jetrec tool.
from JetRec.JetRecFlags import jetFlags from RecExConfig.ObjKeyStore import cfgKeyStore from AthenaCommon import Logging jetlog = Logging.logging.getLogger('JetRec_jobOptions') # Skip truth if rec says it is absent. # No action if someone has already set the flag. print myname + "Initial useTruth: " + sflagstat(jetFlags.useTruth) print myname + " rec.doTruth: " + str(rec.doTruth()) if not jetFlags.useTruth.statusOn: jetFlags.useTruth = rec.doTruth() print myname + " Final useTruth: " + sflagstat(jetFlags.useTruth) # Skip use of topoclusters if not built # No action if someone has already set the flag. print myname + "Initial use topoclusters: " + str(jetFlags.useTopo()) if not jetFlags.useTopo.statusOn: jetFlags.useTopo = rec.doCalo() print myname + " Final use topoclusters: " + str(jetFlags.useTopo()) # Skip tracks if tracks or vertices are not present in the job. # No action if someone has already set the flag. haveTracks = cfgKeyStore.isInTransient('xAOD::TrackParticleContainer', 'InDetTrackParticles') haveVertices = cfgKeyStore.isInTransient("xAOD::VertexContainer", "PrimaryVertices") recTracks = rec.doInDet() recVertices = bool(InDetFlags.doVertexFinding) and (recTracks or haveTracks) print myname + "Initial useTracks: " + sflagstat(jetFlags.useTracks) print myname + " rec doInDet: " + str(recTracks) print myname + " doVertexFinding: " + str(recVertices)
#-------------------------------------------------------------- # Define the finders and groomers. # Each line configures a finder or groomer and its associated jetrec tool. # The first argument is the name of the output collection and the jetrec tool. # The fifth argument is the list of modifiers. # Non-zero ghostArea enables calculation of active area. #-------------------------------------------------------------- calibopt = "arj" if not jetFlags.useVertices(): calibopt = "aj" jetlog.info(myname + "No vertices -- switch calibopt to " + calibopt) # Finders. if jetFlags.detailLevel()==JetContentDetail.Reduced: if jetFlags.useTopo(): jtm.addJetFinder("AntiKt4EMTopoJets", "AntiKt", 0.4, "emtopo_reduced", "emtopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) jtm.addJetFinder("AntiKt4LCTopoJets", "AntiKt", 0.4, "lctopo_reduced", "lctopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) jtm.addJetFinder("AntiKt10LCTopoJets", "AntiKt", 1.0, "lctopo_reduced", "lctopo_ungroomed", ghostArea=0.01, ptmin= 40000, ptminFilter=50000, calibOpt="none") if jetFlags.usePFlow(): jtm.addJetFinder("AntiKt4EMPFlowJets", "AntiKt", 0.4, "empflow_reduced", "pflow_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 10000, calibOpt=calibopt+":pflow") # if jetFlags.useTruth(): # jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", ptmin= 5000) elif jetFlags.detailLevel()>=JetContentDetail.Full: if jetFlags.useTruth(): jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", ptmin= 5000) jtm.addJetFinder("AntiKt4TruthWZJets", "AntiKt", 0.4, "truthwz", ptmin= 5000) jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin=40000) jtm.addJetFinder("AntiKt10TruthWZJets", "AntiKt", 1.0, "truthwz", ptmin=40000) if jetFlags.useTracks(): jtm.addJetFinder("AntiKt2PV0TrackJets", "AntiKt", 0.2, "pv0track", ptmin= 2000)
from JetRec.JetRecFlags import jetFlags from RecExConfig.ObjKeyStore import cfgKeyStore from AthenaCommon import Logging jetlog = Logging.logging.getLogger('JetRec_jobOptions') # Skip truth if rec says it is absent. # No action if someone has already set the flag. print myname + "Initial useTruth: " + sflagstat(jetFlags.useTruth) print myname + " rec.doTruth: " + str(rec.doTruth()) if not jetFlags.useTruth.statusOn: jetFlags.useTruth = rec.doTruth() print myname + " Final useTruth: " + sflagstat(jetFlags.useTruth) # Skip use of topoclusters if not built # No action if someone has already set the flag. print myname + "Initial use topoclusters: " + str(jetFlags.useTopo()) if not jetFlags.useTopo.statusOn: jetFlags.useTopo = rec.doCalo() print myname + " Final use topoclusters: " + str(jetFlags.useTopo()) # Skip tracks if tracks or vertices are not present in the job. # No action if someone has already set the flag. haveTracks = cfgKeyStore.isInTransient('xAOD::TrackParticleContainer','InDetTrackParticles') haveVertices = cfgKeyStore.isInTransient("xAOD::VertexContainer","PrimaryVertices") recTracks = rec.doInDet() recVertices = bool(InDetFlags.doVertexFinding) and (recTracks or haveTracks) print myname + "Initial useTracks: " + sflagstat(jetFlags.useTracks) print myname + " rec doInDet: " + str(recTracks) print myname + " doVertexFinding: " + str(recVertices) print myname + " have tracks: " + str(haveTracks) print myname + " have vertices: " + str(haveVertices)
# Lock all the flags used here so that later attempts to change # the value will fail with an error message. jetFlags.useTruth.lock() jetFlags.useTopo.lock() jetFlags.useTracks.lock() jetFlags.useMuonSegments.lock() jetFlags.useBTagging.lock() jetFlags.useCaloQualityTool.lock() jetFlags.additionalTopoGetters.lock() jetFlags.truthFlavorTags.lock() jetFlags.skipTools.lock() # Display all flags used here. print myname + "jetFlags.useTruth: " + str(jetFlags.useTruth()) print myname + "jetFlags.useTopo: " + str(jetFlags.useTopo()) print myname + "jetFlags.useTracks: " + str(jetFlags.useTracks()) print myname + "jetFlags.useMuonSegments: " + str(jetFlags.useMuonSegments()) print myname + "jetFlags.useBTagging: " + str(jetFlags.useBTagging()) print myname + "jetFlags.useCaloQualityTool: " + str( jetFlags.useCaloQualityTool()) print myname + "jetFlags.additionalTopoGetters: " + str( jetFlags.additionalTopoGetters()) print myname + "jetFlags.truthFlavorTags: " + str(jetFlags.truthFlavorTags()) print myname + "jetFlags.skipTools: " + str(jetFlags.skipTools()) ######################################################### # Create standard tool manager. ######################################################### # Import the jet tool manager.
# Lock all the flags used here so that later attempts to change # the value will fail with an error message. jetFlags.useTruth.lock() jetFlags.useTopo.lock() jetFlags.useTracks.lock() jetFlags.useMuonSegments.lock() jetFlags.useBTagging.lock() jetFlags.useCaloQualityTool.lock() jetFlags.additionalTopoGetters.lock() jetFlags.truthFlavorTags.lock() jetFlags.skipTools.lock() # Display all flags used here. print myname + "jetFlags.useTruth: " + str(jetFlags.useTruth()) print myname + "jetFlags.useTopo: " + str(jetFlags.useTopo()) print myname + "jetFlags.useTracks: " + str(jetFlags.useTracks()) print myname + "jetFlags.useMuonSegments: " + str(jetFlags.useMuonSegments()) print myname + "jetFlags.useBTagging: " + str(jetFlags.useBTagging()) print myname + "jetFlags.useCaloQualityTool: " + str(jetFlags.useCaloQualityTool()) print myname + "jetFlags.additionalTopoGetters: " + str(jetFlags.additionalTopoGetters()) print myname + "jetFlags.truthFlavorTags: " + str(jetFlags.truthFlavorTags()) print myname + "jetFlags.skipTools: " + str(jetFlags.skipTools()) ######################################################### # Create standard tool manager. ######################################################### # Import the jet tool manager. from JetRec.JetToolSupport import JetToolManager
# Import the jet reconstruction control flags. from JetRec.JetRecFlags import jetFlags from RecExConfig.ObjKeyStore import cfgKeyStore # Skip truth if rec says it is absent. # No action if someone has already set the flag. jetlog.info(myname + "Initial useTruth: " + sflagstat(jetFlags.useTruth)) jetlog.info(myname + " rec.doTruth: " + str(rec.doTruth())) if not jetFlags.useTruth.statusOn: jetFlags.useTruth = rec.doTruth() jetlog.info(myname + " Final useTruth: " + sflagstat(jetFlags.useTruth)) # Skip use of topoclusters if not built # No action if someone has already set the flag. jetlog.info(myname + "Initial use topoclusters: " + str(jetFlags.useTopo())) if not jetFlags.useTopo.statusOn: jetFlags.useTopo = rec.doCalo() jetlog.info(myname + " Final use topoclusters: " + str(jetFlags.useTopo())) # Skip tracks if tracks or vertices are not present in the job. # No action if someone has already set the flag. haveTracks = cfgKeyStore.isInTransient('xAOD::TrackParticleContainer', 'InDetTrackParticles') haveVertices = cfgKeyStore.isInTransient("xAOD::VertexContainer", "PrimaryVertices") recTracks = rec.doInDet() recVertices = bool(InDetFlags.doVertexFinding) and (recTracks or haveTracks) jetlog.info(myname + "Initial useTracks: " + sflagstat(jetFlags.useTracks)) jetlog.info(myname + " rec doInDet: " + str(recTracks)) jetlog.info(myname + " doVertexFinding: " + str(recVertices))
# Lock all the flags used here so that later attempts to change # the value will fail with an error message. jetFlags.useTruth.lock() jetFlags.useTopo.lock() jetFlags.useTracks.lock() jetFlags.useMuonSegments.lock() jetFlags.useBTagging.lock() jetFlags.useCaloQualityTool.lock() jetFlags.additionalTopoGetters.lock() jetFlags.truthFlavorTags.lock() jetFlags.skipTools.lock() # Display all flags used here. jetlog.info(myname + "jetFlags.useTruth: " + str(jetFlags.useTruth())) jetlog.info(myname + "jetFlags.useTopo: " + str(jetFlags.useTopo())) jetlog.info(myname + "jetFlags.useTracks: " + str(jetFlags.useTracks())) jetlog.info(myname + "jetFlags.useMuonSegments: " + str(jetFlags.useMuonSegments())) jetlog.info(myname + "jetFlags.useBTagging: " + str(jetFlags.useBTagging())) jetlog.info(myname + "jetFlags.useCaloQualityTool: " + str(jetFlags.useCaloQualityTool())) jetlog.info(myname + "jetFlags.additionalTopoGetters: " + str(jetFlags.additionalTopoGetters())) jetlog.info(myname + "jetFlags.truthFlavorTags: " + str(jetFlags.truthFlavorTags())) jetlog.info(myname + "jetFlags.skipTools: " + str(jetFlags.skipTools())) ######################################################### # Create standard tool manager. #########################################################