10from reconstruction
import prepare_cdst_analysis
11import modularAnalysis
as mA
15def make_electron_collection(path_electron):
16 prepare_cdst_analysis(path=path_electron)
19 trg_bhabhaskim = path_electron.add_module(
"TriggerSkim", triggerLines=[
"software_trigger_cut&skim&accept_radee"])
20 trg_bhabhaskim.if_value(
"==0", basf2.Path(), basf2.AfterConditionPath.END)
23 path_electron.add_module(
25 relativeCorrections=
False,
35 mA.fillParticleList(
'e+:calib',
' ', path=path_electron)
43def make_muon_collection(path_muon):
45 prepare_cdst_analysis(path=path_muon)
50 relativeCorrections=
False,
60 goodTrack =
'abs(dr) < 0.5 and abs(dz) < 0.5 and nCDCHits > 0'
61 goodTrack +=
' and clusterE < 0.40 and clusterEoP < 0.40 and inCDCAcceptance==1'
62 goodTrack +=
' and [[isPIDAvailableFrom(KLM) == 0 and clusterE < 0.25] or isPIDAvailableFrom(KLM) == 1]'
65 mA.fillParticleList(
'mu+:calib', goodTrack, path=path_muon)
69 track_cuts +=
'daughterProductOf(charge) < 0'
70 track_cuts +=
' and daughterLowest(clusterE) <= 0.25'
73 track_cuts +=
' and [daughter(0,isPIDAvailableFrom(KLM)) == 1 or daughter(1,isPIDAvailableFrom(KLM)) == 1]'
76 mA.reconstructDecay(
'vpho:mumu -> mu+:calib mu-:calib', track_cuts, path=path_muon)
79 event_cuts =
'[nCleanedTracks('+goodTrack+
') == 2]'
80 mA.applyEventCuts(event_cuts, path=path_muon)
81 radmumulist = [
'vpho:mumu']
84 skimfilter = basf2.register_module(
'SkimFilter')
85 skimfilter.param(
'particleLists', radmumulist)
86 path_muon.add_module(skimfilter)
88 filter_path = basf2.create_path()
89 skimfilter.if_value(
'=1', filter_path, basf2.AfterConditionPath.CONTINUE)
93 mA.cutAndCopyList(
'mu+:cal',
'mu+:calib', cutonPairs, path=filter_path)
96 event_cutscopy =
'[nCleanedTracks('+goodTrack+
') == 2]'
97 mA.applyEventCuts(event_cutscopy, path=filter_path)
106def make_proton_collection(path_hadrons):
109 trg_skim = path_hadrons.add_module(
"TriggerSkim", triggerLines=[
"software_trigger_cut&skim&accept_lambda"])
110 trg_skim.if_value(
"==0", basf2.Path(), basf2.AfterConditionPath.END)
112 prepare_cdst_analysis(path=path_hadrons)
115 path_hadrons.add_module(
117 relativeCorrections=
False,
127 goodProtonTrack =
'dr< 0.50 and abs(dz)<0.50'
128 mA.fillParticleList(
"p+:calib", goodProtonTrack, path=path_hadrons)
136def make_pion_kaon_collection(path_hadrons):
139 trg_skim = path_hadrons.add_module(
142 "software_trigger_cut&skim&accept_dstar_1",
143 "software_trigger_cut&skim&accept_dstar_3"])
145 trg_skim.if_value(
"==0", basf2.Path(), basf2.AfterConditionPath.END)
147 prepare_cdst_analysis(path=path_hadrons)
150 path_hadrons.add_module(
152 relativeCorrections=
False,
162 clean_K =
'dr < 1.00 and abs(dz) < 1.0 and inCDCAcceptance==1 '
163 clean_K +=
' and [[cosTheta<-0.45 or cosTheta >= 0.80] or [[cosTheta>=-0.45 and cosTheta <= 0.80 and pt <= 0.50]'
164 clean_K +=
' or [cosTheta>=-0.45 and cosTheta <= 0.80 and pt > 0.50 and pidProbabilityExpert(321, TOP) > 0.015 ]]]'
167 mA.fillParticleList(
"K+:calib", clean_K, path=path_hadrons)
170 clean_Pi =
'dr < 1.0 and abs(dz) < 1.0 and inCDCAcceptance==1 '
171 clean_Pi +=
' and [[cosTheta<-0.45 or cosTheta > 0.80] or [[cosTheta>=-0.45 and cosTheta <= 0.80 and pt <= 0.50] '
172 clean_Pi +=
' or [cosTheta>=-0.45 and cosTheta <= 0.80 and pt > 0.50 and pidProbabilityExpert(321, TOP) < 0.60 ]]]'
175 mA.fillParticleList(
"pi+:calib", clean_Pi, path=path_hadrons)
179 clean_Dz1 =
'abs(dM) < 0.020'
180 clean_Dz1 +=
' and [daughter(0,nCDCHits) > 30 or daughter(1, nCDCHits) > 30] '
182 mA.reconstructDecay(
'D0:cal1 -> K-:calib pi+:calib', clean_Dz1, path=path_hadrons)
185 clean_Dz2 =
'abs(dM) < 0.020'
186 clean_Dz2 +=
' and [daughter(0,nCDCHits) > 25 or daughter(1, nCDCHits) > 25 or daughter(2, nCDCHits) > 25 '
187 clean_Dz2 +=
' or daughter(3, nCDCHits) > 25] '
188 mA.reconstructDecay(
'D0:cal2 -> K-:calib pi+:calib pi+:calib pi-:calib', clean_Dz2, path=path_hadrons)
192 clean_sPi =
'dr < 1.00 and abs(dz) < 1.00 and p < 1.5 and nCDCHits > 10 and inCDCAcceptance==1'
193 mA.fillParticleList(
"pi+:slow", clean_sPi, path=path_hadrons)
198 clean_Ds =
'useCMSFrame(p) > 1.5 and abs(formula(massDifference(0) - 0.14542)) < 0.00070 '
199 clean_Ds +=
' and abs(dM) < 0.020'
200 mA.reconstructDecay(
'D*+:cal1 -> D0:cal1 pi+:slow', clean_Ds, path=path_hadrons)
203 list_Ds1 = [
'D*+:cal1']
204 skimf_Ds1 = basf2.register_module(
'SkimFilter')
205 skimf_Ds1.param(
'particleLists', list_Ds1)
206 path_hadrons.add_module(skimf_Ds1)
207 fpath_Ds1 = basf2.create_path()
208 skimf_Ds1.if_value(
'=1', fpath_Ds1, basf2.AfterConditionPath.CONTINUE)
211 mA.reconstructDecay(
'D*+:cal2 -> D0:cal2 pi+:slow', clean_Ds, path=path_hadrons)
213 list_Ds2 = [
'D*+:cal2']
214 skimf_Ds2 = basf2.register_module(
'SkimFilter')
215 skimf_Ds2.param(
'particleLists', list_Ds2)
216 path_hadrons.add_module(skimf_Ds2)
217 fpath_Ds2 = basf2.create_path()
218 skimf_Ds2.if_value(
'=1', fpath_Ds2, basf2.AfterConditionPath.CONTINUE)
222 mA.variablesToDaughterExtraInfo(
'D*+:cal1',
'D*+ -> [D0 -> ^K- ^pi+ ] ^pi+', {
'dM':
'l_Ds1dM'}, path=fpath_Ds1)
223 mA.variablesToDaughterExtraInfo(
'D*+:cal1',
'D*+ -> [D0 -> ^K- ^pi+ ] ^pi+', {
'useCMSFrame(p)':
'l_Ds1p'}, path=fpath_Ds1)
224 mA.variablesToDaughterExtraInfo(
'D*+:cal1',
'D*+ -> [D0 -> ^K- ^pi+ ] ^pi+',
225 {
'massDifference(0)':
'l_Ds1mDiff'}, path=fpath_Ds1)
226 mA.variablesToDaughterExtraInfo(
'D*+:cal1',
'D*+ -> [D0 -> ^K- ^pi+ ] ^pi+', {
'daughter(0,dM)':
'l_Ds1_DzdM'}, path=fpath_Ds1)
227 mA.variablesToDaughterExtraInfo(
'D*+:cal1',
228 'D*+ -> [D0 -> ^K- ^pi+ ] ^pi+',
229 {
'daughter(0,daughter(0,nCDCHits))':
'l_Ds1_Dz_Khits'},
231 mA.variablesToDaughterExtraInfo(
'D*+:cal1',
232 'D*+ -> [D0 -> ^K- ^pi+ ] ^pi+',
233 {
'daughter(0,daughter(1,nCDCHits))':
'l_Ds1_Dz_Pihits'},
237 cutonD1var =
"abs(extraInfo(l_Ds1dM)) < 0.02"
238 cutonD1var +=
" and extraInfo(l_Ds1p) > 1.5 "
239 cutonD1var +=
" and abs(formula(extraInfo(l_Ds1mDiff) - 0.14542)) < 0.0010"
240 cutonD1var +=
" and abs(extraInfo(l_Ds1_DzdM)) < 0.02"
241 cutonD1var +=
" and [extraInfo(l_Ds1_Dz_Khits) > 30 or extraInfo(l_Ds1_Dz_Pihits) > 30]"
244 mA.cutAndCopyList(
'K+:dst1',
'K+:calib', cutonD1var, path=fpath_Ds1)
245 mA.cutAndCopyList(
'pi+:dst1',
'pi+:calib', cutonD1var, path=fpath_Ds1)
249 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+', {
'dM':
'l_Ds2dM'}, path=fpath_Ds2)
250 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
251 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
252 {
'useCMSFrame(p)':
'l_Ds2p'},
254 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
255 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
256 {
'massDifference(0)':
'l_Ds2mDiff'},
258 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
259 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
260 {
'daughter(0,dM)':
'l_Ds2_DzdM'},
262 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
263 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
264 {
'daughter(0,daughter(0,nCDCHits))':
'l_Ds2_Dz_Khits'},
266 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
267 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
268 {
'daughter(0,daughter(1,nCDCHits))':
'l_Ds2_Dz_Pi1hits'},
270 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
271 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
272 {
'daughter(0,daughter(2,nCDCHits))':
'l_Ds2_Dz_Pi2hits'},
274 mA.variablesToDaughterExtraInfo(
'D*+:cal2',
275 'D*+ -> [D0 -> ^K- ^pi+ ^pi+ ^pi-] ^pi+',
276 {
'daughter(0,daughter(3,nCDCHits))':
'l_Ds2_Dz_Pi3hits'},
280 cutonD2var =
"abs(extraInfo(l_Ds2dM)) < 0.02"
281 cutonD2var +=
" and extraInfo(l_Ds2p) > 2.0"
282 cutonD2var +=
" and abs(formula(extraInfo(l_Ds2mDiff) - 0.14542)) < 0.0010"
283 cutonD2var +=
" and abs(extraInfo(l_Ds2_DzdM)) < 0.02"
284 cutonD2var +=
" and [extraInfo(l_Ds2_Dz_Khits) > 25 or extraInfo(l_Ds2_Dz_Pi1hits) > 25 "
285 cutonD2var +=
" or extraInfo(l_Ds2_Dz_Pi2hits) > 25 or extraInfo(l_Ds2_Dz_Pi3hits) > 25]"
288 mA.cutAndCopyList(
'K+:dst2',
'K+:calib', cutonD2var, path=fpath_Ds2)
289 mA.cutAndCopyList(
'pi+:dst2',
'pi+:calib', cutonD2var, path=fpath_Ds2)
291 pion_kaon_list = [
'pi+:dst1',
'pi+:dst2',
'K+:dst1',
'K+:dst2']
293 return pion_kaon_list