Skip to content

Commit

Permalink
update making of mstorage and finer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosie-Hasan committed Aug 15, 2023
1 parent e054944 commit 39deefc
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 23 deletions.
7 changes: 4 additions & 3 deletions Core/include/Acts/Seeding/GNN_DataStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#include<map>
#include<algorithm>

#define MAX_SEG_PER_NODE 1000 //was 30
#define N_SEG_CONNS 6 //was 6

#include "Acts/Seeding/GNN_Geometry.hpp"

namespace Acts {

constexpr size_t MAX_SEG_PER_NODE = 1000; //was 30
constexpr size_t N_SEG_CONNS = 6; //was 6

template <typename space_point_t>
class TrigFTF_GNN_Node {
public:
Expand Down
2 changes: 0 additions & 2 deletions Core/include/Acts/Seeding/GNN_Geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ class TrigFTF_GNN_Geometry {

return nullptr;
}



return (*it).second;
}
Expand Down
9 changes: 9 additions & 0 deletions Core/include/Acts/Seeding/SeedFinderFTF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ class SeedFinderFTF {


//needs to be memeber of class so can accessed by all memeber functions

//trying to move geo from finder constructor to geo into here
std::ifstream input_ifstream = std::ifstream(m_config.fastrack_input_file.c_str(), std::ifstream::in) ;

FasTrackConnector input_fastrack= FasTrackConnector(input_ifstream) ;

TrigFTF_GNN_Geometry<external_spacepoint_t> mGNNgeo = TrigFTF_GNN_Geometry<external_spacepoint_t>(m_config.input_vector, &input_fastrack);


TrigFTF_GNN_DataStorage<external_spacepoint_t>* m_storage;

};
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Seeding/SeedFinderFTF.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ SeedFinderFTF<external_spacepoint_t>::SeedFinderFTF(
// "SeedFinderOrthogonal");


std::ifstream input_ifstream(m_config.fastrack_input_file.c_str(), std::ifstream::in) ;
// std::ifstream input_ifstream(m_config.fastrack_input_file.c_str(), std::ifstream::in) ;

FasTrackConnector input_fastrack(input_ifstream) ;
// FasTrackConnector input_fastrack(input_ifstream) ;

TrigFTF_GNN_Geometry<external_spacepoint_t> mGNNgeo(m_config.input_vector, &input_fastrack);
// TrigFTF_GNN_Geometry<external_spacepoint_t> mGNNgeo(m_config.input_vector, &input_fastrack);

m_storage = new TrigFTF_GNN_DataStorage(mGNNgeo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SeedingFTFAlgorithm final : public IAlgorithm {

private:
Config m_cfg;
// Acts::SeedFinderFTF<SimSpacePoint> m_seedFinder;
// std::unique_ptr<Acts::SeedFinderFTF<SimSpacePoint>> m_seedFinder;

std::vector<std::unique_ptr<ReadDataHandle<SimSpacePointContainer>>>
m_inputSpacePoints{};
Expand Down
30 changes: 17 additions & 13 deletions Examples/Algorithms/TrackFinding/src/SeedingFTFAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ActsExamples::SeedingFTFAlgorithm::SeedingFTFAlgorithm(
std::make_unique<Acts::SeedFilter<SimSpacePoint>>(
Acts::SeedFilter<SimSpacePoint>(m_cfg.seedFilterConfig));

// m_seedFinder = Acts::SeedFinderFTF<SimSpacePoint>(m_cfg.seedFinderConfig);
// 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 All @@ -88,15 +88,17 @@ ActsExamples::ProcessCode ActsExamples::SeedingFTFAlgorithm::execute(
std::vector<Acts::FTF_SP<SimSpacePoint>> FTF_spacePoints = Make_FTF_spacePoints(ctx, m_cfg.ACTS_FTF_Map);


// //loop over FTF_SP vector to plot the space points
// fstream fout;
// fout.open("FTF_SP_output.csv", ios::out | ios::app);
// for (auto sp : FTF_spacePoints){
// fout << sp.FTF_ID << ", "
// << sp.SP->z() << ", "
// << sp.SP->r()
// << "\n";
// }
//loop over FTF_SP vector to plot the space points
fstream fout;
fout.open("FTF_SP_output.csv", ios::out | ios::app);
for (auto sp : FTF_spacePoints){
int eta_mod_input = sp.combined_ID -sp.FTF_ID*1000 ;
fout << sp.FTF_ID << ", "
<< sp.SP->z() << ", "
<< sp.SP->r() << ", "
<< eta_mod_input //should hopefully be eta mod
<< "\n";
}


for (auto sp : FTF_spacePoints){
Expand All @@ -108,6 +110,7 @@ ActsExamples::ProcessCode ActsExamples::SeedingFTFAlgorithm::execute(
//this is now calling on a core algorithm
Acts::SeedFinderFTF<SimSpacePoint> finder(m_cfg.seedFinderConfig);


//need this function as create_coords is needed for seeds
std::function<std::pair<Acts::Vector3, Acts::Vector2>(
const SimSpacePoint *sp)>
Expand All @@ -118,14 +121,15 @@ ActsExamples::ProcessCode ActsExamples::SeedingFTFAlgorithm::execute(
};
//output of function needed for seed

finder.loadSpacePoints(FTF_spacePoints);

finder.loadSpacePoints(FTF_spacePoints);


//still to develop
SimSeedContainer seeds = finder.createSeeds(m_cfg.seedFinderOptions,
FTF_spacePoints, create_coordinates);


m_outputSeeds(ctx, std::move(seeds));


Expand Down
2 changes: 1 addition & 1 deletion Examples/Scripts/Python/full_chain_itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
field = acts.examples.MagneticFieldMapXyz(str(geo_dir / "bfield/ATLAS-BField-xyz.root"))
rnd = acts.examples.RandomNumbers(seed=42)

s = acts.examples.Sequencer(events=100, numThreads=-1, outputDir=str(outputDir))
s = acts.examples.Sequencer(events=100, numThreads=1, outputDir=str(outputDir)) #-1 threads is max it can do

if not ttbar_pu200:
addParticleGun(
Expand Down
Binary file added mapping/All_modules_FTF.pdf
Binary file not shown.
Binary file added mapping/FTF_spacePoints.pdf
Binary file not shown.
Binary file added mapping/FTF_spacePoints_etamod.pdf
Binary file not shown.
Binary file added mapping/FTF_spacepoints_etamod_plt.pdf
Binary file not shown.
Binary file added mapping/FTF_spacepoints_plt.pdf
Binary file not shown.

0 comments on commit 39deefc

Please sign in to comment.