def configureMicroDSTwriter(name, prefix, sequences): # Configure the dst writers for the output pack = True microDSTwriterInput = MultiSelectionSequence(name, Sequences=sequences) # Configuration of MicroDST # per-event an per-line selective writing of the raw event is active (selectiveRawEvent=True) mdstStreamConf = stripMicroDSTStreamConf( pack=pack) #, selectiveRawEvent = False) mdstElements = stripMicroDSTElements(pack=pack) # Configuration of SelDSTWriter # per-event an per-line selective writing of the raw event is active (selectiveRawEvent=True) SelDSTWriterElements = {'default': mdstElements} SelDSTWriterConf = {'default': mdstStreamConf} # SelDSTWriterConf = {'default': stripCalibMicroDSTStreamConf(pack=pack, selectiveRawEvent=False)} dstWriter = SelDSTWriter("MyDSTWriter", StreamConf=SelDSTWriterConf, MicroDSTElements=SelDSTWriterElements, OutputFileSuffix=prefix, SelectionSequences=[microDSTwriterInput]) from Configurables import StoreExplorerAlg return [microDSTwriterInput.sequence(), dstWriter.sequence()]
SelDSTWriterConf = { 'default': stripDSTStreamConf(pack=enablePacking, selectiveRawEvent=True), charmMicroDSTname: mdstStreamConf, leptonicMicroDSTname: mdstStreamConf, bhadronMicroDSTname: mdstStreamConf, pidMicroDSTname: stripCalibMicroDSTStreamConf(pack=enablePacking, selectiveRawEvent=True) } dstWriter = SelDSTWriter("MyDSTWriter", StreamConf=SelDSTWriterConf, MicroDSTElements=SelDSTWriterElements, OutputFileSuffix='20151106', SelectionSequences=sc.activeStreams()) # # Add stripping TCK # #from Configurables import StrippingTCK #stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x36112100) # #Configure DaVinci # # Change the column size of Timing table from Configurables import TimingAuditor, SequencerTimerTool
sc = StrippingConf( Streams=[MyStream], MaxCandidates=2000, AcceptBadEvents=False, BadEventSelection=filterBadEvents, HDRLocation='NonexistingPlaceholder', ) # # Configuration of SelDSTWriter # SelDSTWriterElements = { 'default': stripDSTElements(), } SelDSTWriterConf = { 'default': stripDSTStreamConf(), } dstWriter = SelDSTWriter("MyDSTWriter", StreamConf=SelDSTWriterConf, OutputFileSuffix='TAGGING', SelectionSequences=sc.activeStreams()) # DaVinci Config DaVinci().appendToMainSequence([ sc.sequence(), dstWriter.sequence(), ])
'default': stripDSTStreamConf(pack=enablePacking, selectiveRawEvent=True), charmMicroDSTname: mdstStreamConf, leptonicMicroDSTname: mdstStreamConf, bhadronMicroDSTname: mdstStreamConf, pidMicroDSTname: stripCalibMicroDSTStreamConf(pack=enablePacking, selectiveRawEvent=True) } import os dstWriter = SelDSTWriter("MyDSTWriter", StreamConf=SelDSTWriterConf, MicroDSTElements=SelDSTWriterElements, OutputFileSuffix=os.environ['FIRST_FILE'], SelectionSequences=sc.activeStreams()) # # Get lines that needs MDST.DST and their required raw banks # mdstDstLines = [ line.name() for line in sc.activeLines(mdstStreams) if (line.MDSTFlag and line.prescale() > 0) ] mdstDstRawEvts = {} for stream in sc.activeStreams(): if stream.name() in mdstStreams: mdstDstRawEvts.update(stream.getRequiredRawEvents()) # Locations to veto from MDST.DST
SelJpsi = Selection('SelJpsi_'+name, Algorithm = filter, RequiredSelections = [ MyLooseJpsi ]) printer = PrintDecayTree("Print_"+name, Inputs = [SelJpsi.outputLocation()]) SeqJpsi = SelectionSequence('SeqJpsi_'+name , TopSelection = SelJpsi , EventPreSelector = [ prescale ] , PostSelectionAlgs = [ printer ]) selections += [SeqJpsi] dstWriter = SelDSTWriter("JpsiDSTWriter_"+name, SelectionSequences = selections) dstWriter.MicroDSTElements['default'] += [CloneParticleMCInfo()] seq = dstWriter.sequence() DaVinci().UserAlgorithms = [ seq ] ############################################################################## DaVinci().EvtMax = 100 DaVinci().PrintFreq = 100 # DaVinci().SkipEvents = 0 DaVinci().DataType = "2010" DaVinci().Simulation = True ######################################################################## MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"
# ============================================================================= ## micro-DST writer # ============================================================================= from DSTWriters.Configuration import ( SelDSTWriter , stripMicroDSTStreamConf , stripMicroDSTElements ) # Configuration of SelDSTWriter SelDSTWriterConf = { 'default' : stripMicroDSTStreamConf ( pack = False ) } SelDSTWriterElements = { 'default' : stripMicroDSTElements ( pack = False , refit = True ) } uDstWriter = SelDSTWriter( "MyDSTWriter" , StreamConf = SelDSTWriterConf , MicroDSTElements = SelDSTWriterElements , OutputFileSuffix = 'BandQ' , ## output PRE-fix! SelectionSequences = [ psi_x0 , ] ) # ## Read only fired events to speed up # from PhysConf.Filters import LoKi_Filters fltrs = LoKi_Filters ( STRIP_Code = """ HLT_PASS_RE ( 'Stripping.*DiMuonJpsi2MuMuDetached.*' ) | HLT_PASS_RE ( 'Stripping.*DiMuonPsi2MuMuDetached.*' ) | HLT_PASS_RE ( 'Stripping.*DiMuonDiMuonHighMass.*' ) """