ATLAS Offline Software
Loading...
Searching...
No Matches
TrigBmuxComboHypo.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIG_TrigBmuxComboHypo_H
6#define TRIG_TrigBmuxComboHypo_H
7
8#include <string>
9#include <vector>
10#include <utility>
11
12#include "Gaudi/Property.h"
20
23
26
30
33
34#include "ITrigBphysState.h"
36
37#include "Constants.h"
38typedef struct PDG20 PDG;
39
46 public:
47 TrigBmuxState() = delete;
54 virtual ~TrigBmuxState() = default;
55
61 std::vector<Muon> muons;
62 std::vector<size_t> trigBphysMuonIndices;
63
64 xAOD::TrigBphys* addTriggerObject(size_t muonIndex) {
66 trigBphysMuonIndices.push_back(muonIndex);
67 return trigBphysCollection().back();
68 }
69
70 std::vector<xAOD::TrigBphys*> addTriggerObjects(size_t n, size_t muonIndex) {
71 std::vector<xAOD::TrigBphys*> triggerObjects(n, nullptr);
72 for (size_t i = 0; i < n; i++) {
73 triggerObjects[i] = addTriggerObject(muonIndex);
74 }
75 return triggerObjects;
76 }
77};
78
79
90 public:
91 TrigBmuxComboHypo(const std::string& name, ISvcLocator* pSvcLocator);
93
94 virtual StatusCode initialize() override;
95 virtual StatusCode execute(const EventContext& context) const override;
96
97 enum Decay : size_t {
98 kD0, // D0 -> K- pi+
99 kDstar, // D*-(-> anti-D0(-> K+ pi-) pi-)
100 kDs, // D_s+ -> K+ K- pi+
101 kDplus, // D+ -> K- pi+ pi+
102 kLambdaC // Lambda_c+ -> p K- pi+
103 };
104
105 private:
106 StatusCode findBmuxCandidates(TrigBmuxState&) const;
107 StatusCode createDecisionObjects(TrigBmuxState&) const;
108
116 std::unique_ptr<xAOD::Vertex> fit(
117 const EventContext& context,
118 const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
119 Decay decay) const;
120
128 std::unique_ptr<Trk::VxCascadeInfo> fitCascade(
129 const EventContext& context,
130 const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
131 Decay decay) const;
132
133
141 StatusCode fillTriggerObject(
142 xAOD::TrigBphys& triggerObject,
144 const xAOD::Vertex& vertex,
145 const std::vector<double>& trkMass) const;
146
155 StatusCode fillTriggerObjects(
156 std::vector<xAOD::TrigBphys*>& triggerObjects,
158 const Trk::VxCascadeInfo& vxCascadeInfo,
159 const Amg::Vector3D& beamSpotPosition) const;
160
166 bool isIdenticalTracks(const xAOD::TrackParticle* lhs, const xAOD::TrackParticle* rhs) const;
167
172 bool isInSameRoI(const xAOD::Muon*, const xAOD::TrackParticle*) const;
173
177 bool isInMassRange(double mass, const std::pair<double, double>& range) const { return (mass > range.first && mass < range.second); }
178
183 double getTrkImpactParameterZ0(const EventContext& ctx, const xAOD::TrackParticle& track, const Amg::Vector3D& vertex) const;
184
189 double Lxy(const Amg::Vector3D& productionVertex, const Amg::Vector3D& decayVertex, const std::vector<TLorentzVector>& momenta) const;
190
192 "TrackCollectionKey", "InDetTrackParticles", "input TrackParticle container name"};
194 "MuonCollectionKey", "Muons", "input EF Muon container name"};
196 "TrigBphysCollectionKey", "TrigBphysContainer", "output TrigBphysContainer name"};
198 m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
199
200 // general properties
201 Gaudi::Property<bool> m_makeCascadeFit {this,
202 "MakeCascadeFit", true, "perform cascade fit of the partially reconstructed decays"};
203 Gaudi::Property<float> m_cascadeChi2 {this,
204 "CascadeChi2", 50., "maximum chi2 of the cascade fit"};
205 Gaudi::Property<double> m_deltaR {this,
206 "DeltaR", 0.01, "minimum deltaR between same-sign tracks (overlap removal)"};
207 Gaudi::Property<double> m_trkZ0 {this,
208 "TrkZ0", 10., "maximum of |z0_trk - z0_muon|, where z0_trk(z0_muon) is impact parameter of the track(muon) wrt BeamSpot; no preselection if negative"};
209 Gaudi::Property<double> m_roiEtaWidth {this,
210 "RoiEtaWidth", 0.75, "extent of the RoI in eta from initial muon, to be check for SuperRoI"};
211 Gaudi::Property<double> m_roiPhiWidth {this,
212 "RoiPhiWidth", 0.75, "extent of the RoI in phi from initial muon, to be check for SuperRoI"};
213 Gaudi::Property<size_t> m_fitAttemptsWarningThreshold {this,
214 "FitAttemptsWarningThreshold", 200, "Events processing this many calls of the vertex fitter will generate a WARNING message (time-out protect)"};
215 Gaudi::Property<size_t> m_fitAttemptsBreakThreshold {this,
216 "FitAttemptsBreakThreshold", 1000, "Events processing this many calls of the vertex fitter will generate a second WARNING message and the loop over combinations will be terminated at this point (time-out protect)"};
217
218 // B+ -> mu+ nu_mu anti-D0(-> K+ pi-) and B0 -> mu+ nu_mu D*-(-> anti-D0(-> K+ pi-) pi-)
219 Gaudi::Property<bool> m_BToD0 {this,
220 "BToD0", true, "switch on/off B+ -> mu+ nu_mu anti-D0(-> K+ pi-) decay"};
221 Gaudi::Property<bool> m_BToD0_makeDstar {this,
222 "BToD0_makeDstar", true, "switch on/off B0 -> mu+ nu_mu D*-(-> anti-D0(-> K+ pi-) pi-) decay"};
223 Gaudi::Property<double> m_BToD0_minD0KaonPt {this,
224 "BToD0_minD0KaonPt", 1000., "minimum pT of kaon track from D0"};
225 Gaudi::Property<double> m_BToD0_minD0PionPt {this,
226 "BToD0_minD0PionPt", 1000., "minimum pT of pion track from D0"};
227 Gaudi::Property<double> m_BToD0_minD0Pt {this,
228 "BToD0_minD0Pt", -1., "minimum pT of D0"};
229 Gaudi::Property<double> m_BToD0_minDstarPt {this,
230 "BToD0_minDstarPt", 5500., "minimum pT of D*-"};
231 Gaudi::Property<double> m_BToD0_minDstarPionPt {this,
232 "BToD0_minDstarPionPt", 1000., "minimum pT of pion track from D*-"};
233 Gaudi::Property<double> m_BToD0_maxDstarPionZ0 {this,
234 "BToD0_maxDstarPionZ0", 5., "maximum z0 impact parameter of the pion track from D*+ wrt the fitted D0 vertex; no preselection if negative"};
235 Gaudi::Property<std::pair<double, double>> m_BToD0_massRange {this,
236 "BToD0_massRange", {-1., 10000.}, "B+/B0 mass range"};
237 Gaudi::Property<std::pair<double, double>> m_BToD0_D0MassRange {this,
238 "BToD0_D0MassRange", {1750., 2000.}, "D0 mass range"};
239 Gaudi::Property<std::pair<double, double>> m_BToD0_DstarMassRange {this,
240 "BToD0_DstarMassRange", {-1., 2110.}, "D*+ mass range"};
241 Gaudi::Property<float> m_BToD0_chi2 {this,
242 "BToD0_chi2", 20., "maximum chi2 of the fitted D0 vertex"};
243 Gaudi::Property<float> m_BToD0_LxyB {this,
244 "BToD0_LxyB", 0.1, "Lxy(B+,BeamSpot) for B+ -> mu+ nu_mu anti-D0"};
245 Gaudi::Property<float> m_BToD0_LxyBd {this,
246 "BToD0_LxyBd", 0.05, "Lxy(B0,BeamSpot) for B0 -> mu+ nu_mu D*-"};
247 Gaudi::Property<float> m_BToD0_LxyD0 {this,
248 "BToD0_LxyD0", 0., "Lxy(D0,B+/B0) for both B+ and B0 decays"};
249
250 // B0 -> mu+ nu_mu D-(-> K+ pi- pi-)
251 Gaudi::Property<bool> m_BdToD {this,
252 "BdToD", true, "switch on/off B0 -> mu+ nu_mu D-(-> K+ pi- pi-) decay"};
253 Gaudi::Property<double> m_BdToD_minKaonPt {this,
254 "BdToD_minKaonPt", 1250., "minimum pT of kaon track from D-"};
255 Gaudi::Property<double> m_BdToD_minPionPt {this,
256 "BdToD_minPionPt", 1000., "minimum pT of pion track from D-"};
257 Gaudi::Property<double> m_BdToD_minDPt {this,
258 "BdToD_minDPt", 4500., "minimum pT of D-"};
259 Gaudi::Property<std::pair<double, double>> m_BdToD_massRange {this,
260 "BdToD_massRange", {-1., 10000.}, "B0 mass range"};
261 Gaudi::Property<std::pair<double, double>> m_BdToD_DMassRange {this,
262 "BdToD_DMassRange", {1750., 2000.}, "D+ mass range"};
263 Gaudi::Property<float> m_BdToD_chi2 {this,
264 "BdToD_chi2", 27., "maximum chi2 of the fitted D- vertex"};
265 Gaudi::Property<float> m_BdToD_LxyBd {this,
266 "BdToD_LxyBd", 0.1, "Lxy(B0,BeamSpot) for B0 -> mu+ nu_mu D-"};
267 Gaudi::Property<float> m_BdToD_LxyD {this,
268 "BdToD_LxyD", 0.05, "Lxy(D-,B0) for D- -> K+ pi- pi-"};
269
270 // B_s0 -> mu+ nu_mu D_s-(->phi(-> K+ K-) pi-)
271 Gaudi::Property<bool> m_BsToDs {this,
272 "BsToDs", true, "switch on/off B_s0 -> mu+ nu_mu D_s-(->phi(-> K+ K-) pi-) decay"};
273 Gaudi::Property<double> m_BsToDs_minKaonPt {this,
274 "BsToDs_minKaonPt", 1000., "minimum pT of kaon track from phi(1020)"};
275 Gaudi::Property<double> m_BsToDs_minPionPt {this,
276 "BsToDs_minPionPt", 1000., "minimum pT of pion track from D_s-"};
277 Gaudi::Property<double> m_BsToDs_minDsPt {this,
278 "BsToDs_minDsPt", 5500., "minimum pT of D_s-"};
279 Gaudi::Property<std::pair<double, double>> m_BsToDs_massRange {this,
280 "BsToDs_massRange", {-1., 10000.}, "B_s0 mass range"};
281 Gaudi::Property<std::pair<double, double>> m_BsToDs_phiMassRange {this,
282 "BsToDs_phiMassRange", {940., 1100.}, "phi(1020) mass range"};
283 Gaudi::Property<std::pair<double, double>> m_BsToDs_DsMassRange {this,
284 "BsToDs_DsMassRange", {1750., 2100.}, "D_s- mass range"};
285 Gaudi::Property<float> m_BsToDs_chi2 {this,
286 "BsToDs_chi2", 27., "maximum chi2 of the fitted D_s- vertex"};
287 Gaudi::Property<float> m_BsToDs_LxyBs {this,
288 "BsToDs_LxyBs", 0.1, "Lxy(B_s0,BeamSpot) for B_s0 -> mu+ nu_mu D_s-"};
289 Gaudi::Property<float> m_BsToDs_LxyDs {this,
290 "BsToDs_LxyDs", 0.02, "Lxy(D_s-,B_s0) for D_s- -> phi pi-"};
291
292 // anti-Lambda_b0 -> mu+ nu_mu anti-Lambda_c-(-> anti-p K+ pi-)
293 Gaudi::Property<bool> m_LambdaBToLambdaC {this,
294 "LambdaBToLambdaC", true, "switch on/off Lambda_b0 -> mu+ nu_mu anti-Lambda_c-(-> anti-p K+ pi-) decay"};
295 Gaudi::Property<double> m_LambdaBToLambdaC_minProtonPt {this,
296 "LambdaBToLambdaC_minProtonPt", 2750., "minimum pT of proton track"};
297 Gaudi::Property<double> m_LambdaBToLambdaC_minKaonPt {this,
298 "LambdaBToLambdaC_minKaonPt", 1250., "minimum pT of kaon track"};
299 Gaudi::Property<double> m_LambdaBToLambdaC_minPionPt {this,
300 "LambdaBToLambdaC_minPionPt", 1000., "minimum pT of pion track"};
301 Gaudi::Property<double> m_LambdaBToLambdaC_minLambdaCPt {this,
302 "LambdaBToLambdaC_minLambdaCPt", 5500., "minimum pT of Lambda_c-"};
303 Gaudi::Property<std::pair<double, double>> m_LambdaBToLambdaC_massRange {this,
304 "LambdaBToLambdaC_massRange", {-1., 10000.}, "Lambda_b0 mass range"};
305 Gaudi::Property<std::pair<double, double>> m_LambdaBToLambdaC_LambdaCMassRange {this,
306 "LambdaBToLambdaC_LambdaCMassRange", {2190., 2390.}, "Lambda_c- mass range"};
307 Gaudi::Property<float> m_LambdaBToLambdaC_chi2 {this,
308 "LambdaBToLambdaC_chi2", 27., "maximum chi2 of the fitted Lambda_c- vertex"};
309 Gaudi::Property<float> m_LambdaBToLambdaC_LxyLb {this,
310 "LambdaBToLambdaC_LxyLb", 0.1, "Lxy(Lambda_b0,BeamSpot) for Lambda_b0 -> mu- anti-nu_mu Lambda_c+"};
311 Gaudi::Property<float> m_LambdaBToLambdaC_LxyLc {this,
312 "LambdaBToLambdaC_LxyLc", 0.02, "Lxy(Lambda_c+,Lambda_b0) for Lambda_c+-> p K- pi+"};
313
314 // external tools
315 ToolHandle<InDet::VertexPointEstimator> m_vertexPointEstimator {this,
316 "VertexPointEstimator", "", "tool to find starting point for the vertex fitter"};
317 ToolHandle<Trk::TrkVKalVrtFitter> m_vertexFitter {this,
318 "VertexFitter", "", "VKalVrtFitter tool to fit tracks into the common vertex"};
319 ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool {this,
320 "TrackToVertexTool", "", "tool to extrapolate track to vertex or beamspot"};
321 ToolHandle<GenericMonitoringTool> m_monTool {this,
322 "MonTool", "", "monitoring tool"};
323
325
326 const static std::vector<std::vector<std::vector<double>>> s_trkMass;
327};
328
329#endif // TRIG_TrigBmuxComboHypo_H
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
struct PDG20 PDG
ComboHypo(const std::string &name, ISvcLocator *pSvcLocator)
Definition ComboHypo.cxx:13
const T * back() const
Access the last element in the collection as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TrigCompositeUtils::DecisionContainer & decisions()
ITrigBphysState()=delete
const TrigCompositeUtils::DecisionContainer & previousDecisions() const
xAOD::TrigBphysContainer & trigBphysCollection()
const EventContext & context() const
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Gaudi::Property< float > m_BsToDs_chi2
double getTrkImpactParameterZ0(const EventContext &ctx, const xAOD::TrackParticle &track, const Amg::Vector3D &vertex) const
Returns the longitudinal impact parameter z0 of the track w.r.t.
Gaudi::Property< double > m_BdToD_minPionPt
Gaudi::Property< std::pair< double, double > > m_LambdaBToLambdaC_LambdaCMassRange
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
Gaudi::Property< bool > m_BsToDs
Gaudi::Property< float > m_BsToDs_LxyBs
Gaudi::Property< std::pair< double, double > > m_BdToD_massRange
bool isInSameRoI(const xAOD::Muon *, const xAOD::TrackParticle *) const
Checks that the given track is close enough to the muon, i.e.
Gaudi::Property< float > m_BToD0_chi2
Gaudi::Property< bool > m_BdToD
Gaudi::Property< std::pair< double, double > > m_LambdaBToLambdaC_massRange
TrigCompositeUtils::DecisionIDContainer m_allowedIDs
Gaudi::Property< bool > m_BToD0_makeDstar
TrigBmuxComboHypo(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< size_t > m_fitAttemptsWarningThreshold
Gaudi::Property< float > m_BsToDs_LxyDs
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey
ToolHandle< Trk::TrkVKalVrtFitter > m_vertexFitter
Gaudi::Property< float > m_BToD0_LxyB
Gaudi::Property< float > m_BdToD_LxyD
std::unique_ptr< xAOD::Vertex > fit(const EventContext &context, const std::vector< ElementLink< xAOD::TrackParticleContainer > > &trackParticleLinks, Decay decay) const
Perform a vertex fit on selected tracks.
StatusCode createDecisionObjects(TrigBmuxState &) const
Gaudi::Property< double > m_BToD0_minD0Pt
Gaudi::Property< double > m_LambdaBToLambdaC_minPionPt
double Lxy(const Amg::Vector3D &productionVertex, const Amg::Vector3D &decayVertex, const std::vector< TLorentzVector > &momenta) const
Returns the transverse decay length of a particle Lxy in [mm].
SG::WriteHandleKey< xAOD::TrigBphysContainer > m_trigBphysContainerKey
Gaudi::Property< double > m_trkZ0
Gaudi::Property< double > m_BsToDs_minPionPt
ToolHandle< GenericMonitoringTool > m_monTool
bool isInMassRange(double mass, const std::pair< double, double > &range) const
Checks that the given mass value falls into the specified range.
Gaudi::Property< double > m_BdToD_minKaonPt
Gaudi::Property< double > m_BToD0_minDstarPionPt
Gaudi::Property< float > m_BdToD_chi2
Gaudi::Property< std::pair< double, double > > m_BToD0_DstarMassRange
Gaudi::Property< double > m_roiEtaWidth
Gaudi::Property< double > m_BdToD_minDPt
Gaudi::Property< float > m_BdToD_LxyBd
static const std::vector< std::vector< std::vector< double > > > s_trkMass
Gaudi::Property< std::pair< double, double > > m_BsToDs_DsMassRange
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Gaudi::Property< float > m_LambdaBToLambdaC_LxyLc
Gaudi::Property< double > m_LambdaBToLambdaC_minProtonPt
Gaudi::Property< double > m_BsToDs_minDsPt
Gaudi::Property< float > m_BToD0_LxyD0
Gaudi::Property< size_t > m_fitAttemptsBreakThreshold
StatusCode findBmuxCandidates(TrigBmuxState &) const
Gaudi::Property< double > m_BsToDs_minKaonPt
Gaudi::Property< std::pair< double, double > > m_BsToDs_phiMassRange
Gaudi::Property< double > m_BToD0_minD0PionPt
Gaudi::Property< double > m_roiPhiWidth
Gaudi::Property< double > m_LambdaBToLambdaC_minLambdaCPt
Gaudi::Property< double > m_BToD0_minD0KaonPt
Gaudi::Property< bool > m_LambdaBToLambdaC
Gaudi::Property< float > m_LambdaBToLambdaC_LxyLb
std::unique_ptr< Trk::VxCascadeInfo > fitCascade(const EventContext &context, const std::vector< ElementLink< xAOD::TrackParticleContainer > > &trackParticleLinks, Decay decay) const
Perform a cascade vertex fit on selected tracks.
Gaudi::Property< double > m_deltaR
Gaudi::Property< float > m_BToD0_LxyBd
Gaudi::Property< bool > m_BToD0
StatusCode fillTriggerObjects(std::vector< xAOD::TrigBphys * > &triggerObjects, xAOD::TrigBphys::pType type, const Trk::VxCascadeInfo &vxCascadeInfo, const Amg::Vector3D &beamSpotPosition) const
Fill the trigger object that may be stored for debugging or matching for a cascade vertex.
Gaudi::Property< double > m_BToD0_minDstarPt
bool isIdenticalTracks(const xAOD::TrackParticle *lhs, const xAOD::TrackParticle *rhs) const
Returns false for the tracks with opposite charges.
Gaudi::Property< bool > m_makeCascadeFit
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Gaudi::Property< double > m_LambdaBToLambdaC_minKaonPt
StatusCode fillTriggerObject(xAOD::TrigBphys &triggerObject, xAOD::TrigBphys::pType type, const xAOD::Vertex &vertex, const std::vector< double > &trkMass) const
Fill the trigger object that may be stored for debugging or matching.
Gaudi::Property< float > m_LambdaBToLambdaC_chi2
virtual StatusCode execute(const EventContext &context) const override
virtual StatusCode initialize() override
TrigBmuxComboHypo()=delete
Gaudi::Property< std::pair< double, double > > m_BToD0_D0MassRange
Gaudi::Property< double > m_BToD0_maxDstarPionZ0
Gaudi::Property< std::pair< double, double > > m_BdToD_DMassRange
Gaudi::Property< float > m_cascadeChi2
ToolHandle< InDet::VertexPointEstimator > m_vertexPointEstimator
Gaudi::Property< std::pair< double, double > > m_BsToDs_massRange
Gaudi::Property< std::pair< double, double > > m_BToD0_massRange
State class for TrigBmuxComboHypo algorithm.
std::vector< Muon > muons
xAOD::TrigBphys * addTriggerObject(size_t muonIndex)
virtual ~TrigBmuxState()=default
TrigBmuxState()=delete
std::vector< size_t > trigBphysMuonIndices
TrigBmuxState(const EventContext &context, const TrigCompositeUtils::DecisionContainer &previousDecisions, TrigCompositeUtils::DecisionContainer &decisions, xAOD::TrigBphysContainer *trigBphysCollection=nullptr, const InDet::BeamSpotData *beamSpotData=nullptr)
std::vector< xAOD::TrigBphys * > addTriggerObjects(size_t n, size_t muonIndex)
pType
enum for different particle types
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::set< DecisionID > DecisionIDContainer
TrigBphys_v1 TrigBphys
Definition TrigBphys.h:18
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
Muon_v1 Muon
Reference the current persistent version:
TrigBphysContainer_v1 TrigBphysContainer
ElementLink< xAOD::MuonContainer > link
ElementLink< TrigCompositeUtils::DecisionContainer > decisionLink
TrigCompositeUtils::DecisionIDContainer decisionIDs