27 from basf2
import (register_module, process, print_params, create_path,
28 statistics, conditions)
29 from modularAnalysis
import fillParticleList
30 from modularAnalysis
import cutAndCopyList
31 from modularAnalysis
import applyEventCuts
32 from simulation
import add_simulation
33 from reconstruction
import add_reconstruction
34 from variables
import variables
39 print(
"Job arguments: nEvents name newGeom; ", narg-1,
"provided")
45 nevt = int(sys.argv[1])
46 outputFileName =
"ntuples/" + sys.argv[2] +
".root"
49 newGeom = int(sys.argv[3])
51 conditions.globaltags = [
'ecl_alignment']
53 conditions.prepend_testing_payloads(
"localdb/database.txt")
54 print(conditions.globaltags)
58 particlegun = register_module(
'ParticleGun')
60 particlegun.param(
'pdgCodes', [13])
61 particlegun.param(
'nTracks', 1)
62 particlegun.param(
'varyNTracks',
False)
63 particlegun.param(
'momentumGeneration',
'uniform')
64 particlegun.param(
'momentumParams', [4.15, 4.5])
65 particlegun.param(
'thetaGeneration',
'uniform')
66 particlegun.param(
'thetaParams', [127.5, 131.5])
67 particlegun.param(
'phiGeneration',
'uniform')
68 particlegun.param(
'phiParams', [0., 360.])
69 particlegun.param(
'vertexGeneration',
'fixed')
70 particlegun.param(
'xVertexParams', [-0.05])
71 particlegun.param(
'yVertexParams', [0.015])
72 particlegun.param(
'zVertexParams', [0.])
73 particlegun.param(
'independentVertices',
False)
75 print_params(particlegun)
81 main.add_module(
"EventInfoSetter", expList=experiment, runList=run, evtNumList=nevt)
82 main.add_module(
"Progress")
83 main.add_module(particlegun)
86 add_reconstruction(main)
91 fillParticleList(
'mu-:highp',
'useCMSFrame(p) > 3.5 and abs(d0) < 0.5 and abs(z0) < 4 and nCDCHits>0 and nVXDHits>0', path=main)
92 cutAndCopyList(
'mu-:highE',
'mu-:highp',
'clusterE>1.', path=main)
94 variables.addAlias(
'nhighp',
'nParticlesInList(mu-:highp)')
95 variables.addAlias(
'nhighE',
'nParticlesInList(mu-:highE)')
96 applyEventCuts(
'[nhighE==0] and [nhighp==1]', main)
100 variables.addAlias(
'muThetaLab',
'formula(57.2957795*theta)')
101 variables.addAlias(
'muPhiLab',
'formula(57.2957795*phi)')
102 variables.addAlias(
'muPcms',
'useCMSFrame(p)')
103 variables.addAlias(
'muptLab',
'pt')
104 variables.addAlias(
'e1Uncorr',
'formula(clusterHighestE * clusterUncorrE / clusterE)')
105 variables.addAlias(
'clustThetaLab',
'formula(57.2957795*clusterTheta)')
106 variables.addAlias(
'clustPhiLab',
'formula(57.2957795*clusterPhi)')
109 variables.addAlias(
'bestMuonID',
'muonID')
110 variables.addAlias(
'worstMuonID',
'muonID')
128 main.add_module(
'VariablesToNtuple', particleList=
'mu-:highp', variables=varsToStore, fileName=outputFileName)