Skip to content

Commit

Permalink
new class roidescriptor made and input to create seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosie-Hasan committed Oct 3, 2023
1 parent 171de50 commit 776d6b2
Show file tree
Hide file tree
Showing 9 changed files with 341 additions and 27 deletions.
1 change: 1 addition & 0 deletions Core/include/Acts/Seeding/GNN_Geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ template <typename space_point_t> class TrigFTF_GNN_Geometry {

std::map<unsigned int, TrigFTF_GNN_Layer<space_point_t> *> m_layMap;
std::vector<TrigFTF_GNN_Layer<space_point_t> *> m_layArray;
//member of fastrack object m_fastrack

int m_nEtaBins;
};
Expand Down
6 changes: 4 additions & 2 deletions Core/include/Acts/Seeding/SeedFinderFTF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "Acts/Seeding/SeedFinderConfig.hpp"
#include "Acts/Seeding/SeedFinderFTFConfig.hpp"
#include "Acts/Utilities/KDTree.hpp"
#include "Acts/TrackFinding/RoiDescriptor.hpp"


#include <array>
#include <iostream>
Expand Down Expand Up @@ -55,7 +57,7 @@ class SeedFinderFTF {

void loadSpacePoints(const std::vector<FTF_SP<external_spacepoint_t>> &);

void createSeeds();
void createSeeds(const Acts::RoiDescriptor&);

// create seeeds function
template <typename input_container_t, typename output_container_t,
Expand All @@ -76,7 +78,7 @@ class SeedFinderFTF {
// config object
SeedFinderFTFConfig<external_spacepoint_t> m_config;

void runGNN_TrackFinder(std::vector<GNN_TrigTracklet<external_spacepoint_t>>&);
void runGNN_TrackFinder(std::vector<GNN_TrigTracklet<external_spacepoint_t>>&, const Acts::RoiDescriptor&);

// needs to be memeber of class so can accessed by all memeber functions
TrigFTF_GNN_DataStorage<external_spacepoint_t> *m_storage;
Expand Down
26 changes: 13 additions & 13 deletions Core/include/Acts/Seeding/SeedFinderFTF.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void SeedFinderFTF<external_spacepoint_t>::loadSpacePoints(


template <typename external_spacepoint_t>
void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_TrigTracklet<external_spacepoint_t>>& vTracks){
void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_TrigTracklet<external_spacepoint_t>>& vTracks, const Acts::RoiDescriptor& roi){
//long term move these to ftf finder config, then m_config. to access them
const int MaxEdges = 2000000;

Expand All @@ -78,8 +78,8 @@ void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_Tr
const float max_z0 = 2800; //roiDescriptor->zedPlus();

const float maxOuterRadius = 550.0;
const float cut_zMinU = min_z0 ; // + maxOuterRadius*roiDescriptor->dzdrMinus();
const float cut_zMaxU = max_z0 ;// + maxOuterRadius*roiDescriptor->dzdrPlus();
const float cut_zMinU = min_z0 + maxOuterRadius*roi.dzdrMinus(); //dzdr can only find =0 in athena
const float cut_zMaxU = max_z0 + maxOuterRadius*roi.dzdrPlus();

float m_minR_squ = 1 ; //set earlier
float m_maxCurv = 1 ;
Expand All @@ -94,7 +94,7 @@ void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_Tr
//eventually want to make elsewhere as a mmeber of config
std::ifstream ifstream(
m_config.fastrack_input_file.c_str(), std::ifstream::in);
const Acts::FasTrackConnector& conn(ifstream); //conn would be memeber of config
const Acts::FasTrackConnector& conn(ifstream); //acces from gnngeo input to function

// const FasTrackConnector& conn = *(m_config.m_fastrack);

Expand All @@ -105,10 +105,10 @@ void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_Tr

int nEdges = 0;


//gnngeo will be input to funciton
// Acts::TrigFTF_GNN_Geometry<external_spacepoint_t> GNNgeo(m_config.input_vector, &conn); //long term make gnngeo memeber of config
std::unique_ptr<Acts::TrigFTF_GNN_Geometry<external_spacepoint_t>> GNNgeo = std::make_unique<Acts::TrigFTF_GNN_Geometry<external_spacepoint_t>>(
m_config.input_vector, &conn); //everywhere GNNgeo -> m_config.m_GNNgeo
m_config.m_layerGeometry, &conn); //everywhere GNNgeo -> m_config.m_GNNgeo

/////

Expand Down Expand Up @@ -480,7 +480,7 @@ void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_Tr

// this used to be m_settings.m_layerGeometry = input_vector

TrigFTF_GNN_TrackingFilter<external_spacepoint_t> tFilter(m_config.input_vector, edgeStorage);
TrigFTF_GNN_TrackingFilter<external_spacepoint_t> tFilter(m_config.m_layerGeometry, edgeStorage);

for(auto pS : vSeeds) {

Expand Down Expand Up @@ -584,13 +584,13 @@ void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_Tr

//3. phi0 cut

// if (!roiDescriptor->isFullscan()) {
// const double uc = 2*B*pS_r - A;
// const double phi0 = std::atan2(sinA - uc*cosA, cosA + uc*sinA);
if (!roi.isFullscan()) {
const double uc = 2*B*pS_r - A;
const double phi0 = std::atan2(sinA - uc*cosA, cosA + uc*sinA);
// if ( !RoiUtil::containsPhi( *roiDescriptor, phi0 ) ) {
// continue;
// }
// }
}

//4. add new triplet

Expand Down Expand Up @@ -618,13 +618,13 @@ void SeedFinderFTF<external_spacepoint_t>::runGNN_TrackFinder(std::vector<GNN_Tr


template <typename external_spacepoint_t>
void SeedFinderFTF<external_spacepoint_t>::createSeeds(){
void SeedFinderFTF<external_spacepoint_t>::createSeeds(const Acts::RoiDescriptor& roi){

std::vector<GNN_TrigTracklet<external_spacepoint_t>> vTracks; //make empty vector

vTracks.reserve(5000);

runGNN_TrackFinder(vTracks); //returns filled vector
runGNN_TrackFinder(vTracks, roi); //returns filled vector

if(vTracks.empty()) return;

Expand Down
4 changes: 1 addition & 3 deletions Core/include/Acts/Seeding/SeedFinderFTFConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ template <typename SpacePoint> struct SeedFinderFTFConfig {
float m_nMaxPhiSlice;
bool m_useClusterWidth = false;
std::string fastrack_input_file;
std::vector<TrigInDetSiLayer> input_vector;
std::vector<TrigInDetSiLayer> m_layerGeometry; //used to be input vector
// Acts::TrigFTF_GNN_Geometry<SpacePoint> m_GNNgeo;
// std::unique_ptr<Acts::TrigFTF_GNN_Geometry<SpacePoint>> m_GNNgeo;
// Acts::FasTrackConnector m_fastrack ;
Expand All @@ -56,8 +56,6 @@ template <typename SpacePoint> struct SeedFinderFTFConfig {
unsigned int m_maxTripletBufferLength = 3 ;

//ROI:
// virtual bool isFullscan() const = 0 ;
bool isFullscan = false ;
bool containsPhi() {
return false;
//need to implement this funciton
Expand Down
Loading

0 comments on commit 776d6b2

Please sign in to comment.