ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimEventSelectionSvc.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 FPGATrackSimCONFTOOLS_FPGATrackSimEVENTSELECTIONSVC_H
6#define FPGATrackSimCONFTOOLS_FPGATrackSimEVENTSELECTIONSVC_H
7
9#include "GaudiKernel/ToolHandle.h"
10
14
15class FPGATrackSimHit;
22
23
24class FPGATrackSimEventSelectionSvc : public extends< AthService, IFPGATrackSimEventSelectionSvc >
25{
26 public:
27
28 FPGATrackSimEventSelectionSvc(const std::string& name, ISvcLocator* svc);
29 virtual ~FPGATrackSimEventSelectionSvc() = default;
30
31 virtual StatusCode initialize() override;
32 virtual StatusCode finalize() override;
33
34 virtual unsigned getRegionID() const override { return m_regionID; }
35 virtual SampleType getSampleType() const override { return m_st; }
36 virtual bool checkPU() const override { return m_withPU.value(); }
37 virtual const FPGATrackSimRegionSlices* getRegions() override;
38 virtual int getLRTpdgID() const override { return m_LRT_pdgID; }
39
40 virtual FPGATrackSimTrackPars getMin() const override { return m_min; }
41 virtual FPGATrackSimTrackPars getMax() const override { return m_max; }
42
43 virtual bool passCuts(const FPGATrackSimHit&) const override;
44 virtual bool passCuts(const FPGATrackSimTrack&) const override;
45 virtual bool passCuts(const FPGATrackSimOfflineTrack&) const override;
46 virtual bool passCuts(const FPGATrackSimTruthTrack&) const override;
47
48 virtual bool passQOverPt(const FPGATrackSimTrack&) const override;
49 virtual bool passEta(const FPGATrackSimTrack&) const override;
50 virtual bool passPhi(const FPGATrackSimTrack&) const override;
51 virtual bool passD0(const FPGATrackSimTrack&) const override;
52 virtual bool passZ0(const FPGATrackSimTrack&) const override;
53 virtual bool passQOverPt(const FPGATrackSimOfflineTrack&) const override;
54 virtual bool passEta(const FPGATrackSimOfflineTrack&) const override;
55 virtual bool passPhi(const FPGATrackSimOfflineTrack&) const override;
56 virtual bool passD0(const FPGATrackSimOfflineTrack&) const override;
57 virtual bool passZ0(const FPGATrackSimOfflineTrack&) const override;
58
59 virtual bool passMatching(FPGATrackSimTrack const &) const override;
60 virtual bool passMatching(FPGATrackSimTruthTrack const &) const override;
61
62 virtual bool selectEvent(const FPGATrackSimEventInputHeader*) override;
64
65 // Allow code to query whether or not an event was selected by the service.
66 // If running over RDO part of this decision is made inside the dataprep algorithm, so it needs a setter.
67 virtual bool getSelectedEvent() const override { return m_selectEvent; }
68 virtual void setSelectedEvent(bool s) override { m_selectEvent = s; }
69
70 private:
71
72 // Gaudi parameters:
73 Gaudi::Property<unsigned int> m_regionID { this, "regionID", 0, "current region under processing"}; // Current region of interest
74 Gaudi::Property<unsigned int> m_skipRegionCheck { this, "skipRegionCheck", false, "this should be set to true for DataPrep or in cases where region cuts don't matter"};
75 Gaudi::Property<std::string> m_regions_path { this, "regions", "", "path of the slices file"}; // path to slices file
76 Gaudi::Property<std::string> m_sampleType { this, "sampleType", "singleMuons", "type of sample under processing (skipTruth, singleElectrons, singleMuons, singlePions, or LLPs)"}; // type of sample ("skipTruth", "singleElectrons", "singleMuons", "singlePions")
77 Gaudi::Property<bool> m_withPU { this, "withPU", false, "flag to say if there is pile-up or not"}; // flag to say if there is pile-up or not
78 Gaudi::Property<bool> m_LRT { this, "doLRT", false, "Change track selection to LRT quantities; hit selection unchanged"}; // flag to require cancelling of selections on d0 and z0 in the case of large-radius tracking
79 Gaudi::Property<float> m_minLRTpT { this, "minLRTpT", 5., "Minimum pT to use in LRT selection, in GeV"}; // minimum pT, in GeV, to use in LRT selection
80 Gaudi::Property<int> m_LRT_pdgID { this, "lrt_truthMatchPDGID", 0, "If we are running an LLP sample but want only some PDGID of output in the truth selection, set this"}; // If we are running an LLP sample but want only some PDGID of output in the truth selection, set this
81 Gaudi::Property<bool> m_allowHighBarcode { this, "allowHighBarcode", false, "Whether or not to allow barcodes over 200000 in truth matching"}; // whether or not to allow barcodes over 200000 in truth matching
82 Gaudi::Property<bool> m_oldRegionDefs {this, "oldRegionDefs", true, "If True, use old region definitions, otherwise new ones where eta-phi for a region is automatically calculated and the rest are passed on"};
83 Gaudi::Property<float> m_mind0 {this, "mind0", -2.0, "Min d0 for region selection"};
84 Gaudi::Property<float> m_minz0 {this, "minz0", -150, "Min z0 for region selection"};
85 Gaudi::Property<float> m_minqOverPt {this, "minqOverPt", -0.001, "Min qOverPt for region selection (MeV)"};
86 Gaudi::Property<float> m_maxd0 {this, "maxd0", 2.0, "Max d0 for region selection"};
87 Gaudi::Property<float> m_maxz0 {this, "maxz0", 150, "Max z0 for region selection"};
88 Gaudi::Property<float> m_maxqOverPt {this, "maxqOverPt", 0.001, "Max qOverPt for region selection (MeV)"};
89
90
91 SampleType m_st = SampleType::skipTruth; // internal value for faster comparisons in selectEvent()
92 FPGATrackSimRegionSlices* m_regions = nullptr; // pointer to RegionSlices class
93
94 FPGATrackSimTrackPars m_min; // min limits of current region
95 FPGATrackSimTrackPars m_max; // max limits of current region
96 FPGATrackSimTrackPars m_trackmin; // min limits of tracks to be accepted in region
97 FPGATrackSimTrackPars m_trackmax; // max limits of tracks to be accepted in region
98
99
100 void createRegions(); // helper function to create RegionSlices object
101 bool checkTruthTracks(const std::vector<FPGATrackSimTruthTrack>&) const; // helper function to check the truth tracks for selectEvent()
102 bool checkTruthTracksLRT(const std::vector<FPGATrackSimTruthTrack>&) const; // check the truth tracks for selectEvent() with LRT requirements
103
104 // Cache result of selectEvent().
105 bool m_selectEvent = false;
106
107};
108
109#endif // FPGATrackSimCONFTOOLS_FPGATrackSimEVENTSELECTIONSVC_H
Structs that store the 5 track parameters.
Gaudi::Property< std::string > m_sampleType
virtual bool passCuts(const FPGATrackSimHit &) const override
virtual unsigned getRegionID() const override
virtual bool passMatching(FPGATrackSimTrack const &) const override
virtual FPGATrackSimTrackPars getMin() const override
virtual bool passQOverPt(const FPGATrackSimTrack &) const override
virtual bool passEta(const FPGATrackSimTrack &) const override
Gaudi::Property< std::string > m_regions_path
virtual bool passZ0(const FPGATrackSimTrack &) const override
virtual bool passPhi(const FPGATrackSimTrack &) const override
virtual void setSelectedEvent(bool s) override
virtual SampleType getSampleType() const override
virtual const FPGATrackSimRegionSlices * getRegions() override
virtual bool selectEvent(const FPGATrackSimEventInputHeader *) override
Gaudi::Property< unsigned int > m_regionID
virtual bool passD0(const FPGATrackSimTrack &) const override
virtual bool checkPU() const override
bool checkTruthTracksLRT(const std::vector< FPGATrackSimTruthTrack > &) const
virtual ~FPGATrackSimEventSelectionSvc()=default
FPGATrackSimEventSelectionSvc(const std::string &name, ISvcLocator *svc)
virtual FPGATrackSimTrackPars getMax() const override
bool checkTruthTracks(const std::vector< FPGATrackSimTruthTrack > &) const
virtual int getLRTpdgID() const override
Gaudi::Property< unsigned int > m_skipRegionCheck
virtual bool getSelectedEvent() const override