from Gaudi.Configuration import * from GaudiKernel.SystemOfUnits import MeV, GeV from Configurables import CombineParticles from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand # prepare input data _muons = DataOnDemand('_stdLooseMuons', Location = 'StdLooseMuons') # create algorithm myalg = CombineParticles("myalg") # define decay and cuts myalg.DecayDescriptor = "J/psi(1S) -> mu+ mu-" myalg.CombinationCut = "ADAMASS('J/psi(1S)')<30*MeV" myalg.MotherCut = "(VFASPF(VCHI2/VDOF)<10)" # add plots to algorithm from Configurables import LoKi__Hybrid__PlotTool as PlotTool myalg.HistoProduce = True myalg.addTool ( PlotTool ( 'DaughtersPlots' ) ) myalg.DaughtersPlots.Histos = { 'P' : ('momentum' , 0*GeV ,30*GeV) , 'M' : ('mass' ,0*GeV,1*GeV) } myalg.addTool( PlotTool ( "MotherPlots" ) ) myalg.MotherPlots.Histos = { "P" : ('momentum',0*GeV,100*GeV) , "M" : ('mass',0*GeV,4*GeV) } # create selection # Selection needs to be defined after all changes to the Algorithm LooseJpsi2MuMu = Selection("seqLooseJPsi2MuMu", Algorithm = myalg, RequiredSelections =[ _muons ]) # start selection sequence mySeq = SelectionSequence("mySeq", TopSelection = LooseJpsi2MuMu) # configure the application. from Configurables import DaVinci DaVinci().UserAlgorithms = [ mySeq.sequence() ] DaVinci().HistogramFile = "histograms.root" # Histogram file DaVinci().EvtMax = 1000 # Number of events to loop over DaVinci().DataType = "MC09" # Default anyway DaVinci().Simulation = True # It's MC