コード例 #1
0
    "DRAW_BCID1Kernel", SkimmingTools=[bcidFilterTool])
topSequence += DRAW_BCID1_Seq

##################
### Output stream
##################
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDRAW_BCID1.StreamName
fileName = buildFileName(primDPD.WriteDRAW_BCID1)
# Remove the .pool.root ending in the file name, this is a RAW file!
if fileName.endswith(".pool.root"):
    fileName = fileName.rstrip(".pool.root")
    pass
StreamDRAW_BCID1 = MSMgr.NewByteStream(streamName, fileName)
StreamDRAW_BCID1.AddRequireAlgs(["DRAW_BCID1Kernel"])

# Don't write an output RAW file if it is empty
StreamDRAW_BCID1.bsOutputSvc.WriteEventlessFiles = primDPD.WriteEventlessFiles(
)

#########################################
# Add the containers to the output stream
#########################################
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput

# Take everything from the input
ExcludeList = []
dpdOutput.addAllItemsFromInputExceptExcludeList(streamName, ExcludeList)
コード例 #2
0
    SkimmingTools=[DRAW_TAUMUH_SkimmingTool])
topSequence += DRAW_TAUMUH_Seq

##################
### Output stream
##################
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDRAW_TAUMUH.StreamName
fileName = buildFileName(primDPD.WriteDRAW_TAUMUH)
# Remove the .pool.root ending in the file name, this is a RAW file!
if fileName.endswith(".pool.root"):
    fileName = fileName.rstrip(".pool.root")
    pass
StreamDRAW_TAUMUH = MSMgr.NewByteStream(streamName, fileName)
StreamDRAW_TAUMUH.AddRequireAlgs(["DRAW_TAUMUHKernel"])

# Don't write an output RAW file if it is empty
StreamDRAW_TAUMUH.bsOutputSvc.WriteEventlessFiles = primDPD.WriteEventlessFiles(
)

#########################################
# Add the containers to the output stream
#########################################
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput

# Take everything from the input
ExcludeList = []
dpdOutput.addAllItemsFromInputExceptExcludeList(streamName, ExcludeList)
コード例 #3
0
    # jetrec_trimm.JetModifiers += [charge]
    # jetrec_trimm.JetModifiers += [subjetmaker]
    # jetrec_trimm.JetModifiers += [subjetfinder]
    ToolSvc += jetrec_trimm

    # Add the algorithm. It runs the demo tools.
    jetalg = JetAlgorithm("JetAlgTruth")

    # jetalg.OutputLevel = INFO
    jetalg.Tools += [copytruth, jetrec, jetrec_trimm]
    topSequence += jetalg

###end jet stuff

from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
xaodStream = MSMgr.NewPoolRootStream("StreamAOD",
                                     "XAOD_" + Name + ".pool.root")
# xaodStream.Stream.TakeItemsFromInput = True #this will only work for the event-by-event items. MetadataItems must still be specified
xaodStream.AddItem("xAOD::EventInfo#*")
xaodStream.AddItem("xAOD::EventAuxInfo#*")
xaodStream.AddItem("xAOD::EventShape#*")
xaodStream.AddItem("xAOD::EventShapeAuxInfo#*")
xaodStream.AddItem("xAOD::VertexContainer#*")
xaodStream.AddItem("xAOD::VertexAuxContainer#*")
# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClusters")
# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersAux.")
# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClustersCombined")
# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersCombinedAux.")
# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClustersAll")
# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersAllAux.")
# xaodStream.AddItem( "xAOD::TrackCaloClusterContainer#TrackCaloClustersAllTrack")
# xaodStream.AddItem( "xAOD::TrackCaloClusterAuxContainer#TrackCaloClustersAllTrackAux.")
コード例 #4
0
        RDOFilePeeker(runArgs, ftkLog)  # not sure what it does
        # enable the detector flag
        from AthenaCommon.DetFlags import DetFlags
        DetFlags.all_setOn()
        DetFlags.ALFA_setOff()
        DetFlags.ZDC_setOff()
        # other services
        from AthenaCommon.AppMgr import ServiceMgr
        from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc
        ServiceMgr += AthenaPoolCnvSvc()
        import AthenaPoolCnvSvc.ReadAthenaPool
        ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput(
        )
        # Add the FTK collections to the RDO
        from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
        StreamRDO = AthenaPoolOutputStream("StreamRDO",
                                           runArgs.outputRDO_FTKFile)
        #StreamRDO.TakeItemsFromInput=True
        StreamRDO.ForceRead = TRUE
        StreamRDO.ItemList += ["FTK_RawTrackContainer#*"]
    else:
        # generate RDO file from scratch, this represents an RDO
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        StreamRDO = MSMgr.NewPoolStream("StreamRDO", runArgs.outputRDO_FTKFile)
        StreamRDO.AddItem(["FTK_RawTrackContainer#*"])
        StreamRDO.AddItem(["TrigInDetTrackCollection#*"])
else:
    ftkLog.error('No output file for merge given')
    raise RuntimeError, 'No output file for merge given'
alg += FTKMerger
コード例 #5
0
                                        OutputLevel=DEBUG,
                                        EventInfoName="MyEvent",
                                        dataROOTFileName=localDataFile,
                                        dataROOTHistName="intperbx",
                                        mcROOTFileName=localMCFile,
                                        mcROOTHistName="mu_mc10a")
    pass

# ====================================================================
# Define the test DPD output stream
# ====================================================================
# 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 = "DAOD_WithPileupWeight.pool.root"
streamName = "DAOD_TEST"
PielupStream = 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
#PileupStream.AcceptAlgs( [""] )

# ---------------------------------------------------
# Add the containers to the output stream
# ---------------------------------------------------
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput

# Take all items from the input, except for the ones listed in the excludeList
# If the excludeList is empty, all containers from the input file (e.g. AOD)
# are copied to the output file.
excludeList = ["TrigMuonEFContainer#HLT_MuonEF"]
コード例 #6
0
D3PDMakerFlags.TruthWriteHadrons = True

# add specific truth jets
include("PhysicsD3PDMaker/MyJetMake.py")

#configure MuonScatteringAngleSignificanceTool
include("JetTagD3PDMaker/MuonScatteringSigToolConfig.py")

### Jason
include("BTagging/BTagging_LoadTools.py")
include("BTagging/BTagging_jobOptions.py")

# Create the D3PD streams:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr

SMWZSOFTD3PDStream = MSMgr.NewRootStream(streamName, fileName, "physics")

# Now add all the content to this stream:
from PhysicsD3PDMaker.SMWZD3PD import SMWZD3PD
if not 'SMWZsoftD3PD_args' in globals():
    SMWZsoftD3PD_args = {}
SMWZD3PD(SMWZSOFTD3PDStream, doSoftQCD=False, **SMWZsoftD3PD_args)

# Silence tool warnings:
from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc, "TrigDecisionTool"):
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
    pass
