ATLAS Offline Software
TrigmuCombHypoTool.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_TRIGMUCOMBHYPOTOOL_H
6 #define TRIGMUONHYPO_TRIGMUCOMBHYPOTOOL_H 1
7 
9 #include "GaudiKernel/SystemOfUnits.h"
10 
12 
14 
15 class StoreGateSvc;
16 
17 // --------------------------------------------------------------------------------
18 // --------------------------------------------------------------------------------
19 
22 const int errorCode_EL_not_valid = 2;
26 }
27 
28 // --------------------------------------------------------------------------------
29 // --------------------------------------------------------------------------------
30 
32  enum { MaxNumberTools = 20 };
33  public:
34 
35  TrigmuCombHypoTool(const std::string& type,
36  const std::string & name,
37  const IInterface* parent );
38 
41  const xAOD::L2CombinedMuon* c,
43  const TrigCompositeUtils::Decision* previousDecision )
44  : decision( d ),
45  muComb( c ),
46  muFast( f ),
48  TrigCompositeUtils::decisionIDs( previousDecision ).end() )
49  {}
50 
56  };
57 
58  virtual ~TrigmuCombHypoTool();
59 
60  virtual StatusCode initialize() override;
61 
62  virtual StatusCode decide(std::vector<TrigmuCombHypoTool::CombinedMuonInfo>& toolInput) const;
63 
64  private:
65 
67 
68  StatusCode inclusiveSelection(std::vector<TrigmuCombHypoTool::CombinedMuonInfo>& input) const;
69 
70  StatusCode multiplicitySelection(std::vector<TrigmuCombHypoTool::CombinedMuonInfo>& input) const;
71 
72  StatusCode applyOverlapRemoval(std::vector<TrigmuCombHypoTool::CombinedMuonInfo>& toolInput) const;
73  StatusCode checkOverlap(std::vector<TrigmuCombHypoTool::CombinedMuonInfo*>& input) const;
74  bool isOverlap(const xAOD::L2CombinedMuon *mf1, const xAOD::L2CombinedMuon *mf2) const;
75  double dR(double eta1, double phi1, double eta2, double phi2) const;
76  double invMass(double m1, double pt1, double eta1, double phi1,
77  double m2, double pt2, double eta2, double phi2) const;
78  StatusCode chooseBestMuon(std::vector<TrigmuCombHypoTool::CombinedMuonInfo*>& input, const std::vector<unsigned int>& mucombResult) const;
79 
81 
82  ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
83 
84  Gaudi::Property< std::vector<std::vector<double>> > m_ptBins {
85  this, "PtBins", { {0, 2.5} }, "Bins range of each pT threshold" };
86 
87  Gaudi::Property< std::vector<std::vector<double>> > m_ptThresholds {
88  this, "PtThresholds", { {5.83 * Gaudi::Units::GeV} }, "Track pT requirement ( separate threshold for each muon )" };
89 
90  Gaudi::Property< bool > m_acceptAll {
91  this, "AcceptAll", false, "Ignore selection" };
92 
93  // Enable pi/k decay rejection
94  Gaudi::Property< bool > m_pikCuts {
95  this, "ApplyPikCuts", false, "Enable pi/k decay rejection" };
96 
97  Gaudi::Property< double > m_maxPtToApplyPik {
98  this, "MaxPtToApplyPik", 25., "" };
99 
100  Gaudi::Property< double > m_chi2MaxID {
101  this, "MaxChi2IDPik", 3.5, "" };
102 
103  Gaudi::Property< size_t > m_numMuonThreshold {
104  this, "numMuonThreshold", 50, "Threshold of the number of muons" };
105 
106  // Apply strategy dependent pT cuts (B/T/S = 0 fields, L1 seeded, ...)
107  // strategy dependent pT cuts
108  //0: Std
109  //1: simplified match Pt combined
110  //2: simplified match Pt ID
111  //3: simplified match Pt MU
112  //4: simplified match Pt infinite
113  Gaudi::Property< bool > m_strategydependent {
114  this, "ApplyStrategyDependentCuts", false, "" };
115 
116  Gaudi::Property< std::vector<double> > m_strategyDependentPtCuts {
117  this, "StrategyDependentPtCuts",{ 0.0, 0.0, 0.0, -3.0 }, "" };
118  // { strategy 1 (in GeV) (if<0 do not apply the standard signature cut),
119  // strategy 2 (in GeV),
120  // strategy 3 (in GeV),
121  // strategy 4 (in GeV) }
122 
123  Gaudi::Property<bool> m_decisionPerCluster {
124  this, "DecisionPerCluster", true, "Is multiplicity requirement refering to muons ( false ) or RoIs/clusters with muons ( false ), relevant only in when multiplicity > 1" };
125 
126 
127  // Members for overlap removal
128  Gaudi::Property< bool > m_applyOR {
129  this, "ApplyOR", false, "apply overlap removal for mucomb" };
130 
131  Gaudi::Property<bool> m_requireDR{
132  this, "RequireDR", true, "require or not DR cut for overlap removal"};
133 
134  Gaudi::Property<bool> m_requireMufastDR{
135  this, "RequireMufastDR", true, "require or not mufast DR cut for overlap removal"};
136 
137  Gaudi::Property<bool> m_requireMass{
138  this, "RequireMass", true, "require or not mass cut for overlap removal"};
139 
140  Gaudi::Property<bool> m_requireSameSign{
141  this, "RequireSameSign", true, "require or not charge cut for overlap removal"};
142 
143  Gaudi::Property< std::vector<float> > m_etaBins {
144  this, "EtaBins", {0, 1.9, 2.1, 9.9}, "eta bins of DR and mass thresholds"};
145 
146  Gaudi::Property< std::vector<float> > m_dRThres {
147  this, "DRThres", {0.06, 0.05, 0.05}, "DR threshold"};
148 
149  Gaudi::Property< std::vector<float> > m_mufastDRThres {
150  this, "MufastDRThres", {0.06, 0.05, 0.05}, "mufast DR threshold"};
151 
152  Gaudi::Property< std::vector<float> > m_massThres {
153  this, "MassThres", {0.20, 0.15, 0.10}, "mass threshold"};
154 
155  Gaudi::Property< float > m_d0min {
156  this, "MinimumD0", 0., "lower d0 cut (mm)"};
157 
158  // Other members:
159  std::vector<size_t> m_bins = {0};
160 };
161 
162 #endif
TrigmuCombHypoTool::CombinedMuonInfo
Definition: TrigmuCombHypoTool.h:39
TrigmuCombHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigmuCombHypoTool.h:82
TrigmuCombHypoTool::m_dRThres
Gaudi::Property< std::vector< float > > m_dRThres
Definition: TrigmuCombHypoTool.h:146
TrigmuCombHypoTool::CombinedMuonInfo::CombinedMuonInfo
CombinedMuonInfo(TrigCompositeUtils::Decision *d, const xAOD::L2CombinedMuon *c, const xAOD::L2StandAloneMuon *f, const TrigCompositeUtils::Decision *previousDecision)
Definition: TrigmuCombHypoTool.h:40
TrigmuCombHypoTool::checkOverlap
StatusCode checkOverlap(std::vector< TrigmuCombHypoTool::CombinedMuonInfo * > &input) const
Definition: TrigmuCombHypoTool.cxx:421
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
muComb
Main LVL2 Algorithm.
Definition: muComb.h:54
TrigmuCombHypoTool::multiplicitySelection
StatusCode multiplicitySelection(std::vector< TrigmuCombHypoTool::CombinedMuonInfo > &input) const
Definition: TrigmuCombHypoTool.cxx:290
TrigmuCombHypoTool::CombinedMuonInfo::isOR
TrigCompositeUtils::DecisionIDContainer isOR
Definition: TrigmuCombHypoTool.h:55
python.SystemOfUnits.m2
int m2
Definition: SystemOfUnits.py:92
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
TrigmuCombHypoTool::m_d0min
Gaudi::Property< float > m_d0min
Definition: TrigmuCombHypoTool.h:155
TrigmuCombHypoTool::CombinedMuonInfo::muComb
const xAOD::L2CombinedMuon * muComb
Definition: TrigmuCombHypoTool.h:52
xAOD::L2StandAloneMuon_v2
Class describing standalone muons reconstructed in the LVL2 trigger.
Definition: L2StandAloneMuon_v2.h:36
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigmuCombHypoTool::m_applyOR
Gaudi::Property< bool > m_applyOR
Definition: TrigmuCombHypoTool.h:128
L2CombinedMuonContainer.h
TrigmuCombHypoTool::invMass
double invMass(double m1, double pt1, double eta1, double phi1, double m2, double pt2, double eta2, double phi2) const
Definition: TrigmuCombHypoTool.cxx:638
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TrigmuCombHypoTool::m_strategyDependentPtCuts
Gaudi::Property< std::vector< double > > m_strategyDependentPtCuts
Definition: TrigmuCombHypoTool.h:116
TrigmuCombHypoTool::m_maxPtToApplyPik
Gaudi::Property< double > m_maxPtToApplyPik
Definition: TrigmuCombHypoTool.h:97
TrigmuCombHypoToolConsts::errorCode_cannot_get_EL
const int errorCode_cannot_get_EL
Definition: TrigmuCombHypoTool.h:21
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigmuCombHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigmuCombHypoTool.h:90
TrigmuCombHypoTool::m_strategydependent
Gaudi::Property< bool > m_strategydependent
Definition: TrigmuCombHypoTool.h:113
TrigmuCombHypoTool::m_decisionPerCluster
Gaudi::Property< bool > m_decisionPerCluster
Definition: TrigmuCombHypoTool.h:123
TrigmuCombHypoTool::chooseBestMuon
StatusCode chooseBestMuon(std::vector< TrigmuCombHypoTool::CombinedMuonInfo * > &input, const std::vector< unsigned int > &mucombResult) const
Definition: TrigmuCombHypoTool.cxx:674
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TrigmuCombHypoTool::inclusiveSelection
StatusCode inclusiveSelection(std::vector< TrigmuCombHypoTool::CombinedMuonInfo > &input) const
Definition: TrigmuCombHypoTool.cxx:270
xAOD::L2CombinedMuon_v1
Class describing combined muon reconstructed in the LVL2 trigger.
Definition: L2CombinedMuon_v1.h:41
TrigmuCombHypoTool::TrigmuCombHypoTool
TrigmuCombHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigmuCombHypoTool.cxx:18
TrigmuCombHypoTool::m_ptBins
Gaudi::Property< std::vector< std::vector< double > > > m_ptBins
Definition: TrigmuCombHypoTool.h:84
TrigmuCombHypoTool::~TrigmuCombHypoTool
virtual ~TrigmuCombHypoTool()
Definition: TrigmuCombHypoTool.cxx:26
GenericMonitoringTool.h
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
TrigmuCombHypoTool::m_etaBins
Gaudi::Property< std::vector< float > > m_etaBins
Definition: TrigmuCombHypoTool.h:143
python.changerun.m1
m1
Definition: changerun.py:32
TrigmuCombHypoTool::m_bins
std::vector< size_t > m_bins
Definition: TrigmuCombHypoTool.h:159
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigmuCombHypoToolConsts
Definition: TrigmuCombHypoTool.h:20
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
hist_file_dump.f
f
Definition: hist_file_dump.py:135
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
TrigmuCombHypoTool::m_massThres
Gaudi::Property< std::vector< float > > m_massThres
Definition: TrigmuCombHypoTool.h:152
TrigmuCombHypoTool::CombinedMuonInfo::decision
TrigCompositeUtils::Decision * decision
Definition: TrigmuCombHypoTool.h:51
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
TrigmuCombHypoToolConsts::errorCode_EL_not_valid
const int errorCode_EL_not_valid
Definition: TrigmuCombHypoTool.h:22
TrigmuCombHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigmuCombHypoTool.cxx:32
TrigmuCombHypoTool::decideOnSingleObject
bool decideOnSingleObject(TrigmuCombHypoTool::CombinedMuonInfo &input, size_t cutIndex) const
Definition: TrigmuCombHypoTool.cxx:105
TrigmuCombHypoTool::m_numMuonThreshold
Gaudi::Property< size_t > m_numMuonThreshold
Definition: TrigmuCombHypoTool.h:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigmuCombHypoTool::m_requireMass
Gaudi::Property< bool > m_requireMass
Definition: TrigmuCombHypoTool.h:137
TrigmuCombHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigmuCombHypoTool.h:80
TrigmuCombHypoTool
Definition: TrigmuCombHypoTool.h:31
TrigmuCombHypoTool::isOverlap
bool isOverlap(const xAOD::L2CombinedMuon *mf1, const xAOD::L2CombinedMuon *mf2) const
Definition: TrigmuCombHypoTool.cxx:505
TrigmuCombHypoTool::m_chi2MaxID
Gaudi::Property< double > m_chi2MaxID
Definition: TrigmuCombHypoTool.h:100
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
TrigmuCombHypoTool::MaxNumberTools
@ MaxNumberTools
Definition: TrigmuCombHypoTool.h:32
TrigmuCombHypoTool::CombinedMuonInfo::muFast
const xAOD::L2StandAloneMuon * muFast
Definition: TrigmuCombHypoTool.h:53
TrigmuCombHypoTool::m_requireMufastDR
Gaudi::Property< bool > m_requireMufastDR
Definition: TrigmuCombHypoTool.h:134
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLTIdentifier.h
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
TrigmuCombHypoToolConsts::errorCode_inconsistent_overlap1
const int errorCode_inconsistent_overlap1
Definition: TrigmuCombHypoTool.h:23
TrigmuCombHypoTool::CombinedMuonInfo::previousDecisionIDs
const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs
Definition: TrigmuCombHypoTool.h:54
TrigmuCombHypoToolConsts::errorCode_cannot_get_RoI
const int errorCode_cannot_get_RoI
Definition: TrigmuCombHypoTool.h:25
TrigmuCombHypoTool::m_requireDR
Gaudi::Property< bool > m_requireDR
Definition: TrigmuCombHypoTool.h:131
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigmuCombHypoTool::m_ptThresholds
Gaudi::Property< std::vector< std::vector< double > > > m_ptThresholds
Definition: TrigmuCombHypoTool.h:87
TrigmuCombHypoTool::decide
virtual StatusCode decide(std::vector< TrigmuCombHypoTool::CombinedMuonInfo > &toolInput) const
Definition: TrigmuCombHypoTool.cxx:246
TrigmuCombHypoTool::dR
double dR(double eta1, double phi1, double eta2, double phi2) const
Definition: TrigmuCombHypoTool.cxx:628
TrigmuCombHypoTool::applyOverlapRemoval
StatusCode applyOverlapRemoval(std::vector< TrigmuCombHypoTool::CombinedMuonInfo > &toolInput) const
Definition: TrigmuCombHypoTool.cxx:359
AthAlgTool
Definition: AthAlgTool.h:26
TrigmuCombHypoTool::m_requireSameSign
Gaudi::Property< bool > m_requireSameSign
Definition: TrigmuCombHypoTool.h:140
python.compressB64.c
def c
Definition: compressB64.py:93
TrigmuCombHypoTool::m_mufastDRThres
Gaudi::Property< std::vector< float > > m_mufastDRThres
Definition: TrigmuCombHypoTool.h:149
TrigmuCombHypoTool::m_pikCuts
Gaudi::Property< bool > m_pikCuts
Definition: TrigmuCombHypoTool.h:94
TrigmuCombHypoToolConsts::errorCode_inconsistent_overlap2
const int errorCode_inconsistent_overlap2
Definition: TrigmuCombHypoTool.h:24