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 treeName=
'eventVariables',
43 fileName=
'EventVariables.root')
47ma.buildRestOfEvent(
'D0', path=mypath)
48cleanMask = (
'cleanMask',
49 'nCDCHits > 0 and useCMSFrame(p)<=3.2',
50 'p >= 0.05 and useCMSFrame(p)<=3.2'
52ma.appendROEMasks(
'D0', mask_tuples=[cleanMask], path=mypath)
55roe_path = basf2.Path()
56ma.fillParticleList(
'pi+:inRoe',
'isInRestOfEvent > 0 and passesROEMask(cleanMask)', path=roe_path)
57ma.variablesToNtuple(decayString=
'pi+:inRoe',
59 filename=
'CandidateVariables.root',
61 signalSideParticleList=
'D0',
63mypath.for_each(
'RestOfEvent',
'RestOfEvents', roe_path)
72print(basf2.statistics)