ToolSvc.TrigDecisionTool.Navigation.OutputLevel = ERROR
コード例 #7
0
def SMWZLightD3PD (alg                  = None,
                   file                 = 'smlight.root',
                   tuplename            = 'physics',
                   streamname           = 'd3pdstream',
                   stdElectronContainer = 'None',
                   gsfElectronContainer = 'None',
                   stacoMuonContainer   = 'None',
                   muidMuonContainer    = 'None',
                   photonContainer      = 'None',
                   jetContainer         = 'None',
                   clusterContainer     = 'None',
                   tauContainer         = 'None',
                   trackContainer       = 'None',
                   **kw):


    preseq = AlgSequence (D3PDMakerFlags.PreD3PDAlgSeqName())

    # perform recoil calculation

    import HadronicRecoil.Configurables as hrc
    preseq = hrc.add_hadronic_recoil_filters(preseq)


    # configure the D3PD
    
    if not alg:
        alg = MSMgr.NewRootStream(StreamName = streamname, FileName = file, TreeName = tuplename)
        
    
    alg += EventInfoD3PDObject        (**_args (10, 'EventInfo', kw))
    alg += LArCollisionTimeD3PDObject (**_args (10, 'LArCollisionTime', kw))

    from TriggerD3PDMaker.BunchStructureMetadata import addBunchStructureMetadata
    addBunchStructureMetadata (alg)

    
    # Electron/Photon blocks
    
    if stdElectronContainer != 'None':
        alg += ElectronD3PDObject         (**_args (10, 'Electron', kw,
                                                    sgkey = stdElectronContainer,
                                                    prefix = 'el_',
                                                    exclude = ['EMTrackFit','EMTrackFitDetailsBrem',
                                                               'EMTrackFitDetailsRefit',
                                                               'EMTrackFitDetailsRefitCov'],
                                                    allowMissing = True ))

    if (gsfElectronContainer != 'None') and testSGKey ('ElectronContainer', gsfElectronContainer):
        alg += GSFElectronD3PDObject  (**_args (1, 'GSFElectron', kw,
                                                sgkey = gsfElectronContainer,
                                                prefix = 'el_gsf_',
                                                exclude = ['EMTrackFit','EMTrackFitDetailsBrem',
                                                           'EMTrackFitDetailsRefit',
                                                           'EMTrackFitDetailsRefitCov'],
                                                allowMissing = True ))

    D3PDMakerFlags.DoPAU = False
    if photonContainer != 'None':
        alg += PhotonD3PDObject           (**_args (10, 'Photon', kw,
                                                    sgkey = photonContainer,
                                                    prefix = 'ph_',
                                                    exclude = ['OQRecalc'],
                                                    allowMissing = True ))

    
    # Muon blocks

    # ... add the scattering significance filler - to be removed when added in the MuonD3PDMaker
    if not MuonD3PDObject.allBlocknames().has_key("MuonScatteringAngleSignificance"):
        from AthenaCommon.AppMgr import ToolSvc
        muonScatteringSigTool=None
        if hasattr(ToolSvc, "MuonScatteringSigTool"):
            muonScatteringSigTool=ToolSvc.MuonScatteringSigTool
        from JetTagD3PDMaker import MuonScatteringAngleSignificanceFillerTool
        MuonD3PDObject.defineBlock (100, "MuonScatteringAngleSignificance",
                                    MuonScatteringAngleSignificanceFillerTool,
                                    ScatteringSigTool=muonScatteringSigTool)
        
    if stacoMuonContainer != 'None':
        alg += MuonD3PDObject             (**_args (10, 'StacoMuon', kw,
                                                    sgkey=stacoMuonContainer,
                                                    prefix='mu_staco_',
                                                    include = ['EFCBInfoIndex', 'EFMGInfoIndex', 'EFMEInfoIndex',
                                                               'MuonScatteringAngleSignificance'],
                                                    exclude = ['EFCBInfo', 'EFMGInfo', 'EFMEInfo',
                                                               'L2CBInfo', 'L1Info',
                                                               'MuonTimingFillerTool'],
                                                    allowMissing = True ))
    
    if muidMuonContainer != 'None':
        alg += MuonD3PDObject             (**_args (10, 'MuidMuon', kw,
                                                    sgkey=muidMuonContainer,
                                                    prefix='mu_muid_',
                                                    include = ['EFCBInfoIndex', 'EFMGInfoIndex', 'EFMEInfoIndex',
                                                               'MuonScatteringAngleSignificance'],
                                                    exclude = ['EFCBInfo', 'EFMGInfo', 'EFMEInfo',
                                                               'L2CBInfo', 'L1Info',
                                                               'MuonTimingFillerTool'],
                                                    allowMissing = True ))
    
    # Jet block
    
    from JetTagD3PDMaker.JetTagD3PDMakerFlags import JetTagD3PDFlags
    from JetTagD3PDMaker.JetTagD3PDMakerKeys import JetTagD3PDKeys
    
    if jetContainer != 'None':
        alg += JetD3PDObject              (**_args ( 3, 'AK4TopoEMJet', kw,
                                                     sgkey=jetContainer,
                                                     allowMissing=True,
                                                     prefix='jet_AntiKt4TopoEM_',
                                                     JetVertexFraction_FromUD=True,
                                                     JetVertexFraction_FillFullJVF=True,
                                                     include = [ JetTagD3PDKeys.BTagWeightsBlockName(),
                                                                 JetTagD3PDKeys.TruthInfoBlockName() ] ))


    # Tau block

    if tauContainer != 'None':
        alg += TauD3PDObject              (**_args ( 0, 'Tau', kw,
                                                     allowMissing=True,
                                                     sgkey=tauContainer ))

    
    # HF overlap removal (ALPGEN)

    from TopInputsD3PDMaker.HforD3PDObject import HforD3PDObject
    alg += HforD3PDObject(**_args (0, 'HforInfo', kw))


    # MET blocks
    # a whole mess to remove x,y components separately for all flavours

    alg += MissingETD3PDObject   (**_args (10, 'MissingET', kw,
                                           exclude=['MET_Base','MET_Base0','MET_Truth',
                                                    'MET_RefFinal_Comps','MET_RefFinal_Regions',
                                                    'MET_LocHadTopo_Comps','MET_LocHadTopo_Regions',
                                                    'MET_CellOut_Comps','MET_CellOut_Regions',
                                                    'MET_Calib',
                                                    'MET_CorrTopo',
                                                    'MET_Cryo',
                                                    'MET_CryoCone',
                                                    'MET_Final',
                                                    'MET_LocHadTopoObj',
                                                    'MET_Muid',
                                                    'MET_Muid_Spectro',
                                                    'MET_Muid_Track',
                                                    'MET_MuonBoy',
                                                    'MET_MuonBoy_Spectro',
                                                    'MET_MuonBoy_Track',
                                                    'MET_MuonMuid',
                                                    'MET_Muon',
                                                    'MET_Muon_Isol_Muid',
                                                    'MET_Muon_Isol_Staco',
                                                    'MET_Muon_NonIsol_Muid',
                                                    'MET_Muon_NonIsol_Staco',
                                                    'MET_Muon_Total_Muid',
                                                    'MET_Muon_Total_Staco',
                                                    'MET_RefEle_Comps','MET_RefEle_Regions',
                                                    'MET_RefEle_em_Comps','MET_RefEle_em_Regions',
                                                    'MET_RefGamma_Comps','MET_RefGamma_Regions',
                                                    'MET_RefGamma_em_Comps','MET_RefGamma_em_Regions',
                                                    'MET_RefJet_Comps','MET_RefJet_Regions',
                                                    'MET_RefJet_em_Comps','MET_RefJet_em_Regions',
                                                    'MET_RefMuon_Comps','MET_RefMuon_Regions',
                                                    'MET_RefMuon_Muid_Comps','MET_RefMuon_Muid_Regions',
                                                    'MET_RefMuon_Staco_Comps','MET_RefMuon_Staco_Regions',
                                                    'MET_RefMuon_Track_Muid_Comps','MET_RefMuon_Track_Muid_Regions',
                                                    'MET_RefMuon_Track_Staco_Comps','MET_RefMuon_Track_Staco_Regions',
                                                    'MET_RefMuon_Track_em_Comps','MET_RefMuon_Track_em_Regions',
                                                    'MET_RefMuon_Track_Comps','MET_RefMuon_Track_Regions',
                                                    'MET_RefMuon_em_Comps','MET_RefMuon_em_Regions',
                                                    'MET_RefTau_Comps','MET_RefTau_Regions',
                                                    'MET_RefTau_em_Comps','MET_RefTau_em_Regions',
                                                    'MET_SoftJets_Comps','MET_SoftJets_Regions',
                                                    'MET_SoftJets_em_Comps','MET_SoftJets_em_Regions',
                                                    'MET_Topo',
                                                    'MET_TopoObj_Comps','MET_TopoObj_Regions',
                                                    'MET_Track_Comps','MET_Track_Regions',
                                                    'MET_Comps',
                                                    'MET_Track_Weights','MET_Cluster_Weights',
                                                    'MET_Regions','MET_Composition'],
                                           allowMissing=True ))


    # HadronicRecoil blocks

    alg += ElectronD3PDObject(0,  sgkey = 'HR_selectedElectrons', prefix = 'hr_el_',allowMissing=True )
    alg += MuonD3PDObject( 0,     sgkey = 'HR_selectedMuons',     prefix = 'hr_mu_', allowMissing=True )

    # ... DR = 0.15
 
    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_15',                prefix = 'hr_roughRecoil_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_15',               prefix = 'hr_ueCorrection_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_15',              prefix = 'hr_corrRecoil_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_15',                     prefix = 'hr_MET_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
 
    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_Eflow_15',          prefix = 'hr_roughRecoil_Eflow_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_Eflow_15',         prefix = 'hr_ueCorrection_Eflow_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_Eflow_15',        prefix = 'hr_corrRecoil_Eflow_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_Eflow_15',               prefix = 'hr_MET_Eflow_15',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True ) 

    alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_track_15",          prefix = "hr_roughRecoil_track_15",
                                exclude=['MET_Regions','MET_Comps'] )
    alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_track_15",         prefix = "hr_ueCorrection_track_15",
                                exclude=['MET_Regions','MET_Comps'] )
    alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_track_15",        prefix = "hr_corrRecoil_track_15",
                                exclude=['MET_Regions','MET_Comps'] )
    alg += MissingETD3PDObject( 0, sgkey = "MET_HR_track_15",               prefix = "hr_MET_track_15",
                                exclude=['MET_Regions','MET_Comps'] ) 

    # ... DR = 0.20

    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_20',                prefix = 'hr_roughRecoil_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_20',               prefix = 'hr_ueCorrection_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_20',              prefix = 'hr_corrRecoil_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_20',                     prefix = 'hr_MET_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
 
    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_track_20',          prefix = 'hr_roughRecoil_track_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_track_20',         prefix = 'hr_ueCorrection_track_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_track_20',        prefix = 'hr_corrRecoil_track_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_track_20',               prefix = 'hr_MET_track_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )    

    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_clusNoTrack_20',    prefix = 'hr_roughRecoil_clusNoTrack_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_clusNoTrack_20',   prefix = 'hr_ueCorrection_clusNoTrack_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_clusNoTrack_20',  prefix = 'hr_corrRecoil_clusNoTrack_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_clusNoTrack_20',         prefix = 'hr_MET_clusNoTrack_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )  

    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_Eflow_20',          prefix = 'hr_roughRecoil_Eflow_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_Eflow_20',         prefix = 'hr_ueCorrection_Eflow_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_Eflow_20',        prefix = 'hr_corrRecoil_Eflow_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_Eflow_20',               prefix = 'hr_MET_Eflow_20',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )

    # ... DR = 0.25

    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_25',                prefix = 'hr_roughRecoil_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_25',               prefix = 'hr_ueCorrection_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_25',              prefix = 'hr_corrRecoil_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_25',                     prefix = 'hr_MET_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )

    alg += MissingETD3PDObject( 0, sgkey = 'RoughRecoil_Eflow_25',          prefix = 'hr_roughRecoil_Eflow_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'ueCorrection_Eflow_25',         prefix = 'hr_ueCorrection_Eflow_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'RefinedRecoil_Eflow_25',        prefix = 'hr_corrRecoil_Eflow_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
    alg += MissingETD3PDObject( 0, sgkey = 'MET_HR_Eflow_25',               prefix = 'hr_MET_Eflow_25',
                                exclude=['MET_Regions','MET_Comps'],
                                allowMissing=True )
 
    alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_track_25",          prefix = "hr_roughRecoil_track_25",
                                exclude=['MET_Regions','MET_Comps'] )
    alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_track_25",         prefix = "hr_ueCorrection_track_25",
                                exclude=['MET_Regions','MET_Comps'] )
    alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_track_25",        prefix = "hr_corrRecoil_track_25",
                                exclude=['MET_Regions','MET_Comps'] )
    alg += MissingETD3PDObject( 0, sgkey = "MET_HR_track_25",               prefix = "hr_MET_track_25",
                                exclude=['MET_Regions','MET_Comps'] )


    # HR using truth leptons
    if rec.doTruth():
        
        ## ... DR = 0.15               
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_15",
                                    prefix = "hr_roughRecoil_trLep_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_15",
                                    prefix = "hr_ueCorrection_trLep_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_15",
                                    prefix = "hr_corrRecoil_trLep_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_15",
                                    prefix = "hr_MET_trLep_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_Eflow_15",
                                    prefix = "hr_roughRecoil_trLep_Eflow_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_Eflow_15",
                                    prefix = "hr_ueCorrection_trLep_Eflow_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_Eflow_15",
                                    prefix = "hr_corrRecoil_trLep_Eflow_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_Eflow_15",
                                    prefix = "hr_MET_trLep_Eflow_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_track_15",
                                    prefix = "hr_roughRecoil_trLep_track_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_track_15",
                                    prefix = "hr_ueCorrection_trLep_track_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_track_15",
                                    prefix = "hr_corrRecoil_trLep_track_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_track_15",
                                    prefix = "hr_MET_trLep_track_15",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        ## ... DR = 0.20
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_20",
                                    prefix = "hr_roughRecoil_trLep_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_20",
                                    prefix = "hr_ueCorrection_trLep_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_20",
                                    prefix = "hr_corrRecoil_trLep_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_20",
                                    prefix = "hr_MET_trLep_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_Eflow_20",
                                    prefix = "hr_roughRecoil_trLep_Eflow_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_Eflow_20",
                                    prefix = "hr_ueCorrection_trLep_Eflow_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_Eflow_20",
                                    prefix = "hr_corrRecoil_trLep_Eflow_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_Eflow_20",
                                    prefix = "hr_MET_trLep_Eflow_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_track_20",
                                    prefix = "hr_roughRecoil_trLep_track_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_track_20",
                                    prefix = "hr_ueCorrection_trLep_track_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_track_20",
                                    prefix = "hr_corrRecoil_trLep_track_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_track_20",
                                    prefix = "hr_MET_trLep_track_20",
                                    exclude=['MET_Regions','MET_Comps'] )
        
         ## ... DR = 0.25
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_25",
                                    prefix = "hr_roughRecoil_trLep_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_25",
                                    prefix = "hr_ueCorrection_trLep_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_25",
                                    prefix = "hr_corrRecoil_trLep_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_25",
                                    prefix = "hr_MET_trLep_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_Eflow_25",
                                    prefix = "hr_roughRecoil_trLep_Eflow_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_Eflow_25",
                                    prefix = "hr_ueCorrection_trLep_Eflow_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_Eflow_25",
                                    prefix = "hr_corrRecoil_trLep_Eflow_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_Eflow_25",
                                    prefix = "hr_MET_trLep_Eflow_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        
        alg += MissingETD3PDObject( 0, sgkey = "RoughRecoil_TruthLep_track_25",
                                    prefix = "hr_roughRecoil_trLep_track_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "ueCorrection_TruthLep_track_25",
                                    prefix = "hr_ueCorrection_trLep_track_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_track_25",
                                    prefix = "hr_corrRecoil_trLep_track_25",
                                    exclude=['MET_Regions','MET_Comps'] )
        alg += MissingETD3PDObject( 0, sgkey = "RefinedRecoil_TruthLep_track_25",
                                    prefix = "hr_MET_trLep_track_25",
                                    exclude=['MET_Regions','MET_Comps'] )


    # Cluster block

    # ... all clusters, very low LOD

    if clusterContainer != 'None':
        alg += ClusterD3PDObject          (**_args ( 0, 'Clusters', kw,
                                                     sgkey = clusterContainer,
                                                     exclude='SamplingBasics',
                                                     allowMissing=True ))


    # Track block

    # ... good tracks only (nSCT>=6; no pt cut)

    if trackContainer != 'None':
        alg += TrackParticleD3PDObject (**_args ( 3, 'Tracks', kw,
                                                  sgkey  = trackContainer,
                                                  label  = 'trk',
                                                  prefix = 'trk_',
                                                  allowMissing=True ))

    
    # Primary vertex block - May be missing in single-beam data.

    alg += PrimaryVertexD3PDObject (**_args (1, 'PrimaryVertex', kw,
                                             sgkey = D3PDMakerFlags.VertexSGKey(),
                                             prefix = 'vxp_',
                                             allowMissing=True ))
    
    # Truth

    if rec.doTruth():

        from TruthD3PDMaker.TruthParticleD3PDObject            import TruthParticleD3PDObject
        from MuonD3PDMaker.TruthMuonD3PDObject                 import TruthMuonD3PDObject
        alg += TruthMuonD3PDObject    (**_args ( 2, 'TruthMuon', kw))

        from AthenaCommon.AppMgr import ToolSvc
        from TruthD3PDAnalysis.TruthD3PDAnalysisConf import D3PD__GenObjectsFilterTool

        # ... remove empty GenEvents

        smlightGenEvtFilterTool = D3PD__GenObjectsFilterTool( "smlightGenEvtFilterTool" )
        ToolSvc += smlightGenEvtFilterTool
        smlightGenEvtFilterTool.RemoveDummyEvents = True
        smlightGenEvtFilterTool.RemoveInTimePileUp = True
        smlightGenEvtFilterTool.Remove2BCPileUp = True
        smlightGenEvtFilterTool.Remove800nsPileUp = True
        smlightGenEvtFilterTool.RemoveCavernBkg = True
        smlightGenEvtFilterTool.RemoveEmptyEvents = True

        from TruthD3PDMaker.GenEventD3PDObject                 import GenEventD3PDObject
        alg += GenEventD3PDObject     (**_args ( 0, 'GenEvent', kw, filter = smlightGenEvtFilterTool ))

        

        # ... leptonic W/Z truth information

        smlightLepWZFilterTool = D3PD__GenObjectsFilterTool( "smlightLepWZFilterTool" )
        ToolSvc += smlightLepWZFilterTool

        smlightLepWZFilterTool.RemoveInTimePileUp = True
        smlightLepWZFilterTool.Remove2BCPileUp = True
        smlightLepWZFilterTool.Remove800nsPileUp = True
        smlightLepWZFilterTool.RemoveCavernBkg =  True
        smlightLepWZFilterTool.RemoveEmptyEvents = True
        smlightLepWZFilterTool.RemoveDummyEvents = True
        smlightLepWZFilterTool.RemoveUnrequestedParticles=True
        smlightLepWZFilterTool.KeepLeptonicWZBosons=True
        smlightLepWZFilterTool.KeepLeptonicWZBosonDecayChains=True
        smlightLepWZFilterTool.KeepLeptonicWZBosonsParents=True

        from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject
        alg += GenParticleD3PDObject( **_args(10, "lepwzgenparticle", kw, prefix='mclepwzpart_',
                                              filter = smlightLepWZFilterTool,
                                              label = "LepWZTruthD3PDObject",
                                              exclude = ["GenPartProdVertexAssoc","GenPartDecayVertexAssoc"],
                                              GenParticle_WriteMotherType=False,
                                              GenParticle_WriteMotherBarcode=False,
                                              GenPartMotherAssoc_target="LepWZTruthD3PDObject",
                                              GenPartChildAssoc_target="LepWZTruthD3PDObject"
                                              )
                                      )


    if not rec.doTruth():
        alg += BeamSpotD3PDObject(10)
    
    
    # Trigger

    if D3PDMakerFlags.DoTrigger():

#        RedefineTriggerBits(alg, 'EF*')
#        alg += SMWZLightTriggerBitsD3PDObject      (**_args (10, 'SMWZLightTriggerBits', kw))

        # metadata

        addTrigConfMetadata(alg)
        
        # Bunch group info

        alg += BGCodeD3PDObject (**_args (2, 'BGCode', kw))

        # Egamma EF information
        
        alg += EFElectronD3PDObject(0, name='trig_EF_el_', 
                                    sgkey='HLT_egamma_Electrons,HLT_egamma',
                                    prefix='trig_EF_el_',
                                    exclude=['Author','IsEM','IsEMCuts'],
                                    include=['Triggers'],
                                    allowMissing = True)
        
#        alg += EFPhotonD3PDObject(0, name='trig_EF_ph_', 
#                                  sgkey='HLT_egamma_Photons,HLT_egamma',
#                                  prefix='trig_EF_ph_',
#                                  exclude=['Author','Conversion0','IsEM','IsEMCuts'],
#                                  include=['Triggers'],
#                                  allowMissing = True)        

        # Muon EF information
        
        alg += TrigMuonEFInfoD3PDObject(0,
                                        include=['Decision'],
                                        exclude=['TrackDetails','SpectrometerTrackBasics','ExtrapolatedTrackBasics'],
                                        allowMissing = True)
        
        alg += TrigMuonEFInfoD3PDObject(0,
                                        name = "trig_EF_trigmugirl_",
                                        sgkey = "HLT_eMuonEFInfo",
                                        prefix = "trig_EF_trigmugirl_",
                                        exclude=['TrackDetails','SpectrometerTrackBasics','ExtrapolatedTrackBasics'],
                                        include=['Decision'],
                                        allowMissing = True)
        
        # MET EF information

#        alg += TrigMETD3PDObject(**_args ( 0, 'TrigMETEF', kw,
#                                           prefix = "trig_EF_met_",
#                                           sgkey = "HLT_TrigEFMissingET" ))
        

# Event metadata

    alg.MetadataTools += [LBMetadataConfig()]

    if D3PDMakerFlags.FilterCollCand():
        from CaloD3PDMaker.CollisionFilterAlg import CollisionFilterAlg
        alg.filterSeq += CollisionFilterAlg (tuplename + '_CollCandFilter')

    return alg
コード例 #8
0
def VertexGroupD3PD(alg=None,
                    file=VertexD3PDAnalysisKeys.D3PDFileName(),
                    treeName=VertexD3PDAnalysisKeys.D3PDTreeName(),
                    **kw):

    print '[TrackD3PDMaker.VertexGroupD3PD] Vertex group D3PD settings:'
    print 'VertexD3PDAnalysisFlags'
    print VertexD3PDAnalysisFlags
    print 'VertexD3PDAnalysisKeys'
    print VertexD3PDAnalysisKeys

    if not alg:
        ## Create a new algorithm
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        alg = MSMgr.NewRootStream(treeName, file)

    ## General event information (custom options prefix: 'ei_')
    if VertexD3PDAnalysisFlags.useEventInfo():
        from EventCommonD3PDMaker.EventInfoD3PDObject import EventInfoD3PDObject
        alg += EventInfoD3PDObject(**_args('ei_', kw, level=0, prefix='ei_'))

    ## Trigger information (custom options prefix: 'trig_')
    if VertexD3PDAnalysisFlags.useTrigger():
        from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
        cfg = TriggerConfigGetter("ReadPool")
        from TriggerD3PDMaker.defineTriggerBits import defineTriggerBits
        from TriggerD3PDMaker.TrigConfMetadata import addTrigConfMetadata
        from TriggerD3PDMaker.TrigDecisionD3PDObject import TrigDecisionD3PDObject
        alg += TrigDecisionD3PDObject(**_args('trig_', kw, level=2))
        addTrigConfMetadata(alg)
    if VertexD3PDAnalysisFlags.useTriggerRaw():
        from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
        cfg = TriggerConfigGetter("ReadPool")
        from TriggerD3PDMaker.defineTriggerBits import defineTriggerBits
        from TriggerD3PDMaker.TrigConfMetadata import addTrigConfMetadata
        #Setup custom D3PD object with raw trigger info only (e.g. calibration_vdM streams)
        from D3PDMakerCoreComps.D3PDObject import make_Void_D3PDObject
        import TriggerD3PDMaker
        TrigDecisionD3PDObjectRaw = make_Void_D3PDObject(
            "trigRaw_",
            "TrigDecisionD3PDObjectRaw",
            default_name="TrigDecisionFillerRaw")
        if not VertexD3PDAnalysisFlags.useTrigger():
            TrigDecisionD3PDObjectRaw.defineBlock(
                0,
                "TriggerRawInfo",
                TriggerD3PDMaker.TrigDecisionFillerTool,
                SaveLVL1Raw=True,
                SaveHLTRaw=True,
                SaveBGCode=True)
        else:
            TrigDecisionD3PDObjectRaw.defineBlock(
                0,
                "TriggerRawInfo",
                TriggerD3PDMaker.TrigDecisionFillerTool,
                SaveHLTRaw=True,
                SaveBGCode=True)
        #Finally add object to algorithms
        alg += TrigDecisionD3PDObjectRaw(**_args('trig_', kw, level=0))
        if not VertexD3PDAnalysisFlags.useTrigger():
            #unless we've already added it, add meta-data as well
            addTrigConfMetadata(alg)

    ## Beam background information (custom options prefix: 'bkg_')
    if VertexD3PDAnalysisFlags.useBackgroundWord():
        from BackgroundD3PDMaker.BackgroundWordD3PDObject import BackgroundWordD3PDObject
        alg += BackgroundWordD3PDObject(**_args('bkg_', kw, level=0))

    ## Tracks and V0 information (custom options prefix: 'trk_', and 'v0_')
    if VertexD3PDAnalysisFlags.useTracks():
        labelDefaultVtx = VertexD3PDAnalysisKeys.LabelDefaultVtx()
        prefixDefaultVtx = labelDefaultVtx + '_'  #Add trailing '_'

        import TrackD3PDMaker
        from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags
        from TrackD3PDMaker.TrackD3PDObject import TrackD3PDObject
        from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
        from TruthD3PDMaker.TruthD3PDMakerFlags import TruthD3PDFlags
        from TruthD3PDMaker.TruthD3PDMakerKeys import TruthD3PDKeys
        VtxD3PD_Track_Exclude = ['vx_weight']
        TrackD3PDMaker.PerigeeUnbiasedIPAtPVFillerTool.DoBiased = False  #Switch off biased perigee
        TrackParticleD3PDObjectForVertex = TrackD3PDObject(
            _label='trk',
            _prefix='trk_',
            _sgkey=D3PDMakerFlags.TrackSGKey(),
            _object_name='TrackParticleD3PDObjectForVertex',
            typeName='Rec::TrackParticleContainer',
            vertexTarget=labelDefaultVtx,
            vertexPrefix=prefixDefaultVtx,
            vertexSGKey='VxPrimaryCandidate',
            truthTarget=TruthD3PDFlags.GenParticleAssocLabel(),
            truthPrefix=TruthD3PDKeys.GenParticlePrefix(),
            detailedTruthPrefix='',  # 'mc_detailed_'
            SGKeyForTruth=D3PDMakerFlags.TrackSGKey(),
            truthMapKey='TrackParticleTruthCollection',
            detailedTruthMapKey='',  #'DetailedTrackTruth'
            flags=TrackD3PDFlags)
        alg += TrackParticleD3PDObjectForVertex(
            **_args('trk_', kw, level=8, exclude=VtxD3PD_Track_Exclude))

    if VertexD3PDAnalysisFlags.useSecondaryVertex():
        from TrackD3PDMaker.V0D3PDObject import V0D3PDObject
        alg += V0D3PDObject(**_args('v0_', kw, level=10))

    ## Store beamspot information (custom option perfix: 'bs_')
    if VertexD3PDAnalysisFlags.useBeamspot():
        from TrackD3PDMaker.BeamSpotD3PDObject import BeamSpotD3PDObject
        alg += BeamSpotD3PDObject(**_args('bs_', kw, level=0))

    ## Store vertex information (custom options prefix: 'vtx_' or 'vtx' for BuildVertexD3PDObject)
    from TrackD3PDMaker.VertexD3PDObject import PrimaryVertexD3PDObject
    from TrackD3PDMaker.VertexD3PDObject import BuildVertexD3PDObject
    from InDetRecExample.InDetKeys import InDetKeys
    from InDetRecExample.InDetJobProperties import InDetFlags
    #First dump existing content
    labelDefaultVtx = VertexD3PDAnalysisKeys.LabelDefaultVtx()
    prefixDefaultVtx = labelDefaultVtx + '_'  #Add trailing '_'
    VtxDefaultD3PDObj = BuildVertexD3PDObject(
        **_args('vtx',
                kw,
                _prefix=prefixDefaultVtx,
                _label=labelDefaultVtx,
                _sgkey=InDetKeys.PrimaryVertices(),
                trackTarget='trk',
                trackPrefix='trk_',
                trackType='Rec::TrackParticleContainer'))
    alg += VtxDefaultD3PDObj(**_args('vtx_', kw, level=10))
    #Then also dump the other vertex collections
    if VertexD3PDAnalysisFlags.useAllVertexCollections:
        #Use non BC and split collections (sorry, no customization of parameters here)
        if not InDetFlags.doSplitVertexFindingForMonitoring():
            #raise NameError('Requesting split vertices but algorith has not run!')
            #pass
            print(
                '[TrackD3PDMaker.VertexGroupD3PD] WARNING: Requested split vertices, but algorithm has not run! Skipped.'
            )
        else:
            SplitPrimaryVertexD3PDObject = BuildVertexD3PDObject(
                _prefix='vxsplit_',
                _label='vxsplit',
                _sgkey=InDetKeys.PrimaryVerticesSplitStream(),
                trackTarget='trk',
                trackPrefix='trk_',
                trackType='Rec::TrackParticleContainer')
            alg += SplitPrimaryVertexD3PDObject(8)

        #Then store also non beamspot constrained ones
        if not InDetFlags.doVertexFindingForMonitoring():
            #raise NameError('Requesting NBC vertices but algorith has not run!')
            #pass
            print(
                '[TrackD3PDMaker.VertexGroupD3PD] WARNING: Requested non beamspot constrained vertices, but algorithm has not run! Skipped.'
            )
        else:
            NoBeamConstraintPrimaryVertexD3PDObject = BuildVertexD3PDObject(
                _prefix='vxnbc_',
                _label='vxnbc',
                _sgkey=InDetKeys.PrimaryVerticesWithoutBeamConstraint(),
                trackTarget='trk',
                trackPrefix='trk_',
                trackType='Rec::TrackParticleContainer')
            alg += NoBeamConstraintPrimaryVertexD3PDObject(8)

    ## Store truth-level information (custom options prefix: 'tuthVtx_', 'truthEvt_', 'truthPart_')
    if VertexD3PDAnalysisFlags.useTruth():
        from TruthD3PDAnalysis.TruthD3PDAnalysisConf import D3PD__GenObjectsFilterTool
        trackGenObjectsFilterTool = D3PD__GenObjectsFilterTool(
            "trackGenObjectsFilterTool")
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += trackGenObjectsFilterTool

        if (VertexD3PDAnalysisFlags.filterTightTruth()):
            trackGenObjectsFilterTool.SelectTruthTracks = True
            trackGenObjectsFilterTool.PtMin = VertexD3PDAnalysisKeys.TruthTrackCutPtMin(
            )
            trackGenObjectsFilterTool.EtaMax = VertexD3PDAnalysisKeys.TruthTrackCutEtaMax(
            )
            trackGenObjectsFilterTool.RemoveEmptyEvents = True
            trackGenObjectsFilterTool.RemoveDummyEvents = True
            trackGenObjectsFilterTool.RemoveInTimePileUp = False
            trackGenObjectsFilterTool.Remove2BCPileUp = True
            trackGenObjectsFilterTool.Remove800nsPileUp = True
            trackGenObjectsFilterTool.RemoveCavernBkg = False
            trackGenObjectsFilterTool.AddOnlyFirstVertex = VertexD3PDAnalysisKeys.TruthAddOnlyFirstVertex(
            )
        else:
            #Use a more inclusive truth policy
            trackGenObjectsFilterTool.SelectTruthTracks = False
            trackGenObjectsFilterTool.PtMin = VertexD3PDAnalysisKeys.TruthTrackCutPtMin(
            )
            trackGenObjectsFilterTool.EtaMax = VertexD3PDAnalysisKeys.TruthTrackCutEtaMax(
            )
            trackGenObjectsFilterTool.RemoveEmptyEvents = True
            trackGenObjectsFilterTool.RemoveDummyEvents = True
            trackGenObjectsFilterTool.AddOnlyFirstVertex = VertexD3PDAnalysisKeys.TruthAddOnlyFirstVertex(
            )

        from TruthD3PDMaker.GenEventD3PDObject import GenEventD3PDObject
        alg += GenEventD3PDObject(
            **_args('truthEvt_',
                    kw,
                    level=10,
                    filter=trackGenObjectsFilterTool,
                    pileup_CollectionGetterRegistry=alg.name() +
                    '_CollectionGetterRegistry'))

        from TruthD3PDMaker.GenVertexD3PDObject import GenVertexD3PDObject
        alg += GenVertexD3PDObject(**_args(
            'truthVtx_', kw, level=1, filter=trackGenObjectsFilterTool))

        from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject
        alg += GenParticleD3PDObject(**_args(
            'truthPart_', kw, level=10, filter=trackGenObjectsFilterTool))

        from TruthD3PDMaker.GenParticleD3PDObject import GenTruthTrackD3PDObject
        alg += GenTruthTrackD3PDObject(**_args('truthTrack_', kw, level=0))

    ## Dump higher level objects
    # Missing Energy (custom options prefix with VertexD3PDAnalysisKeys.MetCollections+'_')
    if VertexD3PDAnalysisFlags.useMET():
        for MET in VertexD3PDAnalysisKeys.MetCollections():
            VtxD3PD_Met_Key = MET
            VtxD3PD_Met_Prefix = MET.replace('_', '') + '_'
            VtxD3PD_Met_Level = 0  #Only basic info
            VtxD3PD_Met_Exclude = ['MET_Regions', 'L1_', 'L2_', 'EF_']
            from MissingETD3PDMaker.MissingETD3PDObject import RefFinalMETD3PDObject
            VtxD3PD_Met_Obj = RefFinalMETD3PDObject(
                **_args(MET + '_',
                        kw,
                        level=VtxD3PD_Met_Level,
                        sgkey=VtxD3PD_Met_Key,
                        prefix=VtxD3PD_Met_Prefix,
                        exclude=VtxD3PD_Met_Exclude))
            alg += VtxD3PD_Met_Obj

    #Muons (custom options prefix VtxD3PD_Muon_Prefix -- see below [e.g. muid_, staco_, ...])
    if VertexD3PDAnalysisFlags.useMuons():
        from MuonD3PDMaker.MuonD3PDObject import MuonD3PDObject
        for Muon in VertexD3PDAnalysisKeys.MuonCollections():
            VtxD3PD_Muon_Key = Muon
            VtxD3PD_Muon_Prefix = Muon + '_'
            if VtxD3PD_Muon_Key == 'MuidMuonCollection':
                VtxD3PD_Muon_Prefix = 'muid_'
            elif VtxD3PD_Muon_Key == 'StacoMuonCollection':
                VtxD3PD_Muon_Prefix = 'staco_'

            VtxD3PD_Muon_Level = 0  #Only basic info
            VtxD3PD_Muon_Exclude = [
                'EFCBInfo', 'EFMGInfo', 'EFMEInfo', 'L2CBInfo', 'L1Info',
                'L1_', 'L2_', 'EF_'
            ]
            VtxD3PD_Muon_Obj = MuonD3PDObject(
                **_args(VtxD3PD_Muon_Prefix,
                        kw,
                        level=VtxD3PD_Muon_Level,
                        sgkey=VtxD3PD_Muon_Key,
                        prefix=VtxD3PD_Muon_Prefix,
                        allowMissing=True,
                        exclude=VtxD3PD_Muon_Exclude))
            alg += VtxD3PD_Muon_Obj

    #Electrons (custom options prefix: 'el_')
    if VertexD3PDAnalysisFlags.useElectrons():
        from egammaD3PDMaker.ElectronD3PDObject import ElectronD3PDObject
        alg += ElectronD3PDObject(**_args('el_', kw, prefix='el_', level=0))

    #Photons (custom options prefix: 'ph_')
    if VertexD3PDAnalysisFlags.usePhotons():
        from egammaD3PDMaker.PhotonD3PDObject import PhotonD3PDObject
        alg += PhotonD3PDObject(**_args('ph_', kw, prefix='ph_', level=0))

    #Jets, JVF, b-jets (custom options prefix: 'jet_')
    if VertexD3PDAnalysisFlags.useJets():
        from JetD3PDMaker.JetD3PDObject import JetD3PDObject
        from JetTagD3PDMaker.JetTagD3PDMakerKeys import JetTagD3PDKeys
        from JetTagD3PDMaker.AddBTagD3PDInfo import addBTagInfoToJetObject
        addBTagInfoToJetObject(JetD3PDObject, btagLevelOffset=0)
        VtxD3PD_Jet_Include = [
            'Kinematics', 'JetVertexFraction', 'JVtx', 'EMFraction',
            'TrueFlavorComponents',
            JetTagD3PDKeys.BTagWeightsBlockName()
        ]
        for JET in VertexD3PDAnalysisKeys.JetCollections():
            VtxD3PD_Jet_Prefix = JET.replace('_', '') + '_'
            if len(VertexD3PDAnalysisKeys.JetCollections()) == 1:
                #only 1 element, simplify prefix
                VtxD3PD_Jet_Prefix = 'jet_'
            alg += JetD3PDObject(**_args('jet_',
                                         kw,
                                         sgkey=JET,
                                         prefix=VtxD3PD_Jet_Prefix,
                                         level=0,
                                         include=VtxD3PD_Jet_Include))

    #Taus
    if VertexD3PDAnalysisFlags.useTaus():
        from TauD3PDMaker.TauD3PDObject import TauD3PDObject
        VtxD3PD_Tau_Include = ['TauPriVtx']
        alg += TauD3PDObject(**_args(
            'tau_', kw, prefix='tau_', level=0, include=VtxD3PD_Tau_Include))

    ## Return algorithm
    return alg
コード例 #9
0
EgammaD3PDStream_msg = logging.getLogger( 'EgammaD3PD_prodJobOFragment' )

# Check if the configuration makes sense:
if prodFlags.WriteEgammaD3PD.isVirtual:
    EgammaD3PDStream_msg.error( "The Egamma D3PD stream can't be virtual! " +
                                "It's a configuration error!" )
    raise NameError( "Egamma D3PD set to be a virtual stream" )
    pass

#configure MuonScatteringAngleSignificanceTool
include("JetTagD3PDMaker/MuonScatteringSigToolConfig.py")

# Construct the stream and file names for the SUSY D3PD:
streamName = prodFlags.WriteEgammaD3PD.StreamName
fileName   = buildFileName( prodFlags.WriteEgammaD3PD )
EgammaD3PDStream_msg.info( "Configuring EgammaD3PD with streamName '%s' and fileName '%s'" % \
                           ( streamName, fileName ) )

# Create the D3PD streams:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
EgammaD3PDStream = MSMgr.NewRootStream( streamName, fileName, "egamma", asAlg=True )
EgammaTriggerD3PDStream = MSMgr.NewRootStream( streamName + ":" + streamName +
                                               "D3PDTrigDec", fileName,
                                               "egammaTrigDec",
                                               asAlg=True)

# Now add all the content to this stream:
from D3PDMakerConfig.egammaD3PD import egammaD3PD
egammaD3PD_args = globals().get('egammaD3PD_args', {})
egammaD3PD( EgammaD3PDStream, EgammaTriggerD3PDStream, **egammaD3PD_args )
コード例 #10
0
def backgroundD3PD(alg=None,
                   level=10,
                   file='background.root',
                   tuplename='background',
                   flags=BackgroundD3PDMakerFlags,
                   **kw):

    preseq = AlgSequence(D3PDMakerFlags.PreD3PDAlgSeqName())
    if (not hasattr(topSequence, 'BeamBackgroundFiller')
            and not hasattr(preseq, 'BeamBackgroundFiller')):
        if cfgKeyStore.isInInput("Trk::SegmentCollection",
                                 "ConvertedMBoySegments"):
            from RecBackgroundAlgs import RecBackgroundAlgsConf
            preseq += RecBackgroundAlgsConf.BeamBackgroundFiller()

    if (not hasattr(topSequence, 'BeamBackgroundFillerMoore')
            and not hasattr(preseq, 'BeamBackgroundFillerMoore')):
        if cfgKeyStore.isInInput("Trk::SegmentCollection", "MooreSegments"):
            from RecBackgroundAlgs.RecBackgroundAlgsConf import BeamBackgroundFiller
            BeamBackgroundFillerMoore = BeamBackgroundFiller(
                'BeamBackgroundFillerMoore',
                muonSegmentContainerKey='MooreSegments',
                BeamBackgroundKey='BeamBackgroundDataMoore')
            preseq += BeamBackgroundFillerMoore

    # The core algorithm
    if not alg:
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        alg = MSMgr.NewRootStream(tuplename, file)

    #Event level info
    alg += EventInfoD3PDObject(**_args(1, 'EventInfo', kw))
    if globalflags.DataSource == "data":
        alg += LBLengthD3PDObject(**_args(0, 'LBLength', kw))

    if rec.doTruth():
        from TruthD3PDMaker.GenEventD3PDObject import GenEventD3PDObject
        alg += GenEventD3PDObject(**_args(0, 'GenEvent', kw))

    if rec.doTrigger():
        alg += TrigDecisionD3PDObject(**_args(2, 'TrigDecision', kw))
        addTrigConfMetadata(alg)

        bcToolType = ""
        if globalflags.DataSource == "data":
            bcToolType = "LHC"
        addBunchStructureMetadata(alg, bcToolType)

        alg += BGCodeD3PDObject(**_args(2, 'BGCode', kw))

        if flags.AddTriggerBits():
            alg += getBkgdTriggerBitsD3PDObject([])

    alg += BackgroundWordD3PDObject(**_args(0, 'BkgWord', kw))
    if flags.doLUCID():
        alg += Lucid_RawDataD3PDObject(**_args(0, 'Lucid', kw))
    alg += RawInfoSummaryForTagD3PDObject(**_args(0, 'SumForTag', kw))

    alg += MBTSD3PDObject(**_args(0, 'MBTS', kw))
    alg += LArCollisionTimeD3PDObject(**_args(0, 'LArTimeDiff', kw))

    if flags.doMet():
        alg += MissingETD3PDObject(**_args(1,
                                           'MET_RefFinal',
                                           kw,
                                           sgkey='MET_RefFinal',
                                           prefix='MET_RefFinal',
                                           allowMissing=True))

    alg += MuonD3PDObject(
        **_args(0,
                'Muon',
                kw,
                sgkey='MuonCollection',
                prefix='mu_',
                include=[
                    "Isolation", "Quality", "MuonTimingFillerTool",
                    "MuonTileTimeTool", "ChamberT0"
                ],
                allowMissing=True))
    alg += MuonD3PDObject(
        **_args(0,
                'MuidMuon',
                kw,
                sgkey='MuidMuonCollection',
                prefix='mu_muid_',
                include=[
                    "Isolation", "Quality", "MuonTimingFillerTool",
                    "MuonTileTimeTool", "ChamberT0"
                ],
                allowMissing=True))
    alg += MuonD3PDObject(
        **_args(0,
                'StacoMuon',
                kw,
                sgkey='StacoMuonCollection',
                prefix='mu_staco_',
                include=[
                    "Isolation", "Quality", "MuonTimingFillerTool",
                    "MuonTileTimeTool", "ChamberT0"
                ],
                allowMissing=True))
    if flags.doCaloMuon():
        alg += MuonD3PDObject(
            **_args(0,
                    'CaloMuon',
                    kw,
                    sgkey='CaloMuonCollection',
                    prefix='mu_calo_',
                    include=[
                        "Isolation", "Quality", "MuonTimingFillerTool",
                        "MuonTileTimeTool", "ChamberT0"
                    ],
                    allowMissing=True))

    alg += MuonSegmentD3PDObject(**_args(
        1,
        'MuonSeg',
        kw,
        sgkey='MuonSegments',
        prefix='museg_',
        # MooreSegmentT0 takes the default time
        # MuonboySegmentT0 recalculates time (see MuonSegmentD3PDObject.py and MuonSegmentT0FillerTool.cxx)
        include=['MooreSegmentT0'],
        exclude=['MuonboySegmentT0'],
        allowMissing=True))
    alg += MuonSegmentD3PDObject(**_args(1,
                                         'MooreSeg',
                                         kw,
                                         sgkey='MooreSegments',
                                         prefix='mooreseg_',
                                         include=['MooreSegmentT0'],
                                         exclude=['MuonboySegmentT0'],
                                         allowMissing=True))
    alg += MuonSegmentD3PDObject(**_args(1,
                                         'MboySeg',
                                         kw,
                                         sgkey='ConvertedMBoySegments',
                                         prefix='mboyseg_',
                                         include=['MuonboySegmentT0'],
                                         exclude=['MooreSegmentT0'],
                                         allowMissing=True))
    if flags.doMuGirlSeg():
        alg += MuonSegmentD3PDObject(**_args(1,
                                             'MuGirlSeg',
                                             kw,
                                             sgkey='MuGirlSegments',
                                             prefix='mgseg_',
                                             include=['MooreSegmentT0'],
                                             exclude=['MuonboySegmentT0'],
                                             allowMissing=True))

    if flags.doTrk():
        alg += xAODTrackParticleD3PDObject(
            **_args(0, 'TrackParticle', kw, prefix='trk_'))

    if flags.doMuonHits():
        alg += MdtPrepDataD3PDObject(0)
        alg += RpcPrepDataD3PDObject(0)
        alg += CscPrepDataD3PDObject(0)
        alg += TgcPrepDataD3PDObject(0)

        alg += TgcPrepDataD3PDObject(**_args(0,
                                             'TGC_MeasurementsPriorBC',
                                             kw,
                                             sgkey='TGC_MeasurementsPriorBC',
                                             prefix='tgcPriorBC_',
                                             label='TgcPrepDataPriorBC'))
        alg += TgcPrepDataD3PDObject(**_args(0,
                                             'TGC_MeasurementsNextBC',
                                             kw,
                                             sgkey='TGC_MeasurementsNextBC',
                                             prefix='tgcNextBC_',
                                             label='TgcPrepDataNextBC'))

    if flags.doCaloJet():
        #alg += JetD3PDObject (**_args(4,'AntiKt4TopoEMJets', kw,  sgkey='AntiKt4TopoEMJets',   prefix='AntiKt4TopoEM_', include='BeamBackground' ))
        if cfgKeyStore.isInInput("Trk::SegmentCollection",
                                 "ConvertedMBoySegments"):
            alg += JetD3PDObject(
                **_args(4,
                        'AntiKt4TopoEMJets',
                        kw,
                        sgkey='AntiKt4TopoEMJets',
                        prefix='AntiKt4TopoEM_',
                        include=['BeamBackground'],
                        exclude=[
                            'JetVertexFraction', 'JVtx', 'ActiveArea',
                            'TruthMF', 'TracksMoments'
                        ],
                        BeamBackground_BeamBackgroundKey='BeamBackgroundData'))
        else:
            alg += JetD3PDObject(
                **_args(4,
                        'AntiKt4TopoEMJets',
                        kw,
                        sgkey='AntiKt4TopoEMJets',
                        prefix='AntiKt4TopoEM_',
                        exclude=[
                            'JetVertexFraction', 'JVtx', 'ActiveArea',
                            'TruthMF', 'TracksMoments'
                        ]))
    else:
        alg += JetD3PDObject(
            **_args(4,
                    'AntiKt4TrackJets',
                    kw,
                    sgkey='AntiKt4TrackJets',
                    prefix='AntiKt4Track_',
                    exclude=[
                        'JetVertexFraction', 'JVtx', 'ActiveArea', 'TruthMF',
                        'TracksMoments'
                    ]))

    alg += PrimaryxAODVertexD3PDObject(0)

    if flags.doBeamBkgd():
        #alg += BeamBackgroundD3PDObject(1)
        if cfgKeyStore.isInInput("Trk::SegmentCollection",
                                 "ConvertedMBoySegments"):
            alg += BeamBackgroundD3PDObject(
                **_args(1,
                        'BeamBackgroundData',
                        kw,
                        sgkey='BeamBackgroundData',
                        prefix='bb_',
                        bbJetIndex_Target='AntiKt4TopoEM_',
                        bbClusterIndex_Target='cl_'))
        if cfgKeyStore.isInInput("Trk::SegmentCollection", "MooreSegments"):
            alg += BeamBackgroundD3PDObject(
                **_args(1,
                        'BeamBackgroundData',
                        kw,
                        sgkey='BeamBackgroundDataMoore',
                        prefix='bbMoore_',
                        bbJetIndex_Target='AntiKt4TopoEM_',
                        bbClusterIndex_Target='cl_'))

    if flags.doBCM():
        alg += BcmRdoFlatD3PDObject(**_args(0, 'BCMRdo', kw))

    if flags.doZDC():
        if globalflags.DataSource == "data": alg += ZdcD3PDObject(10)

    if flags.doPixelClus():
        from InDetD3PDMaker.PixelClusterD3PDObject import PixelClusterD3PDObject
        alg += PixelClusterD3PDObject(0)

    if flags.doCaloClus():
        from CaloSysD3PDMaker.ClusterD3PDObject import ClusterD3PDObject
        alg += ClusterD3PDObject(1)

    return alg
コード例 #11
0
    'ViewVector<DataVector<DMTest::C_v1,DataModel_detail::NoBase> >',
    'DMTest::C_v1',
    'DMTest::CInfoAuxContainer_v1',
    'DataVector<DMTest::G_v1>',
    'DMTest::GAuxContainer_v1',
    'DMTest::G_v1',
    'DMTest::H_v1',
    'DataVector<DMTest::H_v1>',
    'ViewVector<DataVector<DMTest::H_v1,DataModel_detail::NoBase> >',
    'DMTest::HAuxContainer_v1',
])
ServiceMgr += fmtsvc

# Stream's output file
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
Stream1_Augmented = MSMgr.NewPoolStream('Stream1', 'xaoddata.root', asAlg=True)
Stream1_Augmented.AddMetaDataItem('xAOD::EventFormat#EventFormat')
Stream1 = Stream1_Augmented.GetEventStream()
Stream1.WritingTool.SubLevelBranchName = '<key>'
# List of DO's to write out
Stream1.ItemList += fullItemList
ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += ["DEFAULT_SPLITLEVEL='1'"]

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = 3
svcMgr.MessageSvc.debugLimit = 100000
svcMgr.ClassIDSvc.OutputLevel = 3

# No stats printout
コード例 #12
0
##
##-----------------------------------------------------------------------------

# ##########################################################################################
# Imports and initial setup
# ##########################################################################################

from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from PrimaryDPDMaker.PrimaryDPDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD

from LongLivedParticleDPDMaker.HipsFlags import primHIPsDESD

streamName = primDPD.WriteDESDM_EXOTHIPStream.StreamName
fileName   = buildFileName( primDPD.WriteDESDM_EXOTHIPStream )
HIPsStream      = MSMgr.NewPoolStream( streamName,fileName )


from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool as skimtool
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel as kernel

HIPsFilterNames = [] # Filters should append their final selection algo names to this list
filtersToBookkeep = [] # Not sure what this does?


def HipTriggerSelectionString(flags):
    cutString=""
    if flags.triggers.__len__() >=1:
        cutString+=flags.triggers[0]
        if flags.triggers.__len__() >1:
            for trigger in flags.triggers[1:]:
コード例 #13
0
    desdAlignmentTriggerMuonSequence += filAlg_MS

    filAlg_CT = muonTrkTrackThinTool("muonTrkTrackThinTool_CT",
                                     TrackCollectionKey="CombinedMuonTracks")
    desdAlignmentTriggerMuonSequence += filAlg_CT
    pass
print topSequence

##====================================================================
## Define this Muon DPD output stream
##====================================================================
#WriteMuonAlignmentTriggerStream
streamName = primDPD.WriteDESDM_MSPerfStream.StreamName
fileName = buildFileName(primDPD.WriteDESDM_MSPerfStream)
if primDPD.WriteDESDM_MSPerfStream.isVirtual or primDPD.isVirtual():
    AlignmentTriggerMuonStream = MSMgr.NewVirtualStream(streamName, fileName)
    pass
else:
    AlignmentTriggerMuonStream = MSMgr.NewPoolStream(streamName, fileName)
    pass

if primDPDAlignTrigMu.ApplyThinning():
    AlignmentTriggerMuonStream.AcceptAlgs(["muonTrkTrackThinTool_MS"])
    AlignmentTriggerMuonStream.AcceptAlgs(["muonTrkTrackThinTool_CT"])
    pass

if primDPDAlignTrigMu.ApplySkimming():
    AlignmentTriggerMuonStream.AcceptAlgs(["EventSkimmingKernel"])
    pass
#---------------------------------------------------
# Add the containers to the output stream
コード例 #14
0
def BTaggingD3PD(alg=None,
                 file=JetTagD3PDKeys.D3PDFileName(),
                 algname=JetTagD3PDKeys.D3PDAlgName(),
                 **kw):

    print "printing additional d3pd properties from dictionary"
    print kw

    if not alg:
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        alg = MSMgr.NewRootStream(JetTagD3PDKeys.D3PDAlgName(),
                                  JetTagD3PDKeys.D3PDFileName(),
                                  JetTagD3PDKeys.D3PDTupleName())

    selectedJetCollections = []

    if len(JetTagD3PDFlags.JetCollections()) != 0:

        from JetTagD3PDMaker.JetTagJetD3PDObject import getJetTagJetD3PDObject
        for jetcoll in JetTagD3PDFlags.JetCollections():
            filteredcoll = jetcoll + JetTagD3PDKeys.FilteredJetCollectionPostfix(
            )
            ### you can add specific selection for a certain jet collection as argument to the function bellow
            ### otherwise the one specified by JetTagD3PDFlags will be used
            alg += getJetTagJetD3PDObject(**_args(
                jetcoll, kw, filteredsgkey=filteredcoll, origsgkey=jetcoll))
            selectedJetCollections.append(filteredcoll)
    else:
        print "Warning: you didn't specify any jet collection for the JetTag D3PD"

    if len(selectedJetCollections) != 0:

        ### add muon in jets object
        if JetTagD3PDFlags.AddMuonInJetsObject():
            from JetTagD3PDMaker.JetTagMuonInJetD3PDObject import getJetTagMuonInJetObject
            alg += getJetTagMuonInJetObject(
                **_args("muon1injet",
                        kw,
                        level=10,
                        jetCollections=selectedJetCollections))

            if JetTagD3PDFlags.AddSecondMuonCollection():
                alg += getJetTagMuonInJetObject(
                    **_args("muon2injet",
                            kw,
                            level=10,
                            jetCollections=selectedJetCollections,
                            prefix=JetTagD3PDKeys.Muon2InJetPrefix(),
                            object_name='JetTagMuon2InJetD3PDObject',
                            label=JetTagD3PDKeys.Muon2InJetGetterLabel(),
                            muonsName="SecondMuons"))

    ### add electron in jets object
        if JetTagD3PDFlags.AddElectronInJetsObject():
            from JetTagD3PDMaker.JetTagElectronInJetD3PDObject import getJetTagElectronInJetD3PDObject
            alg += getJetTagElectronInJetD3PDObject(
                **_args("electroninjet",
                        kw,
                        level=10,
                        jetCollections=selectedJetCollections))

    ### add photon in jets object
        if JetTagD3PDFlags.AddPhotonInJetsObject():
            from JetTagD3PDMaker.JetTagPhotonInJetD3PDObject import getJetTagPhotonInJetD3PDObject
            alg += getJetTagPhotonInJetD3PDObject(
                **_args("photoninjet",
                        kw,
                        level=10,
                        jetCollections=selectedJetCollections))

    ### add VxOnJetAxis object
        if JetTagD3PDFlags.AddVxOnJetAxisInJetsObject():
            from JetTagD3PDMaker.JetTagVxOnJetAxisD3PDObject import getJetTagVxOnJetAxisD3PDObject
            alg += getJetTagVxOnJetAxisD3PDObject(
                **_args("vxonjetaxis",
                        kw,
                        level=0,
                        jetCollections=selectedJetCollections))

    ### add TwoTrackVertex object
        if JetTagD3PDFlags.AddTwoTrackVertexInJetsObject():
            from JetTagD3PDMaker.JetTagTwoTrackVertexD3PDObject import getJetTagTwoTrackVertexD3PDObject
            alg += getJetTagTwoTrackVertexD3PDObject(
                **_args("twotrackvertex",
                        kw,
                        level=0,
                        jetCollections=selectedJetCollections))

    ### add MSVVtxInfo object
        if JetTagD3PDFlags.AddMSVVtxInfoInJetsObject():
            from JetTagD3PDMaker.JetTagMSVVtxInJetD3PDObject import getJetTagMSVVtxInfoInJetD3PDObject
            alg += getJetTagMSVVtxInfoInJetD3PDObject(
                **_args("msvvtxinfo",
                        kw,
                        level=1,
                        jetCollections=selectedJetCollections))

