ATLAS Offline Software
FPGATrackSimEventSelectionSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 
15 class FPGATrackSimHit;
16 class FPGATrackSimTrack;
22 
23 
24 class 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  //static const InterfaceID& interfaceID();
35  virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIf) override;
36 
37  virtual unsigned getRegionID() const override { return m_regionID; }
38  virtual SampleType getSampleType() const override { return m_st; }
39  virtual bool checkPU() const override { return m_withPU.value(); }
40  virtual const FPGATrackSimRegionSlices* getRegions() override;
41  virtual int getLRTpdgID() const override { return m_LRT_pdgID; }
42 
43  virtual FPGATrackSimTrackPars getMin() const override { return m_min; }
44  virtual FPGATrackSimTrackPars getMax() const override { return m_max; }
45 
46  virtual bool passCuts(const FPGATrackSimHit&) const override;
47  virtual bool passCuts(const FPGATrackSimTrack&) const override;
48  virtual bool passCuts(const FPGATrackSimOfflineTrack&) const override;
49  virtual bool passCuts(const FPGATrackSimTruthTrack&) const override;
50 
51  virtual bool passQOverPt(const FPGATrackSimTrack&) const override;
52  virtual bool passEta(const FPGATrackSimTrack&) const override;
53  virtual bool passPhi(const FPGATrackSimTrack&) const override;
54  virtual bool passD0(const FPGATrackSimTrack&) const override;
55  virtual bool passZ0(const FPGATrackSimTrack&) const override;
56  virtual bool passQOverPt(const FPGATrackSimOfflineTrack&) const override;
57  virtual bool passEta(const FPGATrackSimOfflineTrack&) const override;
58  virtual bool passPhi(const FPGATrackSimOfflineTrack&) const override;
59  virtual bool passD0(const FPGATrackSimOfflineTrack&) const override;
60  virtual bool passZ0(const FPGATrackSimOfflineTrack&) const override;
61 
62  virtual bool passMatching(FPGATrackSimTrack const &) const override;
63  virtual bool passMatching(FPGATrackSimTruthTrack const &) const override;
64 
65  virtual bool selectEvent(FPGATrackSimEventInputHeader*) const override;
66  virtual bool selectEvent(FPGATrackSimLogicalEventInputHeader*) const override;
67 
68  private:
69 
70  // Gaudi parameters:
71  Gaudi::Property<unsigned int> m_regionID { this, "regionID", 0, "current region under processing"}; // Current region of interest
72  Gaudi::Property<std::string> m_regions_path { this, "regions", "", "path of the slices file"}; // path to slices file
73  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")
74  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
75  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
76  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
77  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
78  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
79 
80 
81 
82  SampleType m_st = SampleType::skipTruth; // internal value for faster comparisons in selectEvent()
83  FPGATrackSimRegionSlices* m_regions = nullptr; // pointer to RegionSlices class
84 
85  FPGATrackSimTrackPars m_min; // min limits of current region
86  FPGATrackSimTrackPars m_max; // max limits of current region
87  FPGATrackSimTrackPars m_trackmin; // min limits of tracks to be accepted in region
88  FPGATrackSimTrackPars m_trackmax; // max limits of tracks to be accepted in region
89 
90 
91  void createRegions(); // helper function to create RegionSlices object
92  bool checkTruthTracks(const std::vector<FPGATrackSimTruthTrack>&) const; // helper function to check the truth tracks for selectEvent()
93  bool checkTruthTracksLRT(const std::vector<FPGATrackSimTruthTrack>&) const; // check the truth tracks for selectEvent() with LRT requirements
94 };
95 
96 /*inline const InterfaceID& FPGATrackSimEventSelectionSvc::interfaceID()
97 {
98  static const InterfaceID IID_FPGATrackSimEventSelectionSvc("FPGATrackSimEventSelectionSvc", 1, 0);
99  return IID_FPGATrackSimEventSelectionSvc;
100 }*/
101 
102 #endif // FPGATrackSimCONFTOOLS_FPGATrackSimEVENTSELECTIONSVC_H
FPGATrackSimEventSelectionSvc::passZ0
virtual bool passZ0(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:154
FPGATrackSimEventSelectionSvc::checkTruthTracksLRT
bool checkTruthTracksLRT(const std::vector< FPGATrackSimTruthTrack > &) const
Definition: FPGATrackSimEventSelectionSvc.cxx:336
FPGATrackSimLogicalEventInputHeader
Definition: FPGATrackSimLogicalEventInputHeader.h:21
FPGATrackSimEventSelectionSvc::checkTruthTracks
bool checkTruthTracks(const std::vector< FPGATrackSimTruthTrack > &) const
Definition: FPGATrackSimEventSelectionSvc.cxx:310
FPGATrackSimRegionSlices
Definition: FPGATrackSimRegionSlices.h:25
FPGATrackSimEventSelectionSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIf) override
Definition: FPGATrackSimEventSelectionSvc.cxx:80
FPGATrackSimTrack
Definition: FPGATrackSimTrack.h:16
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
FPGATrackSimTruthTrack
Definition: FPGATrackSimTruthTrack.h:13
FPGATrackSimEventSelectionSvc::passMatching
virtual bool passMatching(FPGATrackSimTrack const &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:234
FPGATrackSimEventSelectionSvc::m_trackmin
FPGATrackSimTrackPars m_trackmin
Definition: FPGATrackSimEventSelectionSvc.h:87
FPGATrackSimEventSelectionSvc::m_regions
FPGATrackSimRegionSlices * m_regions
Definition: FPGATrackSimEventSelectionSvc.h:83
FPGATrackSimEventSelectionSvc::passQOverPt
virtual bool passQOverPt(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:122
FPGATrackSimEventSelectionSvc::getSampleType
virtual SampleType getSampleType() const override
Definition: FPGATrackSimEventSelectionSvc.h:38
FPGATrackSimEventSelectionSvc::getMax
virtual FPGATrackSimTrackPars getMax() const override
Definition: FPGATrackSimEventSelectionSvc.h:44
FPGATrackSimEventSelectionSvc::passCuts
virtual bool passCuts(const FPGATrackSimHit &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:98
FPGATrackSimHit
Definition: FPGATrackSimHit.h:38
FPGATrackSimEventSelectionSvc::passD0
virtual bool passD0(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:146
FPGATrackSimEventSelectionSvc::FPGATrackSimEventSelectionSvc
FPGATrackSimEventSelectionSvc(const std::string &name, ISvcLocator *svc)
Definition: FPGATrackSimEventSelectionSvc.cxx:22
FPGATrackSimEventSelectionSvc::getMin
virtual FPGATrackSimTrackPars getMin() const override
Definition: FPGATrackSimEventSelectionSvc.h:43
FPGATrackSimEventSelectionSvc::passPhi
virtual bool passPhi(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:138
FPGATrackSimEventSelectionSvc::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimEventSelectionSvc.cxx:71
FPGATrackSimEventSelectionSvc
Definition: FPGATrackSimEventSelectionSvc.h:25
FPGATrackSimEventSelectionSvc::~FPGATrackSimEventSelectionSvc
virtual ~FPGATrackSimEventSelectionSvc()=default
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimEventSelectionSvc::m_sampleType
Gaudi::Property< std::string > m_sampleType
Definition: FPGATrackSimEventSelectionSvc.h:73
FPGATrackSimEventInputHeader
Definition: FPGATrackSimEventInputHeader.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
FPGATrackSimOfflineTrack
Definition: FPGATrackSimOfflineTrack.h:12
FPGATrackSimEventSelectionSvc::selectEvent
virtual bool selectEvent(FPGATrackSimEventInputHeader *) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:252
FPGATrackSimEventSelectionSvc::m_max
FPGATrackSimTrackPars m_max
Definition: FPGATrackSimEventSelectionSvc.h:86
SampleType::skipTruth
@ skipTruth
FPGATrackSimEventSelectionSvc::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimEventSelectionSvc.cxx:26
FPGATrackSimEventSelectionSvc::m_trackmax
FPGATrackSimTrackPars m_trackmax
Definition: FPGATrackSimEventSelectionSvc.h:88
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FPGATrackSimEventSelectionSvc::m_minLRTpT
Gaudi::Property< float > m_minLRTpT
Definition: FPGATrackSimEventSelectionSvc.h:76
FPGATrackSimEventSelectionSvc::m_regions_path
Gaudi::Property< std::string > m_regions_path
Definition: FPGATrackSimEventSelectionSvc.h:72
FPGATrackSimEventSelectionSvc::m_LRT
Gaudi::Property< bool > m_LRT
Definition: FPGATrackSimEventSelectionSvc.h:75
FPGATrackSimEventSelectionSvc::m_LRT_pdgID
Gaudi::Property< int > m_LRT_pdgID
Definition: FPGATrackSimEventSelectionSvc.h:77
FPGATrackSimEventSelectionSvc::passEta
virtual bool passEta(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:130
IFPGATrackSimEventSelectionSvc.h
FPGATrackSimEventSelectionSvc::m_regionID
Gaudi::Property< unsigned int > m_regionID
Definition: FPGATrackSimEventSelectionSvc.h:71
FPGATrackSimEventSelectionSvc::m_st
SampleType m_st
Definition: FPGATrackSimEventSelectionSvc.h:82
FPGATrackSimEventSelectionSvc::m_allowHighBarcode
Gaudi::Property< bool > m_allowHighBarcode
Definition: FPGATrackSimEventSelectionSvc.h:78
AthService.h
FPGATrackSimEventSelectionSvc::getLRTpdgID
virtual int getLRTpdgID() const override
Definition: FPGATrackSimEventSelectionSvc.h:41
FPGATrackSimEventSelectionSvc::checkPU
virtual bool checkPU() const override
Definition: FPGATrackSimEventSelectionSvc.h:39
FPGATrackSimTypes.h
FPGATrackSimEventSelectionSvc::createRegions
void createRegions()
Definition: FPGATrackSimEventSelectionSvc.cxx:299
SampleType
SampleType
Definition: FPGATrackSimTypes.h:40
FPGATrackSimTrackPars.h
Structs that store the 5 track parameters.
FPGATrackSimEventSelectionSvc::m_withPU
Gaudi::Property< bool > m_withPU
Definition: FPGATrackSimEventSelectionSvc.h:74
FPGATrackSimEventSelectionSvc::getRegions
virtual const FPGATrackSimRegionSlices * getRegions() override
Definition: FPGATrackSimEventSelectionSvc.cxx:293
FPGATrackSimEventSelectionSvc::m_min
FPGATrackSimTrackPars m_min
Definition: FPGATrackSimEventSelectionSvc.h:85
FPGATrackSimEventSelectionSvc::getRegionID
virtual unsigned getRegionID() const override
Definition: FPGATrackSimEventSelectionSvc.h:37