ATLAS Offline Software
Loading...
Searching...
No Matches
BeamBackgroundFiller.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef RECBACKGROUNDALGS_BEAMBACKGROUNDFILLER
6#define RECBACKGROUNDALGS_BEAMBACKGROUNDFILLER
7
8
9
10#include "AthLinks/ElementLinkVector.h"
12#include "GaudiKernel/ServiceHandle.h"
17#include "TrkSegment/Segment.h"
21#include "GaudiKernel/SystemOfUnits.h"
23
24#include <string>
25#include <vector>
39 public:
40 BeamBackgroundFiller(const std::string& name, ISvcLocator* pSvcLocator);
41 virtual ~BeamBackgroundFiller() = default;
42
43 virtual StatusCode initialize() override;
44 virtual StatusCode execute(const EventContext& ctx) const override;
45
46 private:
47 struct Cache {
48 int m_numSegment{0}; // number of segments with the direction parallel to
49 // the beam pipe
50 int m_numSegmentEarly{0}; // number of early segments
51 int m_numSegmentACNoTime{0}; // number of matched pairs of segments on
52 // side A and side C
53 int m_numSegmentAC{0}; // number of matched pairs of segments with
54 // corresponding time difference
55 int m_numMatched{0}; // number of clusters matched with the segments
56 int m_numNoTimeLoose{0}; // number of clusters identified by the "No-Time
57 // Method"
60 int m_numOneSidedLoose{0}; // number of clusters identified by the
61 // "One-Sided Method"
64 int m_numTwoSidedNoTime{0}; // number of clusters identified by the
65 // "Two-Sided No-Time Method"
66 int m_numTwoSided{0}; // number of clusters identified by the "Two-Sided
67 // Method"
68 int m_numClusterShape{0}; // number of clusters identified by the
69 // "Cluster-Shape Method"
70 int m_numJet{0}; // number of fake jets
71 int m_direction{0}; // direction of beam halo from the "Two-Sided Method"
72 // (positive for A->C, negative for C->A)
73 // link to the calorimeter cluster
75 // line to the muon segment
77 // matching matrix (stores results for each muon segment and calorimeter
78 // cluster)
79 std::vector<std::vector<int> > m_matchMatrix{};
80 // summary of the results for each muon segment
81 std::vector<int> m_resultSeg{};
82 // summary of the results for each cluster segment
83 std::vector<int> m_resultClus{};
84 // shape of the cluster
85 std::vector<float> m_drdzClus{};
86
88 std::vector<int> m_resultJet{}; // summary of the results for each jet
89 };
90
91 // Function matching calorimeter clusters with muon segments
92 void FillMatchMatrix(const EventContext& ctx, Cache& cache) const;
93 // Beam background identification methods
94 void SegmentMethod(Cache& cache) const;
95 void OneSidedMethod(Cache& cache) const;
96 void TwoSidedMethod(Cache& cache) const;
97 void ClusterShapeMethod(Cache& cache) const;
98
99 // Function calculating time for mboy CSC segments
100 // (needed until release 17.1.0, does not work on AOD)
101 double GetSegmentTime(const Muon::MuonSegment& pMuonSegment) const;
102
103 // Function to identify fake jets
104 void FindFakeJets(const EventContext& ctx, Cache& cache) const;
105 // Function to store the results in BeamBackgroundData
107 SG::WriteHandle<BeamBackgroundData>& beamBackgroundDataWriteHandle,
108 Cache& cache) const;
109
112 this, "SegmentKeys", {"NCB_TrackMuonSegments", /*"TrackMuonSegments" */} ,
113 "Muon segment collections from the MS patterns"};
114
118 this, "caloClusterContainerKey", "CaloCalTopoClusters",
119 "ReadHandleKey for CaloClusterContainer"};
120
123 this, "jetContainerKey", "AntiKt4EMTopoJets",
124 "ReadHandleKey for JetContainer"};
125
126 /* WriteHandleKey for BeamBackgroundData */
128 this, "BeamBackgroundKey", "BeamBackgroundData",
129 "WriteHandleKey for BeamBackgroundData"};
130
131 ToolHandle<Muon::IMuonSegmentSelectionTool> m_segmentSelector{this, "SegmentSelector",""};
132
133
135 Gaudi::Property<double> m_thetaCutNCB{this, "cutThetaNCB", 5. * Gaudi::Units::deg};
136
137 Gaudi::Property<double> m_cutDphiSegAC{this,"cutPhi", 4.* Gaudi::Units::deg};
138
140 Gaudi::Property<double> m_clusEnergyCut{this,"clustEnergy", 10. *Gaudi::Units::GeV};
141 // CSC : 881 < R < 2081
142 // LAr barrel : 1500 < R < 1970
143 // TileCal : 2280 < R < 4250
144 Gaudi::Property<double> m_clusRadiusLow{this, "cutRadiusLow", 881. * Gaudi::Units::mm};
145 Gaudi::Property<double> m_clusRadiusHigh{this,"cutRadiusHigh", 4250. * Gaudi::Units::mm};
146
147 Gaudi::Property<double> m_cutDphiClusSeg{this, "cutDphiClusSeg", 4.* Gaudi::Units::deg};
148 Gaudi::Property<double> m_cutDradClusSeg{this,"cutDrClusSet", 40. * Gaudi::Units::cm};
149
150
151
152 Gaudi::Property<double> m_cutMuonTime{this, "cutMuonTime", 25.};
153 Gaudi::Property<double> m_cutClusTime{this,"cutClusTime", 2.5};
154 Gaudi::Property<double> m_cutTimeDiffAC{this,"cutTimeDiffAC", 25.};
155 Gaudi::Property<double> m_cutDrdz{this,"cutDrdz", 0.15};
157 this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
158 "Handle to the service providing the IMuonEDMHelperSvc interface"};
160 this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
161};
162
163#endif
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< double > m_thetaCutNCB
Inclanation cut between the segment position and its direction.
SG::WriteHandleKey< BeamBackgroundData > m_beamBackgroundDataWriteHandleKey
Gaudi::Property< double > m_cutDradClusSeg
void SegmentMethod(Cache &cache) const
This function looks at the segments found by the FillMatchMatrix function.
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerReadHandleKey
ReadHandleKey for JetContainer.
ToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
virtual StatusCode initialize() override
void FindFakeJets(const EventContext &ctx, Cache &cache) const
This function checks whether the matched clusters are contained in any jets.
BeamBackgroundFiller(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKeyArray< Trk::SegmentCollection > m_segmentKeys
ReadHandleKey for Trk::SegmentCollection from CSC.
Gaudi::Property< double > m_cutDrdz
Gaudi::Property< double > m_clusRadiusLow
Gaudi::Property< double > m_cutTimeDiffAC
Gaudi::Property< double > m_cutDphiClusSeg
void ClusterShapeMethod(Cache &cache) const
This function is the implementation of the "Cluster-Shape Method".
void FillBeamBackgroundData(SG::WriteHandle< BeamBackgroundData > &beamBackgroundDataWriteHandle, Cache &cache) const
This function stores all the results in BeamBackgroundData.
void FillMatchMatrix(const EventContext &ctx, Cache &cache) const
This function selects the muon segments with the direction parallel to the beam pipe and calorimeter ...
void OneSidedMethod(Cache &cache) const
This function is the implementation of the "No-Time Method" and the "One-Sided Method".
Gaudi::Property< double > m_clusEnergyCut
Minimum cut on the cluster energy to be considered.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterContainerReadHandleKey
ReadHandleKey for CaloClusterContainer.
Gaudi::Property< double > m_cutDphiSegAC
Gaudi::Property< double > m_clusRadiusHigh
Gaudi::Property< double > m_cutClusTime
double GetSegmentTime(const Muon::MuonSegment &pMuonSegment) const
Gaudi::Property< double > m_cutMuonTime
virtual StatusCode execute(const EventContext &ctx) const override
void TwoSidedMethod(Cache &cache) const
This function is the implementation of the "Two-Sided No-Time Method" and the "Two-Sided Method" that...
virtual ~BeamBackgroundFiller()=default
ElementLinkVector implementation for standalone ROOT.
This is the common class for 3D segments used in the muon spectrometer.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
ElementLinkVector< xAOD::JetContainer > m_indexJet
std::vector< std::vector< int > > m_matchMatrix
ElementLinkVector< xAOD::CaloClusterContainer > m_indexClus
ElementLinkVector< Trk::SegmentCollection > m_indexSeg