def SetPrescale(self,value): #Set a master prescale to given value. Create the Prescaler tool if necessary. if not hasattr(self,"_Prescaler"): from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler prescalerName="MasterPrescale_"+self.Name self._Prescaler = PrimaryDPDPrescaler(prescalerName) #Deep copies of the Require and Accept algs lists considered by the Master prescaler #Notes: # 1) deep copy is necessary because the Master prescaler itself will be added to the RequireAlgs list\ # 2) this implies that SetPrescale must be the *last* algorithm added to the stream self._Prescaler.RequireAlgs = self.Stream.RequireAlgs[:] self._Prescaler.AcceptAlgs = self.Stream.AcceptAlgs[:] from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += self._Prescaler self.AddRequireAlgs(prescalerName) self._Prescaler.Prescale=value return
algsToBookkeep.append(filterName) finalFilterNames.append(filterName) pass #==================================================================== # Create a subsequence: Only when the first algorithm returns isEventAccepted, the rest is executed #==================================================================== from AthenaCommon.AlgSequence import AthSequencer thinSeqHighMassDiJetStream = AthSequencer("HighMassDiJetStreamThinningSeq") topSequence += thinSeqHighMassDiJetStream # Create the combined decission. # The rest of the thinSeqHighMassDiJetStream will only be executed if this first algorithm accepts the event from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler thinSeqHighMassDiJetStream += PrimaryDPDPrescaler( "StreamHighMassDiJet_AcceptEvent", AcceptAlgs=finalFilterNames, # Logical OR of all fitlers Prescale=1) if D2PDFlags.WriteDAODM_HighMDiJetStream.ApplyThinning: # Apply the trigger navigation slimming include("PrimaryDPDMaker/SetupTrigDecisionTool.py") from TrigNavTools.TrigNavToolsConfig import HLTStreamTrigNavSlimming thinSeqHighMassDiJetStream += HLTStreamTrigNavSlimming( "StreamHighMassDiJet_HLTStreamTrigNavSlimming") thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.OutputLevel = INFO thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.ThinningSvc = 'ThinningSvc/HighMassDiJetStreamThinning' thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.PrintTree = 0 thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.ProtectOtherStreams = 1 thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.Squeeze = 1 thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.RemoveFeatureless = 1 thinSeqHighMassDiJetStream.StreamHighMassDiJet_HLTStreamTrigNavSlimming.RemoveGhosts = 1
##Creation: David Cote, September 2010 ##This file defines the RNDM stream, which simply select 1/100 of events ## Include the job property flags for this package and from RecExCommon from D2PDMaker.D2PDFlags import D2PDFlags ## This handels multiple output streams from OutputStreamAthenaPool.MultipleStreamManager import MSMgr #==================================================================== # Define the event selection #==================================================================== from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler topSequence += PrimaryDPDPrescaler("DAOD_RNDM_Filter", Prescale=100) #==================================================================== # Define the test DPD output stream #==================================================================== from D2PDMaker.D2PDHelpers import buildFileName # This stream HAS TO start with "StreamD2AODM_"! If the input was an (D)ESD(M), this should start with "StreamD2ESD(M)_". # See this twiki for more information: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/DPDNamingConvention fileName = buildFileName(D2PDFlags.WriteDAOD_RNDMStream) streamName = D2PDFlags.WriteDAOD_RNDMStream.StreamName RNDMStream = MSMgr.NewPoolStream(streamName, fileName) # Only events that pass the filters listed below are written out # AcceptAlgs = logical OR of filters # RequireAlgs = logical AND of filters RNDMStream.AcceptAlgs(["DAOD_RNDM_Filter"]) #---------------------------------------------------
#ByteStreamInputSvc.DumpFlag = True #ByteStreamInputSvc.SkipNeventBeforeNext=10 from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() # AthenaOutputStream Name OutStreamName = "OutputStreamBSCopy" # make a prescale algorithm #from PrimaryDPDMaker.PrescaleFilter import PrescaleFilter from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler Prescaler = PrimaryDPDPrescaler(OutStreamName + "_Prescaler", Prescale=2) topSequence += Prescaler # BS OutputStream Tool from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageOutputSvc, ByteStreamOutputStreamCopyTool bsCopyTool = ByteStreamOutputStreamCopyTool("OutputStreamBSCopyTool") svcMgr.ToolSvc += bsCopyTool # BS output Svc from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageOutputSvc bsOutputSvc = ByteStreamEventStorageOutputSvc( "BSESOutputSvc", OutputDirectory=".", SimpleFileName="PrescaledEvents.data")
segmentFilter.maxNumberSegments = flags.cutNsegMax segmentFilter.muonSegmentContainer = flags.muonSegmentCollectionName topSequence += segmentFilter if primRPVLLDESDM.Stopped_muonSegmentFilterFlags.addPrescaledLooseFilter: looseMuSegFilterName = "Stopped_looseMuSegFilter" looseMuSegFilter = MuonSegmentFilterAlg(looseMuSegFilterName) looseMuSegFilter.maxNumberSegments = flags.cutNsegMaxLoose looseMuSegFilter.minNumberSegments = flags.cutNsegMinLoose looseMuSegFilter.muonSegmentContainer = flags.muonSegmentCollectionName topSequence += looseMuSegFilter from PrimaryDPDMaker.PrimaryDPDMakerConf import PrimaryDPDPrescaler prescaledMuSegFilterName = "Stopped_prescaledMuSegFilter" topSequence += PrimaryDPDPrescaler( prescaledMuSegFilterName, Prescale=flags.prescaleFactorForLooseFilter, AcceptAlgs=[looseMuSegFilterName]) ########### combine the offline filters combinedOfflineFilterName = "Stopped_CombinedOfflineFilter" topSequence += LogicalFilterCombiner(combinedOfflineFilterName) cmdstring = jetFilterName + " and " + segFilterName if primRPVLLDESDM.Stopped_muonSegmentFilterFlags.addPrescaledLooseFilter: cmdstring = jetFilterName + " and (" + segFilterName + " or " + prescaledMuSegFilterName + ")" print('Josh\'s Stopped_CombinedOfflineFilter: %s' % cmdstring) topSequence.Stopped_CombinedOfflineFilter.cmdstring = cmdstring filtersToBookkeep += ["Stopped_CombinedOfflineFilter"]