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.

85 lines
3.1 KiB

  1. #!/usr/bin/env python
  2. ReferenceList = [{'string':"KstJpsi", 'bool': True},
  3. {'string':"KstMuMu", 'bool': False}]
  4. DataDict = {'name':"data",
  5. 'data':True,
  6. 'reference':[{'string':"", 'bool': False}],
  7. 'phsp': 'False',
  8. 'BkgStudy': 'False',
  9. 'stream': "Leptonic",
  10. 'line': "B2XMuMu_Line",
  11. 'channel': [{'string':"", 'boolKshort': 'True', 'boolKplus': 'True'}]
  12. }
  13. MCDict = {'name':"MC",
  14. 'data':False,
  15. 'reference':ReferenceList,
  16. 'phsp': 'False',
  17. 'BkgStudy': 'False',
  18. 'stream': "AllStreams",
  19. 'line': "B2XMuMu_Line",
  20. 'channel': [{'string':"_Kshort", 'boolKshort': 'True', 'boolKplus': 'False'},
  21. {'string':"_Kplus", 'boolKshort': 'False', 'boolKplus': 'True'}]
  22. }
  23. PHSPDict = {'name':"PHSP",
  24. 'data':False,
  25. 'reference':[{'string':"", 'bool': False}],
  26. 'phsp': 'True',
  27. 'BkgStudy': 'False',
  28. 'stream': "B2XMuMu.Strip",
  29. 'line': "B2XMuMu_Line",
  30. 'channel': [{'string':"_Kshort", 'boolKshort': 'True', 'boolKplus': 'False'},
  31. {'string':"_Kplus", 'boolKshort': 'False', 'boolKplus': 'True'}]
  32. }
  33. BkgDict = {'name':"MC",
  34. 'data':False,
  35. 'reference':[{'string':"BkgStudy", 'bool': False}],
  36. 'phsp': 'False',
  37. 'BkgStudy': 'True',
  38. 'stream': "AllStreams",
  39. 'line': "B2XMuMu_Line",
  40. 'channel': [{'string':"_Kplus", 'boolKshort': 'False', 'boolKplus': 'True'}]
  41. }
  42. DataTypeList = [DataDict,MCDict,PHSPDict,BkgDict]
  43. PolarityList = [{'string':"Down", 'bool': True},
  44. {'string':"Up", 'bool': False}]
  45. YearList = ['2011','2012','2015','2016','2017','2018']
  46. for Type in DataTypeList:
  47. for Year in YearList:
  48. for Polarity in PolarityList:
  49. for Ref in Type['reference']:
  50. for Channel in Type['channel']:
  51. ScriptName = "./optfiles/%s/%s/%s%s_%s%s.py" % (Type['name'],Ref['string'],Year, Polarity['string'],Type['name'],Channel['string'])
  52. f1 = open(ScriptName, 'w')
  53. f1.write( '############# Global settings\n' )
  54. f1.write( 'runFilters = False\n' )
  55. f1.write( 'reference = %s\n' % Ref['bool'] )
  56. f1.write( 'phsp = %s\n' % Type['phsp'] )
  57. f1.write( 'BkgStudy = %s\n' % Type['BkgStudy'] )
  58. f1.write( 'data = %s\n' % Type['data'] )
  59. f1.write( 'down = %s\n' % Polarity['bool'] )
  60. f1.write( 'year = "%s"\n'%Year )
  61. f1.write( 'stream = "%s"\n' % Type['stream'] )
  62. f1.write( 'line = "%s"\n\n'% Type['line'] )
  63. f1.write( '#subdecay chains\n' )
  64. f1.write( 'KShortPiPlus = %s\n' % Channel['boolKshort'] )
  65. f1.write( 'KplusPi0Merged = False\n') #% Channel['boolKplus'] )
  66. f1.write( 'KplusPi0Resolved = %s\n\n\n'% Channel['boolKplus'] )
  67. f = open('./optfiles/BasicOptfile.py')
  68. for line in f.readlines():
  69. f1.write(line)
  70. f.close()
  71. f1.close()