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.

82 lines
2.9 KiB

  1. from Configurables import (
  2. DaVinci,
  3. EventSelector,
  4. PrintMCTree,
  5. MCDecayTreeTuple,
  6. TupleToolMCTruth
  7. )
  8. from DecayTreeTuple.Configuration import *
  9. """Configure the variables below with:
  10. decay: Decay you want to inspect, using 'newer' LoKi decay descriptor syntax,
  11. decay_heads: Particles you'd like to see the decay tree of,
  12. datafile: Where the file created by the Gauss generation phase is, and
  13. year: What year the MC is simulating.
  14. """
  15. # Select correct MC sample
  16. RefChan = False
  17. PHSP = True
  18. # https://twiki.cern.ch/twiki/bin/view/LHCb/FAQ/LoKiNewDecayFinders
  19. decay = "[B+ => ^(K*(892)+ => ^K+ ^(pi0=> ^gamma ^gamma)) ^mu- ^mu+]CC"
  20. if (RefChan): decay = "[B+ => ^(K*(892)+ => ^K+ ^(pi0=> ^gamma ^gamma)) ^(J/psi(1S) => ^mu- ^mu+)]CC"
  21. decay_heads = ["B+", "B-"]
  22. #Path to datafile
  23. datafile = "/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu/EvtGen/GaussDev_v49r12/MCTruth.sim"
  24. if (RefChan): datafile =datafile.replace(".sim","_RefChan.sim",1)
  25. if (PHSP): datafile =datafile.replace(".sim","_PHSP.sim",1)
  26. year = 2017
  27. # For a quick and dirty check, you don't need to edit anything below here.
  28. ##########################################################################
  29. # Create an MC DTT containing any candidates matching the decay descriptor
  30. mctuple = MCDecayTreeTuple("MCDecayTreeTuple")
  31. mctuple.Decay = decay
  32. # Name of the .xgen file produced by Gauss
  33. EventSelector().Input = ["DATAFILE='{0}' TYP='POOL_ROOTTREE' Opt='READ'".format(datafile)]
  34. # Configure DaVinci
  35. DaVinci().TupleFile =datafile.replace(".sim","_orig.root",1)
  36. DaVinci().HistogramFile = "DVntuple_histo.root"
  37. DaVinci().Simulation = True
  38. DaVinci().Lumi = False
  39. DaVinci().DataType = str(year)
  40. DaVinci().UserAlgorithms = [mctuple]
  41. def doIt():
  42. """
  43. specific post-config action for (x)GEN-files
  44. """
  45. extension = "xgen"
  46. ext = extension.upper()
  47. from Configurables import DataOnDemandSvc
  48. dod = DataOnDemandSvc ()
  49. from copy import deepcopy
  50. algs = deepcopy ( dod.AlgMap )
  51. bad = set()
  52. for key in algs :
  53. if 0 <= key.find ( 'Rec' ) : bad.add ( key )
  54. elif 0 <= key.find ( 'Raw' ) : bad.add ( key )
  55. elif 0 <= key.find ( 'DAQ' ) : bad.add ( key )
  56. elif 0 <= key.find ( 'Trigger' ) : bad.add ( key )
  57. elif 0 <= key.find ( 'Phys' ) : bad.add ( key )
  58. elif 0 <= key.find ( 'Prev/' ) : bad.add ( key )
  59. elif 0 <= key.find ( 'Next/' ) : bad.add ( key )
  60. elif 0 <= key.find ( '/MC/' ) and 'GEN' == ext : bad.add ( key )
  61. for b in bad :
  62. del algs[b]
  63. dod.AlgMap = algs
  64. from Configurables import EventClockSvc, CondDB
  65. EventClockSvc ( EventTimeDecoder = "FakeEventTime" )
  66. CondDB ( IgnoreHeartBeat = True )
  67. appendPostConfigAction( doIt )