diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/AsgAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/AsgAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..3640921d33a64e0257689e2ac12099d58786c727 --- /dev/null +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/AsgAnalysisAlgorithmsTest.py @@ -0,0 +1,174 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# @author Nils Krumnack +# @author Tadej Novak + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeOverlapSequence (dataType) : + algSeq = AlgSequence() + + # Skip events with no primary vertex: + algSeq += createAlgorithm( 'CP::VertexSelectionAlg', + 'PrimaryVertexSelectorAlg' ) + algSeq.PrimaryVertexSelectorAlg.VertexContainer = 'PrimaryVertices' + algSeq.PrimaryVertexSelectorAlg.MinVertices = 1 + + # Set up the systematics loader/handler algorithm: + algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + algSeq.SysLoaderAlg.sigmaRecommended = 1 + + # Include, and then set up the pileup analysis sequence: + from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ + makePileupAnalysisSequence + pileupSequence = makePileupAnalysisSequence( dataType ) + pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) + algSeq += pileupSequence + + # Include, and then set up the electron analysis sequence: + from EgammaAnalysisAlgorithms.ElectronAnalysisSequence import \ + makeElectronAnalysisSequence + electronSequence = makeElectronAnalysisSequence( dataType, 'LooseLHElectron.GradientLoose', + recomputeLikelihood = True ) + electronSequence.configure( inputName = 'Electrons', + outputName = 'AnalysisElectrons_%SYS%' ) + algSeq += electronSequence + + # Include, and then set up the photon analysis sequence: + from EgammaAnalysisAlgorithms.PhotonAnalysisSequence import \ + makePhotonAnalysisSequence + photonSequence = makePhotonAnalysisSequence( dataType, 'Tight.FixedCutTight', recomputeIsEM = True ) + photonSequence.configure( inputName = 'Photons', + outputName = 'AnalysisPhotons_%SYS%' ) + algSeq += photonSequence + + # Include, and then set up the muon analysis algorithm sequence: + from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence + muonSequence = makeMuonAnalysisSequence( dataType, 'Tight.Iso' ) + muonSequence.configure( inputName = 'Muons', + outputName = 'AnalysisMuons_%SYS%' ) + algSeq += muonSequence + + # Include, and then set up the jet analysis algorithm sequence: + jetContainer = 'AntiKt4EMTopoJets' + from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence + jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) + jetSequence.configure( inputName = jetContainer, + outputName = 'AnalysisJets_%SYS%' ) + algSeq += jetSequence + + # Include, and then set up the tau analysis algorithm sequence: + from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence + tauSequence = makeTauAnalysisSequence( dataType, 'Tight' ) + tauSequence.configure( inputName = 'TauJets', + outputName = 'AnalysisTauJets_%SYS%' ) + algSeq += tauSequence + + # Include, and then set up the overlap analysis algorithm sequence: + from AsgAnalysisAlgorithms.OverlapAnalysisSequence import \ + makeOverlapAnalysisSequence + overlapSequence = makeOverlapAnalysisSequence( dataType ) + overlapSequence.configure( + inputName = { + 'electrons' : 'AnalysisElectrons_%SYS%', + 'photons' : 'AnalysisPhotons_%SYS%', + 'muons' : 'AnalysisMuons_%SYS%', + 'jets' : 'AnalysisJets_%SYS%', + 'taus' : 'AnalysisTauJets_%SYS%' }, + outputName = { + 'electrons' : 'AnalysisElectronsOR_%SYS%', + 'photons' : 'AnalysisPhotonsOR_%SYS%', + 'muons' : 'AnalysisMuonsOR_%SYS%', + 'jets' : 'AnalysisJetsOR_%SYS%', + 'taus' : 'AnalysisTauJetsOR_%SYS%' }, + affectingSystematics = { + 'electrons' : electronSequence.affectingSystematics(), + 'photons' : photonSequence.affectingSystematics(), + 'muons' : muonSequence.affectingSystematics(), + 'jets' : jetSequence.affectingSystematics(), + 'taus' : tauSequence.affectingSystematics() } ) + algSeq += overlapSequence + + # Set up an ntuple to check the job with: + treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) + treeMaker.TreeName = 'particles' + algSeq += treeMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) + ntupleMaker.TreeName = 'particles' + ntupleMaker.Branches = [ + 'EventInfo.runNumber -> runNumber', + 'EventInfo.eventNumber -> eventNumber', + 'AnalysisElectrons_%SYS%.eta -> el_%SYS%_eta', + 'AnalysisElectrons_%SYS%.phi -> el_%SYS%_phi', + 'AnalysisElectrons_%SYS%.pt -> el_%SYS%_pt', + 'AnalysisElectronsOR_%SYS%.eta -> el_OR_%SYS%_eta', + 'AnalysisElectronsOR_%SYS%.phi -> el_OR_%SYS%_phi', + 'AnalysisElectronsOR_%SYS%.pt -> el_OR_%SYS%_pt', + 'AnalysisPhotons_%SYS%.eta -> ph_%SYS%_eta', + 'AnalysisPhotons_%SYS%.phi -> ph_%SYS%_phi', + 'AnalysisPhotons_%SYS%.pt -> ph_%SYS%_pt', + 'AnalysisPhotonsOR_%SYS%.eta -> ph_OR_%SYS%_eta', + 'AnalysisPhotonsOR_%SYS%.phi -> ph_OR_%SYS%_phi', + 'AnalysisPhotonsOR_%SYS%.pt -> ph_OR_%SYS%_pt', + 'AnalysisMuons_%SYS%.eta -> mu_%SYS%_eta', + 'AnalysisMuons_%SYS%.phi -> mu_%SYS%_phi', + 'AnalysisMuons_%SYS%.pt -> mu_%SYS%_pt', + 'AnalysisMuonsOR_%SYS%.eta -> mu_OR_%SYS%_eta', + 'AnalysisMuonsOR_%SYS%.phi -> mu_OR_%SYS%_phi', + 'AnalysisMuonsOR_%SYS%.pt -> mu_OR_%SYS%_pt', + 'AnalysisJets_%SYS%.eta -> jet_%SYS%_eta', + 'AnalysisJets_%SYS%.phi -> jet_%SYS%_phi', + 'AnalysisJets_%SYS%.pt -> jet_%SYS%_pt', + 'AnalysisJetsOR_%SYS%.eta -> jet_OR_%SYS%_eta', + 'AnalysisJetsOR_%SYS%.phi -> jet_OR_%SYS%_phi', + 'AnalysisJetsOR_%SYS%.pt -> jet_OR_%SYS%_pt', + 'AnalysisTauJets_%SYS%.eta -> tau_%SYS%_eta', + 'AnalysisTauJets_%SYS%.phi -> tau_%SYS%_phi', + 'AnalysisTauJets_%SYS%.pt -> tau_%SYS%_pt', + 'AnalysisTauJetsOR_%SYS%.eta -> tau_OR_%SYS%_eta', + 'AnalysisTauJetsOR_%SYS%.phi -> tau_OR_%SYS%_phi', + 'AnalysisTauJetsOR_%SYS%.pt -> tau_OR_%SYS%_pt' ] + ntupleMaker.systematicsRegex = '.*' + algSeq += ntupleMaker + treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) + treeFiller.TreeName = 'particles' + algSeq += treeFiller + + return algSeq + +def makeEventAlgorithmsSequence (dataType) : + + # Config: + GRLFiles = ['GoodRunsLists/data16_13TeV/20180129/data16_13TeV.periodAllYear_DetStatus-v89-pro21-01_DQDefects-00-02-04_PHYS_StandardGRL_All_Good_25ns.xml'] + + algSeq = AlgSequence() + + # Set up the systematics loader/handler algorithm: + algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + algSeq.SysLoaderAlg.sigmaRecommended = 1 + + # Include, and then set up the pileup analysis sequence: + from AsgAnalysisAlgorithms.EventSelectionAnalysisSequence import \ + makeEventSelectionAnalysisSequence + eventSelectionSequence = \ + makeEventSelectionAnalysisSequence( dataType, userGRLFiles=GRLFiles ) + algSeq += eventSelectionSequence + + # Set up an ntuple to check the job with: + treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) + treeMaker.TreeName = 'events' + algSeq += treeMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) + ntupleMaker.TreeName = 'events' + ntupleMaker.Branches = [ + 'EventInfo.runNumber -> runNumber', + 'EventInfo.eventNumber -> eventNumber', + ] + ntupleMaker.systematicsRegex = '.*' + algSeq += ntupleMaker + treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) + treeFiller.TreeName = 'events' + algSeq += treeFiller + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py index 9442ce1df183e157e8ce06006798747f352f3e8f..e2f4929de9a2119629da3322765b60041fb40485 100755 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_eljob.py @@ -52,47 +52,9 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Config: -GRLFiles = ['GoodRunsLists/data16_13TeV/20180129/data16_13TeV.periodAllYear_DetStatus-v89-pro21-01_DQDefects-00-02-04_PHYS_StandardGRL_All_Good_25ns.xml'] - -# Import(s) needed for the job configuration. -from AnaAlgorithm.AlgSequence import AlgSequence -from AnaAlgorithm.DualUseConfig import createAlgorithm - -# Set up the main analysis algorithm sequence. -algSeq = AlgSequence( 'AnalysisSequence' ) - -# Set up the systematics loader/handler algorithm: -algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) -algSeq.SysLoaderAlg.sigmaRecommended = 1 - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.EventSelectionAnalysisSequence import \ - makeEventSelectionAnalysisSequence -eventSelectionSequence = \ - makeEventSelectionAnalysisSequence( dataType, userGRLFiles=GRLFiles ) -algSeq += eventSelectionSequence - -# Set up an ntuple to check the job with: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'events' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'events' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', -] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'events' -algSeq += treeFiller - -# For debugging. -print( algSeq ) - -# Add all algorithms from the sequence to the job. +from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeEventAlgorithmsSequence +algSeq = makeEventAlgorithmsSequence (dataType) +print algSeq # For debugging for alg in algSeq: job.algsAdd( alg ) pass diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py index 51ff6adecae48f076362c4fb26ba4c1199ee979d..11d48f64c18c6d0a1a35271dd1b6e50e741710f8 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/EventAlgorithmsTest_jobOptions.py @@ -17,48 +17,9 @@ theApp.EvtMax = 500 testFile = os.getenv ( inputfile[dataType] ) svcMgr.EventSelector.InputCollections = [testFile] -# Config: -GRLFiles = ['GoodRunsLists/data16_13TeV/20180129/data16_13TeV.periodAllYear_DetStatus-v89-pro21-01_DQDefects-00-02-04_PHYS_StandardGRL_All_Good_25ns.xml'] - -# Import(s) needed for the job configuration. -from AnaAlgorithm.AlgSequence import AlgSequence -from AnaAlgorithm.DualUseConfig import createAlgorithm - -# Set up the main analysis algorithm sequence. -algSeq = AlgSequence( 'AnalysisSequence' ) - -# Set up the systematics loader/handler algorithm: -algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) -algSeq.SysLoaderAlg.sigmaRecommended = 1 - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.EventSelectionAnalysisSequence import \ - makeEventSelectionAnalysisSequence -eventSelectionSequence = \ - makeEventSelectionAnalysisSequence( dataType, userGRLFiles=GRLFiles ) -algSeq += eventSelectionSequence - -# Set up an ntuple to check the job with: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'events' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'events' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', -] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'events' -algSeq += treeFiller - -# For debugging. -print( algSeq ) - -# Add all algorithms from the sequence to the job. -athAlgSeq += algSeq +from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeEventAlgorithmsSequence +algSeq = makeEventAlgorithmsSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc() diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py index 0516d4249453ab2c10ac353bb414226b378a68ac..9e84437af87fccf0f59234f7bd1ad158fa7d0c09 100755 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_eljob.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -52,147 +52,14 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Import(s) needed for the job configuration. -from AnaAlgorithm.AlgSequence import AlgSequence -from AnaAlgorithm.DualUseConfig import createAlgorithm - -# Set up the main analysis algorithm sequence. -algSeq = AlgSequence( 'AnalysisSequence' ) - -# Skip events with no primary vertex: -algSeq += createAlgorithm( 'CP::VertexSelectionAlg', - 'PrimaryVertexSelectorAlg' ) -algSeq.PrimaryVertexSelectorAlg.VertexContainer = 'PrimaryVertices' -algSeq.PrimaryVertexSelectorAlg.MinVertices = 1 - -# Set up the systematics loader/handler algorithm: -algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) -algSeq.SysLoaderAlg.sigmaRecommended = 1 - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ - makePileupAnalysisSequence -pileupSequence = makePileupAnalysisSequence( dataType ) -pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) -algSeq += pileupSequence - -# Include, and then set up the electron analysis sequence: -from EgammaAnalysisAlgorithms.ElectronAnalysisSequence import \ - makeElectronAnalysisSequence -electronSequence = makeElectronAnalysisSequence( dataType, 'LooseLHElectron.GradientLoose', - recomputeLikelihood = True ) -electronSequence.configure( inputName = 'Electrons', - outputName = 'AnalysisElectrons_%SYS%' ) -algSeq += electronSequence - -# Include, and then set up the photon analysis sequence: -from EgammaAnalysisAlgorithms.PhotonAnalysisSequence import \ - makePhotonAnalysisSequence -photonSequence = makePhotonAnalysisSequence( dataType, 'Tight.FixedCutTight', recomputeIsEM = True ) -photonSequence.configure( inputName = 'Photons', - outputName = 'AnalysisPhotons_%SYS%' ) -algSeq += photonSequence - -# Include, and then set up the muon analysis algorithm sequence: -from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence -muonSequence = makeMuonAnalysisSequence( dataType, 'Tight.Iso' ) -muonSequence.configure( inputName = 'Muons', - outputName = 'AnalysisMuons_%SYS%' ) -algSeq += muonSequence - -# Include, and then set up the jet analysis algorithm sequence: -jetContainer = 'AntiKt4EMTopoJets' -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -jetSequence.configure( inputName = jetContainer, - outputName = 'AnalysisJets_%SYS%' ) -algSeq += jetSequence - -# Include, and then set up the tau analysis algorithm sequence: -from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence -tauSequence = makeTauAnalysisSequence( dataType, 'Tight' ) -tauSequence.configure( inputName = 'TauJets', - outputName = 'AnalysisTauJets_%SYS%' ) -algSeq += tauSequence - -# Include, and then set up the overlap analysis algorithm sequence: -from AsgAnalysisAlgorithms.OverlapAnalysisSequence import \ - makeOverlapAnalysisSequence -overlapSequence = makeOverlapAnalysisSequence( dataType ) -overlapSequence.configure( - inputName = { - 'electrons' : 'AnalysisElectrons_%SYS%', - 'photons' : 'AnalysisPhotons_%SYS%', - 'muons' : 'AnalysisMuons_%SYS%', - 'jets' : 'AnalysisJets_%SYS%', - 'taus' : 'AnalysisTauJets_%SYS%' }, - outputName = { - 'electrons' : 'AnalysisElectronsOR_%SYS%', - 'photons' : 'AnalysisPhotonsOR_%SYS%', - 'muons' : 'AnalysisMuonsOR_%SYS%', - 'jets' : 'AnalysisJetsOR_%SYS%', - 'taus' : 'AnalysisTauJetsOR_%SYS%' }, - affectingSystematics = { - 'electrons' : electronSequence.affectingSystematics(), - 'photons' : photonSequence.affectingSystematics(), - 'muons' : muonSequence.affectingSystematics(), - 'jets' : jetSequence.affectingSystematics(), - 'taus' : tauSequence.affectingSystematics() } ) -algSeq += overlapSequence - -# Set up an ntuple to check the job with: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'particles' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'particles' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', - 'AnalysisElectrons_%SYS%.eta -> el_%SYS%_eta', - 'AnalysisElectrons_%SYS%.phi -> el_%SYS%_phi', - 'AnalysisElectrons_%SYS%.pt -> el_%SYS%_pt', - 'AnalysisElectronsOR_%SYS%.eta -> el_OR_%SYS%_eta', - 'AnalysisElectronsOR_%SYS%.phi -> el_OR_%SYS%_phi', - 'AnalysisElectronsOR_%SYS%.pt -> el_OR_%SYS%_pt', - 'AnalysisPhotons_%SYS%.eta -> ph_%SYS%_eta', - 'AnalysisPhotons_%SYS%.phi -> ph_%SYS%_phi', - 'AnalysisPhotons_%SYS%.pt -> ph_%SYS%_pt', - 'AnalysisPhotonsOR_%SYS%.eta -> ph_OR_%SYS%_eta', - 'AnalysisPhotonsOR_%SYS%.phi -> ph_OR_%SYS%_phi', - 'AnalysisPhotonsOR_%SYS%.pt -> ph_OR_%SYS%_pt', - 'AnalysisMuons_%SYS%.eta -> mu_%SYS%_eta', - 'AnalysisMuons_%SYS%.phi -> mu_%SYS%_phi', - 'AnalysisMuons_%SYS%.pt -> mu_%SYS%_pt', - 'AnalysisMuonsOR_%SYS%.eta -> mu_OR_%SYS%_eta', - 'AnalysisMuonsOR_%SYS%.phi -> mu_OR_%SYS%_phi', - 'AnalysisMuonsOR_%SYS%.pt -> mu_OR_%SYS%_pt', - 'AnalysisJets_%SYS%.eta -> jet_%SYS%_eta', - 'AnalysisJets_%SYS%.phi -> jet_%SYS%_phi', - 'AnalysisJets_%SYS%.pt -> jet_%SYS%_pt', - 'AnalysisJetsOR_%SYS%.eta -> jet_OR_%SYS%_eta', - 'AnalysisJetsOR_%SYS%.phi -> jet_OR_%SYS%_phi', - 'AnalysisJetsOR_%SYS%.pt -> jet_OR_%SYS%_pt', - 'AnalysisTauJets_%SYS%.eta -> tau_%SYS%_eta', - 'AnalysisTauJets_%SYS%.phi -> tau_%SYS%_phi', - 'AnalysisTauJets_%SYS%.pt -> tau_%SYS%_pt', - 'AnalysisTauJetsOR_%SYS%.eta -> tau_OR_%SYS%_eta', - 'AnalysisTauJetsOR_%SYS%.phi -> tau_OR_%SYS%_phi', - 'AnalysisTauJetsOR_%SYS%.pt -> tau_OR_%SYS%_pt' ] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'particles' -algSeq += treeFiller - -# For debugging. -print( algSeq ) - -# Add all algorithms from the sequence to the job. -for alg in algSeq: +from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeOverlapSequence +algSeq = makeOverlapSequence (dataType) +print algSeq # For debugging +for alg in algSeq : job.algsAdd( alg ) pass + # Set up an output file for the job: job.outputAdd( ROOT.EL.OutputStream( 'ANALYSIS' ) ) diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py index 74ef215612ddfe2d059452eed549842fcb2ff3f0..5ae88bd7311304fc08cdf7ab9d3249bd9165a058 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/share/OverlapAlgorithmsTest_jobOptions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -17,144 +17,9 @@ theApp.EvtMax = 500 testFile = os.getenv ( inputfile[dataType] ) svcMgr.EventSelector.InputCollections = [testFile] -# Import(s) needed for the job configuration. -from AnaAlgorithm.AlgSequence import AlgSequence -from AnaAlgorithm.DualUseConfig import createAlgorithm - -# Set up the main analysis algorithm sequence. -algSeq = AlgSequence( 'AnalysisSequence' ) - -# Skip events with no primary vertex: -algSeq += createAlgorithm( 'CP::VertexSelectionAlg', - 'PrimaryVertexSelectorAlg' ) -algSeq.PrimaryVertexSelectorAlg.VertexContainer = 'PrimaryVertices' -algSeq.PrimaryVertexSelectorAlg.MinVertices = 1 - -# Set up the systematics loader/handler algorithm: -algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) -algSeq.SysLoaderAlg.sigmaRecommended = 1 - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ - makePileupAnalysisSequence -pileupSequence = makePileupAnalysisSequence( dataType ) -pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) -algSeq += pileupSequence - -# Include, and then set up the electron analysis sequence: -from EgammaAnalysisAlgorithms.ElectronAnalysisSequence import \ - makeElectronAnalysisSequence -electronSequence = makeElectronAnalysisSequence( dataType, 'LooseLHElectron.GradientLoose', - recomputeLikelihood = True ) -electronSequence.configure( inputName = 'Electrons', - outputName = 'AnalysisElectrons_%SYS%' ) -algSeq += electronSequence - -# Include, and then set up the photon analysis sequence: -from EgammaAnalysisAlgorithms.PhotonAnalysisSequence import \ - makePhotonAnalysisSequence -photonSequence = makePhotonAnalysisSequence( dataType, 'Tight.FixedCutTight', recomputeIsEM = True ) -photonSequence.configure( inputName = 'Photons', - outputName = 'AnalysisPhotons_%SYS%' ) -algSeq += photonSequence - -# Include, and then set up the muon analysis algorithm sequence: -from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence -muonSequence = makeMuonAnalysisSequence( dataType, 'Tight.Iso' ) -muonSequence.configure( inputName = 'Muons', - outputName = 'AnalysisMuons_%SYS%' ) -algSeq += muonSequence - -# Include, and then set up the jet analysis algorithm sequence: -jetContainer = 'AntiKt4EMTopoJets' -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -jetSequence.configure( inputName = jetContainer, - outputName = 'AnalysisJets_%SYS%' ) -algSeq += jetSequence - -# Include, and then set up the tau analysis algorithm sequence: -from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence -tauSequence = makeTauAnalysisSequence( dataType, 'Tight' ) -tauSequence.configure( inputName = 'TauJets', - outputName = 'AnalysisTauJets_%SYS%' ) -algSeq += tauSequence - -# Include, and then set up the overlap analysis algorithm sequence: -from AsgAnalysisAlgorithms.OverlapAnalysisSequence import \ - makeOverlapAnalysisSequence -overlapSequence = makeOverlapAnalysisSequence( dataType ) -overlapSequence.configure( - inputName = { - 'electrons' : 'AnalysisElectrons_%SYS%', - 'photons' : 'AnalysisPhotons_%SYS%', - 'muons' : 'AnalysisMuons_%SYS%', - 'jets' : 'AnalysisJets_%SYS%', - 'taus' : 'AnalysisTauJets_%SYS%' }, - outputName = { - 'electrons' : 'AnalysisElectronsOR_%SYS%', - 'photons' : 'AnalysisPhotonsOR_%SYS%', - 'muons' : 'AnalysisMuonsOR_%SYS%', - 'jets' : 'AnalysisJetsOR_%SYS%', - 'taus' : 'AnalysisTauJetsOR_%SYS%' }, - affectingSystematics = { - 'electrons' : electronSequence.affectingSystematics(), - 'photons' : photonSequence.affectingSystematics(), - 'muons' : muonSequence.affectingSystematics(), - 'jets' : jetSequence.affectingSystematics(), - 'taus' : tauSequence.affectingSystematics() } ) -algSeq += overlapSequence - -# Set up an ntuple to check the job with: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'particles' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'particles' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', - 'AnalysisElectrons_%SYS%.eta -> el_%SYS%_eta', - 'AnalysisElectrons_%SYS%.phi -> el_%SYS%_phi', - 'AnalysisElectrons_%SYS%.pt -> el_%SYS%_pt', - 'AnalysisElectronsOR_%SYS%.eta -> el_OR_%SYS%_eta', - 'AnalysisElectronsOR_%SYS%.phi -> el_OR_%SYS%_phi', - 'AnalysisElectronsOR_%SYS%.pt -> el_OR_%SYS%_pt', - 'AnalysisPhotons_%SYS%.eta -> ph_%SYS%_eta', - 'AnalysisPhotons_%SYS%.phi -> ph_%SYS%_phi', - 'AnalysisPhotons_%SYS%.pt -> ph_%SYS%_pt', - 'AnalysisPhotonsOR_%SYS%.eta -> ph_OR_%SYS%_eta', - 'AnalysisPhotonsOR_%SYS%.phi -> ph_OR_%SYS%_phi', - 'AnalysisPhotonsOR_%SYS%.pt -> ph_OR_%SYS%_pt', - 'AnalysisMuons_%SYS%.eta -> mu_%SYS%_eta', - 'AnalysisMuons_%SYS%.phi -> mu_%SYS%_phi', - 'AnalysisMuons_%SYS%.pt -> mu_%SYS%_pt', - 'AnalysisMuonsOR_%SYS%.eta -> mu_OR_%SYS%_eta', - 'AnalysisMuonsOR_%SYS%.phi -> mu_OR_%SYS%_phi', - 'AnalysisMuonsOR_%SYS%.pt -> mu_OR_%SYS%_pt', - 'AnalysisJets_%SYS%.eta -> jet_%SYS%_eta', - 'AnalysisJets_%SYS%.phi -> jet_%SYS%_phi', - 'AnalysisJets_%SYS%.pt -> jet_%SYS%_pt', - 'AnalysisJetsOR_%SYS%.eta -> jet_OR_%SYS%_eta', - 'AnalysisJetsOR_%SYS%.phi -> jet_OR_%SYS%_phi', - 'AnalysisJetsOR_%SYS%.pt -> jet_OR_%SYS%_pt', - 'AnalysisTauJets_%SYS%.eta -> tau_%SYS%_eta', - 'AnalysisTauJets_%SYS%.phi -> tau_%SYS%_phi', - 'AnalysisTauJets_%SYS%.pt -> tau_%SYS%_pt', - 'AnalysisTauJetsOR_%SYS%.eta -> tau_OR_%SYS%_eta', - 'AnalysisTauJetsOR_%SYS%.phi -> tau_OR_%SYS%_phi', - 'AnalysisTauJetsOR_%SYS%.pt -> tau_OR_%SYS%_pt' ] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'particles' -algSeq += treeFiller - -# For debugging. -print( algSeq ) - -# Add all algorithms from the sequence to the job. -athAlgSeq += algSeq +from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeOverlapSequence +algSeq = makeOverlapSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc() diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..194c018f396c9ba062813750bf49c1c875102fe9 --- /dev/null +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisAlgorithmsTest.py @@ -0,0 +1,30 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# @author Nils Krumnack + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeSequence (dataType) : + + # config parameters + jetContainer = "AntiKt4EMTopoJets" + + algSeq = AlgSequence() + + # Set up the systematics loader/handler algorithm: + sysLoader = createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + sysLoader.sigmaRecommended = 1 + algSeq += sysLoader + + # Include, and then set up the jet analysis algorithm sequence: + from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence + jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) + from FTagAnalysisAlgorithms.FTagAnalysisSequence import makeFTagAnalysisSequence + makeFTagAnalysisSequence( jetSequence, dataType, jetContainer, noEfficiency = True ) + jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) + + # Add the sequence to the job: + algSeq += jetSequence + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_eljob.py index c2e9d96977c955f8ff4ef6c78895a3857f88a20b..b584d43df2ebcde4ca5e3fffcc075d27e5e3623e 100755 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_eljob.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -39,8 +39,6 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', "mc": 'ASG_TEST_FILE_MC', "afii": 'ASG_TEST_FILE_MC_AFII'} -jetContainer = "AntiKt4EMTopoJets" - if not dataType in ["data", "mc", "afii"] : raise ValueError ("invalid data type: " + dataType) @@ -59,22 +57,10 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Set up the systematics loader/handler algorithm: -from AnaAlgorithm.AnaAlgorithmConfig import AnaAlgorithmConfig -config = AnaAlgorithmConfig( 'CP::SysListLoaderAlg/SysLoaderAlg' ) -config.sigmaRecommended = 1 -job.algsAdd( config ) - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -from FTagAnalysisAlgorithms.FTagAnalysisSequence import makeFTagAnalysisSequence -makeFTagAnalysisSequence( jetSequence, dataType, jetContainer, noEfficiency = True ) -jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) -print( jetSequence ) # For debugging - -# Add all algorithms to the job: -for alg in jetSequence: +from FTagAnalysisAlgorithms.FTagAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging +for alg in algSeq: job.algsAdd( alg ) pass diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_jobOptions.py index 2640da0d5dc234b086182b75935362b47bf0b59d..5d497900c8336a5fa16ebb79ca37c091422fffc9 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/share/FTagAnalysisAlgorithmsTest_jobOptions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -10,7 +10,6 @@ dataType = "data" inputfile = {"data": 'ASG_TEST_FILE_DATA', "mc": 'ASG_TEST_FILE_MC', "afii": 'ASG_TEST_FILE_MC_AFII'} -jetContainer = "AntiKt4EMTopoJets" # Set up the reading of the input file: import AthenaRootComps.ReadAthenaxAODHybrid @@ -18,25 +17,9 @@ theApp.EvtMax = 500 testFile = os.getenv ( inputfile[dataType] ) svcMgr.EventSelector.InputCollections = [testFile] -# Access the main algorithm sequence of the job: -from AthenaCommon.AlgSequence import AlgSequence -algSeq = AlgSequence() - -# Set up the systematics loader/handler algorithm: -sysLoader = CfgMgr.CP__SysListLoaderAlg( 'SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -algSeq += sysLoader - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -from FTagAnalysisAlgorithms.FTagAnalysisSequence import makeFTagAnalysisSequence -makeFTagAnalysisSequence( jetSequence, dataType, jetContainer, noEfficiency = True ) -jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) -print( jetSequence ) # For debugging - -# Add the sequence to the job: -algSeq += jetSequence +from FTagAnalysisAlgorithms.FTagAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc() diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..5951ef18a65095bfe7213ad964e544bff653656c --- /dev/null +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/python/JetAnalysisAlgorithmsTest.py @@ -0,0 +1,71 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# @author Nils Krumnack + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeSequence (dataType) : + + # config + jetContainer = "AntiKt4EMTopoJets" + + algSeq = AlgSequence() + + # Set up the systematics loader/handler algorithm: + sysLoader = createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + sysLoader.sigmaRecommended = 1 + algSeq += sysLoader + + # Include, and then set up the pileup analysis sequence: + from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ + makePileupAnalysisSequence + pileupSequence = makePileupAnalysisSequence( dataType ) + pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) + print( pileupSequence ) # For debugging + + # Include, and then set up the jet analysis algorithm sequence: + from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence + jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) + jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJetsBase' ) + print( jetSequence ) # For debugging + + # Include, and then set up the jet analysis algorithm sequence: + from JetAnalysisAlgorithms.JetJvtAnalysisSequence import makeJetJvtAnalysisSequence + jvtSequence = makeJetJvtAnalysisSequence( dataType, jetContainer ) + jvtSequence.configure( inputName = { 'eventInfo' : 'EventInfo_%SYS%', + 'jets' : 'AnalysisJetsBase_%SYS%' }, + outputName = { 'jets' : 'AnalysisJets_%SYS%' }, + affectingSystematics = { 'jets' : jetSequence.affectingSystematics() } ) + print( jvtSequence ) # For debugging + + # Add the sequences to the job: + algSeq += pileupSequence + algSeq += jetSequence + algSeq += jvtSequence + + # Set up an ntuple to check the job with: + treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) + treeMaker.TreeName = 'jets' + algSeq += treeMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) + ntupleMaker.TreeName = 'jets' + ntupleMaker.Branches = [ + 'EventInfo.runNumber -> runNumber', + 'EventInfo.eventNumber -> eventNumber', + 'AnalysisJets_%SYS%.pt -> jet_%SYS%_pt', + ] + if dataType != 'data': + ntupleMaker.Branches += [ + # 'EventInfo.jvt_effSF_%SYS% -> jvtSF_%SYS%', + # 'EventInfo.fjvt_effSF_%SYS% -> fjvtSF_%SYS%', + 'AnalysisJets_%SYS%.jvt_effSF_NOSYS -> jet_%SYS%_jvtEfficiency', + 'AnalysisJets_%SYS%.fjvt_effSF_NOSYS -> jet_%SYS%_fjvtEfficiency', + ] + ntupleMaker.systematicsRegex = '(^$)|(^JET_.*)' + algSeq += ntupleMaker + treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) + treeFiller.TreeName = 'jets' + algSeq += treeFiller + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_eljob.py index 07b432b352cef792fb6bd68a6c0266ce2aa89650..44a51e538611e108e1b4b2db94f5be928f75d586 100755 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_eljob.py @@ -59,72 +59,13 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Set up the systematics loader/handler algorithm: -from AnaAlgorithm.AnaAlgorithmConfig import AnaAlgorithmConfig -config = AnaAlgorithmConfig( 'CP::SysListLoaderAlg/SysLoaderAlg' ) -config.sigmaRecommended = 1 -job.algsAdd( config ) - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ - makePileupAnalysisSequence -pileupSequence = makePileupAnalysisSequence( dataType ) -pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) -print( pileupSequence ) # For debugging - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJetsBase' ) -print( jetSequence ) # For debugging - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetJvtAnalysisSequence import makeJetJvtAnalysisSequence -jvtSequence = makeJetJvtAnalysisSequence( dataType, jetContainer ) -jvtSequence.configure( inputName = { 'eventInfo' : 'EventInfo_%SYS%', - 'jets' : 'AnalysisJetsBase_%SYS%' }, - outputName = { 'jets' : 'AnalysisJets_%SYS%' }, - affectingSystematics = { 'jets' : jetSequence.affectingSystematics() } ) -print( jvtSequence ) # For debugging - -# Add all algorithms to the job: -for alg in pileupSequence: +from JetAnalysisAlgorithms.JetAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging +for alg in algSeq: job.algsAdd( alg ) pass -for alg in jetSequence: - job.algsAdd( alg ) - pass - -for alg in jvtSequence: - job.algsAdd( alg ) - pass - -# Set up an ntuple to check the job with: -from AnaAlgorithm.DualUseConfig import createAlgorithm -treeMaker = AnaAlgorithmConfig( 'CP::TreeMakerAlg/TreeMaker' ) -treeMaker.TreeName = 'jets' -job.algsAdd( treeMaker ) -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'jets' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', - 'AnalysisJets_%SYS%.pt -> jet_%SYS%_pt', -] -if dataType != 'data': - ntupleMaker.Branches += [ - # 'EventInfo.jvt_effSF_%SYS% -> jvtSF_%SYS%', - # 'EventInfo.fjvt_effSF_%SYS% -> fjvtSF_%SYS%', - 'AnalysisJets_%SYS%.jvt_effSF_NOSYS -> jet_%SYS%_jvtEfficiency', - 'AnalysisJets_%SYS%.fjvt_effSF_NOSYS -> jet_%SYS%_fjvtEfficiency', - ] -ntupleMaker.systematicsRegex = '(^$)|(^JET_.*)' -job.algsAdd( ntupleMaker ) -treeFiller = AnaAlgorithmConfig( 'CP::TreeFillerAlg/TreeFiller' ) -treeFiller.TreeName = 'jets' -job.algsAdd( treeFiller ) - # Set up an output file for the job: job.outputAdd( ROOT.EL.OutputStream( 'ANALYSIS' ) ) diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_jobOptions.py index e4e0c297b4b867dfeea832c82eae5118a4535f3f..6a73a2851f977957cb266ae6a7e7567a8f49ba03 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/share/JetAnalysisAlgorithmsTest_jobOptions.py @@ -10,7 +10,6 @@ dataType = "mc" inputfile = {"data": 'ASG_TEST_FILE_DATA', "mc": 'ASG_TEST_FILE_MC', "afii": 'ASG_TEST_FILE_MC_AFII'} -jetContainer = "AntiKt4EMTopoJets" # Set up the reading of the input file: import AthenaRootComps.ReadAthenaxAODHybrid @@ -18,66 +17,9 @@ theApp.EvtMax = 500 testFile = os.getenv ( inputfile[dataType] ) svcMgr.EventSelector.InputCollections = [testFile] -# Access the main algorithm sequence of the job: -from AthenaCommon.AlgSequence import AlgSequence -algSeq = AlgSequence() - -# Set up the systematics loader/handler algorithm: -sysLoader = CfgMgr.CP__SysListLoaderAlg( 'SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -algSeq += sysLoader - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ - makePileupAnalysisSequence -pileupSequence = makePileupAnalysisSequence( dataType ) -pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) -print( pileupSequence ) # For debugging - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJetsBase' ) -print( jetSequence ) # For debugging - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetJvtAnalysisSequence import makeJetJvtAnalysisSequence -jvtSequence = makeJetJvtAnalysisSequence( dataType, jetContainer ) -jvtSequence.configure( inputName = { 'eventInfo' : 'EventInfo_%SYS%', - 'jets' : 'AnalysisJetsBase_%SYS%' }, - outputName = { 'jets' : 'AnalysisJets_%SYS%' }, - affectingSystematics = { 'jets' : jetSequence.affectingSystematics() } ) -print( jvtSequence ) # For debugging - -# Add the sequences to the job: -algSeq += pileupSequence -algSeq += jetSequence -algSeq += jvtSequence - -# Set up an ntuple to check the job with: -from AnaAlgorithm.DualUseConfig import createAlgorithm -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'jets' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'jets' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', - 'AnalysisJets_%SYS%.pt -> jet_%SYS%_pt', -] -if dataType != 'data': - ntupleMaker.Branches += [ - # 'EventInfo.jvt_effSF_%SYS% -> jvtSF_%SYS%', - # 'EventInfo.fjvt_effSF_%SYS% -> fjvtSF_%SYS%', - 'AnalysisJets_%SYS%.jvt_effSF_NOSYS -> jet_%SYS%_jvtEfficiency', - 'AnalysisJets_%SYS%.fjvt_effSF_NOSYS -> jet_%SYS%_fjvtEfficiency', - ] -ntupleMaker.systematicsRegex = '(^$)|(^JET_.*)' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'jets' -algSeq += treeFiller +from JetAnalysisAlgorithms.JetAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc() diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..a8d263ca2919a4c6d73af47c37473bf76ee319f4 --- /dev/null +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisAlgorithmsTest.py @@ -0,0 +1,78 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeSequence (dataType) : + algSeq = AlgSequence() + + from AnaAlgorithm.DualUseConfig import createAlgorithm + + # Set up the systematics loader/handler algorithm: + sysLoader = createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + sysLoader.sigmaRecommended = 1 + algSeq += sysLoader + + # Include, and then set up the jet analysis algorithm sequence: + from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence + jetContainer = 'AntiKt4EMTopoJets' + jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) + jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) + + # Add all algorithms to the job: + algSeq += jetSequence + + # Set up a selection alg for demonstration purposes + # Also to avoid warnings from building MET with very soft electrons + from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool + selalg = createAlgorithm( 'CP::AsgSelectionAlg', 'METEleSelAlg' ) + addPrivateTool( selalg, 'selectionTool', 'CP::AsgPtEtaSelectionTool' ) + selalg.selectionTool.minPt = 10e3 + selalg.selectionTool.maxEta = 2.47 + selalg.selectionDecoration = 'selectPtEta' + selalg.particles = 'Electrons' + # We need to copy here, because w/o an output container, it's assumed + # that the input container is non-const + selalg.particlesOut = 'DecorElectrons_%SYS%' + algSeq += selalg + + # Now make a view container holding only the electrons for the MET calculation + viewalg = createAlgorithm( 'CP::AsgViewFromSelectionAlg','METEleViewAlg' ) + viewalg.selection = [ 'selectPtEta' ] + viewalg.input = 'DecorElectrons_%SYS%' + viewalg.output = 'METElectrons_%SYS%' + algSeq += viewalg + + # Include, and then set up the met analysis algorithm sequence: + from MetAnalysisAlgorithms.MetAnalysisSequence import makeMetAnalysisSequence + metSequence = makeMetAnalysisSequence( dataType, metSuffix = jetContainer[:-4] ) + metSequence.configure( inputName = { 'jets' : 'AnalysisJets_%SYS%', + 'muons' : 'Muons', + 'electrons' : 'METElectrons_%SYS%' }, + outputName = 'AnalysisMET_%SYS%', + affectingSystematics = { 'jets' : jetSequence.affectingSystematics(), + 'muons' : '(^$)', + 'electrons' : '(^$)' } ) + + # Add the sequence to the job: + algSeq += metSequence + + # Write the freshly produced MET object(s) to an output file: + treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) + treeMaker.TreeName = 'met' + algSeq += treeMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) + ntupleMaker.TreeName = 'met' + ntupleMaker.Branches = [ 'EventInfo.runNumber -> runNumber', + 'EventInfo.eventNumber -> eventNumber', + 'AnalysisMET_%SYS%.mpx -> met_%SYS%_mpx', + 'AnalysisMET_%SYS%.mpy -> met_%SYS%_mpy', + 'AnalysisMET_%SYS%.sumet -> met_%SYS%_sumet', + 'AnalysisMET_%SYS%.name -> met_%SYS%_name', ] + ntupleMaker.systematicsRegex = '.*' + algSeq += ntupleMaker + treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) + treeFiller.TreeName = 'met' + algSeq += treeFiller + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_eljob.py index 513fc3a09ed0ca1680e3b564e02236002e3e838d..8599ff5aa033b18a27713983301bf93517f9bc5b 100755 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_eljob.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -59,82 +59,15 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Set up the systematics loader/handler algorithm: -sysLoader = AnaAlgorithmConfig( 'CP::SysListLoaderAlg/SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -job.algsAdd( sysLoader ) - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetContainer = 'AntiKt4EMTopoJets' -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) -print( jetSequence ) # For debugging - -# Add all algorithms to the job: -for alg in jetSequence: - job.algsAdd( alg ) - pass - -# Set up a selection alg for demonstration purposes -# Also to avoid warnings from building MET with very soft electrons -from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool -selalg = createAlgorithm( 'CP::AsgSelectionAlg', 'METEleSelAlg' ) -addPrivateTool( selalg, 'selectionTool', 'CP::AsgPtEtaSelectionTool' ) -selalg.selectionTool.minPt = 10e3 -selalg.selectionTool.maxEta = 2.47 -selalg.selectionDecoration = 'selectPtEta' -selalg.particles = 'Electrons' -# We need to copy here, because w/o an output container, it's assumed -# that the input container is non-const -selalg.particlesOut = 'DecorElectrons_%SYS%' -job.algsAdd( selalg ) -print( selalg ) # For debugging - -# Now make a view container holding only the electrons for the MET calculation -viewalg = createAlgorithm( 'CP::AsgViewFromSelectionAlg','METEleViewAlg' ) -viewalg.selection = [ 'selectPtEta' ] -viewalg.input = 'DecorElectrons_%SYS%' -viewalg.output = 'METElectrons_%SYS%' -job.algsAdd( viewalg ) -print( viewalg ) # For debugging - -# Include, and then set up the met analysis algorithm sequence: -from MetAnalysisAlgorithms.MetAnalysisSequence import makeMetAnalysisSequence -metSequence = makeMetAnalysisSequence( dataType, metSuffix = jetContainer[:-4] ) -metSequence.configure( inputName = { 'jets' : 'AnalysisJets_%SYS%', - 'muons' : 'Muons', - 'electrons' : 'METElectrons_%SYS%' }, - outputName = 'AnalysisMET_%SYS%', - affectingSystematics = { 'jets' : jetSequence.affectingSystematics(), - 'muons' : '(^$)', - 'electrons' : '(^$)' } ) -print( metSequence ) # For debugging +job.outputAdd( ROOT.EL.OutputStream( 'ANALYSIS' ) ) -# Add all algorithms to the job: -for alg in metSequence: +from MetAnalysisAlgorithms.MetAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging +for alg in algSeq: job.algsAdd( alg ) pass -# Write the freshly produced MET object(s) to an output file: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'met' -job.algsAdd( treeMaker ) -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'met' -ntupleMaker.Branches = [ 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', - 'AnalysisMET_%SYS%.mpx -> met_%SYS%_mpx', - 'AnalysisMET_%SYS%.mpy -> met_%SYS%_mpy', - 'AnalysisMET_%SYS%.sumet -> met_%SYS%_sumet', - 'AnalysisMET_%SYS%.name -> met_%SYS%_name', ] -ntupleMaker.systematicsRegex = '.*' -job.algsAdd( ntupleMaker ) -job.outputAdd( ROOT.EL.OutputStream( 'ANALYSIS' ) ) -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'met' -job.algsAdd( treeFiller ) - # Find the right output directory: submitDir = options.submission_dir if options.unit_test: diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_jobOptions.py index e9b9a9a2447ff1c88857089963003d89e9469072..5c52cbae376b65d05b515d1a7c3178aacf97d6ed 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/share/MetAnalysisAlgorithmsTest_jobOptions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -18,76 +18,9 @@ dataType = "data" #dataType = "mc" #dataType = "afii" -# Set up the systematics loader/handler algorithm: -sysLoader = CfgMgr.CP__SysListLoaderAlg( 'SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -algSeq += sysLoader - -# Include, and then set up the jet analysis algorithm sequence: -from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence -jetContainer = 'AntiKt4EMTopoJets' -jetSequence = makeJetAnalysisSequence( dataType, jetContainer ) -jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) -print( jetSequence ) # For debugging - -# Add all algorithms to the job: -algSeq += jetSequence - -# Set up a selection alg for demonstration purposes -# Also to avoid warnings from building MET with very soft electrons -from AnaAlgorithm.DualUseConfig import createAlgorithm, addPrivateTool -selalg = createAlgorithm( 'CP::AsgSelectionAlg', 'METEleSelAlg' ) -addPrivateTool( selalg, 'selectionTool', 'CP::AsgPtEtaSelectionTool' ) -selalg.selectionTool.minPt = 10e3 -selalg.selectionTool.maxEta = 2.47 -selalg.selectionDecoration = 'selectPtEta' -selalg.particles = 'Electrons' -# We need to copy here, because w/o an output container, it's assumed -# that the input container is non-const -selalg.particlesOut = 'DecorElectrons_%SYS%' -algSeq += selalg -print( selalg ) # For debugging - -# Now make a view container holding only the electrons for the MET calculation -viewalg = createAlgorithm( 'CP::AsgViewFromSelectionAlg','METEleViewAlg' ) -viewalg.selection = [ 'selectPtEta' ] -viewalg.input = 'DecorElectrons_%SYS%' -viewalg.output = 'METElectrons_%SYS%' -algSeq += viewalg -print( viewalg ) # For debugging - -# Include, and then set up the met analysis algorithm sequence: -from MetAnalysisAlgorithms.MetAnalysisSequence import makeMetAnalysisSequence -metSequence = makeMetAnalysisSequence( dataType, metSuffix = jetContainer[:-4] ) -metSequence.configure( inputName = { 'jets' : 'AnalysisJets_%SYS%', - 'muons' : 'Muons', - 'electrons' : 'METElectrons_%SYS%' }, - outputName = 'AnalysisMET_%SYS%', - affectingSystematics = { 'jets' : jetSequence.affectingSystematics(), - 'muons' : '(^$)', - 'electrons' : '(^$)' } ) -print( metSequence ) # For debugging - -# Add the sequence to the job: -algSeq += metSequence - -# Write the freshly produced MET object(s) to an output file: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'met' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'met' -ntupleMaker.Branches = [ 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', - 'AnalysisMET_%SYS%.mpx -> met_%SYS%_mpx', - 'AnalysisMET_%SYS%.mpy -> met_%SYS%_mpy', - 'AnalysisMET_%SYS%.sumet -> met_%SYS%_sumet', - 'AnalysisMET_%SYS%.name -> met_%SYS%_name', ] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'met' -algSeq += treeFiller +from MetAnalysisAlgorithms.MetAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc() diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..c5608c84c481fba565167577b572c1519552de8b --- /dev/null +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisAlgorithmsTest.py @@ -0,0 +1,68 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# @author Nils Krumnack + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeSequence (dataType) : + + algSeq = AlgSequence() + + # Set up the systematics loader/handler algorithm: + sysLoader = createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + sysLoader.sigmaRecommended = 1 + algSeq += sysLoader + + + # Include, and then set up the pileup analysis sequence: + from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ + makePileupAnalysisSequence + pileupSequence = makePileupAnalysisSequence( dataType ) + pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) + + # Add the pileup sequence to the job: + algSeq += pileupSequence + + # Include, and then set up the muon analysis algorithm sequence: + from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence + muonSequenceMedium = makeMuonAnalysisSequence( dataType, deepCopyOutput = True, shallowViewOutput = False, + workingPoint = 'Medium.Iso', postfix = 'medium' ) + muonSequenceMedium.configure( inputName = 'Muons', + outputName = 'AnalysisMuonsMedium_%SYS%' ) + + # Add the sequence to the job: + algSeq += muonSequenceMedium + + muonSequenceTight = makeMuonAnalysisSequence( dataType, deepCopyOutput = True, shallowViewOutput = False, + workingPoint = 'Tight.Iso', postfix = 'tight' ) + muonSequenceTight.removeStage ("calibration") + muonSequenceTight.configure( inputName = 'AnalysisMuonsMedium_%SYS%', + outputName = 'AnalysisMuons_%SYS%', + affectingSystematics = muonSequenceMedium.affectingSystematics()) + + # Add the sequence to the job: + algSeq += muonSequenceTight + + # Add an ntuple dumper algorithm: + treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) + treeMaker.TreeName = 'muons' + algSeq += treeMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMakerEventInfo' ) + ntupleMaker.TreeName = 'muons' + ntupleMaker.Branches = [ 'EventInfo.runNumber -> runNumber', + 'EventInfo.eventNumber -> eventNumber', ] + ntupleMaker.systematicsRegex = '(^$)' + algSeq += ntupleMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMakerMuons' ) + ntupleMaker.TreeName = 'muons' + ntupleMaker.Branches = [ 'AnalysisMuons_NOSYS.eta -> mu_eta', + 'AnalysisMuons_NOSYS.phi -> mu_phi', + 'AnalysisMuons_%SYS%.pt -> mu_%SYS%_pt', ] + ntupleMaker.systematicsRegex = '(^MUON_.*)' + algSeq += ntupleMaker + treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) + treeFiller.TreeName = 'muons' + algSeq += treeFiller + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py index 05416046d0c799bdd02d884c4f510161ee523a43..76cbf2f37a5f3a6499b6d9f95e803dfb0f940e48 100755 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_eljob.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -56,82 +56,14 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Set up the systematics loader/handler algorithm: -from AnaAlgorithm.AnaAlgorithmConfig import AnaAlgorithmConfig -sysLoader = AnaAlgorithmConfig( 'CP::SysListLoaderAlg/SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -job.algsAdd( sysLoader ) -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ - makePileupAnalysisSequence -pileupSequence = makePileupAnalysisSequence( dataType ) -pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) -print( pileupSequence ) # For debugging - -# Add the pileup algorithm(s) to the job: -for alg in pileupSequence: - job.algsAdd( alg ) - pass - -# Include, and then set up the muon analysis algorithm sequence: -from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence -muonSequenceMedium = makeMuonAnalysisSequence( dataType, deepCopyOutput = True, shallowViewOutput = False, - workingPoint = 'Medium.Iso', postfix = 'medium' ) -muonSequenceMedium.configure( inputName = 'Muons', - outputName = 'AnalysisMuonsMedium_%SYS%' ) -print( muonSequenceMedium ) # For debugging - -# Add all algorithms to the job: -for alg in muonSequenceMedium: +from MuonAnalysisAlgorithms.MuonAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging +for alg in algSeq: job.algsAdd( alg ) pass -muonSequenceTight = makeMuonAnalysisSequence( dataType, deepCopyOutput = True, shallowViewOutput = False, - workingPoint = 'Tight.Iso', postfix = 'tight' ) -muonSequenceTight.removeStage ("calibration") -muonSequenceTight.configure( inputName = 'AnalysisMuonsMedium_%SYS%', - outputName = 'AnalysisMuons_%SYS%', - affectingSystematics = muonSequenceMedium.affectingSystematics()) -print( muonSequenceTight ) # For debugging - -# Add all algorithms to the job: -for alg in muonSequenceTight: - job.algsAdd( alg ) - pass - -# Add ntuple dumper algorithms: -from AnaAlgorithm.DualUseConfig import createAlgorithm -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'muons' -job.algsAdd( treeMaker ) -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMakerEventInfo' ) -ntupleMaker.TreeName = 'muons' -ntupleMaker.Branches = [ 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', ] -ntupleMaker.systematicsRegex = '(^$)' -job.algsAdd( ntupleMaker ) -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMakerMuons' ) -ntupleMaker.TreeName = 'muons' -ntupleMaker.Branches = [ 'AnalysisMuons_NOSYS.eta -> mu_eta', - 'AnalysisMuons_NOSYS.phi -> mu_phi', - 'AnalysisMuons_%SYS%.pt -> mu_%SYS%_pt', ] -ntupleMaker.systematicsRegex = '(^MUON_.*)' -job.algsAdd( ntupleMaker ) -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'muons' -job.algsAdd( treeFiller ) - -# Set up a mini-xAOD writer algorithm: -xaodWriter = AnaAlgorithmConfig( 'CP::xAODWriterAlg/xAODWriter' ) -xaodWriter.ItemList = \ - [ 'xAOD::EventInfo#EventInfo', - 'xAOD::EventAuxInfo#EventInfoAux.-', - 'xAOD::MuonContainer#AnalysisMuons_NOSYS', - 'xAOD::AuxContainerBase#AnalysisMuons_NOSYSAux.eta.phi.pt' ] -xaodWriter.systematicsRegex = '.*' -job.algsAdd( xaodWriter ) - # Make sure that both the ntuple and the xAOD dumper have a stream to write to. job.outputAdd( ROOT.EL.OutputStream( 'ANALYSIS' ) ) diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_jobOptions.py index 695adade27092b0a63d4f957b09b321a34dea913..b985c22d01c04bd4e08e790a80de0d6e7c6dca95 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/share/MuonAnalysisAlgorithmsTest_jobOptions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack, Will Buttinger @@ -42,66 +42,10 @@ elif dataType=="afii": jps.AthenaCommonFlags.FilesInput = [testFile] -# Set up the systematics loader/handler algorithm: -sysLoader = CfgMgr.CP__SysListLoaderAlg( 'SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -athAlgSeq += sysLoader - -# Include, and then set up the pileup analysis sequence: -from AsgAnalysisAlgorithms.PileupAnalysisSequence import \ - makePileupAnalysisSequence -pileupSequence = makePileupAnalysisSequence( dataType ) -pileupSequence.configure( inputName = 'EventInfo', outputName = 'EventInfo' ) -print( pileupSequence ) # For debugging - -# Add the pileup sequence to the job: -athAlgSeq += pileupSequence - -# Include, and then set up the muon analysis algorithm sequence: -from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence -muonSequenceMedium = makeMuonAnalysisSequence( dataType, deepCopyOutput = True, shallowViewOutput = False, - workingPoint = 'Medium.Iso', postfix = 'medium' ) -muonSequenceMedium.configure( inputName = 'Muons', - outputName = 'AnalysisMuonsMedium_%SYS%' ) -print( muonSequenceMedium ) # For debugging - -# Add the sequence to the job: -athAlgSeq += muonSequenceMedium - -muonSequenceTight = makeMuonAnalysisSequence( dataType, deepCopyOutput = True, shallowViewOutput = False, - workingPoint = 'Tight.Iso', postfix = 'tight' ) -muonSequenceTight.removeStage ("calibration") -muonSequenceTight.configure( inputName = 'AnalysisMuonsMedium_%SYS%', - outputName = 'AnalysisMuons_%SYS%', - affectingSystematics = muonSequenceMedium.affectingSystematics()) -print( muonSequenceTight ) # For debugging - -# Add the sequence to the job: -athAlgSeq += muonSequenceTight - -# Add an ntuple dumper algorithm: -from AnaAlgorithm.DualUseConfig import createAlgorithm -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'muons' -athAlgSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMakerEventInfo' ) -ntupleMaker.TreeName = 'muons' -ntupleMaker.Branches = [ 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', ] -ntupleMaker.systematicsRegex = '(^$)' -athAlgSeq += ntupleMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMakerMuons' ) -ntupleMaker.TreeName = 'muons' -ntupleMaker.Branches = [ 'AnalysisMuons_NOSYS.eta -> mu_eta', - 'AnalysisMuons_NOSYS.phi -> mu_phi', - 'AnalysisMuons_%SYS%.pt -> mu_%SYS%_pt', ] -ntupleMaker.systematicsRegex = '(^MUON_.*)' -athAlgSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'muons' -athAlgSeq += treeFiller - +from MuonAnalysisAlgorithms.MuonAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging # Write a mini-xAOD if requested: if athArgs.write_xaod: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..58ff38f974291db7f55613a9d3c62737560aa921 --- /dev/null +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisAlgorithmsTest.py @@ -0,0 +1,34 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# @author Nils Krumnack + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeSequence (dataType) : + + algSeq = AlgSequence() + + # Set up the systematics loader/handler algorithm: + sysLoader = createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + sysLoader.sigmaRecommended = 1 + algSeq += sysLoader + + # Include, and then set up the tau analysis algorithm sequence: + from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence + tauSequence = makeTauAnalysisSequence( dataType, 'Tight', postfix = 'tight' ) + tauSequence.configure( inputName = 'TauJets', outputName = 'AnalysisTauJets' ) + + # Add the sequence to the job: + algSeq += tauSequence + + # Include, and then set up the tau analysis algorithm sequence: + from TauAnalysisAlgorithms.DiTauAnalysisSequence import makeDiTauAnalysisSequence + diTauSequence = makeDiTauAnalysisSequence( dataType, 'Tight', postfix = 'tight' ) + diTauSequence.configure( inputName = 'DiTauJets', outputName = 'AnalysisDiTauJets' ) + + # Add the sequence to the job: + # disabling this, the standard test files don't have DiTauJets + # algSeq += diTauSequence + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py index 80139ad8b6aca941b9896789ea4eb9efe993e2d0..2abbf38e0291316dddcf37029603741a2d37efa3 100755 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_eljob.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -61,35 +61,13 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Set up the systematics loader/handler algorithm: -from AnaAlgorithm.AnaAlgorithmConfig import AnaAlgorithmConfig -config = AnaAlgorithmConfig( 'CP::SysListLoaderAlg/SysLoaderAlg' ) -config.sigmaRecommended = 1 -job.algsAdd( config ) - -# Include, and then set up the tau analysis algorithm sequence: -from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence -tauSequence = makeTauAnalysisSequence( dataType, 'Tight', postfix = 'tight', deepCopyOutput = True ) -tauSequence.configure( inputName = 'TauJets', outputName = 'AnalysisTauJets' ) -print( tauSequence ) # For debugging - -# Add all algorithms to the job: -for alg in tauSequence: +from TauAnalysisAlgorithms.TauAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging +for alg in algSeq: job.algsAdd( alg ) pass -# Include, and then set up the di-tau analysis algorithm sequence: -from TauAnalysisAlgorithms.DiTauAnalysisSequence import makeDiTauAnalysisSequence -diTauSequence = makeDiTauAnalysisSequence( dataType, 'Tight', postfix = 'tight', deepCopyOutput = True ) -diTauSequence.configure( inputName = 'DiTauJets', outputName = 'AnalysisDiTauJets' ) -print( diTauSequence ) # For debugging - -# Add all algorithms to the job: -for alg in diTauSequence: - # disabling this, the standard test files don't have DiTauJets - # job.algsAdd( alg ) - pass - # Find the right output directory: submitDir = options.submission_dir if options.unit_test: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_jobOptions.py index fe2b4b2e1444ea23a83fbadb099022a67eb93ef9..90d55476bd9c0ef9a385744c5ddf57012312dbcf 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/share/TauAnalysisAlgorithmsTest_jobOptions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # # @author Nils Krumnack @@ -18,29 +18,10 @@ dataType = "data" #dataType = "mc" #dataType = "afii" -# Set up the systematics loader/handler algorithm: -sysLoader = CfgMgr.CP__SysListLoaderAlg( 'SysLoaderAlg' ) -sysLoader.sigmaRecommended = 1 -algSeq += sysLoader -# Include, and then set up the tau analysis algorithm sequence: -from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence -tauSequence = makeTauAnalysisSequence( dataType, 'Tight', postfix = 'tight' ) -tauSequence.configure( inputName = 'TauJets', outputName = 'AnalysisTauJets' ) -print( tauSequence ) # For debugging - -# Add the sequence to the job: -algSeq += tauSequence - -# Include, and then set up the tau analysis algorithm sequence: -from TauAnalysisAlgorithms.DiTauAnalysisSequence import makeDiTauAnalysisSequence -diTauSequence = makeDiTauAnalysisSequence( dataType, 'Tight', postfix = 'tight' ) -diTauSequence.configure( inputName = 'DiTauJets', outputName = 'AnalysisDiTauJets' ) -print( diTauSequence ) # For debugging - -# Add the sequence to the job: -# disabling this, the standard test files don't have DiTauJets -# algSeq += diTauSequence +from TauAnalysisAlgorithms.TauAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc() diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisAlgorithmsTest.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisAlgorithmsTest.py new file mode 100644 index 0000000000000000000000000000000000000000..c0d82335ddd0c6c11bafdfa3e860b04a253974fb --- /dev/null +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisAlgorithmsTest.py @@ -0,0 +1,49 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# @author Tadej Novak +# @author Nils Krumnack + +from AnaAlgorithm.AlgSequence import AlgSequence +from AnaAlgorithm.DualUseConfig import createAlgorithm + +def makeSequence (dataType) : + + # Config: + triggerChains = [ + 'HLT_2mu14', + 'HLT_mu20_mu8noL1', + 'HLT_2e17_lhvloose_nod0' + ] + + + algSeq = AlgSequence() + + # Set up the systematics loader/handler algorithm: + alg = createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) + alg.sigmaRecommended = 1 + algSeq += alg + + # Include, and then set up the pileup analysis sequence: + from TriggerAnalysisAlgorithms.TriggerAnalysisSequence import \ + makeTriggerAnalysisSequence + triggerSequence = makeTriggerAnalysisSequence( dataType, triggerChains=triggerChains ) + algSeq += triggerSequence + + # Set up an ntuple to check the job with: + treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) + treeMaker.TreeName = 'events' + algSeq += treeMaker + ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) + ntupleMaker.TreeName = 'events' + ntupleMaker.Branches = [ + 'EventInfo.runNumber -> runNumber', + 'EventInfo.eventNumber -> eventNumber', + ] + ntupleMaker.Branches += ['EventInfo.trigPassed_' + t + ' -> trigPassed_' + t for t in triggerChains] + ntupleMaker.systematicsRegex = '.*' + algSeq += ntupleMaker + treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) + treeFiller.TreeName = 'events' + algSeq += treeFiller + + return algSeq diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py index 60373bbff543c1f21a410fe6690732116a25e2c1..dc2771ea81daaab6665dc8f7adcd2b52b7afdec3 100755 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_eljob.py @@ -52,51 +52,9 @@ job = ROOT.EL.Job() job.sampleHandler( sh ) job.options().setDouble( ROOT.EL.Job.optMaxEvents, 500 ) -# Config: -triggerChains = [ - 'HLT_2mu14', - 'HLT_mu20_mu8noL1', - 'HLT_2e17_lhvloose_nod0' -] - -# Import(s) needed for the job configuration. -from AnaAlgorithm.AlgSequence import AlgSequence -from AnaAlgorithm.DualUseConfig import createAlgorithm - -# Set up the main analysis algorithm sequence. -algSeq = AlgSequence( 'AnalysisSequence' ) - -# Set up the systematics loader/handler algorithm: -algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) -algSeq.SysLoaderAlg.sigmaRecommended = 1 - -# Include, and then set up the pileup analysis sequence: -from TriggerAnalysisAlgorithms.TriggerAnalysisSequence import \ - makeTriggerAnalysisSequence -triggerSequence = makeTriggerAnalysisSequence( dataType, triggerChains=triggerChains ) -algSeq += triggerSequence - -# Set up an ntuple to check the job with: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'events' -algSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'events' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', -] -ntupleMaker.Branches += ['EventInfo.trigPassed_' + t + ' -> trigPassed_' + t for t in triggerChains] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'events' -algSeq += treeFiller - -# For debugging. -print( algSeq ) - -# Add all algorithms from the sequence to the job. +from TriggerAnalysisAlgorithms.TriggerAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging for alg in algSeq: job.algsAdd( alg ) pass diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_jobOptions.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_jobOptions.py index 19eba0065dad5ced22a69a2755349a0e91766dc9..b36f226e62626eb5813d8eb9cf8d899dc33f475b 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_jobOptions.py +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/share/TriggerAlgorithmsTest_jobOptions.py @@ -17,52 +17,9 @@ theApp.EvtMax = 500 testFile = os.getenv ( inputfile[dataType] ) svcMgr.EventSelector.InputCollections = [testFile] -# Config: -triggerChains = [ - 'HLT_2mu14', - 'HLT_mu20_mu8noL1', - 'HLT_2e17_lhvloose_nod0' -] - -# Import(s) needed for the job configuration. -from AnaAlgorithm.AlgSequence import AlgSequence -from AnaAlgorithm.DualUseConfig import createAlgorithm - -# Set up the main analysis algorithm sequence. -algSeq = AlgSequence( 'AnalysisSequence' ) - -# Set up the systematics loader/handler algorithm: -algSeq += createAlgorithm( 'CP::SysListLoaderAlg', 'SysLoaderAlg' ) -algSeq.SysLoaderAlg.sigmaRecommended = 1 - -# Include, and then set up the pileup analysis sequence: -from TriggerAnalysisAlgorithms.TriggerAnalysisSequence import \ - makeTriggerAnalysisSequence -triggerSequence = makeTriggerAnalysisSequence( dataType, triggerChains=triggerChains ) -algSeq += triggerSequence - -# Set up an ntuple to check the job with: -treeMaker = createAlgorithm( 'CP::TreeMakerAlg', 'TreeMaker' ) -treeMaker.TreeName = 'events' -athAlgSeq += treeMaker -ntupleMaker = createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' ) -ntupleMaker.TreeName = 'events' -ntupleMaker.Branches = [ - 'EventInfo.runNumber -> runNumber', - 'EventInfo.eventNumber -> eventNumber', -] -ntupleMaker.Branches += ['EventInfo.trigPassed_' + t + ' -> trigPassed_' + t for t in triggerChains] -ntupleMaker.systematicsRegex = '.*' -algSeq += ntupleMaker -treeFiller = createAlgorithm( 'CP::TreeFillerAlg', 'TreeFiller' ) -treeFiller.TreeName = 'events' -athAlgSeq += treeFiller - -# For debugging. -print( algSeq ) - -# Add all algorithms from the sequence to the job. -athAlgSeq += algSeq +from TriggerAnalysisAlgorithms.TriggerAnalysisAlgorithmsTest import makeSequence +algSeq = makeSequence (dataType) +print algSeq # For debugging # Set up a histogram output file for the job: ServiceMgr += CfgMgr.THistSvc()