ATLAS Offline Software
muComb.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 // ********************************************************************
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 public:
40  double ptinv;
41  double eta;
42  double phi;
43  double eptinv;
44  double eeta;
45  double ephi;
46  double charge;
47  bool isBarrel;
50  int status;
51 };
52 
55 {
56  public:
58  muComb(const std::string&, ISvcLocator*);
59 
61  virtual StatusCode initialize() override;
62 
64  virtual StatusCode execute(const EventContext& ctx) const override;
65 
66  private:
67 
69  "TrackParticlesContainerName", // property name
70  "InDetTrigTrackingxAODCnv_Muon_FTF", // default value of StoreGate key
71  "input TrackParticle container name"};
72 
74  "L2StandAloneMuonContainerName", // property name
75  "xAOD::L2StandAloneMuonContainer", // default value of StoreGate key
76  "input L2StandAloneMuon Container name"};
77 
78 
80  "L2CombinedMuonContainerName", // property name
81  "MuonL2CBInfo", // default value of StoreGate key
82  "output CB Muon container name"};
83 
84  ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
85 
87  ToolHandle<Trk::IExtrapolator> m_backExtrapolatorG4 {this,
88  "AtlasExtrapolator",
89  "Trk::Extrapolator/AtlasExtrapolator",
90  "Tool to backextrapolate muon from MS to IP (G4 based)"};
91 
92  SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
93 
94 
95  int drptMatch(double, double, double,
96  double, double, double, int,
97  double&, double&, double&, double&, double&) const;
98 
99  int drptMatch(const xAOD::L2StandAloneMuon* feature,
100  double, double, double, int,
101  double&, double&, double&, double&, double&) const;
102 
103  int mfMatch(const xAOD::L2StandAloneMuon* feature,
104  double, double, double, double,
105  double&, double&, double&, double&, double&, int&) const;
106 
107  int g4Match(const ExtrapolationResult &extr,
108  double, double, double, double, double, double, double,
109  double&, double&, double&, double&, double&, int&) const;
110 
112 
113  private:
114 
115  // Properties
116 
118  Gaudi::Property<bool> m_useBackExtrapolatorG4 {this, "UseBackExtrapolatorG4", true, "Use g4-based back-extraploator"};
119 
121  Gaudi::Property<bool> m_assumeToroidOff {this, "AssumeToroidOff", false, "Force assumption toroid off"};
123  Gaudi::Property<bool> m_assumeSolenoidOff {this, "AssumeSolenoidOff", false, "Force assumption solenoid off"};
124 
125 
130  Gaudi::Property<int> m_AlgoStrategy {this, "MuCombStrategy", 0, "Algoritgm strategy [0=auto select best option,1=simple angular match]"};
131 
137  Gaudi::Property<int> m_ChargeStrategy {this, "ChargeStrategy", 0, "Charge assignement strategy [0=muFast,1=ID,2=resolution based]"};
138 
140  Gaudi::Property<std::string> m_ID_algo_to_use {this, "IDalgo", "InDetTrigTrackingxAODCnv_Muon_FTF","ID trk xAOD collection to use"};
141 
143  Gaudi::Property<double> m_PtMinTrk {this, "MinPtTRK", 1.*Gaudi::Units::GeV, "ID track minimum pT"}; //GeV/c
145  Gaudi::Property<double> m_EtaMaxTrk {this, "MaxAbsEtaTRK", 2.5, "ID tracks max |eta|"};
146 
147  // Matching Parameters
148  //Common
150  Gaudi::Property<int> m_NdofMin {this, "NdofMin", 9999, "matching parameter: min ndof"};
152  Gaudi::Property<bool> m_UseAbsPt {this, "UseAbsPt", false, "matching parameter: use absolute pT"};
153 
154  // LUT based backextrapolator
156  Gaudi::Property<double> m_WinEta {this, "WinEtaSigma", 4.0, "matching parameter: LUT-based"};
158  Gaudi::Property<double> m_WinPhi {this, "WinPhiSigma", 4.0, "matching parameter: LUT-based"};
160  Gaudi::Property<double> m_Chi2Max {this, "Chi2Max", 1.e33, "matching parameter: LUT-based"};
162  Gaudi::Property<double> m_WinEta_EC {this, "WinEtaSigmaEndCaps", 4.0, "matching parameter: LUT-based"};
164  Gaudi::Property<double> m_WinPhi_EC {this, "WinPhiSigmaEndCaps", 10., "matching parameter: LUT-based"};
166  Gaudi::Property<double> m_Chi2Max_EC {this, "Chi2MaxEndCaps", 1.e33, "matching parameter: LUT-based"};
168  Gaudi::Property<double> m_WinEta_TS {this, "WinEtaSigmaTS", 5.0, "matching parameter: LUT-based"};
170  Gaudi::Property<double> m_WinPhi_TS {this, "WinPhiSigmaTS", 5.0, "matching parameter: LUT-based"};
172  Gaudi::Property<double> m_Chi2Max_TS {this, "Chi2MaxTS", 1.e33, "matching parameter: LUT-based"};
174  Gaudi::Property<double> m_WinEta_FE {this, "WinEtaSigmaFE", 10.0, "matching parameter: LUT-based"};
176  Gaudi::Property<double> m_WinPhi_FE {this, "WinPhiSigmaFE", 10.0, "matching parameter: LUT-based"};
178  Gaudi::Property<double> m_Chi2Max_FE {this, "Chi2MaxFE", 1.e33, "matching parameter: LUT-based"};
180  Gaudi::Property<double> m_WeightEta {this, "WeightEta", 2.0, "matching parameter: LUT-based"};
182  Gaudi::Property<double> m_WeightPhi {this, "WeightPhi", 2.0, "matching parameter: LUT-based"};
183 
184  // g4 based backextrapolator
186  Gaudi::Property<double> m_WinEta_g4 {this, "WinEtaSigma_g4", 7.0, "matching parameter: G4-based"};
188  Gaudi::Property<double> m_WinPhi_g4 {this, "WinPhiSigma_g4", 7.0, "matching parameter: G4-based"};
190  Gaudi::Property<double> m_Chi2Max_g4 {this, "Chi2Max_g4", 1.e33, "matching parameter: G4-based"};
192  Gaudi::Property<double> m_WinEta_EC_g4 {this, "WinEtaSigmaEndCaps_g4",7.0, "matching parameter: G4-based"};
194  Gaudi::Property<double> m_WinPhi_EC_g4 {this, "WinPhiSigmaEndCaps_g4",7.0, "matching parameter: G4-based"};
196  Gaudi::Property<double> m_Chi2Max_EC_g4 {this, "Chi2MaxEndCaps_g4", 1.e33, "matching parameter: G4-based"};
198  Gaudi::Property<double> m_WeightEta_g4 {this, "WeightEta_g4", 2.0, "matching parameter: G4-based"};
200  Gaudi::Property<double> m_WeightPhi_g4 {this, "WeightPhi_g4", 2.0, "matching parameter: G4-based"};
202  Gaudi::Property<double> m_Chi2Weight_g4 {this, "Chi2Weight_g4", 2.0, "matching parameter: G4-based"};
203 
204  // Simplified DeltaR(/Pt) based match
206  Gaudi::Property<double> m_winPt {this, "WinPt", -1.0*Gaudi::Units::GeV, "matching parameter (simplifed): pT windows in geV (disabled if < 0)"};
208  Gaudi::Property<double> m_winDR {this, "WinDelta", 0.2, "matching parameter (simplifed): strategy dependent"};
209 
210  // ID parametrized rsolution for matching
211  Gaudi::Property<std::vector<double>> m_IDSCANRes_barrel {this, "IDSCANBarrelRes", {0.017, 0.000000418}, "ID parametrized rsolution for matching (barrel)"};
212  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap1 {this, "IDSCANEndcap1Res",{0.025, 0.0000002}, "ID parametrized rsolution for matching (ec1)"};
213  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap2 {this, "IDSCANEndcap2Res",{0.030, 0.0000002}, "ID parametrized rsolution for matching (ec2)"};
214  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap3 {this, "IDSCANEndcap3Res",{0.036, 0.0000004}, "ID parametrized rsolution for matching (ec3)"};
215  Gaudi::Property<std::vector<double>> m_IDSCANRes_endcap4 {this, "IDSCANEndcap4Res",{0.046, 0.0000002}, "ID parametrized rsolution for matching (ec4)"};
216 
217 };
218 
219 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
ExtrapolationResult::status
int status
Definition: muComb.h:50
muComb::m_WinEta_EC
Gaudi::Property< double > m_WinEta_EC
Number of sigmas for the Eta matching window LUT backextrapolator (EndCaps)
Definition: muComb.h:162
muComb::m_WeightEta
Gaudi::Property< double > m_WeightEta
Scale factor for the Eta matching window in LUT backextrapolator.
Definition: muComb.h:180
muComb::m_assumeToroidOff
Gaudi::Property< bool > m_assumeToroidOff
flag to assume B_Toroid=0 anyway
Definition: muComb.h:121
muComb::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: muComb.h:92
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:55
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:194
muComb::m_PtMinTrk
Gaudi::Property< double > m_PtMinTrk
Min Pt to select the ID track for matching.
Definition: muComb.h:143
muComb::m_Chi2Max
Gaudi::Property< double > m_Chi2Max
Max Chi2 for the combined muon in LUT backextrapolator (Barrel)
Definition: muComb.h:160
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:182
ExtrapolationResult::eptinv
double eptinv
Definition: muComb.h:43
muComb::m_Chi2Max_TS
Gaudi::Property< double > m_Chi2Max_TS
Max Chi2 for the combined muon in LUT backextrapolator (Trigger Stations)
Definition: muComb.h:172
ExtrapolationResult::isRpcFailure
int isRpcFailure
Definition: muComb.h:48
L2CombinedMuonContainer.h
muComb::m_IDSCANRes_endcap4
Gaudi::Property< std::vector< double > > m_IDSCANRes_endcap4
Definition: muComb.h:215
ExtrapolationResult::eta
double eta
Definition: muComb.h:41
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:190
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:202
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:213
muComb::m_ChargeStrategy
Gaudi::Property< int > m_ChargeStrategy
muComb charge assignment strategy: 0: useMuFast 1: use ID 2: use resolution model
Definition: muComb.h:137
ExtrapolationResult::charge
double charge
Definition: muComb.h:46
muComb::m_winPt
Gaudi::Property< double > m_winPt
max deltaPt for simpified matching
Definition: muComb.h:206
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:208
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:196
ExtrapolationResult::ephi
double ephi
Definition: muComb.h:45
GenericMonitoringTool.h
ExtrapolationResult
Definition: muComb.h:38
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
muComb::m_outputCBmuonCollKey
SG::WriteHandleKey< xAOD::L2CombinedMuonContainer > m_outputCBmuonCollKey
Definition: muComb.h:79
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:192
muComb::execute
virtual StatusCode execute(const EventContext &ctx) const override
execute execute the combined muon FEX.
Definition: muComb.cxx:460
ExtrapolationResult::phi
double phi
Definition: muComb.h:42
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:174
muComb::m_WinPhi_EC
Gaudi::Property< double > m_WinPhi_EC
Number of sigmas for the Phi matching window LUT backextrapolator (EndCaps)
Definition: muComb.h:164
muComb::m_WinPhi
Gaudi::Property< double > m_WinPhi
Number of sigmas for the Phi matching window LUT backextrapolator (Barrel)
Definition: muComb.h:158
muComb::m_ID_algo_to_use
Gaudi::Property< std::string > m_ID_algo_to_use
ID Track collection used for matching.
Definition: muComb.h:140
ExtrapolationResult::isBarrel
bool isBarrel
Definition: muComb.h:47
ExtrapolationResult::isTgcFailure
int isTgcFailure
Definition: muComb.h:49
muComb::m_AlgoStrategy
Gaudi::Property< int > m_AlgoStrategy
muComb matching strategy: 0: auto select best option 1: simplified R,(Pt) matching
Definition: muComb.h:130
muComb::m_IDSCANRes_endcap3
Gaudi::Property< std::vector< double > > m_IDSCANRes_endcap3
Definition: muComb.h:214
muComb::m_WinPhi_g4
Gaudi::Property< double > m_WinPhi_g4
Number of sigmas for the Phi matching window LUT backextrapolator (Barrel)
Definition: muComb.h:188
AthReentrantAlgorithm.h
muComb::m_EtaMaxTrk
Gaudi::Property< double > m_EtaMaxTrk
Max abs(eta) to select the ID track for matching.
Definition: muComb.h:145
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:123
ExtrapolationResult::eeta
double eeta
Definition: muComb.h:44
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
muComb::m_TrackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackParticleContainerKey
Definition: muComb.h:68
muComb::m_WinEta_g4
Gaudi::Property< double > m_WinEta_g4
Number of sigmas for the Eta matching window LUT backextrapolator (Barrel)
Definition: muComb.h:186
muComb::m_Chi2Max_EC
Gaudi::Property< double > m_Chi2Max_EC
Max Chi2 for the combined muon in LUT backextrapolator (EndCaps)
Definition: muComb.h:166
muComb::m_useBackExtrapolatorG4
Gaudi::Property< bool > m_useBackExtrapolatorG4
flag to switch between G4 and LUT based back-extrapolation
Definition: muComb.h:118
ExtrapolationResult::ptinv
double ptinv
Definition: muComb.h:40
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:176
muComb::m_UseAbsPt
Gaudi::Property< bool > m_UseAbsPt
Use Absolute value of the Pt in chi2 calculation (i.e.
Definition: muComb.h:152
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:178
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:212
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:170
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:168
muComb::m_IDSCANRes_barrel
Gaudi::Property< std::vector< double > > m_IDSCANRes_barrel
Definition: muComb.h:211
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:150
muComb::m_WeightPhi_g4
Gaudi::Property< double > m_WeightPhi_g4
Scale factor for the Phi matching window in LUT backextrapolator.
Definition: muComb.h:200
muComb::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: muComb.h:84
muComb::m_backExtrapolatorG4
ToolHandle< Trk::IExtrapolator > m_backExtrapolatorG4
Handle to the G4 backExtrapolator tool.
Definition: muComb.h:87
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:198
muComb::m_muonCollKey
SG::ReadHandleKey< xAOD::L2StandAloneMuonContainer > m_muonCollKey
Definition: muComb.h:73
muComb::m_WinEta
Gaudi::Property< double > m_WinEta
Number of sigmas for the Eta matching window LUT backextrapolator (Barrel)
Definition: muComb.h:156