Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
8.0 KiB

  1. #setting up DaVinci directory
  2. DV = GaudiExec()
  3. #DV.directory = '/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/DaVinciDev_v38r1p3/'
  4. #DONT FORGET THE BUILD PATH!
  5. channel_list = ['Kplus'
  6. 'Kshort'
  7. ]
  8. decay_list = [ #'BtoKstMuMu',
  9. 'BtoKstJpsi'
  10. #'PHSP',
  11. # 'BtoXJpsi',
  12. # 'B0toKstMuMu',
  13. #'B0toKstJpsi',
  14. # 'BtoK1MuMu',
  15. # 'BtoK1Jpsi'
  16. ]
  17. polarity_list = [
  18. 'MagDown',
  19. 'MagUp']
  20. decay_no_dict = {
  21. 'BtoKstMuMu' : {'Kplus': 12113100,
  22. 'Kshort': 12115102},
  23. 'BtoKstJpsi' : {'Kplus': 12143401,
  24. 'Kshort': 12145102},
  25. 'PHSP' : {'Kplus': 12113445,
  26. 'Kshort': 12115178},
  27. 'BtoXJpsi' : {'Kplus': 12442001,
  28. 'Kshort': 12442001},
  29. 'B0toKstMuMu': {'Kplus': 11114001,
  30. 'Kshort': 11114001},
  31. 'B0toKstJpsi': {'Kplus': 11144001,
  32. 'Kshort': 11144001},
  33. 'BtoK1MuMu' : {'Kplus': 12435001,
  34. 'Kshort': 12435001},
  35. 'BtoK1Jpsi' : {'Kplus': 12145101,
  36. 'Kshort': 12145101}
  37. }
  38. decay_year_dict = { 'BtoKstMuMu' : ['2011','2012','2015','2016'],
  39. #'BtoKstJpsi' : ['2011','2012'],
  40. 'BtoKstJpsi' : ['2012'], #In the case of the second trigger settings
  41. 'PHSP' : ['2011','2012','2015','2016'],
  42. 'BtoXJpsi' : ['2011','2012','2016'],
  43. 'B0toKstMuMu': ['2011','2012','2015','2016'],
  44. # 'B0toKstJpsi': ['2011','2012','2015','2016'],
  45. 'B0toKstJpsi': ['2015','2016'],
  46. 'BtoK1MuMu' : ['2011','2012'],
  47. 'BtoK1Jpsi' : ['2012']
  48. }
  49. year_E_dict = { '2011': '3500GeV',
  50. '2012': '4000GeV',
  51. '2015': '6500GeV',
  52. '2016': '6500GeV'
  53. }
  54. year_nu_dict = { '2011': '2',
  55. '2012': '2.5',
  56. '2015': '1.6-25ns',
  57. '2016': '1.6-25ns'
  58. }
  59. year_trigg_dict = { '2011': 'Trig0x40760037',
  60. #'2012': 'Trig0x409f0045', TODO! two different trigger settings! for BtoKstJpsi
  61. '2012': 'Trig0x4097003d'
  62. '2015': 'Trig0x411400a2',
  63. '2016': 'Trig0x6138160F'
  64. }
  65. decay_simVer_dict = { 'BtoKstMuMu' : {'2011': 'Sim09b',
  66. '2012': 'Sim09a',
  67. '2015': 'Sim09b',
  68. '2016': 'Sim09c',
  69. },
  70. 'BtoKstJpsi' : {'2011': 'Sim09a',
  71. #'2012': 'Sim09a' Change according to the trigger settings!
  72. '2012': 'Sim09c'
  73. },
  74. 'PHSP' : {'2011': 'Sim09b',
  75. '2012': 'Sim09b',
  76. '2015': 'Sim09b',
  77. '2016': 'Sim09c'
  78. },
  79. 'BtoXJpsi' : {'2011': 'Sim08c/Digi13',
  80. '2012': 'Sim08a/Digi13',
  81. '2016': 'Sim09b'
  82. },
  83. 'B0toKstMuMu': {'2011': 'Sim08e/Digi13',
  84. '2012': 'Sim08b/Digi13',
  85. '2015': 'Sim09c',
  86. '2016': 'Sim09b'
  87. },
  88. 'B0toKstJpsi': {'2011': 'Sim08f/Digi13',
  89. '2012': 'Sim08f/Digi13',
  90. '2015': 'Sim09c',
  91. '2016': 'Sim09c'
  92. },
  93. 'BtoK1MuMu' : {'2011': 'Sim08e/Digi13',
  94. '2012': 'Sim08e/Digi13',
  95. },
  96. 'BtoK1Jpsi' : {'2012': 'Sim08a/Digi13'
  97. }
  98. }
  99. decay_strip_dict = { 'BtoKstMuMu' : {'2011': 'Reco14c/Stripping21r1NoPrescalingFlagged',
  100. '2012': 'Reco14c/Stripping21NoPrescalingFlagged',
  101. '2015': 'Reco15a/Turbo02/Stripping24NoPrescalingFlagged',
  102. '2016': 'Reco16/Turbo03/Stripping28NoPrescalingFlagged',
  103. },
  104. 'BtoKstJpsi' : {'2011': 'Reco14c/Stripping21r1NoPrescalingFlagged',
  105. '2012': 'Reco14c/Stripping21NoPrescalingFlagged',
  106. },
  107. 'PHSP' : {'2011': 'Reco14c/Stripping21r1Filtered',
  108. '2012': 'Reco14c/Stripping21Filtered',
  109. '2015': 'Reco15a/Turbo02/Stripping24Filtered',
  110. '2016': 'Reco16/Turbo03/Stripping28Filtered'
  111. },
  112. 'BtoXJpsi' : {'2011': 'Reco14a/Stripping20r1NoPrescalingFlagged',
  113. '2012': 'Reco14a/Stripping20NoPrescalingFlagged',
  114. '2016': 'Reco16/Turbo03/Stripping26NoPrescalingFlagged'
  115. },
  116. 'B0toKstMuMu': {'2011': 'Reco14a/Stripping20r1NoPrescalingFlagged',
  117. '2012': 'Reco14a/Stripping20NoPrescalingFlagged',
  118. '2015': 'Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged',
  119. '2016': 'Reco16/Turbo03/Stripping26NoPrescalingFlagged'
  120. },
  121. 'B0toKstJpsi': {'2011': 'Reco14a/Stripping20r1NoPrescalingFlagged',
  122. '2012': 'Reco14a/Stripping20NoPrescalingFlagged',
  123. '2015': 'Reco15a/Turbo02/Stripping24r1NoPrescalingFlagged',
  124. '2016': 'Reco16/Turbo03/Stripping28r1NoPrescalingFlagged'
  125. },
  126. 'BtoK1MuMu' : {'2011': 'Reco14a/Stripping20r1NoPrescalingFlagged',
  127. '2012': 'Reco14a/Stripping20NoPrescalingFlagged',
  128. },
  129. 'BtoK1Jpsi' : {'2012': 'Reco14a/Stripping20NoPrescalingFlagged'
  130. }
  131. }
  132. decay_file_dict = { 'BtoKstMuMu' : {'2011': 'ALLSTREAMS.DST',
  133. '2012': 'ALLSTREAMS.DST',
  134. '2015': 'ALLSTREAMS.MDST',
  135. '2016': 'ALLSTREAMS.MDST',
  136. },
  137. 'BtoKstJpsi' : {'2011': 'ALLSTREAMS.DST',
  138. '2012': 'ALLSTREAMS.DST'
  139. },
  140. 'PHSP' : {'2011': 'B2XMUMU.STRIP.DST',
  141. '2012': 'B2XMUMU.STRIP.DST',
  142. '2015': 'B2XMUMU.STRIP.MDST',
  143. '2016': 'B2XMUMU.STRIP.MDST'
  144. },
  145. 'BtoXJpsi' : {'2011': 'ALLSTREAMS.DST',
  146. '2012': 'ALLSTREAMS.DST',
  147. '2016': 'ALLSTREAMS.DST'
  148. },
  149. 'B0toKstMuMu': {'2011': 'ALLSTREAMS.DST',
  150. '2012': 'ALLSTREAMS.DST',
  151. '2015': 'ALLSTREAMS.DST',
  152. '2016': 'ALLSTREAMS.DST'
  153. },
  154. 'B0toKstJpsi': {'2011': 'ALLSTREAMS.DST',
  155. '2012': 'ALLSTREAMS.DST',
  156. '2015': 'ALLSTREAMS.MDST',
  157. '2016': 'ALLSTREAMS.MDST'
  158. },
  159. 'BtoK1MuMu' : {'2011': 'ALLSTREAMS.DST',
  160. '2012': 'ALLSTREAMS.DST',
  161. },
  162. 'BtoK1Jpsi' : {'2012': 'ALLSTREAMS.DST'
  163. }
  164. }
  165. decay_DV_dict = { 'BtoKstMuMu' : {'2011': 'DaVinciDev_v38r1p3',
  166. '2012': 'DaVinciDev_v38r1p3',
  167. '2015': 'DaVinciDev_v41r2',
  168. '2016': 'DaVinciDev_v41r2',
  169. },
  170. 'BtoKstJpsi' : {'2011': 'DaVinciDev_v38r1p3',
  171. '2012': 'DaVinciDev_v38r1p3'
  172. },
  173. 'PHSP' : {'2011': 'DaVinciDev_v38r1p3',
  174. '2012': 'DaVinciDev_v38r1p3',
  175. '2015': 'DaVinciDev_v41r2',
  176. '2016': 'DaVinciDev_v41r2'
  177. },
  178. 'BtoXJpsi' : {'2011': 'DaVinciDev_v38r1p3',
  179. '2012': 'DaVinciDev_v38r1p3',
  180. '2016': 'DaVinciDev_v41r2'
  181. },
  182. 'B0toKstMuMu': {'2011': 'DaVinciDev_v38r1p3',
  183. '2012': 'DaVinciDev_v38r1p3',
  184. '2015': 'DaVinciDev_v41r2',
  185. '2016': 'DaVinciDev_v41r2'
  186. },
  187. 'B0toKstJpsi': {'2011': 'DaVinciDev_v38r1p3',
  188. '2012': 'DaVinciDev_v38r1p3',
  189. '2015': 'DaVinciDev_v41r2',
  190. '2016': 'DaVinciDev_v41r2'
  191. },
  192. 'BtoK1MuMu' : {'2011': 'DaVinciDev_v38r1p3',
  193. '2012': 'DaVinciDev_v38r1p3',
  194. },
  195. 'BtoK1Jpsi' : {'2012': 'DaVinciDev_v38r1p3'
  196. }
  197. }
  198. for channel in channel_list:
  199. for decay in decay_list:
  200. for year in decay_year_dict[decay]:
  201. for polarity in polarity_list:
  202. script_opts = { "DATA_TYPE":"MC",
  203. "CHAN": channel,
  204. "YEAR":year,
  205. "POL":polarity,
  206. "ENERGY":year_E_dict[year],
  207. "NU":year_nu_dict[year],
  208. "SIM": decay_simVer_dict[decay][year],
  209. "TRIG":year_trigg_dict[year],
  210. "STRIP":decay_strip_dict[decay][year],
  211. "NUM":decay_no_dict[decay][channel],
  212. "FILE":decay_file_dict[decay][year],
  213. "DEC":decay,
  214. "DV": decay_DV_dict[decay][year]
  215. }
  216. PATH = "/%(DATA_TYPE)s/%(YEAR)s/Beam%(ENERGY)s-%(YEAR)s-%(POL)s-Nu%(NU)s-Pythia8/%(SIM)s/%(TRIG)s/%(STRIP)s/%(NUM)s/%(FILE)s" % script_opts
  217. print PATH
  218. print '/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/%(DV)s/' % script_opts
  219. DV.directory = '/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/%(DV)s/' % script_opts
  220. opt_path ='/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/DaVinciDev_v41r2/tuplecreation/background_tests/optfiles/%(DEC)s/%(YEAR)s%(POL)s_%(CHAN)s.py'% script_opts
  221. # script_basic = '/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/DaVinciDev_v41r2/tuplecreation/optfiles/BasicOptfile.py'
  222. optsfile = [opt_path]
  223. DV.options = optsfile
  224. j = Job(
  225. name = 'MC%(DEC)s%(CHAN)s%(YEAR)s%(POL)s' % script_opts,
  226. application = DV,
  227. splitter = SplitByFiles(filesPerJob = 25,ignoremissing = False),
  228. inputdata = BKQuery(path=PATH).getDataset(),
  229. outputfiles = [DiracFile(namePattern='*.root')],
  230. do_auto_resubmit = True,
  231. backend = Dirac()
  232. )
  233. j.submit()