### add event info object
    if JetTagD3PDFlags.AddEventInfoObject():
        from JetTagD3PDMaker.JetTagEventInfoD3PDObject import getJetTagEventInfoD3PDObject
        alg += getJetTagEventInfoD3PDObject(**_args("eventinfo", kw, level=1))

### add pileup event info object
    if rec.doTruth and JetTagD3PDFlags.AddPileUpEventInfoObject():
        from TruthD3PDMaker.PileUpInfoD3PDObject import PileUpInfoD3PDObject
        alg += PileUpInfoD3PDObject(0,
                                    "pileupinfo",
                                    "pileupinfo_",
                                    allowMissing=True)

### add track object
    if JetTagD3PDFlags.AddTrackObject():
        from JetTagD3PDMaker.JetTagTrackD3PDObject import getJetTagTrackD3PDObject
        alg += getJetTagTrackD3PDObject(**_args("track", kw))

### add MET objects
    for MET in JetTagD3PDFlags.METObjects():
        from JetTagD3PDMaker.JetTagMETD3PDObject import getJetTagMETD3PDObject
        alg += getJetTagMETD3PDObject(**_args(MET, kw, sgkey=MET))

### add event shape objects
    from QcdD3PDMaker.QcdEventShapeD3PDObject import EventShapeD3PDObject
    alg += EventShapeD3PDObject(level=0)

    ### add pixel clusters object
    if JetTagD3PDFlags.AddPixelClusterObject():
        from JetTagD3PDMaker.JetTagClustersD3PDObject import getJetTagClusterD3PDObject
        alg += getJetTagClusterD3PDObject(**_args("pixelcluster", kw, level=0))

### add primary vertex object
    if JetTagD3PDFlags.AddPrimaryVertexObject():
        from JetTagD3PDMaker.JetTagPrimaryVertexD3PDObject import getJetTagPrimaryVertexD3PDObject
        alg += getJetTagPrimaryVertexD3PDObject(**_args("pv", kw))

### add beam spot object
    if JetTagD3PDFlags.AddBeamSpotObject():
        from TrackD3PDMaker.BeamSpotD3PDObject import BeamSpotD3PDObject
        alg += BeamSpotD3PDObject(10)

### add muid object
    if JetTagD3PDFlags.AddMuonMuidObject():
        from MuonD3PDMaker.MuonD3PDObject import MuonD3PDObject
        _modifyMuonObject(MuonD3PDObject)
        alg += MuonD3PDObject(**_args(
            'MuonMuid',
            kw,
            level=10,
            sgkey='MuidMuonCollection',
            prefix='mu_muid_',
            allowMissing=True,
            exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
            include=[
                "BtagMuonTrackMatchingBlock", "EFCBInfoIndex", "EFMGInfoIndex",
                "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex"
            ]))

    if JetTagD3PDFlags.AddMuonStacoObject():
        from MuonD3PDMaker.MuonD3PDObject import MuonD3PDObject
        _modifyMuonObject(MuonD3PDObject)
        alg += MuonD3PDObject(**_args(
            'MuonStaco',
            kw,
            level=10,
            sgkey='StacoMuonCollection',
            prefix='mu_staco_',
            allowMissing=True,
            exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
            include=[
                "BtagMuonTrackMatchingBlock", "EFCBInfoIndex", "EFMGInfoIndex",
                "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex"
            ]))

### add truth info with a filter

    if rec.doTruth and JetTagD3PDFlags.AddGenObjects():

        from AthenaCommon.AppMgr import ToolSvc
        from TruthD3PDAnalysis.TruthD3PDAnalysisConf import D3PD__GenObjectsFilterTool
        jetTagGenObjectsFilterTool = D3PD__GenObjectsFilterTool(
            "JetTagGenObjectsFilterTool")
        ToolSvc += jetTagGenObjectsFilterTool

        jetTagGenObjectsFilterTool.SelectTruthTracks = False
        jetTagGenObjectsFilterTool.PtMin = JetTagD3PDFlags.MCPtMinCut()
        jetTagGenObjectsFilterTool.EtaMax = JetTagD3PDFlags.MCEtaCut()
        jetTagGenObjectsFilterTool.RemoveEmptyEvents = not JetTagD3PDFlags.MCEmptyEvents(
        )
        jetTagGenObjectsFilterTool.RemoveDummyEvents = not JetTagD3PDFlags.MCDummyEvents(
        )

        if not JetTagD3PDFlags.MCPileUp():
            jetTagGenObjectsFilterTool.RemoveInTimePileUp = True
            jetTagGenObjectsFilterTool.Remove2BCPileUp = True
            jetTagGenObjectsFilterTool.Remove800nsPileUp = True
            jetTagGenObjectsFilterTool.RemoveCavernBkg = True
            jetTagGenObjectsFilterTool.RemoveEmptyEvents = True
            jetTagGenObjectsFilterTool.RemoveDummyEvents = True

        if JetTagD3PDFlags.AddGenEventObjects():
            from TruthD3PDMaker.GenEventD3PDObject import GenEventD3PDObject
            alg += GenEventD3PDObject(**_args("genevent", kw, level=10,
                                              filter = jetTagGenObjectsFilterTool,
                                              pileup_CollectionGetterRegistry=\
                                                  alg.name()+'_CollectionGetterRegistry'
                                              )
                                        )

        if JetTagD3PDFlags.AddGenVertexObjects():
            from TruthD3PDMaker.GenVertexD3PDObject import GenVertexD3PDObject
            alg += GenVertexD3PDObject(**_args(
                "genvertex", kw, level=10, filter=jetTagGenObjectsFilterTool))

        if JetTagD3PDFlags.AddGenParticleObjects():
            from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject
            alg += GenParticleD3PDObject(**_args(
                "genparticle", kw, level=10,
                filter=jetTagGenObjectsFilterTool))

        if JetTagD3PDFlags.AddTruthTrackObjects():
            jetTagTruthTrackObjectsFilterTool = D3PD__GenObjectsFilterTool(
                "JetTagTruthTrackObjectsFilterTool")
            ToolSvc += jetTagTruthTrackObjectsFilterTool

            jetTagTruthTrackObjectsFilterTool.SelectTruthTracks = True

            jetTagTruthTrackObjectsFilterTool.PtMin = JetTagD3PDFlags.MCPtMinCut(
            )
            jetTagTruthTrackObjectsFilterTool.EtaMax = JetTagD3PDFlags.MCEtaCut(
            )
            jetTagTruthTrackObjectsFilterTool.RemoveEmptyEvents = not JetTagD3PDFlags.MCEmptyEvents(
            )
            jetTagTruthTrackObjectsFilterTool.RemoveDummyEvents = not JetTagD3PDFlags.MCDummyEvents(
            )

            if not JetTagD3PDFlags.MCPileUp():
                jetTagTruthTrackObjectsFilterTool.RemoveInTimePileUp = True
                jetTagTruthTrackObjectsFilterTool.Remove2BCPileUp = True
                jetTagTruthTrackObjectsFilterTool.Remove800nsPileUp = True
                jetTagTruthTrackObjectsFilterTool.RemoveCavernBkg = True
                jetTagTruthTrackObjectsFilterTool.RemoveEmptyEvents = True
                jetTagTruthTrackObjectsFilterTool.RemoveDummyEvents = True

            from TruthD3PDMaker.GenParticleD3PDObject import GenTruthTrackD3PDObject
            alg += GenTruthTrackD3PDObject(
                **_args("truthtrack",
                        kw,
                        level=10,
                        filter=jetTagTruthTrackObjectsFilterTool))

### add trigger
    if JetTagD3PDFlags.AddTriggerObject():
        from TriggerD3PDMaker.TrigDecisionD3PDObject import TrigDecisionD3PDObject
        alg += TrigDecisionD3PDObject(**_args("trigdecision", kw, level=2))
        from TriggerD3PDMaker.TrigConfMetadata import addTrigConfMetadata
        addTrigConfMetadata(alg)

        if JetTagD3PDFlags.AddTriggerBits():
            from JetTagD3PDMaker.JetTagTriggerBitsD3PDObject import getJetTagTriggerBitsD3PDObject
            alg += getJetTagTriggerBitsD3PDObject(
                JetTagD3PDFlags.TriggerBitsList())

        if JetTagD3PDFlags.AddJetTriggerObject():
            from TrigJetD3PDMaker.TrigJetD3PD import TrigJetD3PDObjects
            TrigJetD3PDObjects(alg,
                               level=10,
                               addNaviInfo=True,
                               addConfigInfo=False)

        if JetTagD3PDFlags.AddBJetTriggerObject():

            from TrigBJetD3PDMaker.TrigBJetD3PD import TrigBJetD3PDObjects
            bjettriglevel = 1
            if JetTagD3PDFlags.AddTrigL2IDTracks(
            ) or JetTagD3PDFlags.AddTrigEFIDTracks():
                bjettriglevel = 11
            TrigBJetD3PDObjects(alg,
                                level=bjettriglevel,
                                doAddL2ID=JetTagD3PDFlags.AddTrigL2IDTracks(),
                                doAddEFID=JetTagD3PDFlags.AddTrigEFIDTracks())

    if JetTagD3PDFlags.AddPixCond():
        if hasattr(ServiceMgr, "PixelConditionsSummarySvc"):
            from JetTagD3PDMaker.JetTagPixModCondD3PDObject import getJetTagPixModCondD3PDObject
            alg += getJetTagPixModCondD3PDObject(
                PixSummarySvc=ServiceMgr.PixelConditionsSummarySvc)
        else:
            print "Warning: JetTagPixModCondD3PDObject requested but PixelConditionsSummarySvc not configured"

    #### add fat jets and subjets
    if JetTagD3PDFlags.AddFatJets():
        from JetTagD3PDMaker.JetTagJSD3PDObjects import JSD3PD_Tool
        for xx in JetTagD3PDKeys.FatJetsList():
            if xx[0] != None and xx[1] != None:
                jsD3PD = JSD3PD_Tool(xx)
                jsD3PD.addToAlg(alg)

### add skiming
    if JetTagD3PDFlags.SkimD3PD():

        __muonAssocObjects = ["Muons"]
        if JetTagD3PDFlags.AddSecondMuonCollection():
            __muonAssocObjects = ["Muons", "Muons2"]

        from JetTagD3PDMaker.JetTagD3PDMakerConf import D3PD__JetTagD3PDEventFilter
        JetTagD3PDEventFilter = D3PD__JetTagD3PDEventFilter(
            "JetTagD3PDEventFilter",
            UseMuonFilter=JetTagD3PDFlags.UseMuonEventFilter(),
            UseJetFilter=JetTagD3PDFlags.UseJetEventFilter(),
            JetCollections=selectedJetCollections,
            JetPtCut=JetTagD3PDFlags.FilterJetPtCut(),
            JetEtaCut=JetTagD3PDFlags.FilterJetEtaCut(),
            JetWithMuonPtCut=JetTagD3PDFlags.FilterJetWithMuonPtCut(),
            SoftMuonPtCut=JetTagD3PDFlags.FilterMuonInJetPtCut(),
            MinNumberOfJets=JetTagD3PDFlags.FilterMinNJets(),
            MinNumberOfJetsWithMuon=JetTagD3PDFlags.FilterMinNJetsMuon(),
            MuonAssocObjects=__muonAssocObjects,
            MuonCollections=JetTagD3PDFlags.FilterMuonCollections(),
            MuonPtCut=JetTagD3PDFlags.FilterMuonPtCut(),
            MuonEtaCut=JetTagD3PDFlags.FilterMuonEtaCut(),
            MuonIsTightCut=JetTagD3PDFlags.FilterMuonTightCut(),
            MinNumberOfMuons=JetTagD3PDFlags.FilterMinNumberOfMuons())

        alg.filterSeq += JetTagD3PDEventFilter

        from EventCommonD3PDMaker.LBMetadataConfig import LBMetadataConfig
        alg.MetadataTools += [LBMetadataConfig()]

    return alg
コード例 #15
0
    runNumber += i.partition("calib.")[2].partition(".calib")[0]
    pass

#configuration of globalflags... do this FIRST so that anything else you do that might load conddb will be ready for it
from AthenaCommon.GlobalFlags import globalflags
globalflags.DataSource = 'data'
globalflags.DatabaseInstance = 'CONDBR2'
globalflags.InputFormat = 'bytestream'
globalflags.DetDescrVersion = "ATLAS-R2-2015-02-00-00"
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag("CONDBR2-ES1PA-2015-01")

# Output file
OutFile = "xAOD.L1Calo." + runNumber + ".pool.root"
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
xaodStream = MSMgr.NewPoolRootStream("StreamXAOD", OutFile)

# Decorate trigger towers with Calo Cells?
# This should be setup better
decorateTT = True

# Number of events (-1 == all events)
nEvents = -1

# Tell Athena about the input file(s)
from ByteStreamCnvSvc import ReadByteStream
svcMgr.ByteStreamInputSvc.FullFileName = InFiles

topSequence = CfgMgr.AthSequencer("AthAlgSeq")

# Add L1Calo xAOD to output
コード例 #16
0
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr

if rec.doWriteAOD:
    streamAOD = MSMgr.GetStream('StreamAOD')
    streamAOD.AddItem("xAOD::TriggerTowerContainer#xAODTriggerTowers")
    streamAOD.AddItem("xAOD::TriggerTowerAuxContainer#xAODTriggerTowersAux.")
コード例 #17
0
from AthenaCommon.AppMgr import ToolSvc

#import copy
#InDetPriVxFinderTool_Pix = copy.deepcopy(ToolSvc.InDetPriVxFinderTool)
#InDetPriVxFinderTool_SCT = copy.deepcopy(ToolSvc.InDetPriVxFinderTool)

from AthenaCommon.JobProperties import jobproperties
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
#MSMgr.Print()
try:
    StreamName = jobproperties.PrimaryDPDFlags.WriteDESDM_BEAMSPOTStream.StreamName
except:
    StreamName = "StreamDESDM_BEAMSPOT"
#print xxx
try:
    Stream = MSMgr.GetStream(StreamName)
except:
    raise NameError("Stream %s undefined!" % StreamName)

