sel_mu = '(Muons.pt > 27.0*GeV) && (Muons.pt < 1450.0*GeV) && (Muons.etcone40/Muons.pt < 0.1) && (Muons.ptcone40/Muons.pt < 0.2) && Muons.passesIDCuts && (Muons.quality <= 1)' muRequirement = '( count( ' + sel_mu + ' ) == 1 )' # tau selection sel_tau = '(TauJets.pt > 19.0*GeV) && ( TauJets.nTracks >= 0) && ( TauJets.nTracks <= 4) && (TauJets.BDTJetScore > 0.1)' tauRequirement = '( count( ' + sel_tau + ' ) >= 1 )' # event selection string draw_taumuh = muRequirement + ' && ' + tauRequirement + '&& ( count (TAUMUH_DeltaR > 2.9) >=1 )' # DeltaR tool from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__DeltaRTool TAUMUH_DeltaRTool = DerivationFramework__DeltaRTool( name="TAUMUH_DeltaRTool", ContainerName="Muons", ObjectRequirements=sel_mu, SecondContainerName="TauJets", SecondObjectRequirements=sel_tau, StoreGateEntryName="TAUMUH_DeltaR") ToolSvc += TAUMUH_DeltaRTool print TAUMUH_DeltaRTool # Event selection tool from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool DRAW_TAUMUH_SkimmingTool = DerivationFramework__xAODStringSkimmingTool( name="DRAW_TAUMUH_SkimmingTool", expression=draw_taumuh) ToolSvc += DRAW_TAUMUH_SkimmingTool print DRAW_TAUMUH_SkimmingTool # Kernel algorithm from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
if globalflags.DataSource() == 'geant4': ToolSvc += HIGG3D3TruthThinningTool thinningTools.append(HIGG3D3TruthThinningTool) #==================================================================== # SKIMMING TOOL #==================================================================== electronRequirements = '(Electrons.pt > 7*GeV) && (abs(Electrons.eta) < 2.6)' muonsRequirements = '(Muons.pt > 7*GeV) && (abs(Muons.eta) < 2.7) && (Muons.DFCommonGoodMuon)' from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__DeltaRTool HIGG3D3ElJDeltaRTool = DerivationFramework__DeltaRTool( name="HIGG3D3ElJDeltaRTool", StoreGateEntryName="dRElecJet", ObjectRequirements=electronRequirements, SecondObjectRequirements="(AntiKt4EMTopoJets.pt > 15*GeV)", ContainerName="Electrons", SecondContainerName="AntiKt4EMTopoJets") ToolSvc += HIGG3D3ElJDeltaRTool HIGG3D3MuJDeltaRTool = DerivationFramework__DeltaRTool( name="HIGG3D3MuJDeltaRTool", StoreGateEntryName="dRMuJet", ObjectRequirements=muonsRequirements, SecondObjectRequirements="(AntiKt4EMTopoJets.pt > 15*GeV)", ContainerName="Muons", SecondContainerName="AntiKt4EMTopoJets") ToolSvc += HIGG3D3MuJDeltaRTool eSelection = '(count(' + electronRequirements + ')>=1)' mSelection = '(count(' + muonsRequirements + ')>=1)'
fileName = buildFileName(derivationFlags.WriteDAOD_EXOT7Stream) EXOT7Stream = MSMgr.NewPoolRootStream(streamName, fileName) EXOT7Stream.AcceptAlgs(["EXOT7Kernel"]) augStream = MSMgr.GetStream(streamName) evtStream = augStream.GetEventStream() #==================================================================== # OPENING ANGLE TOOL #==================================================================== from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__DeltaRTool EXOT7DeltaRTool = DerivationFramework__DeltaRTool( name="EXOT7DeltaRTool", StoreGateEntryName="dRkt4kt10", ObjectRequirements= "(AntiKt4LCTopoJets.pt > 300*GeV) && (abs(AntiKt4LCTopoJets.eta)<2.7)", SecondObjectRequirements= "(AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.pt > 300*GeV) && (abs(AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.eta)<2.2)", ContainerName="AntiKt4LCTopoJets", SecondContainerName="AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", ) ToolSvc += EXOT7DeltaRTool beamEnergy = jobproperties.Beam.energy() expression = '' if (beamEnergy < 4.1e+06): expression = '((((count((AntiKt4LCTopoJets.pt > 300*GeV) && (abs(AntiKt4LCTopoJets.eta)<2.7)) >= 1)) && (count (AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.pt>300*GeV && (abs(AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.eta)<2.2)) >0 ) && (count(dRkt4kt10 > 1.0) >= 1))' expression += ' || ( ( ( (count((CamKt15LCTopoJets.pt > 400*GeV) && (abs(CamKt15LCTopoJets.eta) < 2.7)) >= 1) && (count((CamKt15LCTopoJets.pt > 150*GeV) && (abs(CamKt15LCTopoJets.eta) < 2.7)) >= 2) )' expression += ' || ( (count((CamKt8LCTopoJets.pt > 400*GeV) && (abs(CamKt8LCTopoJets.eta) < 2.7)) >= 1) && (count((CamKt8LCTopoJets.pt > 150*GeV) && (abs(CamKt8LCTopoJets.eta) < 2.7)) >= 2) ) )' # AND of lepton veto for tt res. all had (note the lepton p_T cuts are higher, to make the veto softer and allow for calibrations) expression += ' && !(((count(Electrons.Tight && Electrons.pt > 30*GeV && Electrons.eta > -2.8 && Electrons.eta < 2.8)>0)) || (( count(Muons.DFCommonGoodMuon && Muons.pt > 30*GeV && Muons.eta > -2.8 && Muons.eta < 2.8)>0))) ))' if (beamEnergy > 6.0e+06):
def setup(HIGG4DxName, ToolSvc): augmentationTools = [] # DELTA R TOOL from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__DeltaRTool HIGG4DxTauJetsElectronsDeltaRTool = DerivationFramework__DeltaRTool( name="HIGG4DxTauJetsElectronsDeltaRTool", ContainerName="Electrons", SecondContainerName="TauJets", StoreGateEntryName="HIGG4DxTauJetsElectronsDeltaR") ToolSvc += HIGG4DxTauJetsElectronsDeltaRTool augmentationTools.append(HIGG4DxTauJetsElectronsDeltaRTool) # TAU SELECTOR TOOL from DerivationFrameworkTau.DerivationFrameworkTauConf import DerivationFramework__TauSelectionWrapper HIGG4DxJetBDTSigMediumSelectionWrapper = DerivationFramework__TauSelectionWrapper( name="HIGG4DxJetBDTSigMediumSelectionWrapper", #IsTauFlag = IsTauFlag.JetBDTSigMedium, IsTauFlag=20, CollectionName="TauJets", StoreGateEntryName="HIGG4DxJetBDTSigMedium") ToolSvc += HIGG4DxJetBDTSigMediumSelectionWrapper augmentationTools.append(HIGG4DxJetBDTSigMediumSelectionWrapper) HIGG4DxJetBDTSigLooseSelectionWrapper = DerivationFramework__TauSelectionWrapper( name="HIGG4DxJetBDTSigLooseSelectionWrapper", IsTauFlag=19, CollectionName="TauJets", StoreGateEntryName="HIGG4DxJetBDTSigLoose") ToolSvc += HIGG4DxJetBDTSigLooseSelectionWrapper augmentationTools.append(HIGG4DxJetBDTSigLooseSelectionWrapper) # Tau primary vertex refit if HIGG4DxName == "HIGG4D3": from DerivationFrameworkTau.DerivationFrameworkTauConf import DerivationFramework__TauPVTrkSelectionTool HIGG4DxTauPVTrkSelectionTool = DerivationFramework__TauPVTrkSelectionTool( name="HIGG4DxTauPVTrkSelectionTool", #minPt = 15000, #m_maxDeltaR = 0.2, UseTrueTracks=DFisMC, TauContainerName="TauJets", TauPVTracksContainerName="TauPVTracks") ToolSvc += HIGG4DxTauPVTrkSelectionTool augmentationTools.append(HIGG4DxTauPVTrkSelectionTool) from DerivationFrameworkTau.DerivationFrameworkTauConf import DerivationFramework__TauPVRefitTool HIGG4DxTauPVRefittingTool = DerivationFramework__TauPVRefitTool( name="HIGG4DxTauPVRefittingTool", PVLinkName="PVLink", RefittedLinkName="TauRefittedPVLink", PVContainerName="PrimaryVertices", TauTrkContainerName="TauPVTracks", PVRefContainerName="TauRefittedPrimaryVertices") ToolSvc += HIGG4DxTauPVRefittingTool augmentationTools.append(HIGG4DxTauPVRefittingTool) if DFisMC: # Tau truth matching from TauAnalysisTools.TauAnalysisToolsConf import TauAnalysisTools__TauTruthMatchingTool HIGG4DxTauTruthMatchingTool = TauAnalysisTools__TauTruthMatchingTool( name="HIGG4DxTauTruthMatchingTool", WriteTruthTaus=True) ToolSvc += HIGG4DxTauTruthMatchingTool # Tau truth matching wrapper from DerivationFrameworkTau.DerivationFrameworkTauConf import DerivationFramework__TauTruthMatchingWrapper HIGG4DxTauTruthMatchingWrapper = DerivationFramework__TauTruthMatchingWrapper( name="HIGG4DxTauTruthMatchingWrapper", TauTruthMatchingTool=HIGG4DxTauTruthMatchingTool) ToolSvc += HIGG4DxTauTruthMatchingWrapper augmentationTools.append(HIGG4DxTauTruthMatchingWrapper) #Tau Overlapping Electron LLH Decorator from TauAnalysisTools.TauAnalysisToolsConf import TauAnalysisTools__TauOverlappingElectronLLHDecorator HIGG4DxTauOrlElLLHDec = TauAnalysisTools__TauOverlappingElectronLLHDecorator( name="HIGG4DxTauOrlElLLHDec", ElectronContainerName="Electrons") ToolSvc += HIGG4DxTauOrlElLLHDec #Tau Overlapping Electron LLH Decorator Wrapper from DerivationFrameworkTau.DerivationFrameworkTauConf import DerivationFramework__TauOverlappingElectronLLHDecoratorWrapper HIGG4DxTauOrlElLLHDecWrapper = DerivationFramework__TauOverlappingElectronLLHDecoratorWrapper( name="HIGG4DxTauOrlElLLHDecWrapper", TauOverlappingElectronLLHDecorator=HIGG4DxTauOrlElLLHDec, TauContainerName="TauJets") ToolSvc += HIGG4DxTauOrlElLLHDecWrapper augmentationTools.append(HIGG4DxTauOrlElLLHDecWrapper) #============= # return tools #============= return augmentationTools