15 This script loads a specified input ROOT file, reconstructs photon conversions and
16 saves converted-photon variables and some of their generator-level counterparts for comparison.
19 $> basf2 getConvertedPhotonVariables.py -i [input_ROOT_file]
23 import modularAnalysis
as ma
24 from variables
import variables
as vm
27 ma.inputMdst(filename=b2.find_file(
'mdst14.root',
'validation',
True),
32 vm.addAlias(
'cpDR',
'convertedPhotonDelR(0,1)')
33 vm.addAlias(
'cpDZ',
'convertedPhotonDelZ(0,1)')
34 vm.addAlias(
'cpDTL',
'convertedPhotonDelTanLambda(0,1)')
35 vm.addAlias(
'cpX',
'convertedPhotonX(0,1)')
36 vm.addAlias(
'cpY',
'convertedPhotonY(0,1)')
37 vm.addAlias(
'cpZ',
'convertedPhotonZ(0,1)')
38 vm.addAlias(
'cpRho',
'convertedPhotonRho(0,1)')
39 vm.addAlias(
'cpM',
'convertedPhotonInvariantMass(0,1)')
40 vm.addAlias(
'cpPx',
'convertedPhotonPx(0,1)')
41 vm.addAlias(
'cpPy',
'convertedPhotonPy(0,1)')
42 vm.addAlias(
'cpPz',
'convertedPhotonPz(0,1)')
44 vm.addAlias(
'mcX',
'daughter(0,mcProductionVertexX)')
45 vm.addAlias(
'mcY',
'daughter(0,mcProductionVertexY)')
46 vm.addAlias(
'mcZ',
'daughter(0,mcProductionVertexZ)')
71 ma.fillParticleList(
"e+:loose", cut=
"p > 0.3", path=path)
73 'gamma:conv -> e+:loose e-:loose',
74 cut=
'cpM < 0.1 and cpDR > -0.15 and cpDR < 0.15 and cpDZ > -0.05 and cpDZ < 0.05',
76 ma.matchMCTruth(
'gamma:conv', path=path)
77 ma.variablesToNtuple(
'gamma:conv', tuple_vars, filename=
'output.root', treename=
'photonVars', path=path)
81 progress = b2.register_module(
'Progress')
82 path.add_module(progress)