from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool
InDetTrackSelectorTool_Pix = InDet__InDetDetailedTrackSelectorTool(
    name="InDetDetailedTrackSelectorTool_Pix",
    pTMin=InDetPrimaryVertexingCuts.minPT(),
    IPd0Max=InDetPrimaryVertexingCuts.IPd0Max(),
    IPz0Max=InDetPrimaryVertexingCuts.IPz0Max(),
    z0Max=InDetPrimaryVertexingCuts.z0Max(),
    sigIPd0Max=InDetPrimaryVertexingCuts.sigIPd0Max(),
    sigIPz0Max=InDetPrimaryVertexingCuts.sigIPz0Max(),
    d0significanceMax=InDetPrimaryVertexingCuts.d0significanceMax(),
    z0significanceMax=InDetPrimaryVertexingCuts.z0significanceMax(),
    etaMax=InDetPrimaryVertexingCuts.etaMax(),
コード例 #18
0
D3PDMakerFlags.DoPAU = False
D3PDMakerFlags.DoTrigger = True
#FPP: patch to run D3PD with the merged L2EF (must add new flags in D3PDMakerConfig/python/D3PDMakerFlags.py)
D3PDMakerFlags.ElectronEFTrigPattern = "EF_[0-9]?e[0-9]+.*|HLT_[0-9]?e[0-9]+.*"
D3PDMakerFlags.ElectronL2TrigPattern = "L2_[0-9]?e[0-9]+.*"
D3PDMakerFlags.PhotonEFTrigPattern = "EF_[0-9]?g[0-9]+.*|HLT_[0-9]?e[0-9]+.*"
D3PDMakerFlags.PhotonL2TrigPattern = "L2_[0-9]?g[0-9]+.*"
D3PDMakerFlags.egammaL1TrigPattern = ""
D3PDMakerFlags.MuonEFTrigPattern = 'EF_2?mu.*|EF_L1ItemStreamer_L1_2?MU.*|HLT_2?mu.*|HLT_L1ItemStreamer_L1_2?MU.*'

from PhotonAnalysisUtils.PhotonAnalysisUtilsFlags import PAUflags
PAUflags.DoReRunJetFinding = False

# Create the D3PD stream(s):
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
d3pdalg = MSMgr.NewRootStream(streamName, fileName, "trigger")
#trigalg = MSMgr.NewRootStream( streamName + ":" + streamName + "TrigDec",
#                               fileName, "triggerDec" )
#d3pdalg.Stream.trigDecisionTree = trigalg

##
## Basic event information:
##
from EventCommonD3PDMaker.EventInfoD3PDObject import EventInfoD3PDObject
d3pdalg += EventInfoD3PDObject(2)
#trigalg += EventInfoD3PDObject( 0, exclude = [ "eventMu", "eventType" ] )
if triggerAvailable:
    from TriggerD3PDMaker.BGCodeD3PDObject import BGCodeD3PDObject
    d3pdalg += BGCodeD3PDObject(0)
    pass
コード例 #19
0
        combination_daod_2l = algsList[iAlg]
    else:
        combination_daod_2l += " or " + algsList[iAlg]

totalDecision_daod_2l = LogicalFilterCombiner("HSG2_2LDAODFilter",
                                              cmdstring=combination_daod_2l)
theJob += totalDecision_daod_2l

## This handles multiple output streams
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr

from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutHelper

# define streams

from AthenaCommon.JobProperties import jobproperties
prodFlags = jobproperties.D2PDFlags
from PrimaryDPDMaker.PrimaryDPDHelpers import buildFileName

# Construct the stream and file names for the jp:
streamName = prodFlags.WriteDAOD_2LHSG2Stream.StreamName
fileName = buildFileName(prodFlags.WriteDAOD_2LHSG2Stream)

#streamOut = MSMgr.NewPoolStream("StreamDAOD_2LHSG2",runArgs.outputDAOD_2LHSG2File)
streamOut_daod_2l = MSMgr.NewPoolStream(streamName, fileName)
streamOut_daod_2l.AcceptAlgs([totalDecision_daod_2l.getName()])
streamOut_daod_2l.AddOtherAlgsToBookkeep(algsList)

dpdOutHelper.addAllItemsFromInputExceptExcludeList(streamName, [])
streamOut_daod_2l.AddMetaDataItem("EventBookkeeperCollection#*")
コード例 #20
0
rec.doApplyAODFix.set_Value_and_Lock(False)

include("RecExCommon/RecExCommon_topOptions.py")

####  ####  ####  ####  ####  ####  ####  ####  ####
#
# Define the D3PD Stream
#
####  ####  ####  ####  ####  ####  ####  ####  ####

## ////////////////////////////////////////////////
## Define the D3PD Stream

from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
alg = MSMgr.NewRootStream("EFLOWD3PDSTREAM",
                          "Test_eflowD3PD_16Dec_WithSplitShower_10Evts.root",
                          "eflowD3PD")

# algs to run prior to dumping
from eflowD3PDMaker.eflowD3PDMakerConf import eflowClusterSelector
eflowClusSelector = eflowClusterSelector()
topSequence += eflowClusSelector

from eflowRec.eflowTrackToCaloTrackExtrapolatorTool import eflowTrackToCaloTrackExtrapolatorToolDefault
TrackToCaloTrackExtrapolatorToolDefault = eflowTrackToCaloTrackExtrapolatorToolDefault(
)

####  ####  ####  ####  ####  ####  ####  ####  ####
#
#                       Configure the D3PD
#
コード例 #21
0
def xAODRoICreator( sequence = None, stream = None, key = "LVL1_ROI" ):
    """
    Helper function that schedules all the components that create xAOD
    LVL1 RoI objects out of existing AOD objects.

    Arguments:
      sequence: Optional sequence to which the components should be added.
                If not specified, the main algorithm sequence is used.
      stream: Optional stream that the objects should be written to.
              If not specified, the objects are added to StreamAOD.
      key: Optional StoreGate key for the AOD object that is supposed to be
           translated.
    """

    # Create a logger for the function:
    if "logger" in dir(): orig_logger = logger
    from AthenaCommon.Logging import logging
    logger = logging.getLogger( "xAODRoICreator" )

    # Tell the user what's happening:
    logger.info( "Creating xAOD LVL1 RoIs from AOD objects" )

    # Get the main sequence if necessary:
    if sequence == None:
        from AthenaCommon.AlgSequence import AlgSequence
        sequence = AlgSequence()
        pass

    # Access the stream if necessary (and possible):
    if stream == None:
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        try:
            stream = MSMgr.GetStream( "StreamAOD" )
        except NameError:
            stream = None
            pass
        pass

    # Add the muon RoI converter algorithm:
    outkey = "LVL1MuonRoIs"
    alg = xAODMaker__MuonRoICnvAlg()
    alg.AODKey = key
    alg.xAODKey = outkey
    sequence += alg
    # Add the muon RoI objects to the output:
    if stream != None:
        stream.AddItem( "xAOD::MuonRoIContainer_v1#%s" % outkey )
        stream.AddItem( "xAOD::MuonRoIAuxContainer_v1#%sAux." % outkey )
        pass

    # Add the jet RoI converter algorithm:
    outkey = "LVL1JetRoIs"
    alg = xAODMaker__JetRoICnvAlg()
    alg.AODKey = key
    alg.xAODKey = outkey
    sequence += alg
    # Add the jet RoI objects to the output:
    if stream != None:
        stream.AddItem( "xAOD::JetRoIContainer_v1#%s" % outkey )
        stream.AddItem( "xAOD::JetRoIAuxContainer_v1#%sAux." % outkey )
        pass

    # Add the em/tau RoI converter algorithm:
    outkey = "LVL1EmTauRoIs"
    alg = xAODMaker__EmTauRoICnvAlg()
    alg.AODKey = key
    alg.xAODKey = outkey
    sequence += alg
    # Add the em/tau RoI objects to the output:
    if stream != None:
        stream.AddItem( "xAOD::EmTauRoIContainer_v1#%s" % outkey )
        stream.AddItem( "xAOD::EmTauRoIAuxContainer_v1#%sAux." % outkey )
        pass

    # Add the energy-sum RoI converter algorithm:
    outkey = "LVL1EnergySumRoI"
    alg = xAODMaker__EnergySumRoICnvAlg()
    alg.AODKey = key
    alg.xAODKey = outkey
    sequence += alg
    # Add the energy-sum RoI objects to the output:
    if stream != None:
        stream.AddItem( "xAOD::EnergySumRoI_v1#%s" % outkey )
        stream.AddItem( "xAOD::EnergySumRoIAuxInfo_v1#%sAux." % outkey )
        pass

    # Add the jet-Et RoI converter algorithm:
    outkey = "LVL1JetEtRoI"
    alg = xAODMaker__JetEtRoICnvAlg()
    alg.AODKey = key
    alg.xAODKey = outkey
    sequence += alg
    # Add the jet-Et RoI objects to the output:
    if stream != None:
        stream.AddItem( "xAOD::JetEtRoI_v1#%s" % outkey )
        stream.AddItem( "xAOD::JetEtRoIAuxInfo_v1#%sAux." % outkey )
        pass

    # Reinstate the old logger if it existed:
    if "orig_logger" in dir(): logger = orig_logger

    pass
コード例 #22
0
                                     minNumberPassed         = 1,
                                     chargeMax               = 0,
                                     massMin                 = 30.0*Units.GeV
                                     )



#====================================================================
# 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
streamName = "StreamD2AODM_MyZmumu"
fileName   = D2PDFlags.OutputDirectoryName() + "MyD2PDExampleSimpleZmumuStream.pool.root"
ExampleSimpleZmumuStream = 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
ExampleSimpleZmumuStream.AcceptAlgs( ["D2PDParticleCombinerInExampleSimpleZmumuStream_ZmumuBoson"] )



#---------------------------------------------------
# Add the containers to the output stream
#---------------------------------------------------
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput

# Take all items from the input, except for the ones listed in the excludeList
# If the excludeList is empty, all containers from the input file (e.g. AOD)
コード例 #23
0
# Set up the reading of a file:
FNAME = "AOD.pool.root"
include("AthenaPython/iread_file.py")

# Access the algorithm sequence:
from AthenaCommon.AlgSequence import AlgSequence
theJob = AlgSequence()

# Create a logger object:
from AthenaCommon.Logging import logging
logger = logging.getLogger("xAODTriggerCnv_jobOptions")

# Create a POOL output file with the StoreGate contents:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
xaodStream = MSMgr.NewPoolStream("StreamAOD", "xAOD.pool.root")

# Create the xAOD RoIs:
from xAODTriggerCnv.xAODRoICreator import xAODRoICreator
xAODRoICreator()

# Create the xAOD trigger decision:
from xAODTriggerCnv.xAODTrigDecisionCreator import xAODTrigDecisionCreator
xAODTrigDecisionCreator()

# Add bunch configuration metadata to the file:
from xAODTriggerCnv.xAODBunchConfCreator import xAODBunchConfCreator
xAODBunchConfCreator()

