ATLAS Offline Software
MMTriggerTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MMTRIGGERTOOL_H
6 #define MMTRIGGERTOOL_H
7 
8 //basic includes
10 #include "GaudiKernel/ConcurrencyFlags.h"
12 #include "Gaudi/Property.h"
13 #include "GaudiKernel/ITHistSvc.h"
15 
16 //local includes
20 
25 
26 
27 // namespace for the NSW LVL1 related classes
28 namespace NSWL1 {
29 
30  class MMTriggerTool : public extends<AthAlgTool, IMMTriggerTool> {
31 
32  public:
33 
34  MMTriggerTool(const std::string& type, const std::string& name, const IInterface* parent);
35  virtual ~MMTriggerTool() override = default;
36 
37  virtual StatusCode initialize() override;
39  StatusCode runTrigger(const EventContext& ctx, Muon::NSW_TrigRawDataContainer* rdo, const bool do_MMDiamonds) const override;
40 
41  private:
42  SG::ReadHandleKey<McEventCollection> m_keyMcEventCollection{this,"McEventCollection","TruthEvent","Location of TruthEvent"};
43  SG::ReadHandleKey<TrackRecordCollection> m_keyMuonEntryLayer{this,"MuonEntryLayer","MuonEntryLayer","Location of MuonEntryLayer"};
44  SG::ReadHandleKey<MmDigitContainer> m_keyMmDigitContainer{this,"MmDigitContainer","MM_DIGITS","Location of MmDigitContainer"};
45  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_detectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of MuonDetectorManager condition data"};
46  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
47 
48  Gaudi::Property<bool> m_isMC {this, "IsMC", true, "This is MC"};
49  Gaudi::Property<bool> m_doTruth {this, "DoTruth", false, "Process truth information. Disabled by default"};
50 
51  // Parameters for Diamond Road algorithms
52  Gaudi::Property<int> m_diamRoadSize {this, "DiamondRoadSize", 8, "Number of strips to create a road"};
53  Gaudi::Property<bool> m_uv {this, "DiamondUV", true, "Include Stereo planes for tracking"};
54  Gaudi::Property<int> m_diamXthreshold {this, "DiamondEtaThreshold", 3, "Number of Eta planes for coincidences"};
55  Gaudi::Property<int> m_diamUVthreshold {this, "DiamondStereoThreshold", 3, "Number of Stereo planes for coincidences"};
56  Gaudi::Property<int> m_diamOverlapEtaUp {this, "DiamondEtaUpOverlap", 4, "Number of Eta strips for upper road overlap"};
57  Gaudi::Property<int> m_diamOverlapEtaDown {this, "DiamondEtaDownOverlap", 0, "Number of Eta strips for lower road overlap"};
58  Gaudi::Property<int> m_diamOverlapStereoUp {this, "DiamondStereoUpOverlap", 4, "Number of Stereo strips for upper road overlap"};
59  Gaudi::Property<int> m_diamOverlapStereoDown{this, "DiamondStereoDownOverlap", 0, "Number of Stereo strips for lower road overlap"};
60 
61  // Parameters for RDO encoding
62  Gaudi::Property<std::string> m_mmDigitContainer{this, "MM_DigitContainerName", "MM_DIGITS", "Name of the MM digit container"};
63  Gaudi::Property<bool> m_doNtuple {this, "DoNtuple", false, "Input the MMStrip branches into the analysis ntuple"};
64  Gaudi::Property<float> m_phiMin {this, "PhiMin", -16.*M_PI/180.0, "Minimum Phi"};
65  Gaudi::Property<float> m_phiMax {this, "PhiMax", 16.*M_PI/180.0, "Maximum Phi"};
66  Gaudi::Property<int> m_phiBits {this, "PhiBits", 6, "Number of Phi bits"};
67  Gaudi::Property<float> m_rMin {this, "RMin", 900.0, "Minimum R [mm]"};
68  Gaudi::Property<float> m_rMax {this, "RMax", 5000.0, "Maximum R [mm]"};
69  Gaudi::Property<int> m_rBits {this, "RBits", 8, "Number of R bits"};
70  Gaudi::Property<float> m_dThetaMin {this, "DThetaMin", -0.015, "Minimum dTheta [rad]"};
71  Gaudi::Property<float> m_dThetaMax {this, "DThetaMax", 0.015, "Maximum dTheta [rad]"};
72  Gaudi::Property<int> m_dThetaBits {this, "DThetaBits", 5, "Number of dTheta bits"};
73 
74  std::unique_ptr<MMT_Diamond> m_diamond;
75 
76  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_ntrig ATLAS_THREAD_SAFE {};
77  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_diamond_bc ATLAS_THREAD_SAFE {};
78  std::shared_ptr<MuonVal::VectorBranch<char> > m_trigger_diamond_sector ATLAS_THREAD_SAFE {};
79  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_diamond_sectorPhi ATLAS_THREAD_SAFE {};
80  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_totalCount ATLAS_THREAD_SAFE {};
81  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_realCount ATLAS_THREAD_SAFE {};
82  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_diamond_iX ATLAS_THREAD_SAFE {};
83  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_diamond_iU ATLAS_THREAD_SAFE {};
84  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_diamond_iV ATLAS_THREAD_SAFE {};
85  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_XbkgCount ATLAS_THREAD_SAFE {};
86  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_UVbkgCount ATLAS_THREAD_SAFE {};
87  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_XmuonCount ATLAS_THREAD_SAFE {};
88  std::shared_ptr<MuonVal::VectorBranch<unsigned int> > m_trigger_diamond_UVmuonCount ATLAS_THREAD_SAFE {};
89  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_diamond_age ATLAS_THREAD_SAFE {};
90  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_mx ATLAS_THREAD_SAFE {};
91  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_my ATLAS_THREAD_SAFE {};
92  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_Uavg ATLAS_THREAD_SAFE {};
93  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_Vavg ATLAS_THREAD_SAFE {};
94  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_mxl ATLAS_THREAD_SAFE {};
95  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_theta ATLAS_THREAD_SAFE {};
96  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_eta ATLAS_THREAD_SAFE {};
97  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_dtheta ATLAS_THREAD_SAFE {};
98  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_phi ATLAS_THREAD_SAFE {};
99  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_diamond_phiShf ATLAS_THREAD_SAFE {};
100  std::shared_ptr<MuonVal::VectorBranch<uint8_t> > m_trigger_diamond_TP_phi_id ATLAS_THREAD_SAFE {};
101  std::shared_ptr<MuonVal::VectorBranch<uint8_t> > m_trigger_diamond_TP_R_id ATLAS_THREAD_SAFE {};
102  std::shared_ptr<MuonVal::VectorBranch<uint8_t> > m_trigger_diamond_TP_dTheta_id ATLAS_THREAD_SAFE {};
103  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_RZslopes ATLAS_THREAD_SAFE {};
104  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueEtaRange ATLAS_THREAD_SAFE {};
105  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_truePtRange ATLAS_THREAD_SAFE {};
106  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_VMM ATLAS_THREAD_SAFE {};
107  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_plane ATLAS_THREAD_SAFE {};
108  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_station ATLAS_THREAD_SAFE {};
109  std::shared_ptr<MuonVal::VectorBranch<int> > m_trigger_strip ATLAS_THREAD_SAFE {};
110  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_slope ATLAS_THREAD_SAFE {};
111  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueThe ATLAS_THREAD_SAFE {};
112  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_truePhi ATLAS_THREAD_SAFE {};
113  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueDth ATLAS_THREAD_SAFE {};
114  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueEtaEnt ATLAS_THREAD_SAFE {};
115  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueTheEnt ATLAS_THREAD_SAFE {};
116  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_truePhiEnt ATLAS_THREAD_SAFE {};
117  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueEtaPos ATLAS_THREAD_SAFE {};
118  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_trueThePos ATLAS_THREAD_SAFE {};
119  std::shared_ptr<MuonVal::VectorBranch<double> > m_trigger_truePhiPos ATLAS_THREAD_SAFE {};
120  }; // end of MMTriggerTool class
121 } // namespace NSWL1
122 #endif
NSWL1::MMTriggerTool::m_keyMmDigitContainer
SG::ReadHandleKey< MmDigitContainer > m_keyMmDigitContainer
Definition: MMTriggerTool.h:44
NSWL1::MMTriggerTool::m_diamXthreshold
Gaudi::Property< int > m_diamXthreshold
Definition: MMTriggerTool.h:54
NSWL1::MMTriggerTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MMTriggerTool.h:46
NSWL1::MMTriggerTool::m_diamOverlapStereoDown
Gaudi::Property< int > m_diamOverlapStereoDown
Definition: MMTriggerTool.h:59
NSWL1::MMTriggerTool::m_diamOverlapEtaUp
Gaudi::Property< int > m_diamOverlapEtaUp
Definition: MMTriggerTool.h:56
NSWL1::MMTriggerTool::m_dThetaMin
Gaudi::Property< float > m_dThetaMin
Definition: MMTriggerTool.h:70
MMLoadVariables.h
NSWL1::MMTriggerTool::attachBranches
StatusCode attachBranches(MuonVal::MuonTesterTree &tree) override
Definition: MMTriggerTool.cxx:35
NSWL1::MMTriggerTool::m_phiMax
Gaudi::Property< float > m_phiMax
Definition: MMTriggerTool.h:65
tree
TChain * tree
Definition: tile_monitor.h:30
NSWL1::MMTriggerTool::m_diamOverlapEtaDown
Gaudi::Property< int > m_diamOverlapEtaDown
Definition: MMTriggerTool.h:57
M_PI
#define M_PI
Definition: ActiveFraction.h:11
NSWL1::MMTriggerTool::m_rMax
Gaudi::Property< float > m_rMax
Definition: MMTriggerTool.h:68
SG::ReadHandleKey< McEventCollection >
MmDigit.h
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
NSWL1::MMTriggerTool::m_uv
Gaudi::Property< bool > m_uv
Definition: MMTriggerTool.h:53
NSWL1::MMTriggerTool::m_mmDigitContainer
Gaudi::Property< std::string > m_mmDigitContainer
Definition: MMTriggerTool.h:62
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
McEventCollection.h
NSWL1::MMTriggerTool
Definition: MMTriggerTool.h:30
MmDigitContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
MmIdHelper.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
NSWL1::MMTriggerTool::m_keyMuonEntryLayer
SG::ReadHandleKey< TrackRecordCollection > m_keyMuonEntryLayer
Definition: MMTriggerTool.h:43
NSWL1::MMTriggerTool::runTrigger
StatusCode runTrigger(const EventContext &ctx, Muon::NSW_TrigRawDataContainer *rdo, const bool do_MMDiamonds) const override
Definition: MMTriggerTool.cxx:128
NSWL1::MMTriggerTool::MMTriggerTool
MMTriggerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MMTriggerTool.cxx:9
NSWL1::MMTriggerTool::m_diamRoadSize
Gaudi::Property< int > m_diamRoadSize
Definition: MMTriggerTool.h:52
NSWL1::MMTriggerTool::ATLAS_THREAD_SAFE
std::shared_ptr< MuonVal::VectorBranch< unsigned int > > m_trigger_diamond_ntrig ATLAS_THREAD_SAFE
Definition: MMTriggerTool.h:76
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrackRecordCollection.h
NSWL1::MMTriggerTool::m_dThetaMax
Gaudi::Property< float > m_dThetaMax
Definition: MMTriggerTool.h:71
IMMTriggerTool.h
NSWL1::MMTriggerTool::m_keyMcEventCollection
SG::ReadHandleKey< McEventCollection > m_keyMcEventCollection
Definition: MMTriggerTool.h:42
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
NSWL1::MMTriggerTool::initialize
virtual StatusCode initialize() override
Definition: MMTriggerTool.cxx:12
NSWL1::MMTriggerTool::m_detectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detectorManagerKey
Definition: MMTriggerTool.h:45
NSWL1::MMTriggerTool::m_diamond
std::unique_ptr< MMT_Diamond > m_diamond
Definition: MMTriggerTool.h:74
NSWL1::MMTriggerTool::m_isMC
Gaudi::Property< bool > m_isMC
Definition: MMTriggerTool.h:48
NSWL1::MMTriggerTool::m_diamUVthreshold
Gaudi::Property< int > m_diamUVthreshold
Definition: MMTriggerTool.h:55
NSWL1::MMTriggerTool::m_diamOverlapStereoUp
Gaudi::Property< int > m_diamOverlapStereoUp
Definition: MMTriggerTool.h:58
NSWL1::MMTriggerTool::m_doTruth
Gaudi::Property< bool > m_doTruth
Definition: MMTriggerTool.h:49
Muon::NSW_TrigRawDataContainer
Definition: NSW_TrigRawDataContainer.h:14
checker_macros.h
Define macros for attributes used to control the static checker.
NSWL1::MMTriggerTool::m_rBits
Gaudi::Property< int > m_rBits
Definition: MMTriggerTool.h:69
NSWL1::MMTriggerTool::~MMTriggerTool
virtual ~MMTriggerTool() override=default
NSWL1
A trigger trigger candidate for a stgc sector.
Definition: NSWL1Simulation.cxx:7
MMT_Diamond.h
NSWL1::MMTriggerTool::m_rMin
Gaudi::Property< float > m_rMin
Definition: MMTriggerTool.h:67
NSWL1::MMTriggerTool::m_phiBits
Gaudi::Property< int > m_phiBits
Definition: MMTriggerTool.h:66
NSWL1::MMTriggerTool::m_phiMin
Gaudi::Property< float > m_phiMin
Definition: MMTriggerTool.h:64
NSWL1::MMTriggerTool::m_doNtuple
Gaudi::Property< bool > m_doNtuple
Definition: MMTriggerTool.h:63
NSWL1::MMTriggerTool::m_dThetaBits
Gaudi::Property< int > m_dThetaBits
Definition: MMTriggerTool.h:72
ServiceHandle< Muon::IMuonIdHelperSvc >