ATLAS Offline Software
TrigMufastHypoTool.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 TRIGMUONHYPO_TRIGMUFASTHYPOTOOL_H
6 #define TRIGMUONHYPO_TRIGMUFASTHYPOTOOL_H 1
7 
9 #include "GaudiKernel/SystemOfUnits.h"
10 
15 
16 class StoreGateSvc;
17 
18 // --------------------------------------------------------------------------------
19 // --------------------------------------------------------------------------------
20 
24 const int errorCode_EL_not_valid = 2;
28 }
29 
30 // --------------------------------------------------------------------------------
31 // --------------------------------------------------------------------------------
32 
34  enum { MaxNumberTools = 20 };
35  public:
36 
37  TrigMufastHypoTool(const std::string& type,
38  const std::string & name,
39  const IInterface* parent );
40 
41  virtual ~TrigMufastHypoTool();
42 
43  struct MuonClusterInfo {
45  const TrigRoiDescriptor* r,
47  const TrigCompositeUtils::Decision* previousDecision )
48  : decision( d ),
49  roi( r ),
50  muFast( f ),
52  TrigCompositeUtils::decisionIDs( previousDecision ).end() )
53  {}
54 
60  };
61 
62  virtual StatusCode initialize() override;
63 
64  virtual StatusCode decide(std::vector<TrigMufastHypoTool::MuonClusterInfo>& toolInput) const;
65 
66  private:
67 
69 
71 
72  // for single muon event
73  StatusCode inclusiveSelection(std::vector<TrigMufastHypoTool::MuonClusterInfo>& toolInput) const;
74 
75  // for multipul muon event
76  StatusCode multiplicitySelection(std::vector<TrigMufastHypoTool::MuonClusterInfo>& toolInput) const;
77 
78  StatusCode applyOverlapRemoval(std::vector<TrigMufastHypoTool::MuonClusterInfo>& toolInput) const;
79  StatusCode checkOverlap(std::vector<TrigMufastHypoTool::MuonClusterInfo*>& input) const;
80  bool isOverlap(const xAOD::L2StandAloneMuon *mf1, const xAOD::L2StandAloneMuon *mf2) const;
81  double dR(double eta1, double phi1, double eta2, double phi2) const;
82  double invMass(double m1, double pt1, double eta1, double phi1,
83  double m2, double pt2, double eta2, double phi2) const;
84  StatusCode chooseBestMuon(std::vector<TrigMufastHypoTool::MuonClusterInfo*>& input, const std::vector<unsigned int>& mufastResult) const;
85 
86  float getLocalPhi(float, float, float) const;
87 
88  // Properties:
89  Gaudi::Property< std::vector<std::vector<double>> > m_ptBins {
90  this, "PtBins", { {0, 2.5} }, "Bins range of each pT threshold" };
91 
92  Gaudi::Property< std::vector<std::vector<double>> > m_ptThresholds {
93  this, "PtThresholds", { {5.49*Gaudi::Units::GeV} }, "Track pT requirement ( separate threshold for each muon )" };
94 
95  Gaudi::Property< bool > m_acceptAll {
96  this, "AcceptAll", false, "Ignore selection" };
97 
98  Gaudi::Property< bool > m_selectPV {
99  this, "SelectPV", false, "Select PV" };
100 
101  Gaudi::Property< float > m_ZPV {
102  this, "ZPVBins", 400. , "Define ZPV" };
103 
104  Gaudi::Property< float > m_RPV {
105  this, "RPVBins", 200., "Define RPV" };
106 
107  Gaudi::Property< std::vector<double> > m_ptThresholdForECWeakBRegionA {
108  this, "PtThresholdForECWeakBRegionA", {3.}, "Track pT requirement on regionA of weak magnetic field ( separate threshold for each muon )" };
109 
110  Gaudi::Property< std::vector<double> > m_ptThresholdForECWeakBRegionB {
111  this, "PtThresholdForECWeakBRegionB", {3.}, "Track pT requirement on regionB of weak magnetic field ( separate threshold for each muon )" };
112 
113  Gaudi::Property<bool> m_decisionPerCluster {
114  this, "DecisionPerCluster", true, "Is multiplicity requirement refering to muons ( false ) or RoIs/clusters with muons ( false ), relevant only in when multiplicity > 1" };
115 
116  Gaudi::Property< bool > m_doCalib {
117  this, "DoCalib", false, "muoncalib chain" };
118 
119  // Members for overlap removal
120  Gaudi::Property< bool > m_applyOR {
121  this, "ApplyOR", false, "apply overlap removal for mufast" };
122 
123  Gaudi::Property<bool> m_requireDR{
124  this, "RequireDR", true, "require or not DR cut for overlap removal"};
125 
126  Gaudi::Property<bool> m_requireMass{
127  this, "RequireMass", true, "require or not mass cut for overlap removal"};
128 
129  Gaudi::Property<bool> m_requireSameSign{
130  this, "RequireSameSign", true, "require or not charge cut for overlap removal"};
131 
132  Gaudi::Property< float > m_dRThresBB {
133  this, "DRThresBB", 0.05, "DR threshold in barel and barel region"};
134 
135  Gaudi::Property< float > m_massThresBB {
136  this, "MassThresBB", 0.20, "mass threshold in barel and barel region"};
137 
138  Gaudi::Property< float > m_dRThresBE {
139  this, "DRThresBE", 0.05, "DR threshold in barel and barel region"};
140 
141  Gaudi::Property< float > m_massThresBE {
142  this, "MassThresBE", 0.20, "mass threshold in barel and endcap region"};
143 
144  Gaudi::Property< std::vector<float> > m_etaBinsEC {
145  this, "EtaBinsEC", {0, 1.9, 2.1, 9.9}, "eta bins of DR and mass thresholds in endcap and barel region"};
146 
147  Gaudi::Property< std::vector<float> > m_dRThresEC {
148  this, "DRThresEC", {0.06, 0.05, 0.05}, "DR threshold in endcap and barel region"};
149 
150  Gaudi::Property< std::vector<float> > m_massThresEC {
151  this, "MassThresEC", {0.20, 0.15, 0.10}, "mass threshold in endcap and endcap region"};
152 
153 
154  // Other members:
155  std::vector<size_t> m_bins = {0};
156 
157  ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
158 
159 
160 };
161 
162 #endif
TrigMufastHypoTool::decide
virtual StatusCode decide(std::vector< TrigMufastHypoTool::MuonClusterInfo > &toolInput) const
Definition: TrigMufastHypoTool.cxx:278
beamspotman.r
def r
Definition: beamspotman.py:676
TrigMufastHypoTool::MuonClusterInfo::muFast
const xAOD::L2StandAloneMuon * muFast
Definition: TrigMufastHypoTool.h:57
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
TrigMufastHypoToolConsts::errorCode_EL_not_valid
const int errorCode_EL_not_valid
Definition: TrigMufastHypoTool.h:24
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
TrigMufastHypoTool::MuonClusterInfo
Definition: TrigMufastHypoTool.h:43
TrigCompositeUtils.h
TrigMufastHypoTool::m_ptThresholdForECWeakBRegionA
Gaudi::Property< std::vector< double > > m_ptThresholdForECWeakBRegionA
Definition: TrigMufastHypoTool.h:107
xAOD::L2StandAloneMuon_v2
Class describing standalone muons reconstructed in the LVL2 trigger.
Definition: L2StandAloneMuon_v2.h:36
TrigMufastHypoTool::m_etaBinsEC
Gaudi::Property< std::vector< float > > m_etaBinsEC
Definition: TrigMufastHypoTool.h:144
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigMufastHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigMufastHypoTool.h:68
TrigMufastHypoTool::MuonClusterInfo::roi
const TrigRoiDescriptor * roi
Definition: TrigMufastHypoTool.h:56
TrigMufastHypoTool::m_doCalib
Gaudi::Property< bool > m_doCalib
Definition: TrigMufastHypoTool.h:116
TrigMufastHypoTool::MaxNumberTools
@ MaxNumberTools
Definition: TrigMufastHypoTool.h:34
TrigMufastHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigMufastHypoTool.h:95
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TrigMufastHypoTool::MuonClusterInfo::previousDecisionIDs
const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs
Definition: TrigMufastHypoTool.h:58
TrigMufastHypoTool::MuonClusterInfo::isOR
TrigCompositeUtils::DecisionIDContainer isOR
Definition: TrigMufastHypoTool.h:59
L2StandAloneMuonContainer.h
TrigMufastHypoTool::MuonClusterInfo::decision
TrigCompositeUtils::Decision * decision
Definition: TrigMufastHypoTool.h:55
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigMufastHypoTool::chooseBestMuon
StatusCode chooseBestMuon(std::vector< TrigMufastHypoTool::MuonClusterInfo * > &input, const std::vector< unsigned int > &mufastResult) const
Definition: TrigMufastHypoTool.cxx:684
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
TrigMufastHypoTool::checkOverlap
StatusCode checkOverlap(std::vector< TrigMufastHypoTool::MuonClusterInfo * > &input) const
Definition: TrigMufastHypoTool.cxx:434
TrigMufastHypoTool::m_bins
std::vector< size_t > m_bins
Definition: TrigMufastHypoTool.h:155
TrigMufastHypoTool::invMass
double invMass(double m1, double pt1, double eta1, double phi1, double m2, double pt2, double eta2, double phi2) const
Definition: TrigMufastHypoTool.cxx:648
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TrigMufastHypoTool::m_ptThresholdForECWeakBRegionB
Gaudi::Property< std::vector< double > > m_ptThresholdForECWeakBRegionB
Definition: TrigMufastHypoTool.h:110
TrigMufastHypoTool::m_massThresBE
Gaudi::Property< float > m_massThresBE
Definition: TrigMufastHypoTool.h:141
TrigMufastHypoTool::decideOnSingleObject
bool decideOnSingleObject(TrigMufastHypoTool::MuonClusterInfo &input, size_t cutIndex) const
Definition: TrigMufastHypoTool.cxx:120
TrigMufastHypoTool::m_massThresEC
Gaudi::Property< std::vector< float > > m_massThresEC
Definition: TrigMufastHypoTool.h:150
GenericMonitoringTool.h
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
TrigMufastHypoTool::TrigMufastHypoTool
TrigMufastHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigMufastHypoTool.cxx:19
TrigMufastHypoTool::applyOverlapRemoval
StatusCode applyOverlapRemoval(std::vector< TrigMufastHypoTool::MuonClusterInfo > &toolInput) const
Definition: TrigMufastHypoTool.cxx:390
TrigMufastHypoToolConsts::WeakBFieldB
@ WeakBFieldB
Definition: TrigMufastHypoTool.h:22
python.changerun.m1
m1
Definition: changerun.py:32
TrigMufastHypoTool::m_selectPV
Gaudi::Property< bool > m_selectPV
Definition: TrigMufastHypoTool.h:98
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TrigMufastHypoTool::dR
double dR(double eta1, double phi1, double eta2, double phi2) const
Definition: TrigMufastHypoTool.cxx:638
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigMufastHypoTool::m_decisionPerCluster
Gaudi::Property< bool > m_decisionPerCluster
Definition: TrigMufastHypoTool.h:113
TrigMufastHypoTool::m_dRThresBB
Gaudi::Property< float > m_dRThresBB
Definition: TrigMufastHypoTool.h:132
TrigMufastHypoTool::m_applyOR
Gaudi::Property< bool > m_applyOR
Definition: TrigMufastHypoTool.h:120
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
TrigMufastHypoTool::m_massThresBB
Gaudi::Property< float > m_massThresBB
Definition: TrigMufastHypoTool.h:135
TrigMufastHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigMufastHypoTool.h:157
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
TrigMufastHypoTool::m_dRThresEC
Gaudi::Property< std::vector< float > > m_dRThresEC
Definition: TrigMufastHypoTool.h:147
TrigMufastHypoTool::m_ZPV
Gaudi::Property< float > m_ZPV
Definition: TrigMufastHypoTool.h:101
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TrigMufastHypoToolConsts::errorCode_inconsistent_overlap1
const int errorCode_inconsistent_overlap1
Definition: TrigMufastHypoTool.h:25
TrigMufastHypoTool::inclusiveSelection
StatusCode inclusiveSelection(std::vector< TrigMufastHypoTool::MuonClusterInfo > &toolInput) const
Definition: TrigMufastHypoTool.cxx:302
TrigMufastHypoTool::multiplicitySelection
StatusCode multiplicitySelection(std::vector< TrigMufastHypoTool::MuonClusterInfo > &toolInput) const
Definition: TrigMufastHypoTool.cxx:322
TrigMufastHypoTool::m_ptBins
Gaudi::Property< std::vector< std::vector< double > > > m_ptBins
Definition: TrigMufastHypoTool.h:89
TrigMufastHypoToolConsts
Definition: TrigMufastHypoTool.h:21
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
TrigMufastHypoToolConsts::ECRegions
ECRegions
Definition: TrigMufastHypoTool.h:22
TrigMufastHypoToolConsts::errorCode_inconsistent_overlap2
const int errorCode_inconsistent_overlap2
Definition: TrigMufastHypoTool.h:26
TrigMufastHypoTool::getLocalPhi
float getLocalPhi(float, float, float) const
Definition: TrigMufastHypoTool.cxx:242
TrigMufastHypoTool::m_requireDR
Gaudi::Property< bool > m_requireDR
Definition: TrigMufastHypoTool.h:123
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigMufastHypoTool::MuonClusterInfo::MuonClusterInfo
MuonClusterInfo(TrigCompositeUtils::Decision *d, const TrigRoiDescriptor *r, const xAOD::L2StandAloneMuon *f, const TrigCompositeUtils::Decision *previousDecision)
Definition: TrigMufastHypoTool.h:44
HLTIdentifier.h
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
TrigMufastHypoToolConsts::WeakBFieldA
@ WeakBFieldA
Definition: TrigMufastHypoTool.h:22
TrigMufastHypoTool::~TrigMufastHypoTool
virtual ~TrigMufastHypoTool()
Definition: TrigMufastHypoTool.cxx:27
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigMufastHypoTool::m_requireSameSign
Gaudi::Property< bool > m_requireSameSign
Definition: TrigMufastHypoTool.h:129
TrigRoiDescriptor.h
TrigMufastHypoTool::m_RPV
Gaudi::Property< float > m_RPV
Definition: TrigMufastHypoTool.h:104
TrigMufastHypoToolConsts::Bulk
@ Bulk
Definition: TrigMufastHypoTool.h:22
AthAlgTool
Definition: AthAlgTool.h:26
TrigMufastHypoTool::m_requireMass
Gaudi::Property< bool > m_requireMass
Definition: TrigMufastHypoTool.h:126
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
TrigMufastHypoTool::m_dRThresBE
Gaudi::Property< float > m_dRThresBE
Definition: TrigMufastHypoTool.h:138
TrigMufastHypoTool
Definition: TrigMufastHypoTool.h:33
TrigMufastHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigMufastHypoTool.cxx:33
TrigMufastHypoTool::m_ptThresholds
Gaudi::Property< std::vector< std::vector< double > > > m_ptThresholds
Definition: TrigMufastHypoTool.h:92
TrigMufastHypoTool::isOverlap
bool isOverlap(const xAOD::L2StandAloneMuon *mf1, const xAOD::L2StandAloneMuon *mf2) const
Definition: TrigMufastHypoTool.cxx:518
TrigMufastHypoToolConsts::errorCode_cannot_get_RoI
const int errorCode_cannot_get_RoI
Definition: TrigMufastHypoTool.h:27
TrigMufastHypoToolConsts::errorCode_cannot_get_EL
const int errorCode_cannot_get_EL
Definition: TrigMufastHypoTool.h:23