# Additional type(s) created automatically by RecExCommon:
xaodStream.AddItem("xAOD::EventInfo_v1#EventInfo")
コード例 #24
0
def HSG5D3PD (alg = None,
              file = 'hsg5.root',
              tuplename = 'physics',
              streamname = 'd3pdstream',
              flags=HSG5Flags,
              **kw):

    if flags.doTaus():
        # tau
        from TauD3PDMaker.TauD3PDObject                        import TauD3PDObject

    # define associations
    if flags.doPhotons() and not PhotonD3PDObject.allBlocknames().has_key('RecoveryMatch'):
        from PhotonD3PDMaker.PhotonRecoveryAssociation import PhotonRecoveryAssociation
        PhotonRecoveryAssoc = PhotonRecoveryAssociation(PhotonD3PDObject,
                                                        'ElectronContainer',
                                                        D3PDMakerFlags.ElectronSGKey(),
                                                        prefix = 'el_',
                                                        blockname = 'RecoveryMatch',
                                                        target = 'ph_ElectronRecovered_')
        

    # define track and cluster filters

    preseq = AlgSequence (D3PDMakerFlags.PreD3PDAlgSeqName())

    if flags.doGoodTracks() and not hasattr( preseq, "GoodTracks" ):
        filter1 = makeTrackFilterAlg(TracksName = D3PDMakerFlags.TrackSGKey(),
                                     OutputTracksName='GoodTracks',
                                     ptCut=0.,nSCTPix=4)
        preseq += filter1
                    
    if flags.doHighPtTracks() and not hasattr( preseq, "HighPtTracks" ):
        filter2 = makeTrackFilterAlg(TracksName = D3PDMakerFlags.TrackSGKey(),
                                     OutputTracksName='HighPtTracks',
                                     ptCut=5000.,nSCTPix=4)
        preseq += filter2


    if flags.doHighPtClusters() and not hasattr( preseq, "HighPtClusters" ):
        filter3 = makeClusterFilter(InputName  = D3PDMakerFlags.ClusterSGKey(),
                                    OutputName = 'HighPtClusters',
                                    ptCut=10000.)
        preseq += filter3

    if flags.doHighPtEMClusters() and not hasattr( preseq, "HighPtEMClusters" ):
        filter4 = makeClusterFilter(InputName  = D3PDMakerFlags.EMTopoClusterSGKey(),
                                    OutputName = 'HighPtEMClusters',
                                    ptCut=10000.)
        preseq += filter4

    # perform recoil calculation
     
    if flags.doHadronicRecoil(): 
        from HadronicRecoil.HadronicRecoilConf import HadronicRecoil__ElectronSelector
        from HadronicRecoil.HadronicRecoilConf import HadronicRecoil__MuonSelector
        from HadronicRecoil.HadronicRecoilConf import HadronicRecoil__EflowSelector
        from HadronicRecoil.HadronicRecoilConf import HadronicRecoil__RecoilCalculation
        from HadronicRecoil.HadronicRecoilConf import HadronicRecoil__EflowRecoil
        
        if not hasattr( preseq, "HadronicRecoil::ElectronSelector" ):
            preseq += HadronicRecoil__ElectronSelector()
        if not hasattr( preseq, "HadronicRecoil::MuonSelector" ):
            preseq += HadronicRecoil__MuonSelector()
        if not hasattr( preseq, "HadronicRecoil::EflowSelector" ):
            preseq += HadronicRecoil__EflowSelector()
        if not hasattr( preseq, "HadronicRecoil::RecoilCalculation" ):
            preseq += HadronicRecoil__RecoilCalculation( ConeSizes = [0.20] )
        if not hasattr( preseq, "EflowRecoil_20" ):
            preseq += HadronicRecoil__EflowRecoil("EflowRecoil_20", 
                                                  TrackRough       = "RoughRecoil_track_20", 
                                                  TrackUE          = "ueCorrection_track_20", 
                                                  TrackRef         = "RefinedRecoil_track_20", 
                                                  ClusNoTrackRough = "RoughRecoil_clusNoTrack_20", 
                                                  ClusNoTrackUE    = "ueCorrection_clusNoTrack_20", 
                                                  ClusNoTrackRef   = "RefinedRecoil_clusNoTrack_20", 
                                                  RoughRecoil_out  = "RoughRecoil_Eflow_20", 
                                                  ueCorrection_out = "ueCorrection_Eflow_20", 
                                                  RefinedRecoil_out= "RefinedRecoil_Eflow_20", 
                                                  MET_out          = "MET_HR_Eflow_20" ) 
            
    # now configure the D3PD
    
    if not alg:
        alg = MSMgr.NewRootStream(StreamName = streamname, FileName = file, TreeName = tuplename)

    
    alg += EventInfoD3PDObject        (**_args (10, 'EventInfo', kw))
    alg += LArCollisionTimeD3PDObject (**_args (10, 'LArCollisionTime', kw))

    from TriggerD3PDMaker.BunchStructureMetadata import addBunchStructureMetadata
    addBunchStructureMetadata (alg)

    # Eta rings of energy
    # FIXME brian crashing aod running
    if not rec.readAOD:
        from CaloD3PDMaker.RapgapD3PDObject       import EtaRingsNonTileD3PDObject
        from CaloD3PDMaker.RapgapD3PDObject       import EtaRingsD3PDObject

        alg += EtaRingsNonTileD3PDObject  ( **_args ( 0, 'EtaRings', kw) )
        alg += EtaRingsD3PDObject         ( **_args ( 0, 'EtaRings', kw) )
    
    # Electron/Photon blocks
    
    alg += ElectronD3PDObject         (**_args (10, 'Electron', kw))

    if testSGKey ('ElectronContainer', D3PDMakerFlags.GSFElectronSGKey()):
        alg += GSFElectronD3PDObject  (**_args (10, 'GSFElectron', kw,
                                                sgkey = D3PDMakerFlags.GSFElectronSGKey(),
                                                prefix = 'el_gsf_'))

    if flags.doPhotons():
        print "adding photons"
        alg += PhotonD3PDObject           (**_args (10, 'Photon', kw))


    # Muon blocks

     ### add the scattering significance filler - to be removed when added in the MuonD3PDMaker
    if not MuonD3PDObject.allBlocknames().has_key("MuonScatteringAngleSignificance"):
        from AthenaCommon.AppMgr import ToolSvc
        muonScatteringSigTool=None
        if hasattr(ToolSvc, "MuonScatteringSigTool"):
            muonScatteringSigTool=ToolSvc.MuonScatteringSigTool
        from JetTagD3PDMaker import MuonScatteringAngleSignificanceFillerTool
        MuonD3PDObject.defineBlock (100, "MuonScatteringAngleSignificance",
                                    MuonScatteringAngleSignificanceFillerTool,
                                    ScatteringSigTool=muonScatteringSigTool)

    alg += MuonD3PDObject             (**_args (10, 'MuidMuon', kw,
                                                sgkey='MuidMuonCollection', prefix='mu_muid_',
                                                include = ["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex",
                                                           "L2CBInfoIndex", "L1InfoIndex"],
                                                exclude = ["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
                                                allowMissing = True ))

    alg += MuonD3PDObject             (**_args (10, 'StacoMuon', kw,
                                                sgkey='StacoMuonCollection', prefix='mu_staco_',
                                                include = ["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex",
                                                           "L2CBInfoIndex", "L1InfoIndex"],
                                                exclude = ["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
                                                allowMissing = True ))
    
    from AthenaCommon.KeyStore import CfgItemList
    if CfgItemList("KeyStore_inputFile").has_item("Analysis::MuonContainer#Muons"):
        alg += MuonD3PDObject             (**_args (10, 'Muons', kw,
                                                    sgkey='Muons', prefix='mu_muons_',
                                                    include = ["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex",
                                                               "L2CBInfoIndex", "L1InfoIndex"],
                                                    exclude = ["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"],
                                                    allowMissing = True ))

    alg += MuonD3PDObject             (**_args (0, 'CaloMuon', kw, sgkey='CaloMuonCollection', prefix='mu_calo_',
                                                include = ["MuonHitSummary", "Authors", "Likelihood",
                                                           "Isolation", "CaloEnergyLoss", "Quality"] ))
    
    # Tau block

    if flags.doTaus():
        alg += TauD3PDObject              (**_args ( 1, 'Tau', kw))



     # track and cluster blocks

    # ... all clusters, very low LOD
    
    alg += ClusterD3PDObject          (**_args ( 0, 'Clusters1', kw,
                                                 exclude='SamplingBasics'))

    # ... higher LOD for pt>10 GeV
    if flags.doHighPtClusters():
        alg += ClusterD3PDObject          (**_args ( 2, 'Clusters2', kw,
                                                     sgkey  = 'HighPtClusters',
                                                     prefix = 'clpt10_'))

    if flags.doHighPtEMClusters():    
        alg += ClusterD3PDObject          (**_args ( 3, 'Clusters3', kw,
                                                     sgkey  = 'HighPtEMClusters',
                                                     prefix = 'emclpt10_'))

    from TrackD3PDMaker.TrackD3PDObject import TrackD3PDObject    

    # ... good tracks only (nSCT>3; no pt cut)

    # use standard level of track info for 'GoodTracks'

    if flags.doGoodTracks():
        # use standard level of track info for 'GoodTracks'
        alg += TrackParticleD3PDObject    (**_args ( 3, 'Tracks1', kw,
                                                     sgkey  = 'GoodTracks',
                                                     label  = 'trk',
                                                     prefix = 'trk_'))
            
        # ... high-pt tracks (nSCT>3; pt>5 GeV)
            
    if flags.doHighPtTracks():
        
        from TrackD3PDMaker.TrackD3PDMakerFlags                import TrackD3PDFlags as highPtFlags
        highPtFlags.doTruth = True
        highPtFlags.storeDiagonalCovarianceAsErrors = True
        highPtFlags.storeHitTruthMatching = True
        highPtFlags.storePixelHitsOnTrack = False
        highPtFlags.storePixelHolesOnTrack = False
        highPtFlags.storePixelOutliersOnTrack = False
        highPtFlags.storeSCTHitsOnTrack = False
        highPtFlags.storeSCTHolesOnTrack = False
        highPtFlags.storeSCTOutliersOnTrack = False
        highPtFlags.storeTRTHitsOnTrack = False
        highPtFlags.storeTRTHolesOnTrack = False
        highPtFlags.storeTRTOutliersOnTrack = False
        highPtFlags.storeTrackFitQuality = True
        highPtFlags.storeTrackMomentum = True
        highPtFlags.storeTrackSummary = True
        highPtFlags.storeTrackSummary.IDOutliers = True
        highPtFlags.storeTrackSummary.PixelInfoPlus = True
        highPtFlags.storeTrackSummary.SCTInfoPlus = True
        highPtFlags.storeTrackSummary.TRTInfoPlus = True
        highPtFlags.storeTrackSummary.InfoPlus = True
        highPtFlags.trackParametersAtBeamSpotLevelOfDetails = 0
        highPtFlags.trackParametersAtGlobalPerigeeLevelOfDetails = 2
        highPtFlags.trackParametersAtPrimaryVertexLevelOfDetails = 3  

        HighPtTrackParticleD3PDObject = TrackD3PDObject(_label='trkpt5',
                                                        _prefix='trkpt5_',
                                                        _sgkey='HighPtTracks',
                                                        typeName='Rec::TrackParticleContainer',
                                                        flags=highPtFlags)
            
        alg += HighPtTrackParticleD3PDObject(**_args ( 3, 'Tracks2', kw,
                                                       sgkey  = 'HighPtTracks',
                                                       label  = 'trkpt5',
                                                       prefix = 'trkpt5_'))

  
    # Jet blocks
    
    from JetTagD3PDMaker.JetTagD3PDMakerFlags import JetTagD3PDFlags

    # include list modified for HSG5D3PD
    
    includelist = JetTagD3PDFlags.StdInfoInclude()

    from JetTagD3PDMaker.JetTagD3PDMakerKeys import JetTagD3PDKeys
    includelist += [JetTagD3PDKeys.BTagWeightsBlockName()]
    #includelist += [JetTagD3PDKeys.JetFitterInfoBaseBlockName()] 
    #includelist += [JetTagD3PDKeys.JetFitterTagInfoBlockName()] 
    #includelist += [JetTagD3PDKeys.IP3DInfoBaseBlockName()] 
    #includelist += [JetTagD3PDKeys.IP3DIPInfoBaseBlockName()] 
    #includelist += [JetTagD3PDKeys.JetFitterCombInfoBaseBlockName()] 
    includelist += [JetTagD3PDKeys.JetTrackAssocBlockName()] 
    includelist += [JetTagD3PDKeys.JetTrackBlockName()] 
    includelist += [JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()] 
    includelist += [JetTagD3PDKeys.IPInfoPlusTrackBlockName()] 
    includelist += ['ConstituentScale']
    
    jetkw = kw
    if not jetkw.has_key ( 'AK4TopoEMJet_'+JetTagD3PDKeys.JetTrackAssocBlockName()+'_target'):
        jetkw['AK4TopoEMJet_'+JetTagD3PDKeys.JetTrackAssocBlockName()+'_target']= "trk" 
    if not jetkw.has_key ( 'AK4TopoEMJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target'):
        jetkw['AK4TopoEMJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target']= "trk" 

    alg += JetD3PDObject              (**_args ( 3, 'AK4TopoEMJet', jetkw,
                                                 sgkey='AntiKt4TopoEMJets', prefix='jet_AntiKt4TopoEM_',
                                                 include = includelist,
                                                 JetVertexFraction_FromUD=True,
                                                 JetVertexFraction_FillFullJVF=True,
                                                 allowMissing = True))

    alg += JetD3PDObject              (**_args ( 3, 'AK6TopoEMJet', kw,
                                                 sgkey='AntiKt6TopoEMJets', prefix='jet_AntiKt6TopoEM_',
                                                 include = [JetTagD3PDFlags.StdInfoInclude(),'ConstituentScale'],
                                                 JetVertexFraction_FromUD=True,
                                                 JetVertexFraction_FillFullJVF=True,
                                                 allowMissing = True))

    alg += JetD3PDObject              (**_args ( 3, 'AK4LCTopoJet', kw,
                                                 sgkey='AntiKt4LCTopoJets', prefix='jet_AntiKt4LCTopo_',
                                                 exclude=['Layer'],
                                                 include=['ConstituentScale'],
                                                 JetVertexFraction_FromUD=True,
                                                 JetVertexFraction_FillFullJVF=True,
                                                 allowMissing = True))
    
    alg += JetD3PDObject              (**_args ( 3, 'AK6LCTopoJet', kw,
                                                 sgkey='AntiKt6LCTopoJets', prefix='jet_AntiKt6LCTopo_',
                                                 exclude=['Layer'],
                                                 include=['ConstituentScale'],
                                                 JetVertexFraction_FromUD=True,
                                                 JetVertexFraction_FillFullJVF=True,
                                                 allowMissing = True))


    from TopInputsD3PDMaker.HforD3PDObject import HforD3PDObject
    alg += HforD3PDObject(**_args (0, 'HforInfo', kw))


    # MET blocks
    # a whole mess to remove x,y components separately for all flavours

    if flags.doAllMissingET() :
        alg += MissingETD3PDObject        (**_args (10, 'MissingET', kw,
                                                    exclude=['MET_Base', 'MET_Base0', 'MET_Truth_Int',
                                                             'MET_RefFinal_Comps','MET_Calib_Comps','MET_CellOut_Comps',
                                                             'MET_CorrTopo_Comps','MET_Cryo_Comps','MET_CryoCone_Comps',
                                                             'MET_Final_Comps','MET_LocHadTopo_Comps',
                                                             'MET_LocHadTopoObj_Comps',
                                                             'MET_Muid_Comps','MET_Muid_Spectro_Comps','MET_Muid_Track_Comps',
                                                             'MET_MuonBoy_Comps','MET_MuonBoy_Spectro_Comps','MET_MuonBoy_Track_Comps',
                                                             'MET_Muons_Comps','MET_Muons_Spectro_Comps','MET_Muons_Track_Comps',
                                                             'MET_MuonMuid_Comps',
                                                             'MET_Muon_Comps','MET_Muon_Isol_Muid_Comps',
                                                             'MET_Muon_Isol_Staco_Comps','MET_Muon_NonIsol_Muid_Comps',
                                                             'MET_Muon_NonIsol_Staco_Comps','MET_Muon_Total_Muid_Comps',
                                                             'MET_Muon_Total_Staco_Comps','MET_RefEle_Comps',
                                                             'MET_RefEle_em_Comps','MET_RefGamma_Comps',
                                                             'MET_RefGamma_em_Comps','MET_RefJet_Comps',
                                                             'MET_RefJet_em_Comps','MET_RefMuon_Comps',
                                                             'MET_RefMuon_Muid_Comps','MET_RefMons_Comps','MET_RefMuon_Staco_Comps',
                                                             'MET_RefMuon_Track_Muid_Comps','MET_RefMuon_Track_Staco_Comps',
                                                             'MET_RefMuon_Track_em_Comps','MET_RefMuon_Track_Comps',
                                                             'MET_RefMuons_Track_Comps',
                                                             'MET_RefMuon_em_Comps','MET_RefTau_Comps',
                                                             'MET_RefTau_em_Comps','MET_SoftJets_Comps',
                                                             'MET_SoftJets_em_Comps','MET_Topo_Comps',
                                                             'MET_TopoObj_Comps','MET_Track_Comps','MET_Comps',
                                                             'MET_Track_Weights','MET_Cluster_Weights'],
                                                    allowMissing=True))
    else :
        alg += MissingETD3PDObject(0, sgkey = "MET_RefFinal",                prefix = "MET_RefFinal")

        # MuonBoy terms used in RefFinal
        alg += MissingETD3PDObject(0, sgkey = "MET_MuonBoy",                 prefix = "MET_MuonBoy")
        alg += MissingETD3PDObject(0, sgkey = "MET_RefMuon",                 prefix = "MET_RefMuon")
        alg += MissingETD3PDObject(0, sgkey = "MET_CellOut_Eflow",           prefix = "MET_CellOut_Eflow")

        # terms needed to calculate RefFinal with Muid instead of Staco
        alg += MissingETD3PDObject(0, sgkey = "MET_RefMuon_Muid",            prefix = "MET_RefMuon_Muid")
        alg += MissingETD3PDObject(0, sgkey = "MET_MuonMuid",                prefix = "MET_MuonMuid")
        alg += MissingETD3PDObject(0, sgkey = "MET_Muid",                    prefix = "MET_Muid")
        alg += MissingETD3PDObject(0, sgkey = "MET_CellOut_Eflow_Muid",      prefix = "MET_CellOut_Eflow_Muid")

        # terms needed to calculate RefFinal with third chain instead of Staco
        from AthenaCommon.KeyStore import CfgItemList
        keystore = CfgItemList("KeyStore_inputFile")
        if keystore.has_item("MissingET#MET_Muons"):
            alg += MissingETD3PDObject(0, sgkey = "MET_Muons",                    prefix = "MET_Muons")
        if keystore.has_item("MissingET#MET_RefMuons"):
            alg += MissingETD3PDObject(0, sgkey = "MET_RefMuons",                 prefix = "MET_RefMuons")
        if keystore.has_item("MissingET#MET_CellOut_Eflow_Muons"):
            alg += MissingETD3PDObject(0, sgkey = "MET_CellOut_Eflow_Muons",      prefix = "MET_CellOut_Eflow_Muons")
        
        # I have no idea what these are for
        alg += MissingETD3PDObject(0, sgkey = "MET_SoftJets",                prefix = "MET_SoftJets")
        alg += MissingETD3PDObject(0, sgkey = "MET_RefFinal_em",             prefix = "MET_RefFinal_em")
        alg += MissingETD3PDObject(0, sgkey = "MET_CellOut_em",              prefix = "MET_CellOut_em")
        alg += MissingETD3PDObject(0, sgkey = "MET_SoftJets_em",             prefix = "MET_SoftJets_em")
                   

    # HadronicRecoil blocks

    if flags.doHadronicRecoil():
        alg += ElectronD3PDObject(0,  sgkey = "HR_selectedElectrons",       prefix = "hr_el_")
        alg += MuonD3PDObject( 0,     sgkey = "HR_selectedMuons",           prefix = "hr_mu_" )
        
        alg += MissingETD3PDObject(0, sgkey = "RoughRecoil_20",                prefix = "hr_roughRecoil_20", 
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "ueCorrection_20",               prefix = "hr_ueCorrection_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "RefinedRecoil_20",              prefix = "hr_corrRecoil_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "MET_HR_20",                     prefix = "hr_MET_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        
        alg += MissingETD3PDObject(0, sgkey = "RoughRecoil_track_20",          prefix = "hr_roughRecoil_track_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "ueCorrection_track_20",         prefix = "hr_ueCorrection_track_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "RefinedRecoil_track_20",        prefix = "hr_corrRecoil_track_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "MET_HR_track_20",               prefix = "hr_MET_track_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        
        alg += MissingETD3PDObject(0, sgkey = "RoughRecoil_clusNoTrack_20",    prefix = "hr_roughRecoil_clusNoTrack_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "ueCorrection_clusNoTrack_20",   prefix = "hr_ueCorrection_clusNoTrack_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "RefinedRecoil_clusNoTrack_20",  prefix = "hr_corrRecoil_clusNoTrack_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "MET_HR_clusNoTrack_20",         prefix = "hr_MET_clusNoTrack_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        
        alg += MissingETD3PDObject(0, sgkey = "RoughRecoil_Eflow_20",          prefix = "hr_roughRecoil_Eflow_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "ueCorrection_Eflow_20",         prefix = "hr_ueCorrection_Eflow_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "RefinedRecoil_Eflow_20",        prefix = "hr_corrRecoil_Eflow_20",
                                   exclude=['MET_Regions','MET_Comps'] )  
        alg += MissingETD3PDObject(0, sgkey = "MET_HR_Eflow_20",               prefix = "hr_MET_Eflow_20", 
                                   exclude=['MET_Regions','MET_Comps'] )  


    """
    # track and cluster blocks

    # ... all clusters, very low LOD
    
    alg += ClusterD3PDObject          (**_args ( 0, 'Clusters1', kw,
                                                 exclude='SamplingBasics'))

    # ... higher LOD for pt>10 GeV
    if flags.doHighPtClusters():
        alg += ClusterD3PDObject          (**_args ( 2, 'Clusters2', kw,
                                                     sgkey  = 'HighPtClusters',
                                                     prefix = 'clpt10_'))

    if flags.doHighPtEMClusters():    
        alg += ClusterD3PDObject          (**_args ( 3, 'Clusters3', kw,
                                                     sgkey  = 'HighPtEMClusters',
                                                     prefix = 'emclpt10_'))

    from TrackD3PDMaker.TrackD3PDObject import TrackD3PDObject    

    # ... good tracks only (nSCT>3; no pt cut)

    # use standard level of track info for 'GoodTracks'

    if flags.doGoodTracks():
        # use standard level of track info for 'GoodTracks'
        alg += TrackParticleD3PDObject    (**_args ( 3, 'Tracks1', kw,
                                                     sgkey  = 'GoodTracks',
                                                     label  = 'trk',
                                                     prefix = 'trk_'))
            
        # ... high-pt tracks (nSCT>3; pt>5 GeV)
            
    if flags.doHighPtTracks():
        
        from TrackD3PDMaker.TrackD3PDMakerFlags                import TrackD3PDFlags as highPtFlags
        highPtFlags.doTruth = True
        highPtFlags.storeDiagonalCovarianceAsErrors = True
        highPtFlags.storeHitTruthMatching = True
        highPtFlags.storePixelHitsOnTrack = False
        highPtFlags.storePixelHolesOnTrack = False
        highPtFlags.storePixelOutliersOnTrack = False
        highPtFlags.storeSCTHitsOnTrack = False
        highPtFlags.storeSCTHolesOnTrack = False
        highPtFlags.storeSCTOutliersOnTrack = False
        highPtFlags.storeTRTHitsOnTrack = False
        highPtFlags.storeTRTHolesOnTrack = False
        highPtFlags.storeTRTOutliersOnTrack = False
        highPtFlags.storeTrackFitQuality = True
        highPtFlags.storeTrackMomentum = True
        highPtFlags.storeTrackSummary = True
        highPtFlags.storeTrackSummary.IDOutliers = True
        highPtFlags.storeTrackSummary.PixelInfoPlus = True
        highPtFlags.storeTrackSummary.SCTInfoPlus = True
        highPtFlags.storeTrackSummary.TRTInfoPlus = True
        highPtFlags.storeTrackSummary.InfoPlus = True
        highPtFlags.trackParametersAtBeamSpotLevelOfDetails = 0
        highPtFlags.trackParametersAtGlobalPerigeeLevelOfDetails = 2
        highPtFlags.trackParametersAtPrimaryVertexLevelOfDetails = 3  

        HighPtTrackParticleD3PDObject = TrackD3PDObject(_label='trkpt5',
                                                        _prefix='trkpt5_',
                                                        _sgkey='HighPtTracks',
                                                        typeName='Rec::TrackParticleContainer',
                                                        flags=highPtFlags)
            
        alg += HighPtTrackParticleD3PDObject(**_args ( 3, 'Tracks2', kw,
                                                       sgkey  = 'HighPtTracks',
                                                       label  = 'trkpt5',
                                                       prefix = 'trkpt5_'))
    """       
    
    # Primary vertex block - May be missing in single-beam data.

    alg += PrimaryVertexD3PDObject (**_args (1, 'PrimaryVertex', kw,
                                             allowMissing = True,
                                             sgkey = D3PDMakerFlags.VertexSGKey(),
                                             prefix = 'vxp_'))
            
    # MBTS 
            
    alg += MBTSD3PDObject             (**_args (10, 'MBTS', kw))
    alg += MBTSTimeD3PDObject         (**_args (10, 'MBTSTime', kw))
    alg += MBTSTriggerBitsD3PDObject  (**_args (10, 'MBTSTriggerBits', kw))
    #alg += CollisionDecisionD3PDObject(**_args (10, 'CollisionDecision', kw))
    
    # Truth

    if rec.doTruth():

        from TruthD3PDMaker.TruthParticleD3PDObject            import TruthParticleD3PDObject
        from MuonD3PDMaker.TruthMuonD3PDObject                 import TruthMuonD3PDObject

        alg += TruthMuonD3PDObject    (**_args ( 2, 'TruthMuon', kw))
        alg += GenEventD3PDObject     (**_args ( 1, 'GenEvent', kw))
        alg += TruthParticleD3PDObject(**_args ( 1, 'TruthParticle', kw))

        # TruthJets
        alg += JetD3PDObject          (**_args ( 1, 'AK4TruthJet', kw,
                                                 sgkey='AntiKt4TruthJets',prefix='jet_AntiKt4Truth_',
                                                 allowMissing = True))
        alg += JetD3PDObject          (**_args ( 1, 'AK6TruthJet', kw,
                                                 sgkey='AntiKt6TruthJets', prefix='jet_AntiKt6Truth_',
                                                 allowMissing = True))
        alg += JetD3PDObject          (**_args ( 1, 'AK4TruthJetALL', kw,
                                                 sgkey='AntiKt4TruthJets_ALL', prefix='jet_AntiKt4TruthALL_',
                                                 allowMissing = True))
        alg += JetD3PDObject          (**_args ( 1, 'AK6TruthJetALL', kw,
                                                 sgkey='AntiKt6TruthJets_ALL', prefix='jet_AntiKt6TruthALL_',
                                                 allowMissing = True))
        alg += JetD3PDObject          (**_args ( 1, 'AK4TruthJetWZ', kw,
                                                 sgkey='AntiKt4TruthJets_WZ', prefix='jet_AntiKt4TruthWZ_',
                                                 allowMissing = True))
        alg += JetD3PDObject          (**_args ( 1, 'AK6TruthJetWZ', kw,
                                                 sgkey='AntiKt6TruthJets_WZ', prefix='jet_AntiKt6TruthWZ_',
                                                 allowMissing = True))
        

    if not rec.doTruth():
        alg += BeamSpotD3PDObject(10)
    

    from TrigMissingETD3PDMaker.TrigMETD3PD import TrigMETD3PDObjects
    TrigMETD3PDObjects(alg,10)
    
    # Trigger

    if D3PDMakerFlags.DoTrigger():

        alg += SMWZTriggerBitsD3PDObject      (**_args (10, 'SMWZTriggerBits', kw))
        
        # Trigger Decision + metadata

        alg += TrigDecisionD3PDObject  (**_args(10, 'TrigDecision', kw))
        addTrigConfMetadata(alg)
        
        # Bunch group info

        alg += BGCodeD3PDObject (**_args (2, 'BGCode', kw))

        # Egamma and Mu
        
        TrigEgammaD3PDObjects (alg, 1)
        TrigMuonD3PDObjects( alg, 1)

        # Esum

        #alg += EnergySumROID3PDObject(**_args (2, 'EnergySumROI', kw,
        #                                       prefix = "trig_L1_esum_"))

        # The LVL2 information:

        #alg += TrigMETD3PDObject(**_args( 2, 'TrigMETL2', kw,
        #                                  prefix = "trig_L2_met_",
        #                                  sgkey = "HLT_T2MissingET" ))
        # The EF information:

        #alg += TrigMETD3PDObject(**_args ( 2, 'TrigMETEF', kw,
        #                                   prefix = "trig_EF_met_",
        #                                   sgkey = "HLT_TrigEFMissingET" ))

# Event metadata

    alg.MetadataTools += [LBMetadataConfig()]

# Invoke routine to write GSCFactor and WidthFraction jet moments

    #addSTRUCTCalib('AntiKt4LCTopoJets', input='Topo', mainParam=0.4)
    #addSTRUCTCalib('AntiKt6LCTopoJets', input='Topo', mainParam=0.6)
    #addSTRUCTCalib('AntiKt4TopoEMJets', input='Topo', mainParam=0.4)
    #addSTRUCTCalib('AntiKt6TopoEMJets', input='Topo', mainParam=0.6)
    
    if D3PDMakerFlags.FilterCollCand():
        from CaloD3PDMaker.CollisionFilterAlg import CollisionFilterAlg
        alg.filterSeq += CollisionFilterAlg (tuplename + '_CollCandFilter')

    return alg
コード例 #25
0
mixedFilterMuid=H4lDPDMaker.H4lMixedFilter("H4lMixedFilterMuid", nLept=2,\
                                           pTCuts=[0,10*Units.GeV],\
                                           eTCuts=[10*Units.GeV,0],\
                                           qualityCuts=[eQual,muQual],\
                                           types=["e","mu"],\
                                           collections=["RobustLooseElectronCollection","MuidMuonCollection"],\
                                           mass=5*Units.GeV)

theJob += mixedFilterStaco
theJob += mixedFilterMuid

# The job starts here!
rec.AutoConfiguration.append('FieldAndGeo')
#rec.AutoConfiguration.append('BeamType')
rec.AutoConfiguration.append('ConditionsTag')
rec.AutoConfiguration.append('RealOrSim')

include("RecExCommon/RecExCommon_topOptions.py")

# define streams

streamOut = MSMgr.NewPoolStream("HSG2_DPD", OutputFile2L)
streamOut.AcceptAlgs([
    "H4l_2ElectronFilter", "H4l_2StacoMuonFilter", "H4l_2MuidMuonFilter",
    "H4lMixedFilterStaco", "H4lMixedFilterMuid"
])

dpdOutHelper.addAllItemsFromInputExceptExcludeList("HSG2_DPD", [])

theApp.EvtMax = evtMax
コード例 #26
0
    SkimmingTools=[DRAW_EGZ_SkimmingTool])
topSequence += DRAW_EGZ_Seq

##################
### Output stream
##################
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD

streamName = primDPD.WriteDRAW_EGZ.StreamName
fileName = buildFileName(primDPD.WriteDRAW_EGZ)
# Remove the .pool.root ending in the file name, this is a RAW file!
if fileName.endswith(".pool.root"):
    fileName = fileName.rstrip(".pool.root")
    pass
StreamDRAW_EGZ = MSMgr.NewByteStream(streamName, fileName)
StreamDRAW_EGZ.AddRequireAlgs(["DRAW_EGZKernel"])

# Don't write an output RAW file if it is empty
StreamDRAW_EGZ.bsOutputSvc.WriteEventlessFiles = primDPD.WriteEventlessFiles()

#########################################
# Add the containers to the output stream
#########################################
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput

# Take everything from the input
ExcludeList = []
dpdOutput.addAllItemsFromInputExceptExcludeList(streamName, ExcludeList)
コード例 #27
0
include("PhysicsD3PDMaker/JetSelector.py")
include("PhysicsD3PDMaker/TauSelector.py")

# Configure branches
from AthenaCommon.AppMgr import ServiceMgr
from D3PDMakerRoot.D3PDMakerRootConf import D3PD__RootD3PDSvc
ServiceMgr += D3PD__RootD3PDSvc("SMDYEE_D3PDSvc")
ServiceMgr.SMDYEE_D3PDSvc.VetoedNames = [
    "L1_.*", "L2_.*", "EF_m.*", "EF_2m.*", "EF_j.*", "EF_2j.*", "EF_tau.*"
]
ServiceMgr.SMDYEE_D3PDSvc.VetoedNames += ["trig_EF_trigmu.*"]
ServiceMgr.SMDYEE_D3PDSvc.VetoedNames += ["MET.*", ".*etx.*", ".*ety.*"]

# Create the D3PD streams:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
SMDYEED3PDStream = MSMgr.NewRootStream(streamName, fileName, "physics")
SMDYEED3PDStream.D3PDSvc = ServiceMgr.SMDYEE_D3PDSvc

# Now add all the content to this stream:
from PhysicsD3PDMaker.SMWZLightD3PD import SMWZLightD3PD
SMWZLightD3PD(SMDYEED3PDStream, stdElectronContainer='LowPtElectrons')

# apply skim
SMDYEED3PDStream.AddAcceptAlgs(["SMWZ_JPsieeFilter"])

# add cut flow information
from EventCommonD3PDMaker.CutFlowMetadataConfig import CutFlowMetadataConfig
SMDYEED3PDStream.MetadataTools += [CutFlowMetadataConfig(SMDYEED3PDStream)]

# Silence tool warnings:
コード例 #28
0
    print DerivationFrameworkJob.properties()

#################
### Steer output file content
#################
## Add service for metadata
ToolSvc += CfgMgr.xAODMaker__TriggerMenuMetaDataTool("TriggerMenuMetaDataTool")
svcMgr.MetaDataSvc.MetaDataTools += [ToolSvc.TriggerMenuMetaDataTool]

## Steer output file
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDAOD_IDNCBStream.StreamName
fileName = buildFileName(primDPD.WriteDAOD_IDNCBStream)
IDNCBStream = MSMgr.NewPoolRootStream(streamName, fileName)
IDNCBStream.AcceptAlgs(["DFIDNCB_KERN"])
from AthenaServices.Configurables import ThinningSvc, createThinningSvc
augStream = MSMgr.GetStream(streamName)
evtStream = augStream.GetEventStream()
svcMgr += createThinningSvc(svcName="IDNCBThinningSvc", outStreams=[evtStream])

excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-trackParameterCovarianceMatrices.-parameterX.-parameterY.-parameterZ.-parameterPX.-parameterPY.-parameterPZ.-parameterPosition"
excludedTRTData = "-T0.-TRTboard.-TRTchip.-bitPattern.-driftTimeToTCorrection.-driftTimeHTCorrection.-highThreshold.-strawnumber"
excludedSCTData = "-detectorElementID.-hitsInThirdTimeBin.-rdo_groupsize"

# Add generic event information
IDNCBStream.AddItem("xAOD::EventInfo#*")
IDNCBStream.AddItem("xAOD::EventAuxInfo#*")

#SKC Add jets!
コード例 #29
0
if not 'JetTagD3PD_redoTagging' in dir():
    JetTagD3PD_redoTagging = True

if not 'JetTagD3PD_JetFitterCharm' in dir():
    JetTagD3PD_JetFitterCharm = True

if not 'JetTagD3PD_MV3' in dir():
    JetTagD3PD_MV3 = True

include("JetTagD3PDMaker/JetTagD3PD_prodFragmentCore.py")

from AthenaCommon.JobProperties import jobproperties
btagprodFlags = jobproperties.D3PDProdFlags
from PrimaryDPDMaker.PrimaryDPDHelpers import buildFileName

if btagprodFlags.WriteBTAGEFFD3PD.isVirtual:
    raise NameError("BTAGD3PD set to be a virtual stream")
    pass

streamName = btagprodFlags.WriteBTAGEFFD3PD.StreamName
fileName = buildFileName(btagprodFlags.WriteBTAGEFFD3PD)

from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
alg = MSMgr.NewRootStream(btagprodFlags.WriteBTAGEFFD3PD.StreamName, fileName,
                          JetTagD3PDKeys.D3PDTupleName())

from JetTagD3PDMaker.BTaggingD3PD import BTaggingD3PD
BTaggingD3PD(alg, **(JetTagD3PDFlags.D3PDPropDict()))

include("JetTagD3PDMaker/JetTagD3PD_prodFragmentPostStream.py")
コード例 #30
0
# filterseq += CfgMgr.met__METAssocTestAlg("TestMETAssocEMPFlow",
#                                          OutputLevel=VERBOSE,
#                                          FailOnInconsistency=True,
#                                          METMapSuffix="NewAntiKt4EMPFlow")

write_xAOD = True
if write_xAOD:

    # The list of output containers/maps is autogenerated and stored in metFlags
    # This jO extracts them with the appropriate formatting
    from AthenaCommon.Resilience import protectedInclude
    protectedInclude(
        "METReconstruction/METReconstructionOutputAODList_jobOptions.py")

    from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
    xaodStream = MSMgr.NewPoolRootStream("StreamAOD", "xAOD3.pool.root")
    for item in MissingETAODList:
        xaodStream.AddItem(item)

    xaodStream.AddItem('xAOD::MissingETContainer#MET_Reference_Anti*')
    xaodStream.AddItem('xAOD::MissingETAuxContainer#MET_Reference_Anti*Aux.')

    xaodStream.AddItem('xAOD::TrackParticleContainer#InDetTrackParticles*')
    xaodStream.AddItem(
        'xAOD::TrackParticleAuxContainer#InDetTrackParticlesAux.')

    # xaodStream.AddAcceptAlgs( "PVSoftTrkTail" )
theApp.EvtMax = 200
ServiceMgr.EventSelector.SkipEvents = 0
ServiceMgr.MessageSvc.defaultLimit = 9999