ATLAS Offline Software
TrigHitDVHypoAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRIGLONGLIVEDPARTICLESHYPO_TRIGHITDVHYPOALG_H
5 #define TRIGLONGLIVEDPARTICLESHYPO_TRIGHITDVHYPOALG_H
6 
7 #include <string>
8 
9 #include "Gaudi/Property.h"
13 #include "TrigHitDVHypoTool.h"
14 
15 #include "xAODJet/JetContainer.h"
18 
19 #include "TMVA/Reader.h"
20 
28 
35 struct HitDVSeed {
36  float eta;
37  float phi;
39 };
40 
41 struct HitDVTrk {
42  int id;
43  float pt;
44  float eta;
45  float phi;
49  float a0beam;
50 };
51 
53  float eta;
54  float r;
55  float phi;
57  bool isPix;
58  bool isSct;
60 };
61 
63 {
64 public:
65 
66  TrigHitDVHypoAlg( const std::string& name, ISvcLocator* pSvcLocator );
67  virtual StatusCode initialize() override;
68  virtual StatusCode execute(const EventContext& context) const override;
69 
70 private:
71 
72  ToolHandle<ITrigSpacePointConversionTool> m_spacePointTool{this, "SpacePointProviderTool", "TrigSpacePointConversionTool"};
73  ToolHandleArray< TrigHitDVHypoTool > m_hypoTools {this, "HypoTools", {}, "Tools to perform selection"};
74 
75  // EDMs
76  SG::ReadHandleKey< xAOD::JetContainer > m_jetsKey {this, "Jets", "HLT_AntiKt4EMTopoJets_subjesIS", ""};
78  SG::ReadHandleKey< TrackCollection> m_tracksKey {this, "HitDVTracks", "HLT_IDTrkTrack_FS_FTF", ""};
79 
80  // Luminosity related
81  ToolHandle<ILumiBlockMuTool> m_lumiBlockMuTool;
82  // Property: Per-bunch luminosity data (data only) conditions input)
83  SG::ReadCondHandleKey<LuminosityCondData> m_lumiDataKey {this, "LuminosityCondDataKey", "LuminosityCondData", ""};
84  // Property: MC flag.
85  Gaudi::Property<bool> m_isMC {this, "isMC", false, "Real data or MC"};
86  // Property: jet seed cut
87  Gaudi::Property<float> m_jetSeed_ptMin {this, "jetSeed_ptMin", 50.0, "Minimum pT for jet seed"};
88  Gaudi::Property<float> m_jetSeed_etaMax {this, "jetSeed_etaMin", 2.0, "Maximum eta for jet seed"};
89  // Property: Name of the link to hitDV seed container to pass to ViewCreatorROITool
90  Gaudi::Property<std::string> m_hitDVLinkName {this, "hitDVLinkName", "HitDVSeedLink", "Name of the link to HitDVContainer. Used by ViewCreatorROITool."};
91 
92  // seed type enum
94 
95  // monitoring
96  ToolHandle<GenericMonitoringTool> m_monTool{ this, "MonTool", "", "Monitoring tool" };
98 
99  //
100  float deltaR2(float, float, float, float) const;
101  int getSPLayer(int, float) const;
102  StatusCode findSPSeeds(const EventContext&, const std::vector<HitDVSpacePoint>&, std::vector<float>&, std::vector<float>&) const;
103  StatusCode findJetSeeds(const xAOD::JetContainer*, const float, const float, std::vector<float>&, std::vector<float>&, std::vector<float>&) const;
104  StatusCode selectSeedsNearby(const std::vector<HitDVSeed>& hitDVSeedsContainer,
105  std::vector<float>& jetSeeds_eta, std::vector<float>& jetSeeds_phi, std::vector<float>& jetSeeds_pt) const;
106  StatusCode calculateBDT(const EventContext&, const std::vector<HitDVSpacePoint>&, const std::vector<HitDVTrk>&,
107  const std::vector<float>&, const std::vector<float>&, const std::vector<float>&,
108  const float&, const int, xAOD::TrigCompositeContainer*, int&) const;
109 
110  // BDT
111  struct TMVAReader {
112  std::unique_ptr<TMVA::Reader> tmva_0eta1;
113  std::unique_ptr<TMVA::Reader> tmva_1eta2;
115  float ly0_sp_frac;
116  float ly1_sp_frac;
117  float ly2_sp_frac;
118  float ly3_sp_frac;
119  float ly4_sp_frac;
120  float ly5_sp_frac;
121  float ly6_sp_frac;
122  float ly7_sp_frac;
123  };
125 
126  // parameters
129 
130  //Ctrl Flags
132 
133  //Vertex
134  //bool m_doHitDV;
135  bool m_doHitDV_Seeding = true;
136 
138  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
139 
140  StatusCode findSPSeeds( const EventContext& ctx,
141  const std::vector<float>& v_sp_eta, const std::vector<float>& v_sp_phi,
142  const std::vector<int>& v_sp_layer, const std::vector<int>& v_sp_usedTrkId,
143  std::vector<float>& seeds_eta, std::vector<float>& seeds_phi ) const;
144  StatusCode findHitDV(const EventContext& ctx, const std::vector<TrigSiSpacePointBase>& convertedSpacePoints,
145  const DataVector<Trk::Track>& tracks, std::vector<HitDVSeed>& hitDVSeedsContainer,
146  std::vector<HitDVTrk>& hitDVTrksContainer,
147  std::vector<HitDVSpacePoint>& hitDVSPContainer) const;
148 };
149 
150 #endif //> !TRIGLONGLIVEDPARTICLESHYPO_TRIGHITDVHYPOALG_H
TrigHitDVHypoAlg::calculateBDT
StatusCode calculateBDT(const EventContext &, const std::vector< HitDVSpacePoint > &, const std::vector< HitDVTrk > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const float &, const int, xAOD::TrigCompositeContainer *, int &) const
Definition: TrigHitDVHypoAlg.cxx:565
HitDVSpacePoint::isPix
bool isPix
Definition: TrigHitDVHypoAlg.h:57
TrigHitDVHypoAlg::TMVAReader::ly0_sp_frac
float ly0_sp_frac
Definition: TrigHitDVHypoAlg.h:115
TrigHitDVHypoAlg::TrigHitDVHypoAlg
TrigHitDVHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigHitDVHypoAlg.cxx:43
HitDVTrk::n_hits_inner
int16_t n_hits_inner
Definition: TrigHitDVHypoAlg.h:46
HitDVSpacePoint::r
float r
Definition: TrigHitDVHypoAlg.h:54
TrigHitDVHypoAlg::m_spacePointTool
ToolHandle< ITrigSpacePointConversionTool > m_spacePointTool
Definition: TrigHitDVHypoAlg.h:72
TrigHitDVHypoAlg::TMVAReader::ly4_sp_frac
float ly4_sp_frac
Definition: TrigHitDVHypoAlg.h:119
TrigHitDVHypoAlg::ATLAS_THREAD_SAFE
SG::SlotSpecificObj< TMVAReader > m_tmva_reader ATLAS_THREAD_SAFE
Definition: TrigHitDVHypoAlg.h:124
HitDVSpacePoint
Definition: TrigHitDVHypoAlg.h:52
TrigHitDVHypoAlg::TMVAReader::ly7_sp_frac
float ly7_sp_frac
Definition: TrigHitDVHypoAlg.h:122
TrigHitDVHypoAlg
Implements Hypo selection on triggering displaced vertex.
Definition: TrigHitDVHypoAlg.h:63
TrigHitDVHypoAlg::m_jetRoiCollectionKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jetRoiCollectionKey
Definition: TrigHitDVHypoAlg.h:137
TrigHitDVHypoAlg::TMVAReader::ly5_sp_frac
float ly5_sp_frac
Definition: TrigHitDVHypoAlg.h:120
TrigHitDVHypoAlg::m_useBeamSpot
bool m_useBeamSpot
Definition: TrigHitDVHypoAlg.h:131
TrigHitDVHypoAlg::TMVAReader::tmva_0eta1
std::unique_ptr< TMVA::Reader > tmva_0eta1
Definition: TrigHitDVHypoAlg.h:112
TrigHitDVHypoAlg::m_tools_loosest_wp
int m_tools_loosest_wp
Definition: TrigHitDVHypoAlg.h:128
TrigHitDVHypoAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigHitDVHypoAlg.h:96
TrigHitDVHypoAlg::TMVAReader::n_track_qual
float n_track_qual
Definition: TrigHitDVHypoAlg.h:114
HitDVTrk::phi
float phi
Definition: TrigHitDVHypoAlg.h:45
HitDVTrk::pt
float pt
Definition: TrigHitDVHypoAlg.h:43
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
HitDVSeed
Definition: TrigHitDVHypoAlg.h:35
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
PrepRawData.h
HitDVTrk::a0beam
float a0beam
Definition: TrigHitDVHypoAlg.h:49
TrigHitDVHypoAlg::m_jetSeed_etaMax
Gaudi::Property< float > m_jetSeed_etaMax
Definition: TrigHitDVHypoAlg.h:88
HitDVTrk::n_hits_pix
int16_t n_hits_pix
Definition: TrigHitDVHypoAlg.h:47
TrigHitDVHypoAlg::TMVAReader::tmva_1eta2
std::unique_ptr< TMVA::Reader > tmva_1eta2
Definition: TrigHitDVHypoAlg.h:113
TrigHitDVHypoAlg::deltaR2
float deltaR2(float, float, float, float) const
Definition: TrigHitDVHypoAlg.cxx:333
HitDVSpacePoint::phi
float phi
Definition: TrigHitDVHypoAlg.h:55
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
TrigHitDVHypoAlg::TMVAReader
Definition: TrigHitDVHypoAlg.h:111
TrigHitDVHypoAlg::m_doHitDV_Seeding
bool m_doHitDV_Seeding
Definition: TrigHitDVHypoAlg.h:135
TrigHitDVHypoAlg::selectSeedsNearby
StatusCode selectSeedsNearby(const std::vector< HitDVSeed > &hitDVSeedsContainer, std::vector< float > &jetSeeds_eta, std::vector< float > &jetSeeds_phi, std::vector< float > &jetSeeds_pt) const
Definition: TrigHitDVHypoAlg.cxx:948
TrigHitDVHypoTool::SeedType
SeedType
Definition: TrigHitDVHypoTool.h:44
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
HitDVTrk::n_hits_sct
int16_t n_hits_sct
Definition: TrigHitDVHypoAlg.h:48
HitDVSeed::eta
float eta
Definition: TrigHitDVHypoAlg.h:36
TrigSiSpacePointBase.h
TrigHitDVHypoAlg::TMVAReader::ly3_sp_frac
float ly3_sp_frac
Definition: TrigHitDVHypoAlg.h:118
jFexSRJetRoIContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigHitDVHypoAlg::m_lumiBlockMuTool
ToolHandle< ILumiBlockMuTool > m_lumiBlockMuTool
Definition: TrigHitDVHypoAlg.h:81
TrigHitDVHypoTool.h
HitDVSeed::type
int16_t type
Definition: TrigHitDVHypoAlg.h:38
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
TrigHitDVHypoAlg::doMonitor
StatusCode doMonitor(const xAOD::TrigCompositeContainer *) const
Definition: TrigHitDVHypoAlg.cxx:466
TrigHitDVHypoAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrigHitDVHypoAlg.h:138
TrigCompositeAuxContainer.h
LuminosityCondData.h
Hold luminosity data produced by LuminosityCondAlg.
ITrigSpacePointConversionTool.h
TrigHitDVHypoAlg::findJetSeeds
StatusCode findJetSeeds(const xAOD::JetContainer *, const float, const float, std::vector< float > &, std::vector< float > &, std::vector< float > &) const
Definition: TrigHitDVHypoAlg.cxx:709
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigHitDVHypoAlg::m_tracksKey
SG::ReadHandleKey< TrackCollection > m_tracksKey
Definition: TrigHitDVHypoAlg.h:78
RIO_OnTrack.h
TrigHitDVHypoAlg::TMVAReader::ly6_sp_frac
float ly6_sp_frac
Definition: TrigHitDVHypoAlg.h:121
HypoBase
Hypothesis algorithms take the output of reco algorithms and the decision from the preceeding InputMa...
Definition: HypoBase.h:13
TrigHitDVHypoAlg::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: TrigHitDVHypoAlg.cxx:127
HitDVTrk::eta
float eta
Definition: TrigHitDVHypoAlg.h:44
TrigHitDVHypoAlg::m_jetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetsKey
Definition: TrigHitDVHypoAlg.h:76
ILumiBlockMuTool.h
TrigHitDVHypoAlg::m_hitDVKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_hitDVKey
Definition: TrigHitDVHypoAlg.h:77
TrigHitDVHypoAlg::TMVAReader::ly2_sp_frac
float ly2_sp_frac
Definition: TrigHitDVHypoAlg.h:117
TrigHitDVHypoAlg::initialize
virtual StatusCode initialize() override
Definition: TrigHitDVHypoAlg.cxx:52
TrigHitDVHypoAlg::m_lumiDataKey
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
Definition: TrigHitDVHypoAlg.h:83
TrigHitDVHypoAlg::m_isMC
Gaudi::Property< bool > m_isMC
Definition: TrigHitDVHypoAlg.h:85
HitDVSpacePoint::layer
int16_t layer
Definition: TrigHitDVHypoAlg.h:56
SG::ReadCondHandleKey< LuminosityCondData >
TrigHitDVHypoAlg::m_hitDVLinkName
Gaudi::Property< std::string > m_hitDVLinkName
Definition: TrigHitDVHypoAlg.h:90
HitDVSeed::phi
float phi
Definition: TrigHitDVHypoAlg.h:37
JetContainer.h
TrigHitDVHypoAlg::m_jetSeed_ptMin
Gaudi::Property< float > m_jetSeed_ptMin
Definition: TrigHitDVHypoAlg.h:87
HitDVSpacePoint::eta
float eta
Definition: TrigHitDVHypoAlg.h:53
TrigHitDVHypoAlg::findSPSeeds
StatusCode findSPSeeds(const EventContext &, const std::vector< HitDVSpacePoint > &, std::vector< float > &, std::vector< float > &) const
Definition: TrigHitDVHypoAlg.cxx:745
HypoBase.h
HitDVSpacePoint::usedTrkId
int16_t usedTrkId
Definition: TrigHitDVHypoAlg.h:59
SlotSpecificObj.h
Maintain a set of objects, one per slot.
TrigHitDVHypoAlg::TMVAReader::ly1_sp_frac
float ly1_sp_frac
Definition: TrigHitDVHypoAlg.h:116
BeamSpotData.h
TrigHitDVHypoAlg::m_hypoTools
ToolHandleArray< TrigHitDVHypoTool > m_hypoTools
Definition: TrigHitDVHypoAlg.h:73
TrigHitDVHypoAlg::findHitDV
StatusCode findHitDV(const EventContext &ctx, const std::vector< TrigSiSpacePointBase > &convertedSpacePoints, const DataVector< Trk::Track > &tracks, std::vector< HitDVSeed > &hitDVSeedsContainer, std::vector< HitDVTrk > &hitDVTrksContainer, std::vector< HitDVSpacePoint > &hitDVSPContainer) const
Definition: TrigHitDVHypoAlg.cxx:1178
checker_macros.h
Define macros for attributes used to control the static checker.
TrigHitDVHypoAlg::m_tools_lowest_jetEt
int m_tools_lowest_jetEt
Definition: TrigHitDVHypoAlg.h:127
HitDVTrk::id
int id
Definition: TrigHitDVHypoAlg.h:42
HitDVSpacePoint::isSct
bool isSct
Definition: TrigHitDVHypoAlg.h:58
HitDVTrk
Definition: TrigHitDVHypoAlg.h:41
TrigHitDVHypoAlg::getSPLayer
int getSPLayer(int, float) const
Definition: TrigHitDVHypoAlg.cxx:342