Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
FPGATrackSimEventSelectionSvc.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 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  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(FPGATrackSimEventInputHeader*) override;
63  virtual bool selectEvent(FPGATrackSimLogicalEventInputHeader*) 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
FPGATrackSimEventSelectionSvc::passZ0
virtual bool passZ0(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:135
FPGATrackSimEventSelectionSvc::checkTruthTracksLRT
bool checkTruthTracksLRT(const std::vector< FPGATrackSimTruthTrack > &) const
Definition: FPGATrackSimEventSelectionSvc.cxx:327
FPGATrackSimLogicalEventInputHeader
Definition: FPGATrackSimLogicalEventInputHeader.h:21
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
FPGATrackSimEventSelectionSvc::checkTruthTracks
bool checkTruthTracks(const std::vector< FPGATrackSimTruthTrack > &) const
Definition: FPGATrackSimEventSelectionSvc.cxx:301
FPGATrackSimRegionSlices
Definition: FPGATrackSimRegionSlices.h:25
FPGATrackSimEventSelectionSvc::selectEvent
virtual bool selectEvent(FPGATrackSimEventInputHeader *) override
Definition: FPGATrackSimEventSelectionSvc.cxx:233
FPGATrackSimTrack
Definition: FPGATrackSimTrack.h:18
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
FPGATrackSimTruthTrack
Definition: FPGATrackSimTruthTrack.h:14
FPGATrackSimEventSelectionSvc::passMatching
virtual bool passMatching(FPGATrackSimTrack const &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:215
FPGATrackSimEventSelectionSvc::m_trackmin
FPGATrackSimTrackPars m_trackmin
Definition: FPGATrackSimEventSelectionSvc.h:96
FPGATrackSimEventSelectionSvc::m_regions
FPGATrackSimRegionSlices * m_regions
Definition: FPGATrackSimEventSelectionSvc.h:92
FPGATrackSimEventSelectionSvc::passQOverPt
virtual bool passQOverPt(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:103
FPGATrackSimEventSelectionSvc::m_minz0
Gaudi::Property< float > m_minz0
Definition: FPGATrackSimEventSelectionSvc.h:84
FPGATrackSimEventSelectionSvc::m_skipRegionCheck
Gaudi::Property< unsigned int > m_skipRegionCheck
Definition: FPGATrackSimEventSelectionSvc.h:74
FPGATrackSimEventSelectionSvc::getSelectedEvent
virtual bool getSelectedEvent() const override
Definition: FPGATrackSimEventSelectionSvc.h:67
FPGATrackSimEventSelectionSvc::getSampleType
virtual SampleType getSampleType() const override
Definition: FPGATrackSimEventSelectionSvc.h:35
FPGATrackSimEventSelectionSvc::getMax
virtual FPGATrackSimTrackPars getMax() const override
Definition: FPGATrackSimEventSelectionSvc.h:41
FPGATrackSimEventSelectionSvc::passCuts
virtual bool passCuts(const FPGATrackSimHit &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:79
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
FPGATrackSimEventSelectionSvc::passD0
virtual bool passD0(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:127
FPGATrackSimEventSelectionSvc::FPGATrackSimEventSelectionSvc
FPGATrackSimEventSelectionSvc(const std::string &name, ISvcLocator *svc)
Definition: FPGATrackSimEventSelectionSvc.cxx:22
FPGATrackSimEventSelectionSvc::m_oldRegionDefs
Gaudi::Property< bool > m_oldRegionDefs
Definition: FPGATrackSimEventSelectionSvc.h:82
FPGATrackSimEventSelectionSvc::getMin
virtual FPGATrackSimTrackPars getMin() const override
Definition: FPGATrackSimEventSelectionSvc.h:40
FPGATrackSimEventSelectionSvc::passPhi
virtual bool passPhi(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:119
FPGATrackSimEventSelectionSvc::m_selectEvent
bool m_selectEvent
Definition: FPGATrackSimEventSelectionSvc.h:105
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:76
FPGATrackSimEventInputHeader
Definition: FPGATrackSimEventInputHeader.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
FPGATrackSimEventSelectionSvc::m_maxd0
Gaudi::Property< float > m_maxd0
Definition: FPGATrackSimEventSelectionSvc.h:86
FPGATrackSimOfflineTrack
Definition: FPGATrackSimOfflineTrack.h:12
FPGATrackSimEventSelectionSvc::m_maxqOverPt
Gaudi::Property< float > m_maxqOverPt
Definition: FPGATrackSimEventSelectionSvc.h:88
FPGATrackSimEventSelectionSvc::m_max
FPGATrackSimTrackPars m_max
Definition: FPGATrackSimEventSelectionSvc.h:95
SampleType::skipTruth
@ skipTruth
FPGATrackSimEventSelectionSvc::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimEventSelectionSvc.cxx:26
FPGATrackSimEventSelectionSvc::m_trackmax
FPGATrackSimTrackPars m_trackmax
Definition: FPGATrackSimEventSelectionSvc.h:97
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
FPGATrackSimEventSelectionSvc::m_minLRTpT
Gaudi::Property< float > m_minLRTpT
Definition: FPGATrackSimEventSelectionSvc.h:79
FPGATrackSimEventSelectionSvc::m_maxz0
Gaudi::Property< float > m_maxz0
Definition: FPGATrackSimEventSelectionSvc.h:87
FPGATrackSimEventSelectionSvc::m_regions_path
Gaudi::Property< std::string > m_regions_path
Definition: FPGATrackSimEventSelectionSvc.h:75
FPGATrackSimEventSelectionSvc::m_minqOverPt
Gaudi::Property< float > m_minqOverPt
Definition: FPGATrackSimEventSelectionSvc.h:85
FPGATrackSimEventSelectionSvc::m_LRT
Gaudi::Property< bool > m_LRT
Definition: FPGATrackSimEventSelectionSvc.h:78
FPGATrackSimEventSelectionSvc::m_LRT_pdgID
Gaudi::Property< int > m_LRT_pdgID
Definition: FPGATrackSimEventSelectionSvc.h:80
FPGATrackSimEventSelectionSvc::passEta
virtual bool passEta(const FPGATrackSimTrack &) const override
Definition: FPGATrackSimEventSelectionSvc.cxx:111
IFPGATrackSimEventSelectionSvc.h
FPGATrackSimEventSelectionSvc::m_regionID
Gaudi::Property< unsigned int > m_regionID
Definition: FPGATrackSimEventSelectionSvc.h:73
FPGATrackSimEventSelectionSvc::setSelectedEvent
virtual void setSelectedEvent(bool s) override
Definition: FPGATrackSimEventSelectionSvc.h:68
FPGATrackSimEventSelectionSvc::m_st
SampleType m_st
Definition: FPGATrackSimEventSelectionSvc.h:91
FPGATrackSimEventSelectionSvc::m_allowHighBarcode
Gaudi::Property< bool > m_allowHighBarcode
Definition: FPGATrackSimEventSelectionSvc.h:81
AthService.h
FPGATrackSimEventSelectionSvc::getLRTpdgID
virtual int getLRTpdgID() const override
Definition: FPGATrackSimEventSelectionSvc.h:38
FPGATrackSimEventSelectionSvc::checkPU
virtual bool checkPU() const override
Definition: FPGATrackSimEventSelectionSvc.h:36
FPGATrackSimTypes.h
FPGATrackSimEventSelectionSvc::createRegions
void createRegions()
Definition: FPGATrackSimEventSelectionSvc.cxx:286
SampleType
SampleType
Definition: FPGATrackSimTypes.h:40
FPGATrackSimTrackPars.h
Structs that store the 5 track parameters.
FPGATrackSimEventSelectionSvc::m_mind0
Gaudi::Property< float > m_mind0
Definition: FPGATrackSimEventSelectionSvc.h:83
FPGATrackSimEventSelectionSvc::m_withPU
Gaudi::Property< bool > m_withPU
Definition: FPGATrackSimEventSelectionSvc.h:77
FPGATrackSimEventSelectionSvc::getRegions
virtual const FPGATrackSimRegionSlices * getRegions() override
Definition: FPGATrackSimEventSelectionSvc.cxx:280
FPGATrackSimEventSelectionSvc::m_min
FPGATrackSimTrackPars m_min
Definition: FPGATrackSimEventSelectionSvc.h:94
FPGATrackSimEventSelectionSvc::getRegionID
virtual unsigned getRegionID() const override
Definition: FPGATrackSimEventSelectionSvc.h:34