def addToAlg(self,alg): alg += self.MyJetD3PDObject(0, prefix='jet_' + self.parentJets + '_', sgkey=self.parentJets+'Jets', exclude=self.commonExcludeList, include = self.commonIncludeList + self.VtxInclude + self.JetQualInclude) for idx,gr in enumerate(self.groomedJetsList): kw = {} includelist = [] includelist_unique = [] if 'Trim' in gr: includelist_unique += ['TrimConfigMoments'] elif 'Filt' in gr and 'Subjets' not in gr: includelist += ['FiltMoments'] includelist_unique += ['FiltConfigMoments'] if len(self.groomedJetsList) > idx+1 and 'Subjets' in self.groomedJetsList[idx+1]: includelist += ['blockbtag'+self.groomedJetsList[idx+1], self.groomedJetsList[idx+1]+'blockindex'] elif 'Subjets' in gr: includelist += [JetTagD3PDKeys.BTagWeightsBlockName()] includelist += [JetTagD3PDKeys.JetTrackAssocBlockName()] includelist += [JetTagD3PDKeys.JetTrackBlockName()] includelist += [JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()] includelist += [JetTagD3PDKeys.IPInfoPlusTrackBlockName()] kw[JetTagD3PDKeys.JetTrackAssocBlockName()+'_target']= "trk" kw[JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target']= "trk" alg += self.MyGroomedJetD3PDObject(0, prefix='jet_' + self.parentJets + gr + '_', sgkey=self.parentJets + gr +'Jets', include = includelist + self.commonIncludeList,exclude=self.commonExcludeList,**kw) alg += self.MyGroomedJetCollectionD3PDObject( 0, prefix='jet_' + self.parentJets + gr + '_config_', sgkey=self.parentJets + gr +'Jets', include = includelist_unique) return
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
def SMWZD3PD (alg = None, file = 'smwz.root', tuplename = 'physics', streamname = 'd3pdstream', doSoftQCD = False, doThirdMuonChain = True, stdElectronContainer = D3PDMakerFlags.ElectronSGKey(), gsfElectronContainer = D3PDMakerFlags.GSFElectronSGKey(), muonContainer = 'None', # can be 'Muons' for third muon chain stacoMuonContainer = 'StacoMuonCollection', muidMuonContainer = 'MuidMuonCollection', caloMuonContainer = 'CaloMuonCollection', photonContainer = D3PDMakerFlags.PhotonSGKey(), tauContainer = D3PDMakerFlags.TauSGKey(), jetEM4Container = 'AntiKt4TopoEMJets', #Commented by Bertrand jetEM6Container = 'AntiKt6TopoEMJets', jetLC4Container = 'AntiKt4LCTopoJets', jetLC6Container = 'AntiKt6LCTopoJets', #jetEM4Container = 'AntiKt4TopoEMJetsReTagged', #jetEM6Container = 'AntiKt6TopoEMJetsReTagged', #jetLC4Container = 'AntiKt4LCTopoJetsReTagged', #jetLC6Container = 'AntiKt6LCTopoJetsReTagged', jetDetails = 3, # for the moment only level 2 and 3 are defined METDetails = 3, # for the moment only level 2 and 3 are defined **kw): if doThirdMuonChain and muonContainer == 'None': muonContainer = 'Muons' # define associations if not PhotonD3PDObject.allBlocknames().has_key('RecoveryMatch'): from PhotonD3PDMaker.PhotonRecoveryAssociation import PhotonRecoveryAssociation if (stdElectronContainer != 'None'): PhotonRecoveryAssoc = PhotonRecoveryAssociation(PhotonD3PDObject, 'ElectronContainer', stdElectronContainer, prefix = 'el_', blockname = 'RecoveryMatch', target = 'ph_ElectronRecovered_') # define track and cluster filters preseq = AlgSequence (D3PDMakerFlags.PreD3PDAlgSeqName()) if not hasattr( preseq, "GoodTracks" ): filter1 = makeTrackFilterAlg(TracksName = D3PDMakerFlags.TrackSGKey(), OutputTracksName='GoodTracks', ptCut=0.,nSCTPix=4) preseq += filter1 if not hasattr( preseq, "HighPtTracks" ): filter2 = makeTrackFilterAlg(TracksName = D3PDMakerFlags.TrackSGKey(), OutputTracksName='HighPtTracks', ptCut=4000.,nSCTPix=4) preseq += filter2 if not hasattr( preseq, "HighPtClusters" ): filter3 = makeClusterFilter(InputName = D3PDMakerFlags.ClusterSGKey(), OutputName = 'HighPtClusters', ptCut=10000.) preseq += filter3 if not hasattr( preseq, "HighPtEMClusters" ): filter4 = makeClusterFilter(InputName = D3PDMakerFlags.EMTopoClusterSGKey(), OutputName = 'HighPtEMClusters', ptCut=10000.) preseq += filter4 # perform recoil calculation import HadronicRecoil.Configurables as hrc preseq = hrc.add_hadronic_recoil_filters(preseq) # beam background stuff from RecBackgroundAlgs.RecBackgroundAlgsConf import BeamBackgroundFiller if not hasattr( preseq, "BeamBackgroundFiller" ): BeamBackgroundFiller=BeamBackgroundFiller() preseq += BeamBackgroundFiller # 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) from BackgroundD3PDMaker.BeamBackgroundD3PDObject import BeamBackgroundD3PDObject from BackgroundD3PDMaker.BackgroundWordD3PDObject import BackgroundWordD3PDObject alg += BackgroundWordD3PDObject (**_args(0, 'BkgWord', kw)) alg += BeamBackgroundD3PDObject(1) # Electron/Photon blocks if (stdElectronContainer != 'None'): alg += ElectronD3PDObject (**_args (10, 'Electron', kw, sgkey = stdElectronContainer)) if (gsfElectronContainer != 'None') and testSGKey ('ElectronContainer', gsfElectronContainer): alg += GSFElectronD3PDObject (**_args (10, 'GSFElectron', kw, sgkey = gsfElectronContainer, prefix = 'el_gsf_')) if (photonContainer != 'None'): alg += PhotonD3PDObject (**_args (10, 'Photon', kw, sgkey = photonContainer)) # Muon blocks ### Third muon chain variables! if (muonContainer != 'None'): alg += MuonD3PDObject (**_args (10, 'Muon', kw, sgkey=muonContainer, prefix='mu_', include = ["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex"], exclude = ["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"], allowMissing = True )) ### Third muon chain variables! if (muidMuonContainer != 'None'): alg += MuonD3PDObject (**_args (10, 'MuidMuon', kw, sgkey=muidMuonContainer, prefix='mu_muid_', include = ["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex"], exclude = ["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"], allowMissing = True )) if (stacoMuonContainer != 'None'): alg += MuonD3PDObject (**_args (10, 'StacoMuon', kw, sgkey=stacoMuonContainer, prefix='mu_staco_', include = ["EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex"], exclude = ["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"], allowMissing = True )) if (caloMuonContainer != 'None'): alg += MuonD3PDObject (**_args (10, 'CaloMuon', kw, sgkey=caloMuonContainer, prefix='mu_calo_', include = ["MuonHitSummary", "Authors", "Likelihood", "Isolation", "CaloEnergyLoss", "Quality"] )) # Tau block if (tauContainer != 'None'): alg += TauD3PDObject (**_args ( 1, 'Tau', kw, sgkey = tauContainer)) # Jet blocks from JetTagD3PDMaker.JetTagD3PDMakerFlags import JetTagD3PDFlags from JetTagD3PDMaker.JetTagD3PDMakerKeys import JetTagD3PDKeys ## add MSV target to the jetd3pd object properties if not kw.has_key ('AK4TopoEMJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target'): kw['AK4TopoEMJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target']= JetTagD3PDKeys.MSVVtxInfoInJetGetterLabel() if not kw.has_key ('AK6TopoEMJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target'): kw['AK6TopoEMJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target']= JetTagD3PDKeys.MSVVtxInfoInJetGetterLabel() ## add track index for IPInfoPlus if not kw.has_key ('AK4TopoEMJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target'): kw['AK4TopoEMJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target']= "trk" if not kw.has_key ('AK6TopoEMJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target'): kw['AK6TopoEMJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target']= "trk" ## add track index for SVInfoPlus if not kw.has_key ('AK4TopoEMJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target'): kw['AK4TopoEMJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target']= "trk" if not kw.has_key ('AK6TopoEMJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target'): kw['AK6TopoEMJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target']= "trk" ## add track index for SV0InfoPlus if not kw.has_key ('AK4TopoEMJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target'): kw['AK4TopoEMJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target']= "trk" if not kw.has_key ('AK6TopoEMJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target'): kw['AK6TopoEMJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target']= "trk" ## add MSV target to the jetd3pd object properties if not kw.has_key ('AK4LCTopoJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target'): kw['AK4LCTopoJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target']= JetTagD3PDKeys.MSVVtxInfoInJetGetterLabel() if not kw.has_key ('AK6LCTopoJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target'): kw['AK6LCTopoJet_'+JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName()+'_target']= JetTagD3PDKeys.MSVVtxInfoInJetGetterLabel() ## add track index for IPInfoPlus if not kw.has_key ('AK4LCTopoJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target'): kw['AK4LCTopoJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target']= "trk" if not kw.has_key ('AK6LCTopoJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target'): kw['AK6LCTopoJet_'+JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName()+'_target']= "trk" ## add track index for SVInfoPlus if not kw.has_key ('AK4LCTopoJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target'): kw['AK4LCTopoJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target']= "trk" if not kw.has_key ('AK6LCTopoJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target'): kw['AK6LCTopoJet_'+JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName()+'_target']= "trk" ## add track index for SV0InfoPlus if not kw.has_key ('AK4LCTopoJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target'): kw['AK4LCTopoJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target']= "trk" if not kw.has_key ('AK6LCTopoJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target'): kw['AK6LCTopoJet_'+JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName()+'_target']= "trk" if jetDetails == 3: jetInclude = JetTagD3PDFlags.StdInfoInclude()+[JetTagD3PDKeys.MultiSVInfoPlusBlockName()] jetInclude += [JetTagD3PDKeys.JetFitterCharmTagInfoBlockName(), JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName()] else: jetInclude = [ JetTagD3PDKeys.BTagWeightsBlockName(), JetTagD3PDKeys.TruthInfoBlockName() ] if (jetEM4Container != 'None'): alg += JetD3PDObject (**_args ( 4, 'AK4TopoEMJet', kw, sgkey=jetEM4Container, prefix='jet_AntiKt4TopoEM_', include = jetInclude+['BeamBackground','ConstituentScale','TracksMoments'], JetVertexFraction_FromUD=False, JetVertexFraction_FillFullJVF=False, allowMissing = True)) if (jetEM6Container != 'None'): alg += JetD3PDObject (**_args ( 4, 'AK6TopoEMJet', kw, sgkey=jetEM6Container, prefix='jet_AntiKt6TopoEM_', include = jetInclude+['BeamBackground','ConstituentScale','TracksMoments'], JetVertexFraction_FromUD=False, JetVertexFraction_FillFullJVF=False, allowMissing = True)) if (jetLC4Container != 'None'): alg += JetD3PDObject (**_args ( 4, 'AK4LCTopoJet', kw, sgkey=jetLC4Container, prefix='jet_AntiKt4LCTopo_', include = jetInclude+['BeamBackground','ConstituentScale','TracksMoments'], JetVertexFraction_FromUD=False, JetVertexFraction_FillFullJVF=False, allowMissing = True)) if (jetLC6Container != 'None'): alg += JetD3PDObject (**_args ( 4, 'AK6LCTopoJet', kw, sgkey=jetLC6Container, prefix='jet_AntiKt6LCTopo_', include = jetInclude+['BeamBackground','ConstituentScale','TracksMoments'], JetVertexFraction_FromUD=False, JetVertexFraction_FillFullJVF=False, allowMissing = True)) ### add the MSV block MSVJetCollections = [] if (jetEM4Container != 'None'): MSVJetCollections += [jetEM4Container] if (jetEM6Container != 'None'): MSVJetCollections += [jetEM6Container] if (jetLC4Container != 'None'): MSVJetCollections += [jetLC4Container] if (jetLC6Container != 'None'): MSVJetCollections += [jetLC6Container] ### link multisv to tracks if not kw.has_key ('msvvtxinfo_JetTag_JetMultiSVVtxAssoc_target'): kw['msvvtxinfo_JetTag_JetMultiSVVtxAssoc_target']= "trk" from JetTagD3PDMaker.JetTagMSVVtxInJetD3PDObject import getJetTagMSVVtxInfoInJetD3PDObject alg += getJetTagMSVVtxInfoInJetD3PDObject(**_args(1,"msvvtxinfo", kw, jetCollections=MSVJetCollections) ) 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 METDetails >= 3: 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_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_RefMuon_Staco_Comps', 'MET_RefMuon_Track_Muid_Comps','MET_RefMuon_Track_Staco_Comps', 'MET_RefMuon_Track_em_Comps','MET_RefMuon_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)) elif METDetails > 0: alg += MissingETD3PDObject (**_args (10, 'MissingET', kw, exclude=['MET_Base','MET_Base0','MET_Truth', 'MET_CellOut_Comps','MET_CellOut_Regions', 'MET_CellOut_em_Comps','MET_CellOut_em_Regions', 'MET_CellOut_Eflow_Comps','MET_CellOut_Eflow_Regions', 'MET_Calib', 'MET_CorrTopo', 'MET_Cryo', 'MET_CryoCone', 'MET_Final', 'MET_LocHadTopo_Comps', 'MET_LocHadTopoObj', 'MET_Muid', 'MET_Muid_Spectro', 'MET_Muid_Track', 'MET_MuonBoy_Regions', '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_Track_Weights','MET_Cluster_Weights', 'MET_Comps' ], allowMissing=True )) if METDetails > 0: add_met (alg) # track and cluster blocks # ... all clusters, very low LOD alg += ClusterD3PDObject (**_args ( 0, 'Clusters1', kw, exclude='SamplingBasics')) # ... higher LOD for pt>10 GeV alg += ClusterD3PDObject (**_args ( 2, 'Clusters2', kw, sgkey = 'HighPtClusters', prefix = 'clpt10_')) alg += ClusterD3PDObject (**_args ( 3, 'Clusters3', kw, sgkey = 'HighPtEMClusters', prefix = 'emclpt10_')) from TrackD3PDMaker.TrackD3PDObject import TrackD3PDObject # ... good tracks only (nSCT>3; no pt cut) # turn on detailed track info if writing SoftQCD version of D3PD if doSoftQCD : from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags as softQcdFlags softQcdFlags.doTruth = True softQcdFlags.storeDetailedTruth = False softQcdFlags.storeDiagonalCovarianceAsErrors = True softQcdFlags.storeHitTruthMatching = True softQcdFlags.storePixelHitsOnTrack = False softQcdFlags.storePixelHolesOnTrack = False softQcdFlags.storePixelOutliersOnTrack = False softQcdFlags.storeSCTHitsOnTrack = False softQcdFlags.storeSCTHolesOnTrack = False softQcdFlags.storeSCTOutliersOnTrack = False softQcdFlags.storeTRTHitsOnTrack = False softQcdFlags.storeTRTHolesOnTrack = False softQcdFlags.storeTRTOutliersOnTrack = False softQcdFlags.storeTrackFitQuality = True softQcdFlags.storeTrackInfo = True softQcdFlags.storeTrackMomentum = True softQcdFlags.storeTrackPredictionAtBLayer = True softQcdFlags.storeTrackSummary = True softQcdFlags.trackParametersAtBeamSpotLevelOfDetails = 0 softQcdFlags.trackParametersAtGlobalPerigeeLevelOfDetails = 2 softQcdFlags.trackParametersAtPrimaryVertexLevelOfDetails = 2 SoftQCDTrackParticleD3PDObject = TrackD3PDObject(_label='trk', _prefix='trk_', _sgkey='GoodTracks', typeName='Rec::TrackParticleContainer', truthMapKey='TrackParticleTruthCollection', SGKeyForTruth=D3PDMakerFlags.TrackSGKey(), flags=softQcdFlags) alg += SoftQCDTrackParticleD3PDObject(**_args ( 3, 'Tracks1', kw, sgkey = 'GoodTracks', label = 'trk', prefix = 'trk_')) else : # ... 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) 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='trkpt4', _prefix='trkpt4_', _sgkey='HighPtTracks', typeName='Rec::TrackParticleContainer', truthMapKey='TrackParticleTruthCollection', SGKeyForTruth=D3PDMakerFlags.TrackSGKey(), flags=highPtFlags) alg += HighPtTrackParticleD3PDObject(**_args ( 3, 'Tracks2', kw, sgkey = 'HighPtTracks', label = 'trkpt4', prefix = 'trkpt4_')) # 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)) ### EventShape variables Bertrand alg += EventShapeD3PDObject(**_args(0, 'rho', kw)) # Truth if rec.doTruth(): from TruthD3PDMaker.TruthParticleD3PDObject import TruthParticleD3PDObject alg += TruthParticleD3PDObject(**_args ( 1, 'TruthParticle', kw)) 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 smwzGenEvtFilterTool = D3PD__GenObjectsFilterTool( "smwzGenEvtFilterTool" ) ToolSvc += smwzGenEvtFilterTool smwzGenEvtFilterTool.RemoveDummyEvents = True smwzGenEvtFilterTool.RemoveInTimePileUp = True smwzGenEvtFilterTool.Remove2BCPileUp = True smwzGenEvtFilterTool.Remove800nsPileUp = True smwzGenEvtFilterTool.RemoveCavernBkg = True smwzGenEvtFilterTool.RemoveEmptyEvents = True from TruthD3PDMaker.GenEventD3PDObject import GenEventD3PDObject alg += GenEventD3PDObject (**_args ( 0, 'GenEvent', kw, filter = smwzGenEvtFilterTool )) # ... TruthJets if not testSGKey ('JetCollection', 'AntiKt6TruthJets'): make_StandardJetGetter('AntiKt', 0.6, 'Truth') 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)) # ... heavy flavor truth information from AthenaCommon.AppMgr import ToolSvc from TruthD3PDAnalysis.TruthD3PDAnalysisConf import D3PD__GenObjectsFilterTool smwzhfGenVtxFilterTool = D3PD__GenObjectsFilterTool( "SMWZHFGenVtxFilterTool" ) ToolSvc += smwzhfGenVtxFilterTool smwzhfGenVtxFilterTool.RemoveInTimePileUp = False smwzhfGenVtxFilterTool.Remove2BCPileUp = True smwzhfGenVtxFilterTool.Remove800nsPileUp = True smwzhfGenVtxFilterTool.RemoveCavernBkg = True smwzhfGenVtxFilterTool.RemoveEmptyEvents = True smwzhfGenVtxFilterTool.RemoveDummyEvents = True smwzhfGenVtxFilterTool.RemoveUnrequestedParticles=True smwzhfGenVtxFilterTool.KeepBCHadrons=True from TruthD3PDMaker.GenVertexD3PDObject import GenVertexD3PDObject alg += GenVertexD3PDObject( **_args(0, "hfgenvertex", kw, prefix='mchfvtx_', filter = smwzhfGenVtxFilterTool ) ) smwzhfGenPartFilterTool = D3PD__GenObjectsFilterTool( "SMWZHFGenPartFilterTool" ) ToolSvc += smwzhfGenPartFilterTool smwzhfGenPartFilterTool.RemoveInTimePileUp = False smwzhfGenPartFilterTool.Remove2BCPileUp = True smwzhfGenPartFilterTool.Remove800nsPileUp = True smwzhfGenPartFilterTool.RemoveCavernBkg = True smwzhfGenPartFilterTool.RemoveEmptyEvents = True smwzhfGenPartFilterTool.RemoveDummyEvents = True smwzhfGenPartFilterTool.RemoveUnrequestedParticles=True smwzhfGenPartFilterTool.KeepBCQuarks=True smwzhfGenPartFilterTool.KeepBCQuarkAncestors=True smwzhfGenPartFilterTool.KeepBCHadrons=True smwzhfGenPartFilterTool.KeepBCHadronDecayChain=True smwzhfGenPartFilterTool.BCHadronsDescendantsPtCut=200 smwzhfGenPartFilterTool.BCHadronsDescendantsBarcodeCut=300000 smwzhfGenPartFilterTool.BCHadronsDescendantsEtaCut=5 from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject alg += GenParticleD3PDObject( **_args(10, "hfgenparticle", kw, prefix='mchfpart_', filter = smwzhfGenPartFilterTool, GenParticle_WriteMotherType=False, GenParticle_WriteMotherBarcode=False ) ) # ... leptonic W/Z truth information smwzlepwzGenPartFilterTool = D3PD__GenObjectsFilterTool( "SMWZLepWZGenPartFilterTool" ) ToolSvc += smwzlepwzGenPartFilterTool smwzlepwzGenPartFilterTool.RemoveInTimePileUp = True smwzlepwzGenPartFilterTool.Remove2BCPileUp = True smwzlepwzGenPartFilterTool.Remove800nsPileUp = True smwzlepwzGenPartFilterTool.RemoveCavernBkg = True smwzlepwzGenPartFilterTool.RemoveEmptyEvents = True smwzlepwzGenPartFilterTool.RemoveDummyEvents = True smwzlepwzGenPartFilterTool.RemoveUnrequestedParticles=True smwzlepwzGenPartFilterTool.KeepLeptonicWZBosons=True smwzlepwzGenPartFilterTool.KeepLeptonicWZBosonDecayChains=True smwzlepwzGenPartFilterTool.KeepLeptonicWZBosonsParents=True from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject alg += GenParticleD3PDObject( **_args(10, "lepwzgenparticle", kw, prefix='mclepwzpart_', filter = smwzlepwzGenPartFilterTool, 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(): 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) # MET TrigMETD3PDObjects (alg, 2) # The BJet information: TrigBJetD3PDObjects(alg,10, False, False, True, True, True) # Event metadata alg.MetadataTools += [LBMetadataConfig()] if D3PDMakerFlags.FilterCollCand(): from CaloD3PDMaker.CollisionFilterAlg import CollisionFilterAlg alg.filterSeq += CollisionFilterAlg (tuplename + '_CollCandFilter') return alg
def ZPrimeMMD3PD(alg=None, file='smwz.root', tuplename='physics', streamname='d3pdstream', doSoftQCD=False, doThirdMuonChain=True, **kw): # define associations if 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 not hasattr(preseq, "GoodTracks"): filter1 = makeTrackFilterAlg(TracksName=D3PDMakerFlags.TrackSGKey(), OutputTracksName='GoodTracks', ptCut=0., nSCTPix=4) preseq += filter1 if not hasattr(preseq, "HighPtTracks"): filter2 = makeTrackFilterAlg(TracksName=D3PDMakerFlags.TrackSGKey(), OutputTracksName='HighPtTracks', ptCut=4000., nSCTPix=4) preseq += filter2 if not hasattr(preseq, "HighPtClusters"): filter3 = makeClusterFilter(InputName=D3PDMakerFlags.ClusterSGKey(), OutputName='HighPtClusters', ptCut=10000.) preseq += filter3 if not hasattr(preseq, "HighPtEMClusters"): filter4 = makeClusterFilter( InputName=D3PDMakerFlags.EMTopoClusterSGKey(), OutputName='HighPtEMClusters', ptCut=10000.) preseq += filter4 # perform recoil calculation import HadronicRecoil.Configurables as hrc preseq = hrc.add_hadronic_recoil_filters(preseq) # 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) # 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_')) 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) ### Third muon chain variables! if doThirdMuonChain: if cfgKeyStore.isInInput("Analysis::MuonContainer", "Muons"): alg += MuonD3PDObject(**_args( 10, 'Muon', kw, sgkey='Muons', prefix='mu_', include=[ "EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex", "MuonScatteringAngleSignificance" ], exclude=[ "EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info" ], allowMissing=True)) ### Third muon chain variables! if cfgKeyStore.isInInput("Analysis::MuonContainer", "MuidMuonCollection"): alg += MuonD3PDObject(**_args( 10, 'MuidMuon', kw, sgkey='MuidMuonCollection', prefix='mu_muid_', include=[ "EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex", "MuonScatteringAngleSignificance" ], exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"], allowMissing=True)) if cfgKeyStore.isInInput("Analysis::MuonContainer", "StacoMuonCollection"): alg += MuonD3PDObject(**_args( 10, 'StacoMuon', kw, sgkey='StacoMuonCollection', prefix='mu_staco_', include=[ "EFCBInfoIndex", "EFMGInfoIndex", "EFMEInfoIndex", "L2CBInfoIndex", "L1InfoIndex", "MuonScatteringAngleSignificance" ], exclude=["EFCBInfo", "EFMGInfo", "EFMEInfo", "L2CBInfo", "L1Info"], allowMissing=True)) if cfgKeyStore.isInInput("Analysis::MuonContainer", "CaloMuonCollection"): alg += MuonD3PDObject( **_args(0, 'CaloMuon', kw, sgkey='CaloMuonCollection', prefix='mu_calo_', include=[ "MuonHitSummary", "Authors", "Likelihood", "Isolation", "CaloEnergyLoss", "Quality" ])) # Tau block alg += TauD3PDObject(**_args(1, 'Tau', kw)) # Jet blocks from JetTagD3PDMaker.JetTagD3PDMakerFlags import JetTagD3PDFlags from JetTagD3PDMaker.JetTagD3PDMakerKeys import JetTagD3PDKeys ## add MSV target to the jetd3pd object properties if not kw.has_key('AK4TopoEMJet_' + JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName() + '_target'): kw['AK4TopoEMJet_' + JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName() + '_target'] = JetTagD3PDKeys.MSVVtxInfoInJetGetterLabel() if not kw.has_key('AK6TopoEMJet_' + JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName() + '_target'): kw['AK6TopoEMJet_' + JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName() + '_target'] = JetTagD3PDKeys.MSVVtxInfoInJetGetterLabel() ## add track index for IPInfoPlus if not kw.has_key('AK4TopoEMJet_' + JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName() + '_target'): kw['AK4TopoEMJet_' + JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName() + '_target'] = "trk" if not kw.has_key('AK6TopoEMJet_' + JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName() + '_target'): kw['AK6TopoEMJet_' + JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName() + '_target'] = "trk" ## add track index for SVInfoPlus if not kw.has_key('AK4TopoEMJet_' + JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName() + '_target'): kw['AK4TopoEMJet_' + JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName() + '_target'] = "trk" if not kw.has_key('AK6TopoEMJet_' + JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName() + '_target'): kw['AK6TopoEMJet_' + JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName() + '_target'] = "trk" ## add track index for SV0InfoPlus if not kw.has_key('AK4TopoEMJet_' + JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName() + '_target'): kw['AK4TopoEMJet_' + JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName() + '_target'] = "trk" if not kw.has_key('AK6TopoEMJet_' + JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName() + '_target'): kw['AK6TopoEMJet_' + JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName() + '_target'] = "trk" alg += JetD3PDObject(**_args(3, 'AK4TopoEMJet', kw, sgkey='AntiKt4TopoEMJets', prefix='jet_AntiKt4TopoEM_', include=JetTagD3PDFlags.StdInfoInclude() + [JetTagD3PDKeys.MultiSVInfoPlusBlockName()], JetVertexFraction_FromUD=True, JetVertexFraction_FillFullJVF=True, allowMissing=True)) alg += JetD3PDObject(**_args(3, 'AK6TopoEMJet', kw, sgkey='AntiKt6TopoEMJets', prefix='jet_AntiKt6TopoEM_', include=JetTagD3PDFlags.StdInfoInclude() + [JetTagD3PDKeys.MultiSVInfoPlusBlockName()], JetVertexFraction_FromUD=True, JetVertexFraction_FillFullJVF=True, allowMissing=True)) alg += JetD3PDObject(**_args(3, 'AK4LCTopoJet', kw, sgkey='AntiKt4LCTopoJets', prefix='jet_AntiKt4LCTopo_', JetVertexFraction_FromUD=True, JetVertexFraction_FillFullJVF=True, allowMissing=True)) alg += JetD3PDObject(**_args(3, 'AK6LCTopoJet', kw, sgkey='AntiKt6LCTopoJets', prefix='jet_AntiKt6LCTopo_', JetVertexFraction_FromUD=True, JetVertexFraction_FillFullJVF=True, allowMissing=True)) ### add the MSV block MSVJetCollections = ['AntiKt4TopoEMJets', 'AntiKt6TopoEMJets'] ### link multisv to tracks if not kw.has_key('msvvtxinfo_JetTag_JetMultiSVVtxAssoc_target'): kw['msvvtxinfo_JetTag_JetMultiSVVtxAssoc_target'] = "trk" from JetTagD3PDMaker.JetTagMSVVtxInJetD3PDObject import getJetTagMSVVtxInfoInJetD3PDObject alg += getJetTagMSVVtxInfoInJetD3PDObject( **_args(1, "msvvtxinfo", kw, jetCollections=MSVJetCollections)) from TopInputsD3PDMaker.HforD3PDObject import HforD3PDObject alg += HforD3PDObject(**_args(0, 'HforInfo', kw)) # EventShape variables alg += EventShapeD3PDObject(**_args(0, 'rho', 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_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_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_RefMuon_Staco_Comps', 'MET_RefMuon_Track_Muid_Comps', 'MET_RefMuon_Track_Staco_Comps', 'MET_RefMuon_Track_em_Comps', 'MET_RefMuon_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' 'MET_RefFinal_STVF', 'MET_RefJet_JVF', 'MET_RefJet_JVFCut', 'MET_CellOut_Eflow_STVF', 'MET_CellOut_Eflow_JetArea' ], allowMissing=True)) # ... DR = 0.15 alg += MissingETD3PDObject(0, sgkey="RoughRecoil_15", prefix="hr_roughRecoil_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="ueCorrection_15", prefix="hr_ueCorrection_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="RefinedRecoil_15", prefix="hr_corrRecoil_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="MET_HR_15", prefix="hr_MET_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="RoughRecoil_Eflow_15", prefix="hr_roughRecoil_Eflow_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="ueCorrection_Eflow_15", prefix="hr_ueCorrection_Eflow_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="RefinedRecoil_Eflow_15", prefix="hr_corrRecoil_Eflow_15", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="MET_HR_Eflow_15", prefix="hr_MET_Eflow_15", exclude=['MET_Regions', 'MET_Comps']) # ... DR = 0.20 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']) # ... DR = 0.25 alg += MissingETD3PDObject(0, sgkey="RoughRecoil_25", prefix="hr_roughRecoil_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="ueCorrection_25", prefix="hr_ueCorrection_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="RefinedRecoil_25", prefix="hr_corrRecoil_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="MET_HR_25", prefix="hr_MET_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="RoughRecoil_Eflow_25", prefix="hr_roughRecoil_Eflow_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="ueCorrection_Eflow_25", prefix="hr_ueCorrection_Eflow_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="RefinedRecoil_Eflow_25", prefix="hr_corrRecoil_Eflow_25", exclude=['MET_Regions', 'MET_Comps']) alg += MissingETD3PDObject(0, sgkey="MET_HR_Eflow_25", prefix="hr_MET_Eflow_25", 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 alg += ClusterD3PDObject( **_args(2, 'Clusters2', kw, sgkey='HighPtClusters', prefix='clpt10_')) alg += ClusterD3PDObject(**_args( 3, 'Clusters3', kw, sgkey='HighPtEMClusters', prefix='emclpt10_')) from TrackD3PDMaker.TrackD3PDObject import TrackD3PDObject # ... good tracks only (nSCT>3; no pt cut) # turn on detailed track info if writing SoftQCD version of D3PD if doSoftQCD: from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags as softQcdFlags softQcdFlags.doTruth = True softQcdFlags.storeDetailedTruth = False softQcdFlags.storeDiagonalCovarianceAsErrors = True softQcdFlags.storeHitTruthMatching = True softQcdFlags.storePixelHitsOnTrack = False softQcdFlags.storePixelHolesOnTrack = False softQcdFlags.storePixelOutliersOnTrack = False softQcdFlags.storeSCTHitsOnTrack = False softQcdFlags.storeSCTHolesOnTrack = False softQcdFlags.storeSCTOutliersOnTrack = False softQcdFlags.storeTRTHitsOnTrack = False softQcdFlags.storeTRTHolesOnTrack = False softQcdFlags.storeTRTOutliersOnTrack = False softQcdFlags.storeTrackFitQuality = True softQcdFlags.storeTrackInfo = True softQcdFlags.storeTrackMomentum = True softQcdFlags.storeTrackPredictionAtBLayer = True softQcdFlags.storeTrackSummary = True softQcdFlags.trackParametersAtBeamSpotLevelOfDetails = 0 softQcdFlags.trackParametersAtGlobalPerigeeLevelOfDetails = 2 softQcdFlags.trackParametersAtPrimaryVertexLevelOfDetails = 2 SoftQCDTrackParticleD3PDObject = TrackD3PDObject( _label='trk', _prefix='trk_', _sgkey='GoodTracks', typeName='Rec::TrackParticleContainer', flags=softQcdFlags) alg += SoftQCDTrackParticleD3PDObject(**_args( 3, 'Tracks1', kw, sgkey='GoodTracks', label='trk', prefix='trk_')) else: # ... 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) 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='trkpt4', _prefix='trkpt4_', _sgkey='HighPtTracks', typeName='Rec::TrackParticleContainer', flags=highPtFlags) alg += HighPtTrackParticleD3PDObject(**_args(3, 'Tracks2', kw, sgkey='HighPtTracks', label='trkpt4', prefix='trkpt4_')) # 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)) ### heavy flavor truth information from AthenaCommon.AppMgr import ToolSvc from TruthD3PDAnalysis.TruthD3PDAnalysisConf import D3PD__GenObjectsFilterTool smwzhfGenVtxFilterTool = D3PD__GenObjectsFilterTool( "SMWZHFGenVtxFilterTool") ToolSvc += smwzhfGenVtxFilterTool smwzhfGenVtxFilterTool.RemoveInTimePileUp = False smwzhfGenVtxFilterTool.Remove2BCPileUp = True smwzhfGenVtxFilterTool.Remove800nsPileUp = True smwzhfGenVtxFilterTool.RemoveCavernBkg = True smwzhfGenVtxFilterTool.RemoveEmptyEvents = True smwzhfGenVtxFilterTool.RemoveDummyEvents = True smwzhfGenVtxFilterTool.RemoveUnrequestedParticles = True smwzhfGenVtxFilterTool.KeepBCHadrons = True from TruthD3PDMaker.GenVertexD3PDObject import GenVertexD3PDObject alg += GenVertexD3PDObject(**_args(0, "hfgenvertex", kw, prefix='mchfvtx_', filter=smwzhfGenVtxFilterTool)) smwzhfGenPartFilterTool = D3PD__GenObjectsFilterTool( "SMWZHFGenPartFilterTool") ToolSvc += smwzhfGenPartFilterTool smwzhfGenPartFilterTool.RemoveInTimePileUp = False smwzhfGenPartFilterTool.Remove2BCPileUp = True smwzhfGenPartFilterTool.Remove800nsPileUp = True smwzhfGenPartFilterTool.RemoveCavernBkg = True smwzhfGenPartFilterTool.RemoveEmptyEvents = True smwzhfGenPartFilterTool.RemoveDummyEvents = True smwzhfGenPartFilterTool.RemoveUnrequestedParticles = True smwzhfGenPartFilterTool.KeepBCQuarks = True smwzhfGenPartFilterTool.KeepBCQuarkAncestors = True smwzhfGenPartFilterTool.KeepBCHadrons = True smwzhfGenPartFilterTool.KeepBCHadronDecayChain = True smwzhfGenPartFilterTool.BCHadronsDescendantsPtCut = 200 smwzhfGenPartFilterTool.BCHadronsDescendantsBarcodeCut = 300000 smwzhfGenPartFilterTool.BCHadronsDescendantsEtaCut = 5 from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject alg += GenParticleD3PDObject( **_args(10, "hfgenparticle", kw, prefix='mchfpart_', filter=smwzhfGenPartFilterTool, GenParticle_WriteMotherType=False, GenParticle_WriteMotherBarcode=False)) ### leptonic W/Z truth information smwzlepwzGenPartFilterTool = D3PD__GenObjectsFilterTool( "SMWZLepWZGenPartFilterTool") ToolSvc += smwzlepwzGenPartFilterTool smwzlepwzGenPartFilterTool.RemoveInTimePileUp = True smwzlepwzGenPartFilterTool.Remove2BCPileUp = True smwzlepwzGenPartFilterTool.Remove800nsPileUp = True smwzlepwzGenPartFilterTool.RemoveCavernBkg = True smwzlepwzGenPartFilterTool.RemoveEmptyEvents = True smwzlepwzGenPartFilterTool.RemoveDummyEvents = True smwzlepwzGenPartFilterTool.RemoveUnrequestedParticles = True smwzlepwzGenPartFilterTool.KeepLeptonicWZBosons = True smwzlepwzGenPartFilterTool.KeepLeptonicWZBosonDecayChains = True smwzlepwzGenPartFilterTool.KeepLeptonicWZBosonsParents = True from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject alg += GenParticleD3PDObject(**_args( 10, "lepwzgenparticle", kw, prefix='mclepwzpart_', filter=smwzlepwzGenPartFilterTool, 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(): alg += ZPrimeMMTriggerBitsD3PDObject( **_args(10, 'ZPrimeMMTriggerBits', 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")) # The BJet information: TrigBJetD3PDObjects(alg, 10, False, False, True, True, True) # Event metadata alg.MetadataTools += [LBMetadataConfig()] if D3PDMakerFlags.FilterCollCand(): from CaloD3PDMaker.CollisionFilterAlg import CollisionFilterAlg alg.filterSeq += CollisionFilterAlg(tuplename + '_CollCandFilter') return alg
def addBTagInfoToJetObject(JetD3PDObject, btagLevelOffset=0, LocalFlags=JetTagD3PDFlags): ## first check if the blocks are already added to the JetD3PDObject ## the weight block is always added so check for it from AthenaCommon.Logging import logging addBTagInfoLogger = logging.getLogger("addBTagInfoToJetObject") if JetD3PDObject.allBlocknames().has_key( JetTagD3PDKeys.BTagWeightsBlockName()): addBTagInfoLogger.warning( "btag blocks already added to JetD3PDObject - ignore") return addBTagInfoLogger.info("Adding btag blocks to JetD3PDObject") # ## now add the block fillers ## basic info weights and truth if available ## specify a list of taggers via LocalFlags.Taggers() # JetD3PDObject.defineBlock(btagLevelOffset + 0, JetTagD3PDKeys.BTagWeightsBlockName(), JetTagD3PDMaker.JetTagBTagWeightsFillerTool, prefix=JetTagD3PDKeys.BTagWeightsPrefix(), TaggerNames=LocalFlags.Taggers()) if rec.doTruth: JetD3PDObject.defineBlock(btagLevelOffset + 0, JetTagD3PDKeys.TruthInfoBlockName(), JetTagD3PDMaker.JetTagTruthInfoFillerTool, prefix=JetTagD3PDKeys.TruthInfoPrefix(), InfoType="TruthInfo") if LocalFlags.QGInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.QGPartonTruthInfoBlockName(), JetTagD3PDMaker.JetTagQGPartonTruthInfoFillerTool, prefix=JetTagD3PDKeys.QGPartonTruthInfoPrefix(), InfoType="QGPartonTruthInfo") if LocalFlags.PileupLabeling(): JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.PUTruthInfoBlockName(), JetTagD3PDMaker.JetTagTruthInfoFillerTool, prefix=JetTagD3PDKeys.PUTruthInfoPrefix(), InfoType="TruthInfoPU") if LocalFlags.QGInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.PUQGPartonTruthInfoBlockName(), JetTagD3PDMaker.JetTagQGPartonTruthInfoFillerTool, prefix=JetTagD3PDKeys.PUQGPartonTruthInfoPrefix(), InfoType="QGPartonTruthInfoPU") # ##association to tracks, electron, muons, and photons ##if the getter labels are not specified no association is done ##can add contained information if needed # if LocalFlags.JetTrackAssoc(): JetTrackAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetTrackAssociationTool, '', ## set target when calling the JetD3PDObject level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.JetTrackAssocPrefix(), blockname=JetTagD3PDKeys.JetTrackAssocBlockName(), FillVariables=False) JetTagD3PDTrackToVertexIPEstimator = None from AthenaCommon.AppMgr import ToolSvc if hasattr(ToolSvc, 'BTagTrackToVertexIPEstimator'): JetTagD3PDTrackToVertexIPEstimator = ToolSvc.BTagTrackToVertexIPEstimator print("JetTagD3PD Info: found BTagTrackToVertexIPEstimator") elif hasattr(ToolSvc, 'JetTagD3PDTrackToVertexIPEstimator'): print("JetTagD3PD Info: found JetTagD3PDTrackToVertexIPEstimator") JetTagD3PDTrackToVertexIPEstimator = ToolSvc.JetTagD3PDTrackToVertexIPEstimator else: print("JetTagD3PD Info: configure TrackToVertexIPEstimator") from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory extrap = AtlasExtrapolator() ToolSvc += extrap JetTagD3PDLinTrkFactory = Trk__FullLinearizedTrackFactory( name="JetTagD3PDFullLinearizedTrackFactory", Extrapolator=extrap) ToolSvc += JetTagD3PDLinTrkFactory from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator JetTagD3PDTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(\ name="JetTagD3PDTrackToVertexIPEstimator", Extrapolator=extrap, LinearizedTrackFactory=JetTagD3PDLinTrkFactory) ToolSvc += JetTagD3PDTrackToVertexIPEstimator JetTrack = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetTrackAssociationTool, level=btagLevelOffset + 4, prefix=JetTagD3PDKeys.JetTrackAssocPrefix(), blockname=JetTagD3PDKeys.JetTrackBlockName(), nrowName='', TrackToVertexIPEstimator=JetTagD3PDTrackToVertexIPEstimator, PrimaryVertexCollection=JetTagD3PDFlags.PrimaryVertexSGKey()) if LocalFlags.JetTrackGhostAssoc(): JetTrackAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetTrackAssociationTool, '', ## set target when calling the JetD3PDObject level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.JetTrackGhostAssocPrefix(), blockname=JetTagD3PDKeys.JetTrackGhostAssocBlockName(), FillVariables=False, TrackAssocName=LocalFlags.JetTrackGhostAssocName()) if LocalFlags.JetBHadronGhostAssoc(): JetBHadronAssoc = ContainedVectorMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagJetNavigable4MomentumAssociationTool, JetTagD3PDKeys.JetBHadronGhostAssocPrefix(), level = 900, blockname=JetTagD3PDKeys.JetBHadronGhostAssocBlockName()+"tmp", Navigable4MomentumAssocName=LocalFlags.JetBHadronGhostAssocName()) IndexAssociation( JetBHadronAssoc, TruthD3PDMaker.TruthParticleGenParticleAssociationTool, '', level=_jetTagAssocLevel, blockname=JetTagD3PDKeys.JetBHadronGhostAssocBlockName(), prefix="") if LocalFlags.JetTruthGhostAssoc(): JetTruthAssoc = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetNavigable4MomentumAssociationTool, JetTagD3PDKeys.JetTruthGhostAssocPrefix(), level=900, blockname=JetTagD3PDKeys.JetTruthGhostAssocBlockName() + "tmp", Navigable4MomentumAssocName=LocalFlags.JetTruthGhostAssocName()) IndexAssociation( JetTruthAssoc, TruthD3PDMaker.TruthParticleGenParticleAssociationTool, '', level=_jetTagAssocLevel, blockname=JetTagD3PDKeys.JetTruthGhostAssocBlockName(), prefix="") if LocalFlags.JetConstituantTruthAssoc(): ConstitAssoc = ContainedVectorMultiAssociation \ (JetD3PDObject, EventCommonD3PDMaker.NavigableConstituentAssociationTool, 'constit_', nrowName = '', TypeName = 'TruthParticle', blockname= JetTagD3PDKeys.JetConstituantTruthAssocBlockName()+"tmp", level = 900 ) IndexAssociation( ConstitAssoc, TruthD3PDMaker.TruthParticleGenParticleAssociationTool, '', level=_jetTagAssocLevel, blockname=JetTagD3PDKeys.JetConstituantTruthAssocBlockName(), prefix="mcpart_") if LocalFlags.JetMuonAssoc(): JetMuonAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetMuonAssociationTool, '', ## set target when calling the JetD3PDObject level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.JetMuonAssocPrefix(), blockname=JetTagD3PDKeys.JetMuonAssocBlockName()) if LocalFlags.AddSecondMuonCollection(): JetMuon2Assoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetMuonAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.JetMuon2AssocPrefix(), blockname=JetTagD3PDKeys.JetMuon2AssocBlockName(), MuonsName="SecondMuons") if LocalFlags.JetElectronAssoc(): JetElectronAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetElectronAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.JetElectronAssocPrefix(), blockname=JetTagD3PDKeys.JetElectronAssocBlockName()) if LocalFlags.JetPhotonAssoc(): JetPhotonAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetPhotonAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.JetPhotonAssocPrefix(), blockname=JetTagD3PDKeys.JetPhotonAssocBlockName()) if rec.doTruth and LocalFlags.JetGenSoftLeptonAssoc(): JetGenSoftLeptonAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagJetGenSoftLeptonAssociationTool, '', level = _jetTagAssocLevel, prefix=JetTagD3PDKeys.JetGenSoftLeptonAssocPrefix(), blockname=JetTagD3PDKeys.JetGenSoftLeptonAssocBlockName(), MCCollections = D3PDMakerFlags.TruthSGKey(), FillVariables=False) JetGenSoftLepton = ContainedVectorMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagJetGenSoftLeptonAssociationTool, level = btagLevelOffset+4, prefix=JetTagD3PDKeys.JetGenSoftLeptonAssocPrefix(), blockname=JetTagD3PDKeys.JetGenSoftLeptonBlockName(), nrowName = '', MCCollections = D3PDMakerFlags.TruthSGKey()) JetGenSoftLepton.defineBlock( btagLevelOffset + 20, JetTagD3PDKeys.JetGenSoftLeptonPropBlockName(), EventCommonD3PDMaker.GenParticleFillerTool) # ## info base for each tagger: basicaly B/U/C probabilities # if LocalFlags.InfoBase(): JetD3PDObject.defineBlock(btagLevelOffset + 1, JetTagD3PDKeys.IP2DInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.IP2DInfoBasePrefix(), InfoType="IP2D", AddPC=True) JetD3PDObject.defineBlock(btagLevelOffset + 1, JetTagD3PDKeys.IP2DIPInfoBaseBlockName(), JetTagD3PDMaker.JetTagIPInfoBaseFillerTool, prefix=JetTagD3PDKeys.IP2DInfoBasePrefix(), InfoType="IP2D") JetD3PDObject.defineBlock(btagLevelOffset + 1, JetTagD3PDKeys.IP3DInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.IP3DInfoBasePrefix(), InfoType="IP3D", AddPC=True) JetD3PDObject.defineBlock(btagLevelOffset + 1, JetTagD3PDKeys.IP3DIPInfoBaseBlockName(), JetTagD3PDMaker.JetTagIPInfoBaseFillerTool, prefix=JetTagD3PDKeys.IP3DInfoBasePrefix(), InfoType="IP3D") JetD3PDObject.defineBlock( btagLevelOffset + 1, JetTagD3PDKeys.JetProbInfoBaseBlockName(), JetTagD3PDMaker.JetTagJetProbInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetProbInfoBasePrefix(), InfoType="JetProb", # This may be missing in 17.2 samples. AllowMissing=at_least_version('17.2.0')) JetD3PDObject.defineBlock(btagLevelOffset + 1, JetTagD3PDKeys.SV1InfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.SV1InfoBasePrefix(), InfoType="SV1", AddPC=True) JetD3PDObject.defineBlock(btagLevelOffset + 1, JetTagD3PDKeys.SV2InfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.SV2InfoBasePrefix(), InfoType="SV2") JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.JetFitterInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetFitterTagInfoPrefix(), InfoType="JetFitterTagNN,JetFitterTag", AddPC=True) JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.JetFitterCombInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetFitterCombInfoBasePrefix(), InfoType="JetFitterCOMBNN,JetFitterCOMB", AddPC=True) if LocalFlags.GbbNNInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 1, JetTagD3PDKeys.GbbNNInfoBlockName(), JetTagD3PDMaker.JetTagGbbNNInfoFillerTool, prefix=JetTagD3PDKeys.GbbNNInfoPrefix(), InfoType="GbbNN") if LocalFlags.NewGbbNNInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 1, JetTagD3PDKeys.NewGbbNNInfoBlockName(), JetTagD3PDMaker.JetTagHadFlavorTagInfoFillerTool, prefix=JetTagD3PDKeys.NewGbbNNInfoPrefix(), InfoType="NewGbbNN") if LocalFlags.QGInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 1, JetTagD3PDKeys.QGInfoBlockName(), JetTagD3PDMaker.JetTagHadFlavorTagInfoFillerTool, prefix=JetTagD3PDKeys.QGInfoPrefix(), InfoType="QG") if LocalFlags.InfoBaseCalib(): JetD3PDObject.defineBlock( btagLevelOffset + 3, JetTagD3PDKeys.JetFitterFlipInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetFitterTagFlipInfoPrefix(), InfoType="JetFitterTagNNFlip,JetFitterTagFlip", AddPC=True) JetD3PDObject.defineBlock( btagLevelOffset + 3, JetTagD3PDKeys.JetFitterCombIP3DPosInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetFitterCombIP3DPosInfoBasePrefix(), InfoType="JetFitterCOMBNNIP3DPos,JetFitterCOMBIP3DPos", AddPC=True) JetD3PDObject.defineBlock( btagLevelOffset + 3, JetTagD3PDKeys.JetFitterCombIP3DNegInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetFitterCombIP3DNegInfoBasePrefix(), InfoType="JetFitterCOMBNNIP3DNeg,JetFitterCOMBIP3DNeg", AddPC=True) # if LocalFlags.InfoBaseGaia(): # JetD3PDObject.defineBlock( # btagLevelOffset+1, "JetTag_Gaia", # JetTagD3PDMaker.JetTagInfoBaseFillerTool, # prefix="flavor_component_gaia_", # InfoType="Gaia", # AddPC=True, # AddPTau=False) # JetD3PDObject.defineBlock( # btagLevelOffset+1, "JetTag_GaiaNeg", # JetTagD3PDMaker.JetTagInfoBaseFillerTool, # prefix="flavor_component_gaianeg_", # InfoType="GaiaNeg", # AddPC=True, # AddPTau=False) # # TODO: this should get its own block # JetD3PDObject.defineBlock( # btagLevelOffset+1, "JetTag_IPFordG", # also needs a rename # JetTagD3PDMaker.JetTagInfoBaseFillerTool, # prefix="flavor_component_ip3dloose_", # InfoType="IPFordG", # also needs to be changed in JetTagTools # AddPC=True) ## some additional info for jet fitter # if LocalFlags.JetFitterTagInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 2, JetTagD3PDKeys.JetFitterTagInfoBlockName(), JetTagD3PDMaker.JetTagJetFitterTagInfoFillerTool, prefix=JetTagD3PDKeys.JetFitterTagInfoPrefix(), InfoType="JetFitterTagNN,JetFitterTag") if LocalFlags.JetFitterTagFlipInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 2, JetTagD3PDKeys.JetFitterTagFlipInfoBlockName(), JetTagD3PDMaker.JetTagJetFitterTagInfoFillerTool, prefix=JetTagD3PDKeys.JetFitterTagFlipInfoPrefix(), InfoType="JetFitterTagNNFlip,JetFitterTagFlip") if LocalFlags.JetFitterCharmTagInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 2, JetTagD3PDKeys.JetFitterCharmTagInfoBlockName(), JetTagD3PDMaker.JetTagJetFitterGenericTagInfoFillerTool, prefix=JetTagD3PDKeys.JetFitterCharmTagInfoPrefix(), InfoType="JetFitterCharm") JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName(), JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix=JetTagD3PDKeys.JetFitterCharmTagInfoPrefix(), InfoType="JetFitterCharm", AddPC=True) if LocalFlags.InfoBaseCalib(): JetD3PDObject.defineBlock( btagLevelOffset + 0, JetTagD3PDKeys.JetFitterCharmInfoBaseBlockName() + "NEG", JetTagD3PDMaker.JetTagInfoBaseFillerTool, prefix="flavor_component_jfitcneg_", InfoType="JetFitterCharmNeg", AddPC=True) # ## track information used for IP taggers # if LocalFlags.IPInfoPlus(): IPInfoPlusTrackAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagIPInfoPlusTrackAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.IPInfoPlusTrackAssocPrefix(), blockname=JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName(), FillVariables=False, AllowMissing=True) IPInfoPlusTrack = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagIPInfoPlusTrackAssociationTool, level=btagLevelOffset + 2, prefix=JetTagD3PDKeys.IPInfoPlusTrackAssocPrefix(), blockname=JetTagD3PDKeys.IPInfoPlusTrackBlockName(), nrowName='', AllowMissing=True) IPInfoPlusTrack.defineBlock(btagLevelOffset + 20, JetTagD3PDKeys.IPInfoPlusTrkP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix="", WriteM=False) # ## vertex information used for SV1/SV2 taggers # if LocalFlags.SVInfoPlus(): JetD3PDObject.defineBlock(btagLevelOffset + 2, JetTagD3PDKeys.SVInfoPlusBlockName(), JetTagD3PDMaker.JetTagSVInfoPlusFillerTool, prefix=JetTagD3PDKeys.SVInfoPlusPrefix(), InfoType="SVInfoPlus", AllowMissing=True, AddNormDist=True) SVInfoPlusTrackAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.SVInfoPlusTrackAssocPrefix(), blockname=JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName(), AllowMissing=True) SVInfoPlusTrack = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool, level=btagLevelOffset + 20, prefix=JetTagD3PDKeys.SVInfoPlusTrackAssocPrefix(), blockname=JetTagD3PDKeys.SVInfoPlusTrackBlockName(), nrowName='', AllowMissing=True) SVInfoPlusTrack.defineBlock(btagLevelOffset + 20, JetTagD3PDKeys.SVInfoPlusTrkP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) # ## vertex information used for the SV0 tagger # if LocalFlags.SV0InfoPlus(): JetD3PDObject.defineBlock(btagLevelOffset + 2, JetTagD3PDKeys.SV0InfoPlusBlockName(), JetTagD3PDMaker.JetTagSVInfoPlusFillerTool, prefix=JetTagD3PDKeys.SV0InfoPlusPrefix(), InfoType="SV0InfoPlus", AllowMissing=True) SV0InfoPlusTrackAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.SV0InfoPlusTrackAssocPrefix(), blockname=JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName(), InfoType="SV0InfoPlus", AllowMissing=True) SV0InfoPlusTrack = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSVInfoPlusTrackAssociationTool, level=btagLevelOffset + 20, prefix=JetTagD3PDKeys.SV0InfoPlusTrackAssocPrefix(), blockname=JetTagD3PDKeys.SV0InfoPlusTrackBlockName(), nrowName='', InfoType="SV0InfoPlus", AllowMissing=True) SV0InfoPlusTrack.defineBlock( btagLevelOffset + 20, JetTagD3PDKeys.SV0InfoPlusTrkP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) # ## muon information used for the soft muon tagger # if LocalFlags.SoftMuonInfo(): SoftMuonInfoMuonAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.SoftMuonInfoMuonAssocPrefix(), blockname=JetTagD3PDKeys.SoftMuonInfoMuonAssocBlockName(), FillVariables=False, AllowMissing=True) SoftMuonInfoMuon = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, level=btagLevelOffset + 2, prefix=JetTagD3PDKeys.SoftMuonInfoMuonAssocPrefix(), blockname=JetTagD3PDKeys.SoftMuonInfoMuonBlockName(), nrowName='', AllowMissing=True) leveloffset = 20 if LocalFlags.AddInlineSoftMuonProperties(): leveloffset = -btagLevelOffset SoftMuonInfoMuon.defineBlock(btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfoP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False, WriteE=True) SoftMuonInfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfoChargeBlockName(), EventCommonD3PDMaker.ChargeFillerTool) SoftMuonInfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfoAuthorBlockName(), MuonD3PDMaker.MuonAuthorFillerTool) SoftMuonInfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfomatchChi2BlockName(), MuonD3PDMaker.MuonMatchQualityFillerTool) SoftMuonInfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfoAcceptBlockName(), MuonD3PDMaker.MuonAcceptMethodFillerTool) SoftMuonInfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfoELossBlockName(), MuonD3PDMaker.MuonELossFillerTool) SoftMuonInfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonInfoHitsBlockName(), MuonD3PDMaker.MuonTrkHitFillerTool, SaveIDMuonHitSummary=False) if LocalFlags.AddSecondMuonCollection(): SoftMuon2InfoMuon2Assoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, '', level = _jetTagAssocLevel, prefix=JetTagD3PDKeys.SoftMuon2InfoMuon2AssocPrefix(), blockname=JetTagD3PDKeys.SoftMuon2InfoMuon2AssocBlockName(), InfoType="SecondSoftMuonTag", FillVariables=False, AllowMissing = True) SoftMuon2InfoMuon2 = ContainedVectorMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, level = btagLevelOffset+3, prefix=JetTagD3PDKeys.SoftMuon2InfoMuon2AssocPrefix(), blockname=JetTagD3PDKeys.SoftMuon2InfoMuon2BlockName(), nrowName = '', InfoType="SecondSoftMuonTag", AllowMissing = True) SoftMuon2InfoMuon2.defineBlock( btagLevelOffset + 20, JetTagD3PDKeys.SoftMuon2InfoP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) # ## muon information used for soft muon chi2 tagger # if LocalFlags.SoftMuonChi2Info(): SoftMuonChi2InfoMuonAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, '', level=_jetTagAssocLevel, prefix=JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocPrefix(), blockname=JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocBlockName(), InfoType="SoftMuonTagChi2", FillVariables=False, AllowMissing=True) SoftMuonChi2InfoMuon = ContainedVectorMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, level=btagLevelOffset + 2, prefix=JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocPrefix(), blockname=JetTagD3PDKeys.SoftMuonChi2InfoMuonBlockName(), InfoType="SoftMuonTagChi2", nrowName='', AllowMissing=True) leveloffset = 20 if LocalFlags.AddInlineSoftMuonChi2Properties(): leveloffset = -btagLevelOffset SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfoP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False, WriteE=True) SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfoChargeBlockName(), EventCommonD3PDMaker.ChargeFillerTool) SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfoAuthorBlockName(), MuonD3PDMaker.MuonAuthorFillerTool) SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfomatchChi2BlockName(), MuonD3PDMaker.MuonMatchQualityFillerTool) SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfoAcceptBlockName(), MuonD3PDMaker.MuonAcceptMethodFillerTool) SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfoELossBlockName(), MuonD3PDMaker.MuonELossFillerTool) SoftMuonChi2InfoMuon.defineBlock( btagLevelOffset + leveloffset, JetTagD3PDKeys.SoftMuonChi2InfoHitsBlockName(), MuonD3PDMaker.MuonTrkHitFillerTool, SaveIDMuonHitSummary=False) if LocalFlags.AddSecondMuonCollection(): SoftMuon2Chi2InfoMuon2Assoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, '', level = _jetTagAssocLevel, prefix=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocPrefix(), blockname=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocBlockName(), InfoType="SecondSoftMuonTagChi2", FillVariables=False, AllowMissing = True) SoftMuon2Chi2InfoMuon2 = ContainedVectorMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagSoftMuonInfoMuonAssociationTool, level = btagLevelOffset+3, prefix=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocPrefix(), blockname=JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2BlockName(), nrowName = '', InfoType="SecondSoftMuonTagChi2", AllowMissing = True) SoftMuon2Chi2InfoMuon2.defineBlock( btagLevelOffset + 20, JetTagD3PDKeys.SoftMuon2Chi2InfoP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) # ## electron information used for the soft electron tagger # if LocalFlags.SoftElectronInfo(): SoftElectronInfoElectronAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagSoftElecInfoegammaAssociationTool, '', level = _jetTagAssocLevel, prefix=JetTagD3PDKeys.SoftElectronInfoElectronAssocPrefix(), blockname=JetTagD3PDKeys.SoftElectronInfoElectronAssocBlockName(), FillVariables=False, AllowMissing = True) SoftElectronInfoElectron = ContainedVectorMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagSoftElecInfoegammaAssociationTool, level = btagLevelOffset+2, prefix=JetTagD3PDKeys.SoftElectronInfoElectronAssocPrefix(), blockname=JetTagD3PDKeys.SoftElectronInfoElectronBlockName(), nrowName = '', AllowMissing = True) SoftElectronInfoElectron.defineBlock(\ btagLevelOffset+20, JetTagD3PDKeys.SoftElectronInfoP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) if LocalFlags.MultiSVInfoPlus(): JetD3PDObject.defineBlock( btagLevelOffset + 3, JetTagD3PDKeys.MultiSVInfoPlusBlockName(), JetTagD3PDMaker.JetTagMultiSVInfoPlusFillerTool, prefix=JetTagD3PDKeys.MultiSVInfoPlusPrefix(), InfoType="MultiSVInfoPlus", AllowMissing=True) MultiSVInfoPlusTrackAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagMultiSVInfoMSVVtxInfoAssociationTool, '', level = _jetTagAssocLevel, prefix=JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocPrefix(), blockname=JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName(), AllowMissing = True) #### from here keep the ifs for association labels. These are used only by btag. # ## additional information about the VKal secondary vertex finder used for SV tagger # if LocalFlags.JetVKalVxBadTrack(): if LocalFlags.TrackAssocLabel() != "": JetVKalVxBadTrackAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagVKalVxInJetBadTrackAssociationTool, LocalFlags.TrackAssocLabel(), level = btagLevelOffset+5, prefix=JetTagD3PDKeys.JetVKalVxBadTrackAssocPrefix(), blockname=JetTagD3PDKeys.JetVKalVxBadTrackAssocBlockName()) if LocalFlags.AddContainedTrackP4(): JetVKalVxBadTrackAssoc.defineBlock( btagLevelOffset + 10, JetTagD3PDKeys.SV0InfoPlusTrkP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) else: JetVKalVxBadTrackAssoc = ContainedVectorMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagVKalVxInJetBadTrackAssociationTool, level = btagLevelOffset+6, prefix=JetTagD3PDKeys.JetVKalVxBadTrackAssocPrefix(), blockname=JetTagD3PDKeys.JetVKalVxBadTrackAssocBlockName()) JetVKalVxBadTrackAssoc.defineBlock( btagLevelOffset + 6, JetTagD3PDKeys.SV0InfoPlusTrkP4BlockName(), EventCommonD3PDMaker.FourMomFillerTool, prefix='', WriteM=False) # ## additional information about the vertex finding for JetFitter* ## need to be associated with three additional D3PD objects defined in: ## JetTagVxOnJetAxisD3PDObject.py ## JetTagTwoTrackVertexD3PDObject.py # if LocalFlags.JetFitterVertexFinderInfo(): JetD3PDObject.defineBlock( btagLevelOffset + 5, JetTagD3PDKeys.JetFitterVxAssocBlockName(), JetTagD3PDMaker.JetTagJetFitterVxFillerTool, prefix=JetTagD3PDKeys.JetFitterVxAssocPrefix()) if LocalFlags.JFVxOnJetAxisAssocLabel() != "": JetVxOnJetAxisAssoc = IndexMultiAssociation( JetD3PDObject, JetTagD3PDMaker.JetTagJetVxOnJetAxisAssociationTool, LocalFlags.JFVxOnJetAxisAssocLabel(), level=btagLevelOffset + 5, prefix=JetTagD3PDKeys.JetJFVxOnJetAxisAssocPrefix(), blockname=JetTagD3PDKeys.JetJFVxOnJetAxisAssocBlockName(), VxOnJetHolderName=LocalFlags.JetJFVxOnJetAxisAssocSGKey(), InfoName="NewJetFitterVxFinder") if LocalFlags.JetFitterFlipVxOnJetAxisAssoc(): JFFlipJetVxOnJetAxisAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagJetVxOnJetAxisAssociationTool, LocalFlags.JFVxOnJetAxisAssocLabel(), level = btagLevelOffset+6, prefix=JetTagD3PDKeys.JetJFFlipVxOnJetAxisAssocPrefix(), blockname=JetTagD3PDKeys.JetJFFlipVxOnJetAxisAssocBlockName(), VxOnJetHolderName=LocalFlags.JetJFVxOnJetAxisAssocSGKey(), InfoName="NewJetFitterVxFinderFlip") if LocalFlags.JFTwoTrackVertexAssocLabel() != "": JetJFTwoTrackVertexAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagJetJFTwoTrackVertexAssociationTool, LocalFlags.JFTwoTrackVertexAssocLabel(), level = btagLevelOffset+5, prefix=JetTagD3PDKeys.JetJFTwoTrackVertexAssocPrefix(), blockname=JetTagD3PDKeys.JetJFTwoTrackVertexAssocBlockName(), TwoTrackVertexName=LocalFlags.JetJFTwoTrackVertexAssocSGKey(), InfoName="NewJetFitterVxFinder") if LocalFlags.JetFitterFlipTwoTrackVertexAssoc(): JetJFFlipTwoTrackVertexAssoc = IndexMultiAssociation(\ JetD3PDObject, JetTagD3PDMaker.JetTagJetJFTwoTrackVertexAssociationTool, LocalFlags.JFTwoTrackVertexAssocLabel(), level = btagLevelOffset+6, prefix=JetTagD3PDKeys.JetJFFlipTwoTrackVertexAssocPrefix(), blockname=JetTagD3PDKeys.JetJFFlipTwoTrackVertexAssocBlockName(), TwoTrackVertexName=LocalFlags.JetJFTwoTrackVertexAssocSGKey(), InfoName="NewJetFitterVxFinderFlip")
def getJetTagJetD3PDObject(filteredsgkey, origsgkey, level=4, prefix=None, exclude=[ 'TrueFlavorComponents', 'BTagComponents', 'BTagDefault', 'BTag' ], **kw): if prefix == None: import re prefix = re.sub('Jets', '', origsgkey) prefix = re.sub('AOD', '', prefix) prefix = re.sub('ReTagged', '', prefix) prefix = re.sub('MuonNonInteracting', 'MNI', prefix) prefix = prefix.lower() prefix = "jet_" + prefix + "_" if JetTagD3PDFlags.TrackAssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.JetTrackAssocBlockName(), JetTagD3PDFlags.TrackAssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.IPInfoPlusTrackAssocBlockName(), JetTagD3PDFlags.TrackAssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.SVInfoPlusTrackAssocBlockName(), JetTagD3PDFlags.TrackAssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.SV0InfoPlusTrackAssocBlockName(), JetTagD3PDFlags.TrackAssocLabel(), kw) if JetTagD3PDFlags.MuonAssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.JetMuonAssocBlockName(), JetTagD3PDFlags.MuonAssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.SoftMuonInfoMuonAssocBlockName(), JetTagD3PDFlags.MuonAssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.SoftMuonChi2InfoMuonAssocBlockName(), JetTagD3PDFlags.MuonAssocLabel(), kw) if JetTagD3PDFlags.Muon2AssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.JetMuon2AssocBlockName(), JetTagD3PDFlags.Muon2AssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.SoftMuon2InfoMuon2AssocBlockName(), JetTagD3PDFlags.Muon2AssocLabel(), kw) kw = _updateDict(JetTagD3PDKeys.SoftMuon2Chi2InfoMuon2AssocBlockName(), JetTagD3PDFlags.Muon2AssocLabel(), kw) if JetTagD3PDFlags.ElectronAssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.JetElectronAssocBlockName(), JetTagD3PDFlags.ElectronAssocLabel(), kw) kw = _updateDict( JetTagD3PDKeys.SoftElectronInfoElectronAssocBlockName(), JetTagD3PDFlags.ElectronAssocLabel(), kw) if JetTagD3PDFlags.PhotonAssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.JetPhotonAssocBlockName(), JetTagD3PDFlags.PhotonAssocLabel(), kw) if TruthD3PDFlags.GenParticleAssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.JetGenSoftLeptonAssocBlockName(), TruthD3PDFlags.GenParticleAssocLabel(), kw) if JetTagD3PDFlags.MSVVtxInfoAssocLabel() != "": kw = _updateDict(JetTagD3PDKeys.MultiSVInfoPlusMSVVtxAssocBlockName(), JetTagD3PDFlags.MSVVtxInfoAssocLabel(), kw) return JetTagJetD3PDObject(level, sgkey=filteredsgkey, prefix=prefix, label="JetTag_" + origsgkey, exclude=exclude, JetContainer=origsgkey, **kw)