ATLAS Offline Software
Loading...
Searching...
No Matches
BeamBackgroundFiller.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#ifndef RECBACKGROUNDALGS_BEAMBACKGROUNDFILLER
6#define RECBACKGROUNDALGS_BEAMBACKGROUNDFILLER
7
8#include <string>
9#include <vector>
10
11#include "AthLinks/ElementLinkVector.h"
13#include "GaudiKernel/ServiceHandle.h"
18#include "TrkSegment/Segment.h"
22#include "GaudiKernel/SystemOfUnits.h"
24
38 public:
39 BeamBackgroundFiller(const std::string& name, ISvcLocator* pSvcLocator);
40 virtual ~BeamBackgroundFiller() = default;
41
42 virtual StatusCode initialize() override;
43 virtual StatusCode execute(const EventContext& ctx) const override;
44
45 private:
46 struct Cache {
47 int m_numSegment{0}; // number of segments with the direction parallel to
48 // the beam pipe
49 int m_numSegmentEarly{0}; // number of early segments
50 int m_numSegmentACNoTime{0}; // number of matched pairs of segments on
51 // side A and side C
52 int m_numSegmentAC{0}; // number of matched pairs of segments with
53 // corresponding time difference
54 int m_numMatched{0}; // number of clusters matched with the segments
55 int m_numNoTimeLoose{0}; // number of clusters identified by the "No-Time
56 // Method"
59 int m_numOneSidedLoose{0}; // number of clusters identified by the
60 // "One-Sided Method"
63 int m_numTwoSidedNoTime{0}; // number of clusters identified by the
64 // "Two-Sided No-Time Method"
65 int m_numTwoSided{0}; // number of clusters identified by the "Two-Sided
66 // Method"
67 int m_numClusterShape{0}; // number of clusters identified by the
68 // "Cluster-Shape Method"
69 int m_numJet{0}; // number of fake jets
70 int m_direction{0}; // direction of beam halo from the "Two-Sided Method"
71 // (positive for A->C, negative for C->A)
72 // link to the calorimeter cluster
74 // line to the muon segment
76 // matching matrix (stores results for each muon segment and calorimeter
77 // cluster)
78 std::vector<std::vector<int> > m_matchMatrix{};
79 // summary of the results for each muon segment
80 std::vector<int> m_resultSeg{};
81 // summary of the results for each cluster segment
82 std::vector<int> m_resultClus{};
83 // shape of the cluster
84 std::vector<float> m_drdzClus{};
85
87 std::vector<int> m_resultJet{}; // summary of the results for each jet
88 };
89
90 // Function matching calorimeter clusters with muon segments
91 void FillMatchMatrix(const EventContext& ctx, Cache& cache) const;
92 // Beam background identification methods
93 void SegmentMethod(Cache& cache) const;
94 void OneSidedMethod(Cache& cache) const;
95 void TwoSidedMethod(Cache& cache) const;
96 void ClusterShapeMethod(Cache& cache) const;
97
98 // Function calculating time for mboy CSC segments
99 // (needed until release 17.1.0, does not work on AOD)
100 double GetSegmentTime(const Muon::MuonSegment& pMuonSegment) const;
101
102 // Function to identify fake jets
103 void FindFakeJets(const EventContext& ctx, Cache& cache) const;
104 // Function to store the results in BeamBackgroundData
106 SG::WriteHandle<BeamBackgroundData>& beamBackgroundDataWriteHandle,
107 Cache& cache) const;
108
111 this, "SegmentKeys", {"NCB_TrackMuonSegments", /*"TrackMuonSegments" */} ,
112 "Muon segment collections from the MS patterns"};
113
117 this, "caloClusterContainerKey", "CaloCalTopoClusters",
118 "ReadHandleKey for CaloClusterContainer"};
119
122 this, "jetContainerKey", "AntiKt4EMTopoJets",
123 "ReadHandleKey for JetContainer"};
124
125 /* WriteHandleKey for BeamBackgroundData */
127 this, "BeamBackgroundKey", "BeamBackgroundData",
128 "WriteHandleKey for BeamBackgroundData"};
129
130 ToolHandle<Muon::IMuonSegmentSelectionTool> m_segmentSelector{this, "SegmentSelector",""};
131
132
134 Gaudi::Property<double> m_thetaCutNCB{this, "cutThetaNCB", 5. * Gaudi::Units::deg};
135
136 Gaudi::Property<double> m_cutDphiSegAC{this,"cutPhi", 4.* Gaudi::Units::deg};
137
139 Gaudi::Property<double> m_clusEnergyCut{this,"clustEnergy", 10. *Gaudi::Units::GeV};
140 // CSC : 881 < R < 2081
141 // LAr barrel : 1500 < R < 1970
142 // TileCal : 2280 < R < 4250
143 Gaudi::Property<double> m_clusRadiusLow{this, "cutRadiusLow", 881. * Gaudi::Units::mm};
144 Gaudi::Property<double> m_clusRadiusHigh{this,"cutRadiusHigh", 4250. * Gaudi::Units::mm};
145
146 Gaudi::Property<double> m_cutDphiClusSeg{this, "cutDphiClusSeg", 4.* Gaudi::Units::deg};
147 Gaudi::Property<double> m_cutDradClusSeg{this,"cutDrClusSet", 40. * Gaudi::Units::cm};
148
149
150
151 Gaudi::Property<double> m_cutMuonTime{this, "cutMuonTime", 25.};
152 Gaudi::Property<double> m_cutClusTime{this,"cutClusTime", 2.5};
153 Gaudi::Property<double> m_cutTimeDiffAC{this,"cutTimeDiffAC", 25.};
154 Gaudi::Property<double> m_cutDrdz{this,"cutDrdz", 0.15};
156 this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
157 "Handle to the service providing the IMuonEDMHelperSvc interface"};
159 this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
160};
161
162#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