Skip to content
Snippets Groups Projects
Commit 4a0ec2ed authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'master-TrigBmumuxComboHypo' into 'master'

B-physics migration of Bmumux chains to AthenaMT (ATR-21639)

See merge request atlas/athena!34170
parents 099dc098 ed2554e5
No related branches found
No related tags found
No related merge requests found
Showing
with 1430 additions and 11 deletions
......@@ -12,7 +12,7 @@ atlas_add_component( TrigBphysHypo
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthLinks AthViews AthenaBaseComps AthenaKernel AthenaMonitoringKernelLib BeamSpotConditionsData DecisionHandlingLib ElectronPhotonSelectorToolsLib FourMomUtils InDetConversionFinderToolsLib LumiBlockCompsLib StoreGateLib TrigBphysicsEvent TrigCompositeUtilsLib TrigConfHLTData TrigInDetEvent TrigInDetToolInterfacesLib TrigInterfacesLib TrigNavigationLib TrigParticle TrigSteeringEvent TrigTimeAlgsLib TrkVKalVrtFitterLib xAODBase xAODEgamma xAODEventInfo xAODMuon xAODTracking xAODTrigBphys xAODTrigMuon xAODTrigger )
LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthLinks AthViews AthenaBaseComps AthenaKernel AthenaMonitoringKernelLib BeamSpotConditionsData DecisionHandlingLib ElectronPhotonSelectorToolsLib FourMomUtils InDetConversionFinderToolsLib ITrackToVertex LumiBlockCompsLib StoreGateLib TrigBphysicsEvent TrigCompositeUtilsLib TrigConfHLTData TrigInDetEvent TrigInDetToolInterfacesLib TrigInterfacesLib TrigNavigationLib TrigParticle TrigSteeringEvent TrigTimeAlgsLib TrkVKalVrtFitterLib xAODBase xAODEgamma xAODEventInfo xAODMuon xAODTracking xAODTrigBphys xAODTrigMuon xAODTrigger )
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from TrigBphysHypo.TrigBphysHypoConf import TrigBmumuxComboHypo, TrigBmumuxComboHypoTool
from TrigBphysHypo.TrigBmumuxComboHypoMonitoringConfig import TrigBmumuxComboHypoMonitoring, TrigBmumuxComboHypoToolMonitoring
from AthenaCommon.Logging import logging
log = logging.getLogger('TrigBmumuxComboHypoConfig')
log.setLevel(logging.DEBUG)
def BmumuxComboHypoCfg(name):
log.debug('BmumuxComboHypoCfg.name = %s ', name)
suffix = 'Bmumux'
from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
vertexFitter = Trk__TrkVKalVrtFitter(
name = 'TrigBphysFitter_'+suffix,
FirstMeasuredPoint = False,
MakeExtendedVertex = False,
Extrapolator = AtlasExtrapolator())
from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
vertexPointEstimator = InDet__VertexPointEstimator(
name = 'VertexPointEstimator_'+suffix,
MinDeltaR = [-10000., -10000., -10000.],
MaxDeltaR = [ 10000., 10000., 10000.],
MaxPhi = [ 10000., 10000., 10000.],
MaxChi2OfVtxEstimation = 2000.)
from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex
trackToVertexTool = Reco__TrackToVertex(
name = 'TrackToVertexTool_'+suffix,
Extrapolator = AtlasExtrapolator())
hypo = TrigBmumuxComboHypo(
name = 'BmumuxComboHypo',
VertexFitter = vertexFitter,
VertexPointEstimator = vertexPointEstimator,
TrackToVertexTool = trackToVertexTool,
CheckMultiplicityMap = False,
TrigBphysCollectionKey = 'HLT_Bmumux',
MuonCollectionKey = 'HLT_Muons_Bmumux',
TrackCollectionKey = 'HLT_IDTrack_Bmumux_IDTrig',
DeltaR = 0.01,
TrkZ0 = 50.,
MaxFitAttempts_DimuTrk1 = 200,
MaxFitAttempts_DimuTrk1Trk2 = 2000,
# dimuon properties
Dimuon_rejectSameChargeTracks = True,
Dimuon_massRange = (100., 5500.),
Dimuon_chi2 = 20.,
# B+ -> mu+ mu- K+
BplusToMuMuKaon = True,
BplusToMuMuKaon_minKaonPt = 100.,
BplusToMuMuKaon_massRange = (4500., 5900.),
BplusToMuMuKaon_chi2 = 50.,
# B_c+ -> J/psi(-> mu+ mu-) pi+
BcToMuMuPion = True,
BcToMuMuPion_minPionPt = 2000.,
BcToMuMuPion_dimuonMassRange = (2500., 4300.),
BcToMuMuPion_massRange = (5500., 7300.),
BcToMuMuPion_chi2 = 50.,
# B_s0 -> mu+ mu- phi(-> K+ K-)
BsToMuMuPhi1020 = True,
BsToMuMuPhi1020_rejectSameChargeTracks = True,
BsToMuMuPhi1020_minKaonPt = 100.,
BsToMuMuPhi1020_massRange = (4800., 5800.),
BsToMuMuPhi1020_phiMassRange = (940., 1100.),
BsToMuMuPhi1020_chi2 = 60.,
# B0 -> mu+ mu- K*0(-> K+ pi-)
BdToMuMuKstar0 = True,
BdToMuMuKstar0_rejectSameChargeTracks = True,
BdToMuMuKstar0_minKaonPt = 100.,
BdToMuMuKstar0_minPionPt = 100.,
BdToMuMuKstar0_massRange = (4600., 5900.),
BdToMuMuKstar0_KstarMassRange = (700., 1100.),
BdToMuMuKstar0_chi2 = 60.,
# Lambda_b0 -> J/psi(-> mu+ mu-) p K-
LambdaBToMuMuProtonKaon = True,
LambdaBToMuMuProtonKaon_rejectSameChargeTracks = False,
LambdaBToMuMuProtonKaon_minProtonPt = 1000.,
LambdaBToMuMuProtonKaon_minKaonPt = 1000.,
LambdaBToMuMuProtonKaon_minKstarMass = 1300.,
LambdaBToMuMuProtonKaon_dimuonMassRange = (2500., 4300.),
LambdaBToMuMuProtonKaon_massRange = (4800., 6400.),
LambdaBToMuMuProtonKaon_chi2 = 60.,
#
MonTool = TrigBmumuxComboHypoMonitoring('TrigBmumuxComboHypoMonitoring'))
return hypo
def TrigBmumuxComboHypoToolFromDict(chainDict):
config = TrigBmumuxComboHypoConfig()
tool = config.ConfigurationComboHypoTool(chainDict)
return tool
class TrigBmumuxComboHypoConfig(object):
def ConfigurationComboHypoTool(self, chainDict):
topoAlgs = chainDict['chainName']
log.debug("Set for algorithm %s", topoAlgs)
tool = TrigBmumuxComboHypoTool(topoAlgs)
decay = chainDict['topo'][-1]
trigDecayDict = { # xAOD::TrigBphys::pType
'BpmumuKp': 7, # BKMUMU
'BcmumuPi': 21, # BCPIMUMU
'BsmumuPhi': 9, # BSPHIMUMU
'BdmumuKst': 8, # BDKSTMUMU
'LbPqKm': 22, # LBPQMUMU
}
tool.Decay = trigDecayDict[decay]
tool.MonTool = TrigBmumuxComboHypoToolMonitoring('MonTool')
return tool
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
class TrigBmumuxComboHypoMonitoring(GenericMonitoringTool):
def __init__ (self, name):
super(TrigBmumuxComboHypoMonitoring, self).__init__(name)
self.Histograms = [
defineHistogram('nDimuon', type='TH1F', path='EXPERT', title="number of fitted dimuon vertices", xbins=10, xmin=0, xmax=10),
defineHistogram('nTrk', type='TH1F', path='EXPERT', title="number of merged tracks in extended RoIs", xbins=200, xmin=0, xmax=200),
defineHistogram('nSelectedTrk', type='TH1F', path='EXPERT', title="number of tracks in vicinity of dimuon vertex", xbins=200, xmin=0, xmax=200),
defineHistogram('nBPhysObject', type='TH1F', path='EXPERT', title="number of fitted BPhysObjects", xbins=100, xmin=0, xmax=100),
]
class TrigBmumuxComboHypoToolMonitoring(GenericMonitoringTool):
def __init__ (self, name):
super(TrigBmumuxComboHypoToolMonitoring, self).__init__(name)
self.Histograms = [
defineHistogram('Chi2', type='TH1F', path='EXPERT', title="chi2 of the fitted vertex", xbins=100, xmin=0, xmax=100),
defineHistogram('Fitmass', type='TH1F', path='EXPERT', title="mass of BPhys object", xbins=100, xmin=4000, xmax=8000),
defineHistogram('Mass', type='TH1F', path='EXPERT', title="mass(BPhys object) - mass(dimuon) + PDG::mJpsi", xbins=100, xmin=4000, xmax=8000),
defineHistogram('Pt', type='TH1F', path='EXPERT', title="p_{T} of BPhys object", xbins=100, xmin=0, xmax=40000),
]
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from TrigBphysHypo.TrigBphysHypoConf import TrigBphysStreamerHypoTool
def TrigBphysStreamerHypoToolFromDict(chainDict):
tool = TrigBphysStreamerHypoTool(chainDict['chainName'])
return tool
......@@ -24,12 +24,33 @@ constexpr double LAMBDABMASS = 5620.2; //MeV
constexpr double BCMASS = 6277.0; //MeV
/// list of decay constexprants BMuMuX
constexpr int di_to_muons = 0;
constexpr int di_to_muons = 0;
constexpr int b_to_K = 1; // to recognize type of decay B+/- ->K+/- mu+ mu-
constexpr int bD_to_Kstar = 2; // to recognize type of decay Bd ->K*(K+Pi-) mu+ mu-
constexpr int bS_to_Phi = 3; // to recognize type of decay Bs ->Phi(K+K-) mu+ mu-
constexpr int lB_to_L = 4; // to recognize type of decay Lb ->L(PPi-) mu+ mu-
constexpr int bC_to_PiPi = 5; // to recognize type of decay Bc ->D+(K-pi+pi+) mu+ mu-
constexpr int di_to_electrons = 6;
constexpr int di_to_electrons = 6;
// PDG'2020
struct PDG20 {
static constexpr double
mElectron = 0.5109989461,
mMuon = 105.6583745,
mPion = 139.57039,
mPion0 = 134.9768,
mKaon = 493.677,
mK_S0 = 497.611,
mPhi1020 = 1019.461,
mProton = 938.2720813,
mLambda0 = 1115.683,
mJpsi = 3096.900,
mPsi2S = 3686.097,
mB = 5279.32,
mB0 = 5279.63,
mB_s0 = 5366.89,
mB_c = 6274.9,
mLambda_b0 = 5619.60;
};
#endif
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIG_ITrigBphysState_H
#define TRIG_ITrigBphysState_H
/**
* @class ITrigBphysState
* @brief Base class for TrigBphys state objects
*/
class ITrigBphysState
{
public:
virtual ~ITrigBphysState() = default;
};
#endif // TRIG_ITrigBphysState_H
This diff is collapsed.
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIG_TrigBmumuxComboHypo_H
#define TRIG_TrigBmumuxComboHypo_H
#include <string>
#include <vector>
#include <utility>
#include "Gaudi/Property.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "xAODTracking/VertexContainer.h"
#include "xAODTracking/VertexAuxContainer.h"
#include "xAODMuon/MuonContainer.h"
#include "xAODTrigger/TrigComposite.h"
#include "xAODTrigBphys/TrigBphys.h"
#include "xAODTrigBphys/TrigBphysContainer.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "TrigCompositeUtils/TrigCompositeUtils.h"
#include "DecisionHandling/ComboHypo.h"
#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
#include "InDetConversionFinderTools/VertexPointEstimator.h"
#include "ITrackToVertex/ITrackToVertex.h"
#include "AthenaMonitoringKernel/Monitored.h"
#include "AthenaMonitoringKernel/GenericMonitoringTool.h"
#include "ITrigBphysState.h"
#include "TrigBmumuxComboHypoTool.h"
#include "Constants.h"
typedef struct PDG20 PDG;
/**
* @class TrigBmumuxState
* @brief State class for TrigBmumuxComboHypo algorithm
*/
class TrigBmumuxState: public ::ITrigBphysState {
public:
const EventContext* context;
const TrigCompositeUtils::DecisionContainer* previousDecisions;
TrigCompositeUtils::DecisionContainer* decisions;
xAOD::TrigBphysContainer* trigBphysCollection;
struct Muon {
ElementLink<xAOD::MuonContainer> link;
ElementLinkVector<TrigCompositeUtils::DecisionContainer> decisionLinks;
TrigCompositeUtils::DecisionIDContainer decisionIDs;
};
std::vector<Muon> muons;
std::vector<ElementLink<xAOD::TrackParticleContainer>> tracks;
xAOD::VertexContainer dimuons;
xAOD::VertexAuxContainer dimuonsStore;
StatusCode addTriggerObject(xAOD::TrigBphys* triggerObject) {
if (!triggerObject) {
return StatusCode::FAILURE;
}
trigBphysCollection->push_back(triggerObject);
return StatusCode::SUCCESS;
}
};
/**
* @class TrigBmumuxComboHypo
* @brief EF hypothesis algorithm for B -> mu+ mu- X decays:
* B+ -> mu+ mu- K+
* B_s0 -> mu+ mu- phi1020(-> K+, K-)
*/
class TrigBmumuxComboHypo: public ::ComboHypo {
public:
TrigBmumuxComboHypo(const std::string& name, ISvcLocator* pSvcLocator);
TrigBmumuxComboHypo() = delete;
virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext& context) const override;
virtual StatusCode finalize() override;
enum Decay : size_t {
kPsi_2mu, // psi -> mu+ mu-
kB_2mu1trk, // B -> mu+ mu- trk1
kB_2mu2trk // B -> mu+ mu- trk1 trk2
};
private:
std::unique_ptr<TrigBmumuxState> makeState(const EventContext* context,
const TrigCompositeUtils::DecisionContainer* previousDecisions,
TrigCompositeUtils::DecisionContainer* decisions,
xAOD::TrigBphysContainer* trigBphysCollection) const;
StatusCode mergeMuonsFromViews(TrigBmumuxState&) const;
StatusCode mergeTracksFromViews(TrigBmumuxState&) const;
StatusCode findDimuonCandidates(TrigBmumuxState&) const;
StatusCode findBmumuxCandidates(TrigBmumuxState&) const;
StatusCode createDecisionObjects(TrigBmumuxState&) const;
xAOD::Vertex* fit(const std::vector<ElementLink<xAOD::TrackParticleContainer>>& tracklist, Decay = kPsi_2mu, const xAOD::TrigBphys* dimuon = nullptr) const;
xAOD::TrigBphys* makeTriggerObject(const xAOD::Vertex*,
xAOD::TrigBphys::pType type = xAOD::TrigBphys::MULTIMU,
const std::vector<double>& trkMass = {PDG::mMuon, PDG::mMuon},
const ElementLink<xAOD::TrigBphysContainer>& dimuonLink = ElementLink<xAOD::TrigBphysContainer>()) const;
bool isIdenticalTracks(const xAOD::TrackParticle* lhs, const xAOD::TrackParticle* rhs) const;
bool isIdenticalTracks(const xAOD::Muon* lhs, const xAOD::Muon* rhs) const;
bool passDimuonTrigger(const std::vector<const DecisionIDContainer*>& previousDecisionIDs) const;
bool isInMassRange(double mass, const std::pair<double, double>& range) const { return (mass > range.first && mass < range.second); }
SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleContainerKey {this,
"TrackCollectionKey", "InDetTrackParticles", "input TrackParticle container name"};
SG::ReadHandleKey<xAOD::MuonContainer> m_muonContainerKey {this,
"MuonCollectionKey", "Muons", "input EF Muon container name"};
SG::WriteHandleKey<xAOD::TrigBphysContainer> m_trigBphysContainerKey {this,
"TrigBphysCollectionKey", "TrigBphysContainer", "output TrigBphysContainer name"};
// general properties
Gaudi::Property<double> m_deltaR {this,
"DeltaR", 0.01, "minimum deltaR between same-sign tracks (overlap removal)"};
Gaudi::Property<double> m_trkZ0 {this,
"TrkZ0", 50., "maximum z0 impact parameter of the track wrt the fitted dimuon vertex; no preselection if negative"};
Gaudi::Property<unsigned int> m_maxFitAttempts_DimuTrk1 {this,
"MaxFitAttempts_DimuTrk1", 200, "maximum vertex fitter calls for dimu+trk1 decays (time-out protect)"};
Gaudi::Property<unsigned int> m_maxFitAttempts_DimuTrk1Trk2 {this,
"MaxFitAttempts_DimuTrk1Trk2", 2000, "maximum vertex fitter calls for dimu+trk1+trk2 decays (time-out protect)"};
// dimuon properties
Gaudi::Property<bool> m_dimuon_rejectSameChargeTracks {this,
"Dimuon_rejectSameChargeTracks", true, "if true, the only (mu+, mu-) pairs will be kept (no wrong-charge combinations)"};
Gaudi::Property<std::pair<double, double>> m_dimuon_massRange {this,
"Dimuon_massRange", {100., 5500.}, "dimuon mass range"};
Gaudi::Property<double> m_dimuon_chi2 {this,
"Dimuon_chi2", 20., "maximum chi2 of the dimuon vertex"};
// B+ -> mu+ mu- K+
Gaudi::Property<bool> m_BplusToMuMuKaon {this,
"BplusToMuMuKaon", true, "switch on/off B+ -> mu+ mu- K+ decay"};
Gaudi::Property<double> m_BplusToMuMuKaon_minKaonPt {this,
"BplusToMuMuKaon_minKaonPt", 100., "minimum pT of kaon track"};
Gaudi::Property<std::pair<double, double>> m_BplusToMuMuKaon_massRange {this,
"BplusToMuMuKaon_massRange", {4500., 5900.}, "B+ mass range"};
Gaudi::Property<float> m_BplusToMuMuKaon_chi2 {this,
"BplusToMuMuKaon_chi2", 50., "maximum chi2 of the fitted B+ vertex"};
// B_c+ -> J/psi(-> mu+ mu-) pi+
Gaudi::Property<bool> m_BcToMuMuPion {this,
"BcToMuMuPion", true, "switch on/off B_c+ -> J/psi(-> mu+ mu-) pi+ decay"};
Gaudi::Property<double> m_BcToMuMuPion_minPionPt {this,
"BcToMuMuPion_minPionPt", 2000., "minimum pT of pion track"};
Gaudi::Property<std::pair<double, double>> m_BcToMuMuPion_dimuonMassRange {this,
"BcToMuMuPion_dimuonMassRange", {2500., 4300.}, "dimuon mass range for B_c+ decay"};
Gaudi::Property<std::pair<double, double>> m_BcToMuMuPion_massRange {this,
"BcToMuMuPion_massRange", {5500., 7300.}, "B_c+ mass range"};
Gaudi::Property<float> m_BcToMuMuPion_chi2 {this,
"BcToMuMuPion_chi2", 50., "maximum chi2 of the fitted B_c+ vertex"};
// B_s0 -> mu+ mu- phi(-> K+ K-)
Gaudi::Property<bool> m_BsToMuMuPhi1020 {this,
"BsToMuMuPhi1020", true, "switch on/off B_s0 -> mu+ mu- phi(-> K+ K-) decay"};
Gaudi::Property<bool> m_BsToMuMuPhi1020_rejectSameChargeTracks {this,
"BsToMuMuPhi1020_rejectSameChargeTracks", true, "if true, the only (K+, K-) pairs will be kept (no wrong-charge combinations)"};
Gaudi::Property<double> m_BsToMuMuPhi1020_minKaonPt {this,
"BsToMuMuPhi1020_minKaonPt", 100., "minimum pT of kaon tracks"};
Gaudi::Property<std::pair<double, double>> m_BsToMuMuPhi1020_massRange {this,
"BsToMuMuPhi1020_massRange", {4800., 5800.}, "B_s0 mass range"};
Gaudi::Property<std::pair<double, double>> m_BsToMuMuPhi1020_phiMassRange {this,
"BsToMuMuPhi1020_phiMassRange", {940., 1100.}, "phi1020 mass range"};
Gaudi::Property<float> m_BsToMuMuPhi1020_chi2 {this,
"BsToMuMuPhi1020_chi2", 60., "maximum chi2 of the fitted B+ vertex"};
// B0 -> mu+ mu- K*0(-> K+ pi-)
Gaudi::Property<bool> m_BdToMuMuKstar0 {this,
"BdToMuMuKstar0", true, "switch on/off B0 -> mu+ mu- K*0(-> K+ pi-) decay"};
Gaudi::Property<bool> m_BdToMuMuKstar0_rejectSameChargeTracks {this,
"BdToMuMuKstar0_rejectSameChargeTracks", true, "if true, the only (K+, pi-) and (K-, pi+) pairs will be kept (no wrong-charge combinations)"};
Gaudi::Property<double> m_BdToMuMuKstar0_minKaonPt {this,
"BdToMuMuKstar0_minKaonPt", 100., "minimum pT of kaon track"};
Gaudi::Property<double> m_BdToMuMuKstar0_minPionPt {this,
"BdToMuMuKstar0_minPionPt", 100., "minimum pT of pion track"};
Gaudi::Property<std::pair<double, double>> m_BdToMuMuKstar0_massRange {this,
"BdToMuMuKstar0_massRange", {4600., 5900.}, "B0 mass range"};
Gaudi::Property<std::pair<double, double>> m_BdToMuMuKstar0_KstarMassRange {this,
"BdToMuMuKstar0_KstarMassRange", {700., 1100.}, "K*0 mass range"};
Gaudi::Property<float> m_BdToMuMuKstar0_chi2 {this,
"BdToMuMuKstar0_chi2", 60., "maximum chi2 of the fitted B0 vertex"};
// Lambda_b0 -> J/psi(-> mu+ mu-) p K-
Gaudi::Property<bool> m_LambdaBToMuMuProtonKaon {this,
"LambdaBToMuMuProtonKaon", true, "switch on/off Lambda_b0 -> J/psi(-> mu+ mu-) p K- decay"};
Gaudi::Property<bool> m_LambdaBToMuMuProtonKaon_rejectSameChargeTracks {this,
"LambdaBToMuMuProtonKaon_rejectSameChargeTracks", false, "if true, the only (p, K-) and (anti-p, K+) pairs will be kept (no wrong-charge combinations)"};
Gaudi::Property<double> m_LambdaBToMuMuProtonKaon_minProtonPt {this,
"LambdaBToMuMuProtonKaon_minProtonPt", 1000., "minimum pT of proton track"};
Gaudi::Property<double> m_LambdaBToMuMuProtonKaon_minKaonPt {this,
"LambdaBToMuMuProtonKaon_minKaonPt", 1000., "minimum pT of kaon track"};
Gaudi::Property<double> m_LambdaBToMuMuProtonKaon_minKstarMass {this,
"LambdaBToMuMuProtonKaon_minKstarMass", 1300., "min value for both mass(trk1=kaon, trk2=pion) and mass(trk1=pion, trk2=kaon)"};
Gaudi::Property<std::pair<double, double>> m_LambdaBToMuMuProtonKaon_dimuonMassRange {this,
"LambdaBToMuMuProtonKaon_dimuonMassRange", {2500., 4300.}, "dimuon mass range for Lambda_b0 decay"};
Gaudi::Property<std::pair<double, double>> m_LambdaBToMuMuProtonKaon_massRange {this,
"LambdaBToMuMuProtonKaon_massRange", {4800., 6400.}, "Lambda_b0 mass range"};
Gaudi::Property<float> m_LambdaBToMuMuProtonKaon_chi2 {this,
"LambdaBToMuMuProtonKaon_chi2", 60., "maximum chi2 of the fitted Lambda_b0 vertex"};
// external tools
ToolHandle<InDet::VertexPointEstimator> m_vertexPointEstimator {this,
"VertexPointEstimator", "", "tool to find starting point for the vertex fitter"};
ToolHandle<Trk::TrkVKalVrtFitter> m_vertexFitter {this,
"VertexFitter", "", "VKalVrtFitter tool to fit tracks into the common vertex"};
ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool {this,
"TrackToVertexTool", "", "tool to extrapolate track to vertex or beamspot"};
ToolHandle<GenericMonitoringTool> m_monTool {this,
"MonTool", "", "monitoring tool"};
TrigCompositeUtils::DecisionIDContainer m_allowedIDs;
const std::vector<std::vector<double>> m_trkMass{
{PDG::mMuon, PDG::mMuon},
{PDG::mMuon, PDG::mMuon, PDG::mKaon},
{PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mKaon}
};
};
#endif // TRIG_TrigBmumuxComboHypo_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigBmumuxComboHypoTool.h"
TrigBmumuxComboHypoTool::TrigBmumuxComboHypoTool(const std::string& type, const std::string& name, const IInterface* parent)
: ComboHypoToolBase(type, name, parent) {}
StatusCode TrigBmumuxComboHypoTool::initialize()
{
if (!m_monTool.empty()) {
ATH_CHECK( m_monTool.retrieve() );
ATH_MSG_DEBUG( "GenericMonitoringTool name:" << m_monTool );
}
else {
ATH_MSG_DEBUG( "No GenericMonitoringTool configured: no monitoring histograms will be available" );
}
ATH_MSG_DEBUG( "Initialization completed successfully" );
return StatusCode::SUCCESS;
}
bool TrigBmumuxComboHypoTool::passed(const xAOD::TrigBphys* trigBphys) const {
using namespace Monitored;
auto mon_chi2 = Monitored::Scalar<float>("Chi2", -1.);
auto mon_fitmass = Monitored::Scalar<float>("Fitmass", -1.);
auto mon_mass = Monitored::Scalar<float>("Mass", -1.);
auto mon_pt = Monitored::Scalar<float>("Pt", -1.);
auto group = Monitored::Group(m_monTool, mon_chi2, mon_fitmass, mon_mass, mon_pt);
ATH_MSG_DEBUG( "in TrigBmumuxComboHypoTool::decideOnSingleObject(), looking at TrigBphys object");
bool result = false;
if (static_cast<int>(trigBphys->particleType()) == m_decay) {
result = true;
ATH_MSG_DEBUG("accepting event");
}
if (result) {
mon_chi2 = trigBphys->fitchi2();
mon_fitmass = trigBphys->fitmass();
mon_mass = trigBphys->mass();
mon_pt = trigBphys->pt();
}
return result;
}
StatusCode TrigBmumuxComboHypoTool::decideOnSingleObject(Decision* decision, const std::vector<const DecisionIDContainer*>& previousDecisionIDs) const {
ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString()) );
auto trigBphysEL = decision->objectLink<xAOD::TrigBphysContainer>(TrigCompositeUtils::featureString());
ATH_CHECK( trigBphysEL.isValid() );
ATH_CHECK( previousDecisionIDs.size() == 2 );
ATH_CHECK( previousDecisionIDs.size() == legDecisionIds().size() );
bool direct = true;
bool inverse = true;
for (size_t i = 0; i < 2; ++i) {
if (direct && !TrigCompositeUtils::passed(legDecisionId(i).numeric(), *previousDecisionIDs[i])) direct = false;
if (inverse && !TrigCompositeUtils::passed(legDecisionId(i).numeric(), *previousDecisionIDs[1-i])) inverse = false;
}
if (!direct && !inverse) {
ATH_MSG_DEBUG( "Trigger legs matched to the previous decisions neither direct nor inverse way" );
return StatusCode::SUCCESS;
}
if (passed(*trigBphysEL)) {
TrigCompositeUtils::addDecisionID(decisionId(), decision);
}
return StatusCode::SUCCESS;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIG_TrigBmumuxComboHypoTool_H
#define TRIG_TrigBmumuxComboHypoTool_H
#include <string>
#include <vector>
#include "DecisionHandling/ComboHypoToolBase.h"
#include "xAODTrigBphys/TrigBphys.h"
#include "xAODTrigBphys/TrigBphysContainer.h"
#include "TrigCompositeUtils/HLTIdentifier.h"
#include "TrigCompositeUtils/TrigCompositeUtils.h"
#include "AthenaMonitoringKernel/Monitored.h"
#include "AthenaMonitoringKernel/GenericMonitoringTool.h"
using TrigCompositeUtils::Decision;
using TrigCompositeUtils::DecisionIDContainer;
/**
* @class TrigBmumuxComboHypoTool
* @brief ComboHypoTool for B -> mu+, mu- X decays
*/
class TrigBmumuxComboHypoTool: public ComboHypoToolBase {
public:
TrigBmumuxComboHypoTool(const std::string& type, const std::string& name, const IInterface* parent);
virtual StatusCode initialize() override;
virtual StatusCode decideOnSingleObject(Decision*, const std::vector<const DecisionIDContainer*>&) const override;
private:
bool passed(const xAOD::TrigBphys*) const;
virtual bool executeAlg(std::vector<LegDecision>&) const override { return true; }
Gaudi::Property<int> m_decay {this, "Decay", 9999, "decay as enumerated in xAOD::TrigBphys::pType"};
ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool"};
};
#endif // TRIG_TrigBmumuxComboHypoTool_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigBphysStreamerHypo.h"
#include "xAODMuon/Muon.h"
#include "xAODMuon/MuonContainer.h"
#include "TrigCompositeUtils/HLTIdentifier.h"
#include "TrigCompositeUtils/TrigCompositeUtils.h"
using TrigCompositeUtils::Decision;
using TrigCompositeUtils::DecisionContainer;
using TrigCompositeUtils::DecisionIDContainer;
TrigBphysStreamerHypo::TrigBphysStreamerHypo(const std::string& name, ISvcLocator* pSvcLocator)
: ::HypoBase(name, pSvcLocator) {}
StatusCode TrigBphysStreamerHypo::initialize() {
ATH_MSG_DEBUG( "TrigBphysStreamerHypo::initialize()" );
ATH_CHECK( m_hypoTools.retrieve() );
return StatusCode::SUCCESS;
}
StatusCode TrigBphysStreamerHypo::execute( const EventContext& context ) const {
ATH_MSG_DEBUG( "TrigMultiTrkHypo::execute() starts" );
ATH_MSG_DEBUG( "decision input key: " << decisionInput().key() );
auto previousDecisionsHandle = SG::makeHandle(decisionInput(), context);
CHECK( previousDecisionsHandle.isValid() );
ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle->size() << " previous decisions" );
// create the mutable output DecisionContainer and register it to StoreGate
SG::WriteHandle<DecisionContainer> outputHandle = TrigCompositeUtils::createAndStore(decisionOutput(), context);
DecisionContainer* decisions = outputHandle.ptr();
for (const Decision* previousDecision : *previousDecisionsHandle) {
Decision* decision = TrigCompositeUtils::newDecisionIn(decisions, previousDecision, "", context);
auto muonLinkInfo = TrigCompositeUtils::findLink<xAOD::MuonContainer>(previousDecision, TrigCompositeUtils::featureString(), true);
ATH_CHECK( muonLinkInfo.isValid() );
decision->setObjectLink<xAOD::MuonContainer>(TrigCompositeUtils::featureString(), muonLinkInfo.link);
TrigCompositeUtils::insertDecisionIDs(previousDecision, decision);
if (msgLvl(MSG::DEBUG)) {
const xAOD::Muon* muon = *(muonLinkInfo.link);
if (muon->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) {
const ElementLink<xAOD::TrackParticleContainer> trackEL = muon->inDetTrackParticleLink();
ATH_CHECK( trackEL.isValid() );
const xAOD::TrackParticle* track = *trackEL;
ATH_MSG_DEBUG( " -- muon pt/eta/phi/q: " << track->pt() << " / " << track->eta() << " / " << track->phi() << " / " << track->charge() );
ATH_MSG_DEBUG( " Allowed decisions:" );
DecisionIDContainer IDs;
TrigCompositeUtils::decisionIDs(decision, IDs);
for (const TrigCompositeUtils::DecisionID& id : IDs) {
ATH_MSG_DEBUG( " +++ " << HLT::Identifier(id) );
}
}
}
}
ATH_CHECK( hypoBaseOutputProcessing(outputHandle) );
return StatusCode::SUCCESS;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIG_TrigBphysStreamerHypo_H
#define TRIG_TrigBphysStreamerHypo_H
#include <string>
#include "DecisionHandling/HypoBase.h"
#include "TrigBphysStreamerHypoTool.h"
/**
* @class TrigBphysStreamerHypo
* @brief Implements a streamer (no selection) for the HLT framework
*/
class TrigBphysStreamerHypo : public ::HypoBase {
public:
TrigBphysStreamerHypo(const std::string& name, ISvcLocator* pSvcLocator);
TrigBphysStreamerHypo() = delete;
virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext&) const override;
private:
ToolHandleArray<TrigBphysStreamerHypoTool> m_hypoTools {this, "HypoTools", {}, "Tools to perform selection"};
};
#endif // TRIG_TrigBphysStreamerHypo_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigBphysStreamerHypoTool.h"
TrigBphysStreamerHypoTool::TrigBphysStreamerHypoTool(const std::string& type, const std::string& name, const IInterface* parent)
: AthAlgTool(type, name, parent),
m_decisionId(HLT::Identifier::fromToolName(name)) {}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIG_TrigBphysStreamerHypoTool_H
#define TRIG_TrigBphysStreamerHypoTool_H
#include <string>
#include "AthenaBaseComps/AthAlgTool.h"
#include "TrigCompositeUtils/HLTIdentifier.h"
class TrigBphysStreamerHypoTool : public ::AthAlgTool {
public:
TrigBphysStreamerHypoTool(const std::string& type, const std::string& name, const IInterface* parent);
HLT::Identifier decisionId() const { return m_decisionId; }
private:
HLT::Identifier m_decisionId;
};
#endif // TRIG_TrigBphysStreamerHypoTool_H
......@@ -445,7 +445,7 @@ StatusCode TrigMultiTrkComboHypo::executeEF(const EventContext& context) const {
// create a new output Decision object, backed by the 'decisions' container.
Decision* decision = TrigCompositeUtils::newDecisionIn(decisions);
std::vector<DecisionIDContainer*> previousDecisionIDs;
std::vector<const DecisionIDContainer*> previousDecisionIDs;
for (size_t itrk : trigBphysTrackIdx[idx]) {
// attach all previous decisions: if the same previous decision is called twice, that's fine - internally takes care of that
for (const ElementLink<DecisionContainer>& previousDecisionEL : tracks[itrk].second) {
......
......@@ -158,7 +158,7 @@ bool TrigMultiTrkComboHypoTool::passed(const xAOD::TrigBphys* trigBphys) const {
}
StatusCode TrigMultiTrkComboHypoTool::decideOnSingleObject(Decision* decision, const std::vector<DecisionIDContainer*>& previousDecisionIDs) const {
StatusCode TrigMultiTrkComboHypoTool::decideOnSingleObject(Decision* decision, const std::vector<const DecisionIDContainer*>& previousDecisionIDs) const {
ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString()) );
......
......@@ -34,7 +34,7 @@ class TrigMultiTrkComboHypoTool: public ComboHypoToolBase {
public:
TrigMultiTrkComboHypoTool(const std::string& type, const std::string& name, const IInterface* parent);
virtual StatusCode initialize() override;
virtual StatusCode decideOnSingleObject(TrigCompositeUtils::Decision*, const std::vector<TrigCompositeUtils::DecisionIDContainer*>&) const override;
virtual StatusCode decideOnSingleObject(TrigCompositeUtils::Decision*, const std::vector<const TrigCompositeUtils::DecisionIDContainer*>&) const override;
private:
bool passed(const xAOD::TrigBphys*) const;
......
......@@ -29,10 +29,12 @@
#include "../TrigEFMultiMuFex.h"
#include "../TrigEFTrkMassFex.h"
#include "src/TrigBphysStreamerHypo.h"
#include "src/TrigBphysStreamerHypoTool.h"
#include "src/TrigMultiTrkComboHypo.h"
#include "src/TrigMultiTrkComboHypoTool.h"
//#include "../TrigBphysL1DiMuComboFex.h"
#include "src/TrigBmumuxComboHypo.h"
#include "src/TrigBmumuxComboHypoTool.h"
//DECLARE_COMPONENT( TrigL2DiMuXHypo )
......@@ -65,7 +67,10 @@ DECLARE_COMPONENT( TrigEFTrkMassFex )
DECLARE_COMPONENT( TrigBphysMuonCounter )
DECLARE_COMPONENT( TrigBphysTrackRoiMaker )
DECLARE_COMPONENT( TrigBphysElectronCounter )
//DECLARE_COMPONENT( TrigBphysL1DiMuComboFex )
DECLARE_COMPONENT( TrigBphysStreamerHypo )
DECLARE_COMPONENT( TrigBphysStreamerHypoTool )
DECLARE_COMPONENT( TrigMultiTrkComboHypo )
DECLARE_COMPONENT( TrigMultiTrkComboHypoTool )
DECLARE_COMPONENT( TrigBmumuxComboHypo )
DECLARE_COMPONENT( TrigBmumuxComboHypoTool )
......@@ -35,7 +35,7 @@ public:
**/
virtual StatusCode decide(LegDecisionsMap & passingLegs, const EventContext& /* ctx */ ) const override;
virtual StatusCode decideOnSingleObject(TrigCompositeUtils::Decision*, const std::vector<TrigCompositeUtils::DecisionIDContainer*>&) const { return StatusCode::SUCCESS; }
virtual StatusCode decideOnSingleObject(TrigCompositeUtils::Decision*, const std::vector<const TrigCompositeUtils::DecisionIDContainer*>&) const { return StatusCode::SUCCESS; }
/**
* @brief retrieves this decision Id
......
......@@ -904,6 +904,15 @@ class _Settings_bphysicsHighPt( _GlobalSettings ):
self._configPT = _PrecisionTracking( signatureType = 'bphysHighPt', nameSuffix = 'Bjet' )
self._doRecord = False
class _Settings_bmumux( _GlobalSettings ):
def __init__( self ):
_GlobalSettings.__init__(self)
self._name = "bmumux" #To be appended to alg names
self._roi = "HLT_Roi_Bmumux"
self._configFT = _FastTracking( signatureType = 'bphysics', nameSuffix = 'Bmumux' )
self._configPT = _PrecisionTracking( signatureType = 'bphysics', nameSuffix = 'Bmumux' )
self._doRecord = True #Allow recording of track collections
class _Settings_beamgas( _GlobalSettings ):
def __init__( self ):
_GlobalSettings.__init__(self)
......@@ -961,6 +970,7 @@ _ConfigSettings = {
"minBias0" : _Settings_minBias(),
"bphysics" : _Settings_bphysics(),
"bphysHighPt" : _Settings_bphysicsHighPt(),
"bmumux" : _Settings_bmumux(),
"beamgas" : _Settings_beamgas(),
"hadCalib" : _Settings_hadCalib()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment