Skip to content

Commit

Permalink
moving isPixel and phi functions out of simsapcepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosie-Hasan committed Aug 17, 2023
1 parent f0a2f04 commit cc08dec
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
14 changes: 10 additions & 4 deletions Core/include/Acts/Seeding/GNN_DataStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class TrigFTF_GNN_Node {
struct CompareByPhi {

bool operator()(const TrigFTF_GNN_Node<space_point_t>* n1, const TrigFTF_GNN_Node<space_point_t>* n2) {
return n1->m_sp.phi() < n2->m_sp.phi();
// return n1->m_sp.phi() < n2->m_sp.phi();
return (std::atan(n1->m_sp.x()/n1->m_sp.y())) < (std::atan(n2->m_sp.x()/n1->m_sp.y()));


}

};
Expand Down Expand Up @@ -91,7 +94,8 @@ class TrigFTF_GNN_EtaBin {
for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {

TrigFTF_GNN_Node<space_point_t>* pN = m_vn.at(nIdx);
float phi = pN->m_sp.phi();
// float phi = pN->m_sp.phi();
float phi = (std::atan(pN->m_sp.x()/pN->m_sp.y()));
if(phi <= M_PI-dphi) continue;

m_vPhiNodes.push_back(std::pair<float, unsigned int>(phi - 2*M_PI, nIdx));
Expand All @@ -100,13 +104,15 @@ class TrigFTF_GNN_EtaBin {

for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {
TrigFTF_GNN_Node<space_point_t>* pN = m_vn.at(nIdx);
float phi = pN->m_sp.phi();
// float phi = pN->m_sp.phi();
float phi = (std::atan(pN->m_sp.x()/pN->m_sp.y()));
m_vPhiNodes.push_back(std::pair<float, unsigned int>(phi, nIdx));
}

for(unsigned int nIdx=0;nIdx<m_vn.size();nIdx++) {
TrigFTF_GNN_Node<space_point_t>* pN = m_vn.at(nIdx);
float phi = pN->m_sp.phi();
// float phi = pN->m_sp.phi();
float phi = (std::atan(pN->m_sp.x()/pN->m_sp.y()));
if(phi >= -M_PI + dphi) break;
m_vPhiNodes.push_back(std::pair<float, unsigned int>(phi + 2*M_PI, nIdx));
}
Expand Down
11 changes: 9 additions & 2 deletions Core/include/Acts/Seeding/SeedFinderFTF.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ template <typename external_spacepoint_t>
void SeedFinderFTF<external_spacepoint_t>::loadSpacePoints(const std::vector<FTF_SP<external_spacepoint_t>>& FTF_SP_vect){

for(auto& FTF_sp : FTF_SP_vect) {

bool is_Pixel = FTF_sp.SP->isPixel(); //FTF actual object then sim is pointer

bool is_Pixel ;
if (FTF_sp.SP->sourceLinks().size() == 1) { //pixels have 1 SL
is_Pixel = true ;
}
else {
is_Pixel = false ;
}
// bool is_Pixel = FTF_sp.SP->isPixel(); //FTF actual object then sim is pointer
if(!is_Pixel) continue;

m_storage->addSpacePoint(FTF_sp,(m_config.m_useClusterWidth > 0) ); //add is a funciton FTFtype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ class SeedingFTFAlgorithm final : public IAlgorithm {
//make the vector of space points with FTF Info
std::vector<Acts::FTF_SP<SimSpacePoint>> Make_FTF_spacePoints(const AlgorithmContext& ctx, std::map<std::pair<int, int>,std::pair<int, int>> map) const;
//layer numbering
// std::vector<Acts::TrigInDetSiLayer> LayerNumbering(const AlgorithmContext& ctx, std::map<std::pair<int, int>,int> map) const ;

std::vector<Acts::TrigInDetSiLayer> LayerNumbering() const ;

private:
Expand Down
8 changes: 3 additions & 5 deletions Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ ActsExamples::SeedingFTFAlgorithm::SeedingFTFAlgorithm(
Acts::SeedFilter<SimSpacePoint>(m_cfg.seedFilterConfig));


std::ifstream input_ifstream(m_cfg.seedFinderConfig.fastrack_input_file.c_str(), std::ifstream::in) ;
Acts::FasTrackConnector input_fastrack(input_ifstream) ;
// m_cfg.mGNNgeo = Acts::TrigFTF_GNN_Geometry<SimSpacePoint>(m_cfg.seedFinderConfig.input_vector, &input_fastrack);
mGNNgeo = std::make_unique<Acts::TrigFTF_GNN_Geometry<SimSpacePoint>>(m_cfg.seedFinderConfig.input_vector, &input_fastrack) ;
std::ifstream input_ifstream(m_cfg.seedFinderConfig.fastrack_input_file.c_str(), std::ifstream::in) ;
Acts::FasTrackConnector input_fastrack(input_ifstream) ;
mGNNgeo = std::make_unique<Acts::TrigFTF_GNN_Geometry<SimSpacePoint>>(m_cfg.seedFinderConfig.input_vector, &input_fastrack) ;

// m_seedFinder = std::make_unique<Acts::SeedFinderFTF<SimSpacePoint>>(m_cfg.seedFinderConfig) ;
} //this is not FTF config type because it is a meber of the algs config, which is of type FTF cofig


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,6 @@ class SimSpacePoint {
return m_validDoubleMeasurementDetails;
}

// FTF seeding needs function to say if SP is a pixel
// says pixels have 1 SL
bool isPixel() const {
if (m_sourceLinks.size() == 1) {
return true ;
}
else {
return false ;
}
}

Scalar phi() const {
return std::atan(m_y/m_x) ;

}
private:
// Global position
Scalar m_x;
Expand Down

0 comments on commit cc08dec

Please sign in to comment.