ATLAS Offline Software
muComb.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ********************************************************************
6 //
7 // NAME: muComb.h
8 // PACKAGE: Trigger/TrigAlgorithms/TrigmuComb
9 //
10 // AUTHORS: S. Giagu <stefano.giagu@cern.ch>
11 //
12 // PURPOSE: LVL2 Combined Muon FEX Algorithm (MT version)
13 // ********************************************************************
14 #ifndef TRIGMUCOMB_MUCOMB_H
15 #define TRIGMUCOMB_MUCOMB_H
16 
17 // standard stuff
18 #include <vector>
19 #include <cmath>
20 
21 //Gaudi
22 #include "GaudiKernel/ToolHandle.h"
23 #include "GaudiKernel/SystemOfUnits.h"
24 
25 // Base class
29 
31 
34 
37 
39  double ptinv;
40  double eta;
41  double phi;
42  double eptinv;
43  double eeta;
44  double ephi;
45  double charge;
46  bool isBarrel;
49  int status;
50 };
51 
54 {
55  public:
57  muComb(const std::string&, ISvcLocator*);
58 
60  virtual StatusCode initialize() override;
61 
63  virtual StatusCode execute(const EventContext& ctx) const override;
64 
65  private:
66 
68  "TrackParticlesContainerName", // property name
69  "InDetTrigTrackingxAODCnv_Muon_FTF", // default value of StoreGate key
70  "input TrackParticle container name"};
71 
73  "L2StandAloneMuonContainerName", // property name
74  "xAOD::L2StandAloneMuonContainer", // default value of StoreGate key
75  "input L2StandAloneMuon Container name"};
76 
77 
79  "L2CombinedMuonContainerName", // property name
80  "MuonL2CBInfo", // default value of StoreGate key
81  "output CB Muon container name"};
82 
83  ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
84 
86  ToolHandle<Trk::IExtrapolator> m_backExtrapolatorG4 {this,
87  "AtlasExtrapolator",
88  "Trk::Extrapolator/AtlasExtrapolator",
89  "Tool to backextrapolate muon from MS to IP (G4 based)"};
90 
91  SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
92 
93 
94  int drptMatch(double, double, double,
95  double, double, double, int,
96  double&, double&, double&, double&, double&) const;
97 
98  int drptMatch(const xAOD::L2StandAloneMuon* feature,
99  double, double, double, int,
100  double&, double&, double&, double&, double&) const;
101 
102  int mfMatch(const xAOD::L2StandAloneMuon* feature,
103  double, double, double, double,
104  double&, double&, double&, double&, double&, int&) const;
105 
106  int g4Match(const ExtrapolationResult &extr,
107  double, double, double, double, double, double, double,
108  double&, double&, double&, double&, double&, int&) const;
109 
111 
112  private:
113 
114  // Properties
115 
117  Gaudi::Property<bool> m_useBackExtrapolatorG4 {this, "UseBackExtrapolatorG4", true, "Use g4-based back-extraploator"};
118 
120  Gaudi::Property<bool> m_assumeToroidOff {this, "AssumeToroidOff", false, "Force assumption toroid off"};
122  Gaudi::Property<bool> m_assumeSolenoidOff {this, "AssumeSolenoidOff", false, "Force assumption solenoid off"};
123 
124 
129  Gaudi::Property<int> m_AlgoStrategy {this, "MuCombStrategy", 0, "Algoritgm strategy [0=auto select best option,1=simple angular match]"};
130 
136  Gaudi::Property<int> m_ChargeStrategy {this, "ChargeStrategy", 0, "Charge assignement strategy [0=muFast,1=ID,2=resolution based]"};
137 
139  Gaudi::Property<std::string> m_ID_algo_to_use {this, "IDalgo", "InDetTrigTrackingxAODCnv_Muon_FTF","ID trk xAOD collection to use"};
140 
142  Gaudi::Property<double> m_PtMinTrk {this, "MinPtTRK", 1.*Gaudi::Units::GeV, "ID track minimum pT"}; //GeV/c
144  Gaudi::Property<double> m_EtaMaxTrk {this, "MaxAbsEtaTRK", 2.5, "ID tracks max |eta|"};
145 
146  // Matching Parameters
147  //Common
149  Gaudi::Property<int> m_NdofMin {this, "NdofMin", 9999, "matching parameter: min ndof"};
151  Gaudi::Property<bool> m_UseAbsPt {this, "UseAbsPt", false, "matching parameter: use absolute pT"};
152 
153  // LUT based backextrapolator
155  Gaudi::Property<double> m_WinEta {this, "WinEtaSigma", 4.0, "matching parameter: LUT-based"};
157  Gaudi::Property<double> m_WinPhi {this, "WinPhiSigma", 4.0, "matching parameter: LUT-based"};
159  Gaudi::Property<double> m_Chi2Max {this, "Chi2Max", 1.e33, "matching parameter: LUT-based"};
161  Gaudi::Property<double> m_WinEta_EC {this, "WinEtaSigmaEndCaps", 4.0, "matching parameter: LUT-based"};
163  Gaudi::Property<double> m_WinPhi_EC {this, "WinPhiSigmaEndCaps", 10., "matching parameter: LUT-based"};
165  Gaudi::Property<double> m_Chi2Max_EC {this, "Chi2MaxEndCaps", 1.e33, "matching parameter: LUT-based"};
167  Gaudi::Property<double> m_WinEta_TS {this, "WinEtaSigmaTS", 5.0, "matching parameter: LUT-based"};
169  Gaudi::Property<double> m_WinPhi_TS {this, "WinPhiSigmaTS", 5.0, "matching parameter: LUT-based"};
171  Gaudi::Property<double> m_Chi2Max_TS {this, "Chi2MaxTS", 1.e33, "matching parameter: LUT-based"};
173  Gaudi::Property<double> m_WinEta_FE {this, "WinEtaSigmaFE", 10.0, "matching parameter: LUT-based"};
175  Gaudi::Property<double> m_WinPhi_FE {this, "WinPhiSigmaFE", 10.0, "matching parameter: LUT-based"};
177  Gaudi::Property<double> m_Chi2Max_FE {this, "Chi2MaxFE", 1.e33, "matching parameter: LUT-based"};
179  Gaudi::Property<double> m_WeightEta {this, "WeightEta", 2.0, "matching parameter: LUT-based"};
181  Gaudi::Property<double> m_WeightPhi {this, "WeightPhi", 2.0, "matching parameter: LUT-based"};
182 
183  // g4 based backextrapolator
185  Gaudi::Property<double> m_WinEta_g4 {this, "WinEtaSigma_g4", 7.0, "matching parameter: G4-based"};
187  Gaudi::Property<double> m_WinPhi_g4 {this, "WinPhiSigma_g4", 7.0, "matching parameter: G4-based"};
189  Gaudi::Property<double> m_Chi2Max_g4 {this, "Chi2Max_g4", 1.e33, "matching parameter: G4-based"};
191  Gaudi::Property<double> m_WinEta_EC_g4 {this, "WinEtaSigmaEndCaps_g4",7.0, "matching parameter: G4-based"};
193  Gaudi::Property<double> m_WinPhi_EC_g4 {this, "WinPhiSigmaEndCaps_g4",7.0, "matching parameter: G4-based"};
195  Gaudi::Property<double> m_Chi2Max_EC_g4 {this, "Chi2MaxEndCaps_g4", 1.e33, "matching parameter: G4-based"};
197  Gaudi::Property<double> m_WeightEta_g4 {this, "WeightEta_g4", 2.0, "matching parameter: G4-based"};
199  Gaudi::Property<double> m_WeightPhi_g4 {this, "WeightPhi_g4", 2.0, "matching parameter: G4-based"};
201  Gaudi::Property<double> m_Chi2Weight_g4 {this, "Chi2Weight_g4", 2.0, "matching parameter: G4-based"};
202 
203  // Simplified DeltaR(/Pt) based match
205  Gaudi::Property<double> m_winPt {this, "WinPt", -1.0*Gaudi::Units::GeV, "matching parameter (simplifed): pT windows in geV (disabled if < 0)"};
207  Gaudi::Property<double> m_winDR {this, "WinDelta", 0.2, "matching parameter (simplifed): strategy dependent"};
208 
209  // ID parametrized rsolution for matching
210  Gaudi::Property<std::vector<double>> m_IDSCANRes_barrel {this, "IDSCANBarrelRes", {0.017, 0.000000418}, "ID parametrized rsolution for matching (barrel)"};
211  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap1 {this, "IDSCANEndcap1Res",{0.025, 0.0000002}, "ID parametrized rsolution for matching (ec1)"};
212  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap2 {this, "IDSCANEndcap2Res",{0.030, 0.0000002}, "ID parametrized rsolution for matching (ec2)"};
213  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap3 {this, "IDSCANEndcap3Res",{0.036, 0.0000004}, "ID parametrized rsolution for matching (ec3)"};
214  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap4 {this, "IDSCANEndcap4Res",{0.046, 0.0000002}, "ID parametrized rsolution for matching (ec4)"};
215 
216 };
217 
218 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
muComb::m_WinEta_EC
Gaudi::Property< double > m_WinEta_EC
Number of sigmas for the Eta matching window LUT backextrapolator (EndCaps)
Definition: muComb.h:161
muComb::m_WeightEta
Gaudi::Property< double > m_WeightEta
Scale factor for the Eta matching window in LUT backextrapolator.
Definition: muComb.h:179
muComb::m_assumeToroidOff
Gaudi::Property< bool > m_assumeToroidOff
flag to assume B_Toroid=0 anyway
Definition: muComb.h:120
muComb::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: muComb.h:91
muComb::muComb
muComb(const std::string &, ISvcLocator *)
Constructor.
Definition: muComb.cxx:30
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
muComb
Main LVL2 Algorithm.
Definition: muComb.h:54
muComb::m_WinPhi_EC_g4
Gaudi::Property< double > m_WinPhi_EC_g4
Number of sigmas for the Phi matching window LUT backextrapolator (EndCaps)
Definition: muComb.h:193
muComb::m_PtMinTrk
Gaudi::Property< double > m_PtMinTrk
Min Pt to select the ID track for matching.
Definition: muComb.h:142
muComb::m_Chi2Max
Gaudi::Property< double > m_Chi2Max
Max Chi2 for the combined muon in LUT backextrapolator (Barrel)
Definition: muComb.h:159
xAOD::L2StandAloneMuon_v2
Class describing standalone muons reconstructed in the LVL2 trigger.
Definition: L2StandAloneMuon_v2.h:36
AtlasFieldCacheCondObj.h
muComb::m_WeightPhi
Gaudi::Property< double > m_WeightPhi
Scale factor for the Phi matching window in LUT backextrapolator.
Definition: muComb.h:181
muComb::m_Chi2Max_TS
Gaudi::Property< double > m_Chi2Max_TS
Max Chi2 for the combined muon in LUT backextrapolator (Trigger Stations)
Definition: muComb.h:171
L2CombinedMuonContainer.h
muComb::m_IDSCANRes_endcap4
Gaudi::Property< std::vector< double > > m_IDSCANRes_endcap4
Definition: muComb.h:214
IExtrapolator.h
muComb::m_Chi2Max_g4
Gaudi::Property< double > m_Chi2Max_g4
Max Chi2 for the combined muon in LUT backextrapolator (Barrel)
Definition: muComb.h:189
ExtrapolationResult::eta
double eta
Definition: muComb.h:40
muComb::mfMatch
int mfMatch(const xAOD::L2StandAloneMuon *feature, double, double, double, double, double &, double &, double &, double &, double &, int &) const
Definition: muComb.cxx:334
SG::ReadHandleKey< xAOD::TrackParticleContainer >
muComb::m_Chi2Weight_g4
Gaudi::Property< double > m_Chi2Weight_g4
Scale factor for the Chi2 1/pt resolutions (MS and ID) (Barrel)
Definition: muComb.h:201
muComb::getExtrapolatedMuon
ExtrapolationResult getExtrapolatedMuon(const xAOD::L2StandAloneMuon *feature) const
Definition: muComb.cxx:131
muComb::m_IDSCANRes_endcap2
Gaudi::Property< std::vector< double > > m_IDSCANRes_endcap2
Definition: muComb.h:212
muComb::m_ChargeStrategy
Gaudi::Property< int > m_ChargeStrategy
muComb charge assignment strategy: 0: useMuFast 1: use ID 2: use resolution model
Definition: muComb.h:136
muComb::m_winPt
Gaudi::Property< double > m_winPt
max deltaPt for simpified matching
Definition: muComb.h:205
muComb::drptMatch
int drptMatch(double, double, double, double, double, double, int, double &, double &, double &, double &, double &) const
Definition: muComb.cxx:74
muComb::m_winDR
Gaudi::Property< double > m_winDR
max deltaR for simplified matching
Definition: muComb.h:207
ExtrapolationResult::isTgcFailure
int isTgcFailure
Definition: muComb.h:48
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
muComb::m_Chi2Max_EC_g4
Gaudi::Property< double > m_Chi2Max_EC_g4
Max Chi2 for the combined muon in LUT backextrapolator (EndCaps)
Definition: muComb.h:195
GenericMonitoringTool.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ExtrapolationResult::ptinv
double ptinv
Definition: muComb.h:39
muComb::m_outputCBmuonCollKey
SG::WriteHandleKey< xAOD::L2CombinedMuonContainer > m_outputCBmuonCollKey
Definition: muComb.h:78
muComb::m_WinEta_EC_g4
Gaudi::Property< double > m_WinEta_EC_g4
Number of sigmas for the Eta matching window LUT backextrapolator (EndCaps)
Definition: muComb.h:191
muComb::execute
virtual StatusCode execute(const EventContext &ctx) const override
execute execute the combined muon FEX.
Definition: muComb.cxx:460
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
muComb::m_WinEta_FE
Gaudi::Property< double > m_WinEta_FE
Number of sigmas for the Eta matching window LUT backextrapolator (MS Feet region)
Definition: muComb.h:173
muComb::m_WinPhi_EC
Gaudi::Property< double > m_WinPhi_EC
Number of sigmas for the Phi matching window LUT backextrapolator (EndCaps)
Definition: muComb.h:163
muComb::m_WinPhi
Gaudi::Property< double > m_WinPhi
Number of sigmas for the Phi matching window LUT backextrapolator (Barrel)
Definition: muComb.h:157
muComb::m_ID_algo_to_use
Gaudi::Property< std::string > m_ID_algo_to_use
ID Track collection used for matching.
Definition: muComb.h:139
muComb::m_AlgoStrategy
Gaudi::Property< int > m_AlgoStrategy
muComb matching strategy: 0: auto select best option 1: simplified R,(Pt) matching
Definition: muComb.h:129
muComb::m_IDSCANRes_endcap3
Gaudi::Property< std::vector< double > > m_IDSCANRes_endcap3
Definition: muComb.h:213
ExtrapolationResult::phi
double phi
Definition: muComb.h:41
muComb::m_WinPhi_g4
Gaudi::Property< double > m_WinPhi_g4
Number of sigmas for the Phi matching window LUT backextrapolator (Barrel)
Definition: muComb.h:187
ExtrapolationResult::status
int status
Definition: muComb.h:49
ExtrapolationResult::isBarrel
bool isBarrel
Definition: muComb.h:46
AthReentrantAlgorithm.h
muComb::m_EtaMaxTrk
Gaudi::Property< double > m_EtaMaxTrk
Max abs(eta) to select the ID track for matching.
Definition: muComb.h:144
muComb::g4Match
int g4Match(const ExtrapolationResult &extr, double, double, double, double, double, double, double, double &, double &, double &, double &, double &, int &) const
Definition: muComb.cxx:235
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
muComb::m_assumeSolenoidOff
Gaudi::Property< bool > m_assumeSolenoidOff
flag to assume B_Solenoid=0 anyway
Definition: muComb.h:122
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
muComb::m_TrackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackParticleContainerKey
Definition: muComb.h:67
muComb::m_WinEta_g4
Gaudi::Property< double > m_WinEta_g4
Number of sigmas for the Eta matching window LUT backextrapolator (Barrel)
Definition: muComb.h:185
muComb::m_Chi2Max_EC
Gaudi::Property< double > m_Chi2Max_EC
Max Chi2 for the combined muon in LUT backextrapolator (EndCaps)
Definition: muComb.h:165
muComb::m_useBackExtrapolatorG4
Gaudi::Property< bool > m_useBackExtrapolatorG4
flag to switch between G4 and LUT based back-extrapolation
Definition: muComb.h:117
ExtrapolationResult
Definition: muComb.h:38
muComb::m_WinPhi_FE
Gaudi::Property< double > m_WinPhi_FE
Number of sigmas for the Phi matching window LUT backextrapolator (MS Feet region)
Definition: muComb.h:175
ExtrapolationResult::charge
double charge
Definition: muComb.h:45
muComb::m_UseAbsPt
Gaudi::Property< bool > m_UseAbsPt
Use Absolute value of the Pt in chi2 calculation (i.e.
Definition: muComb.h:151
muComb::m_Chi2Max_FE
Gaudi::Property< double > m_Chi2Max_FE
Max Chi2 for the combined muon in LUT backextrapolator (MS Feet region)
Definition: muComb.h:177
ExtrapolationResult::eeta
double eeta
Definition: muComb.h:43
muComb::initialize
virtual StatusCode initialize() override
initialize.
Definition: muComb.cxx:35
muComb::m_IDSCANRes_endcap1
Gaudi::Property< std::vector< double > > m_IDSCANRes_endcap1
Definition: muComb.h:211
muComb::m_WinPhi_TS
Gaudi::Property< double > m_WinPhi_TS
Number of sigmas for the Phi matching window LUT backextrapolator (Trigger Stations)
Definition: muComb.h:169
muComb::m_WinEta_TS
Gaudi::Property< double > m_WinEta_TS
Number of sigmas for the Eta matching window LUT backextrapolator (Trigger Stations)
Definition: muComb.h:167
muComb::m_IDSCANRes_barrel
Gaudi::Property< std::vector< double > > m_IDSCANRes_barrel
Definition: muComb.h:210
muComb::m_NdofMin
Gaudi::Property< int > m_NdofMin
Min Number of DOF to apply the chi2 cut on macthing based on LUT and G4 backextrapolators.
Definition: muComb.h:149
ExtrapolationResult::isRpcFailure
int isRpcFailure
Definition: muComb.h:47
muComb::m_WeightPhi_g4
Gaudi::Property< double > m_WeightPhi_g4
Scale factor for the Phi matching window in LUT backextrapolator.
Definition: muComb.h:199
muComb::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: muComb.h:83
muComb::m_backExtrapolatorG4
ToolHandle< Trk::IExtrapolator > m_backExtrapolatorG4
Handle to the G4 backExtrapolator tool.
Definition: muComb.h:86
ExtrapolationResult::ephi
double ephi
Definition: muComb.h:44
ExtrapolationResult::eptinv
double eptinv
Definition: muComb.h:42
TrackParticleContainer.h
muComb::m_WeightEta_g4
Gaudi::Property< double > m_WeightEta_g4
Scale factor for the Eta matching window in LUT backextrapolator.
Definition: muComb.h:197
muComb::m_muonCollKey
SG::ReadHandleKey< xAOD::L2StandAloneMuonContainer > m_muonCollKey
Definition: muComb.h:72
muComb::m_WinEta
Gaudi::Property< double > m_WinEta
Number of sigmas for the Eta matching window LUT backextrapolator (Barrel)
Definition: muComb.h:155