File indexing completed on 2026-08-31 08:14:23
0001
0002
0003 #ifndef SILICONSEEDGEOACCEPTANCE_H
0004 #define SILICONSEEDGEOACCEPTANCE_H
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <memory>
0009 #include <string>
0010 #include <vector>
0011
0012 class ActsGeometry;
0013 class PHCompositeNode;
0014 class TFile;
0015 class TH2D;
0016
0017 namespace Acts
0018 {
0019 class Surface;
0020 }
0021
0022 class SiliconSeedGeoAcceptance : public SubsysReco
0023 {
0024 public:
0025 SiliconSeedGeoAcceptance(const std::string &name = "SiliconSeedGeoAcceptance");
0026 ~SiliconSeedGeoAcceptance() override = default;
0027
0028 int InitRun(PHCompositeNode *topNode) override;
0029 int process_event(PHCompositeNode *topNode) override;
0030 int End(PHCompositeNode *topNode) override;
0031
0032 void setOutputFile(const std::string &filename) { m_outputFilename = filename; }
0033 void setEtaRange(int nbins, float lo, float hi)
0034 {
0035 m_etaBins = nbins;
0036 m_etaLo = lo;
0037 m_etaHi = hi;
0038 }
0039 void setVtxZRange(int nbins, float lo, float hi)
0040 {
0041 m_vtxZBins = nbins;
0042 m_vtxZLo = lo;
0043 m_vtxZHi = hi;
0044 }
0045 void setRaysPerBin(int n) { m_raysPerBin = n; }
0046 void setRandomSeed(unsigned int seed) { m_randomSeed = seed; }
0047 void setBeamSpot(float x, float y)
0048 {
0049 m_beamSpotX = x;
0050 m_beamSpotY = y;
0051 }
0052
0053 private:
0054 static constexpr int m_nMvtxLayerCounts = 4;
0055 static constexpr int m_nInttLayerCounts = 5;
0056
0057 void countLayers(double eta, double phi, double vtxZ, int &nMvtx, int &nIntt) const;
0058
0059 ActsGeometry *m_tGeometry = nullptr;
0060 TFile *m_outputFile = nullptr;
0061 TH2D *m_hA[m_nMvtxLayerCounts][m_nInttLayerCounts] = {};
0062 TH2D *m_hN = nullptr;
0063
0064 std::vector<unsigned int> m_surfaceLayers;
0065 std::vector<double> m_surfacePhis;
0066 std::vector<std::shared_ptr<const Acts::Surface>> m_surfaces;
0067
0068 std::string m_outputFilename = "geoacc.root";
0069 int m_etaBins = 80;
0070 float m_etaLo = -2.0;
0071 float m_etaHi = 2.0;
0072 int m_vtxZBins = 20;
0073 float m_vtxZLo = -10.0;
0074 float m_vtxZHi = 10.0;
0075 int m_raysPerBin = 10000;
0076 unsigned int m_randomSeed = 12345;
0077 float m_beamSpotX = 0.0;
0078 float m_beamSpotY = 0.0;
0079 };
0080
0081 #endif