Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Test your line(s) of the stripping
- #
- # NOTE: Please make a copy of this file for your testing, and do NOT change this one!
- #
- #CONFIGURED FOR Bs change to Magnet Down when using with ALPs
- from Gaudi.Configuration import *
- from Configurables import DaVinci,ChargedPP2MC,ChargedProtoParticleMaker
- from StrippingConf.Configuration import StrippingConf
- confname='Bs2GammaGamma'
- from StrippingSelections import buildersConf
- confs = buildersConf()
- from StrippingSelections.Utils import lineBuilder, buildStreamsFromBuilder
- streams = buildStreamsFromBuilder(confs,confname)
- #clone lines for CommonParticles overhead-free timing
- print "Creating line clones for timing"
- for s in streams:
- for l in s.lines:
- if "_TIMING" not in l.name():
- cloned = l.clone(l.name().strip("Stripping")+"_TIMING")
- s.appendLines([cloned])
- #define stream names
- leptonicMicroDSTname = 'Leptonic'
- charmMicroDSTname = 'Charm'
- pidMicroDSTname = 'PID'
- bhadronMicroDSTname = 'Bhadron'
- mdstStreams = [ leptonicMicroDSTname,charmMicroDSTname,pidMicroDSTname,bhadronMicroDSTname ]
- dstStreams = [ "BhadronCompleteEvent", "CharmCompleteEvent", "Dimuon",
- "EW", "Semileptonic", "Calibration", "MiniBias", "Radiative" ]
- stripTESPrefix = 'Strip'
- from Configurables import ProcStatusCheck
- sc = StrippingConf( Streams = streams,
- MaxCandidates = -1,
- AcceptBadEvents = False,
- BadEventSelection = ProcStatusCheck(),
- TESPrefix = stripTESPrefix,
- ActiveMDSTStream = True,
- Verbose = True,
- DSTStreams = dstStreams,
- MicroDSTStreams = mdstStreams )
- #
- # Configure the dst writers for the output
- #
- enablePacking = True
- from DSTWriters.microdstelements import *
- from DSTWriters.Configuration import ( SelDSTWriter,
- stripDSTStreamConf,
- stripDSTElements,
- stripMicroDSTStreamConf,
- stripMicroDSTElements,
- stripCalibMicroDSTStreamConf )
- SelDSTWriterElements = {
- 'default' : stripDSTElements(pack=enablePacking)
- }
- SelDSTWriterConf = {
- 'default' : stripDSTStreamConf(pack=enablePacking,
- selectiveRawEvent=False)
- }
- dstWriter = SelDSTWriter( "MyDSTWriter",
- StreamConf = SelDSTWriterConf,
- MicroDSTElements = SelDSTWriterElements,
- OutputFileSuffix ='Bs2ggStripping',
- SelectionSequences = sc.activeStreams()
- )
- def chunks(l, n):
- """Yield successive n-sized chunks from l."""
- for i in xrange(0, len(l), n):
- yield l[i:i + n]
- DaVinci().HistogramFile = "DVHistos.root"
- DaVinci().ProductionType = "Stripping"
- DaVinci().Simulation = True
- DaVinci().EvtMax = -1 # Number of events
- DaVinci().appendToMainSequence([sc.sequence()])
- DaVinci().appendToMainSequence([ dstWriter.sequence() ])
- DaVinci().DataType = '2017'
- DaVinci().DDDBtag = "dddb-20170721-3"
- DaVinci().CondDBtag = "sim-20180411-vc-m"+sys.argv[1]+"100"
- import GaudiPython
- from Gaudi.Configuration import *
- gaudi = GaudiPython.AppMgr()
- TES = gaudi.evtsvc()
- ToolSvc = gaudi.toolSvc()
- gaudi.run(-1)
- gaudi.stop()
- gaudi.finalize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement