Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.48 KB | None | 0 0
  1. #Test your line(s) of the stripping
  2. #  
  3. # NOTE: Please make a copy of this file for your testing, and do NOT change this one!
  4. #
  5.  
  6. #CONFIGURED FOR Bs change to Magnet Down when using with ALPs
  7.  
  8. from Gaudi.Configuration import *
  9. from Configurables import DaVinci,ChargedPP2MC,ChargedProtoParticleMaker
  10. from StrippingConf.Configuration import StrippingConf
  11.  
  12. confname='Bs2GammaGamma'
  13.  
  14. from StrippingSelections import buildersConf
  15. confs = buildersConf()
  16. from StrippingSelections.Utils import lineBuilder, buildStreamsFromBuilder
  17.  
  18. streams = buildStreamsFromBuilder(confs,confname)
  19.  
  20. #clone lines for CommonParticles overhead-free timing
  21. print "Creating line clones for timing"
  22. for s in streams:
  23.     for l in s.lines:
  24.         if "_TIMING" not in l.name():
  25.             cloned = l.clone(l.name().strip("Stripping")+"_TIMING")
  26.             s.appendLines([cloned])
  27.  
  28. #define stream names
  29. leptonicMicroDSTname   = 'Leptonic'
  30. charmMicroDSTname      = 'Charm'
  31. pidMicroDSTname        = 'PID'
  32. bhadronMicroDSTname    = 'Bhadron'
  33. mdstStreams = [ leptonicMicroDSTname,charmMicroDSTname,pidMicroDSTname,bhadronMicroDSTname ]
  34. dstStreams  = [ "BhadronCompleteEvent", "CharmCompleteEvent", "Dimuon",
  35.                 "EW", "Semileptonic", "Calibration", "MiniBias", "Radiative" ]
  36.  
  37. stripTESPrefix = 'Strip'
  38.  
  39. from Configurables import ProcStatusCheck
  40.  
  41. sc = StrippingConf( Streams = streams,
  42.                     MaxCandidates = -1,
  43.                     AcceptBadEvents = False,
  44.                     BadEventSelection = ProcStatusCheck(),
  45.                     TESPrefix = stripTESPrefix,
  46.                     ActiveMDSTStream = True,
  47.                     Verbose = True,
  48.                     DSTStreams = dstStreams,
  49.                     MicroDSTStreams = mdstStreams )
  50.  
  51. #
  52. # Configure the dst writers for the output
  53. #
  54. enablePacking = True
  55. from DSTWriters.microdstelements import *
  56. from DSTWriters.Configuration import ( SelDSTWriter,
  57.                                        stripDSTStreamConf,
  58.                                        stripDSTElements,
  59.                                        stripMicroDSTStreamConf,
  60.                                        stripMicroDSTElements,
  61.                                        stripCalibMicroDSTStreamConf )
  62.  
  63. SelDSTWriterElements = {
  64.     'default' : stripDSTElements(pack=enablePacking)
  65.         }
  66.  
  67. SelDSTWriterConf = {
  68.     'default' : stripDSTStreamConf(pack=enablePacking,
  69.                                    selectiveRawEvent=False)
  70.         }
  71.  
  72. dstWriter = SelDSTWriter( "MyDSTWriter",
  73.                           StreamConf = SelDSTWriterConf,
  74.                           MicroDSTElements = SelDSTWriterElements,
  75.                           OutputFileSuffix ='Bs2ggStripping',
  76.                           SelectionSequences = sc.activeStreams()
  77.                           )
  78.  
  79. def chunks(l, n):
  80.     """Yield successive n-sized chunks from l."""
  81.     for i in xrange(0, len(l), n):
  82.         yield l[i:i + n]
  83.  
  84. DaVinci().HistogramFile = "DVHistos.root"
  85. DaVinci().ProductionType = "Stripping"
  86. DaVinci().Simulation = True
  87. DaVinci().EvtMax = -1                        # Number of events
  88. DaVinci().appendToMainSequence([sc.sequence()])
  89. DaVinci().appendToMainSequence([ dstWriter.sequence() ])
  90.  
  91. DaVinci().DataType = '2017'
  92. DaVinci().DDDBtag  = "dddb-20170721-3"
  93. DaVinci().CondDBtag = "sim-20180411-vc-m"+sys.argv[1]+"100"
  94.  
  95.  
  96. import GaudiPython
  97. from Gaudi.Configuration import *
  98. gaudi = GaudiPython.AppMgr()
  99. TES = gaudi.evtsvc()
  100. ToolSvc = gaudi.toolSvc()
  101. gaudi.run(-1)
  102. gaudi.stop()
  103. gaudi.finalize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement