18import modularAnalysis
as ma
23ma.inputMdstList([basf2.find_file(
'analysis/tests/mdst.root')], path=mypath)
24ma.fillParticleLists([(
'K-',
'kaonID > 0.2'), (
'pi+',
'pionID > 0.2')], path=mypath)
25ma.reconstructDecay(
'D0 -> K- pi+',
'1.750 < M < 1.95', path=mypath)
26ma.matchMCTruth(
'D0', path=mypath)
30mypath.add_module(
'VariablesToNtuple',
32 variables=[
'dM',
'isSignal',
'mcErrors',
'p',
'E',
33 'daughter(0, kaonID)',
'daughter(1, pionID)'],
34 fileName=
'CandidateVariables.root')
39mypath.add_module(
'VariablesToNtuple',
41 variables=[
'nTracks',
'isMC',
'year'],
42 fileName=
'EventVariables.root')
46ma.buildRestOfEvent(
'D0', path=mypath)
47cleanMask = (
'cleanMask',
48 'nCDCHits > 0 and useCMSFrame(p)<=3.2',
49 'p >= 0.05 and useCMSFrame(p)<=3.2'
51ma.appendROEMasks(
'D0', mask_tuples=[cleanMask], path=mypath)
54roe_path = basf2.Path()
55ma.fillParticleList(
'pi+:inRoe',
'isInRestOfEvent > 0 and passesROEMask(cleanMask)', path=roe_path)
56ma.variablesToNtuple(decayString=
'pi+:inRoe',
58 filename=
'CandidateVariables.root',
60 signalSideParticleList=
'D0',
62mypath.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
71print(basf2.statistics)