Class containing some utility functions for all things CVN. More...
#include <GCNFeatureUtils.h>
Public Member Functions | |
GCNFeatureUtils () | |
~GCNFeatureUtils () | |
int | GetTrackIDFromHit (detinfo::DetectorClocksData const &clockData, const recob::Hit &) const |
Get primary true G4 ID for hit. More... | |
std::pair< unsigned int, float > | GetClosestApproach (const recob::SpacePoint sp, const simb::MCParticle p) const |
Get closest trajectory point for true particle given reconstructed spacepoint. More... | |
unsigned int | GetSpacePointNeighbours (const recob::SpacePoint &sp, art::Event const &evt, const float rangeCut, const std::string &spLabel) const |
Get the number of neighbours within rangeCut cm of this space point. More... | |
unsigned int | GetSpacePointNeighbours (const recob::SpacePoint &sp, art::Event const &evt, const float rangeCut, const std::vector< art::Ptr< recob::SpacePoint >> &sps) const |
std::map< int, unsigned int > | GetAllNeighbours (art::Event const &evt, const float rangeCut, const std::string &spLabel) const |
std::map< int, unsigned int > | GetAllNeighbours (art::Event const &evt, const float rangeCut, const std::vector< art::Ptr< recob::SpacePoint >> &sps) const |
std::vector< std::map< int, unsigned int > > | GetNeighboursForRadii (art::Event const &evt, const std::vector< float > &rangeCuts, const std::string &spLabel) const |
Gets the number of nearest neigbours for each space point for a vector of cut values. Much more efficient that using the above functions multiple times. More... | |
std::vector< std::map< int, unsigned int > > | GetNeighboursForRadii (art::Event const &evt, const std::vector< float > &rangeCuts, const std::vector< art::Ptr< recob::SpacePoint >> &sps) const |
std::vector< std::map< int, unsigned int > > | GetNeighboursForRadii (art::Event const &evt, const std::vector< float > &rangeCuts, const std::map< unsigned int, art::Ptr< recob::SpacePoint >> &sps) const |
std::map< int, int > | GetNearestNeighbours (art::Event const &evt, const std::string &spLabel) const |
Get the nearest neighbour map for the spacepoints. Returns a map of <nose_spacepoint_id,nearest_neighbour_spacepoint_id> More... | |
std::map< int, int > | GetNearestNeighbours (art::Event const &evt, const std::vector< art::Ptr< recob::SpacePoint >> &sps) const |
std::map< int, std::pair< int, int > > | GetTwoNearestNeighbours (art::Event const &evt, const std::string &spLabel) const |
Get the two nearest neighbours to use for calcuation of angles between them and the node in question. More... | |
std::map< int, std::pair< int, int > > | GetTwoNearestNeighbours (art::Event const &evt, const std::vector< art::Ptr< recob::SpacePoint >> &sps) const |
std::map< int, std::pair< int, int > > | GetTwoNearestNeighbours (art::Event const &evt, const std::map< unsigned int, art::Ptr< recob::SpacePoint >> &sps) const |
void | GetAngleAndDotProduct (const recob::SpacePoint &baseNode, const recob::SpacePoint &n1, const recob::SpacePoint &n2, float &dotProduct, float &angle) const |
Get the angle and the dot product between the vector from the base node to its neighbours. More... | |
std::map< unsigned int, float > | GetSpacePointChargeMap (std::vector< art::Ptr< recob::SpacePoint >> const &spacePoints, std::vector< std::vector< art::Ptr< recob::Hit >>> const &sp2Hit) const |
Use the association between space points and hits to return a charge. More... | |
std::map< unsigned int, float > | GetSpacePointChargeMap (art::Event const &evt, const std::string &spLabel) const |
std::map< unsigned int, float > | GetSpacePointMeanHitRMSMap (art::Event const &evt, const std::string &spLabel) const |
std::map< unsigned int, int > | GetTrueG4ID (detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::SpacePoint >> const &spacePoints, std::vector< std::vector< art::Ptr< recob::Hit >>> const &sp2Hit) const |
Get the true G4 ID for each spacepoint using energy matching. More... | |
std::map< unsigned int, int > | GetTrueG4ID (detinfo::DetectorClocksData const &clockData, art::Event const &evt, const std::string &spLabel) const |
std::map< unsigned int, int > | GetTrueG4IDFromHits (detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::SpacePoint >> const &spacePoints, std::vector< std::vector< art::Ptr< recob::Hit >>> const &sp2Hit) const |
Get the true G4 ID for each spacepoint using energy matching. More... | |
std::map< unsigned int, int > | GetTrueG4IDFromHits (detinfo::DetectorClocksData const &clockData, art::Event const &evt, const std::string &spLabel) const |
std::map< unsigned int, int > | GetTruePDG (detinfo::DetectorClocksData const &clockData, art::Event const &evt, const std::string &spLabel, bool useAbsoluteTrackID, bool useHits) const |
Get the true pdg code for each spacepoint. More... | |
std::map< unsigned int, std::vector< float > > | Get2DFeatures (std::vector< art::Ptr< recob::SpacePoint >> const &spacePoints, std::vector< std::vector< art::Ptr< recob::Hit >>> const &sp2Hit) const |
Get 2D hit features for a given spacepoint. More... | |
std::vector< cvn::GCNGraph > | ExtractGraphsFromPixelMap (const cvn::PixelMap &pm, const float chargeThreshold) const |
Convert a pixel map into three 2D GCNGraph objects. More... | |
std::map< unsigned int, unsigned int > | Get2DGraphNeighbourMap (const cvn::GCNGraph &g, const unsigned int npixel) const |
Get the neighbours map <graph node, neighbours> for the three 2D graph in 2 box (npixel+1) around the pixel. More... | |
std::vector< float > | GetNodeGroundTruth (detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::SpacePoint >> const &spacePoints, std::vector< std::vector< art::Ptr< recob::Hit >>> const &spToHit, float distCut, std::vector< std::vector< float >> *dirTruth=nullptr) const |
Get ground truth for spacepoint deghosting graph network. More... | |
std::map< unsigned int, unsigned int > | GetParticleFlowMap (const std::set< unsigned int > &particles) const |
Get hierarchy map from set of particles. More... | |
Static Public Member Functions | |
static std::vector< ptruth > | GetParticleTree (const cvn::GCNGraph *g) |
Private Attributes | |
geoalgo::GeoAlgo | fGeoAlgo |
Class containing some utility functions for all things CVN.
Definition at line 36 of file GCNFeatureUtils.h.
cvn::GCNFeatureUtils::GCNFeatureUtils | ( | ) |
Definition at line 41 of file GCNFeatureUtils.cxx.
cvn::GCNFeatureUtils::~GCNFeatureUtils | ( | ) |
Definition at line 43 of file GCNFeatureUtils.cxx.
vector< GCNGraph > cvn::GCNFeatureUtils::ExtractGraphsFromPixelMap | ( | const cvn::PixelMap & | pm, |
const float | chargeThreshold | ||
) | const |
Convert a pixel map into three 2D GCNGraph objects.
Definition at line 542 of file GCNFeatureUtils.cxx.
std::map< unsigned int, std::vector< float > > cvn::GCNFeatureUtils::Get2DFeatures | ( | std::vector< art::Ptr< recob::SpacePoint >> const & | spacePoints, |
std::vector< std::vector< art::Ptr< recob::Hit >>> const & | sp2Hit | ||
) | const |
std::map< unsigned int, unsigned int > cvn::GCNFeatureUtils::Get2DGraphNeighbourMap | ( | const cvn::GCNGraph & | g, |
const unsigned int | npixel | ||
) | const |
Get the neighbours map <graph node, neighbours> for the three 2D graph in 2 box (npixel+1) around the pixel.
Definition at line 585 of file GCNFeatureUtils.cxx.
std::map< int, unsigned int > cvn::GCNFeatureUtils::GetAllNeighbours | ( | art::Event const & | evt, |
const float | rangeCut, | ||
const std::string & | spLabel | ||
) | const |
Get a map of the number of neighbours for each space point ID. Using this function is much less wasteful than repeated calls to the above function
Definition at line 107 of file GCNFeatureUtils.cxx.
std::map< int, unsigned int > cvn::GCNFeatureUtils::GetAllNeighbours | ( | art::Event const & | evt, |
const float | rangeCut, | ||
const std::vector< art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 118 of file GCNFeatureUtils.cxx.
void cvn::GCNFeatureUtils::GetAngleAndDotProduct | ( | const recob::SpacePoint & | baseNode, |
const recob::SpacePoint & | n1, | ||
const recob::SpacePoint & | n2, | ||
float & | dotProduct, | ||
float & | angle | ||
) | const |
Get the angle and the dot product between the vector from the base node to its neighbours.
Definition at line 306 of file GCNFeatureUtils.cxx.
pair< unsigned int, float > cvn::GCNFeatureUtils::GetClosestApproach | ( | const recob::SpacePoint | sp, |
const simb::MCParticle | p | ||
) | const |
Get closest trajectory point for true particle given reconstructed spacepoint.
Definition at line 65 of file GCNFeatureUtils.cxx.
std::map< int, int > cvn::GCNFeatureUtils::GetNearestNeighbours | ( | art::Event const & | evt, |
const std::string & | spLabel | ||
) | const |
Get the nearest neighbour map for the spacepoints. Returns a map of <nose_spacepoint_id,nearest_neighbour_spacepoint_id>
Definition at line 201 of file GCNFeatureUtils.cxx.
std::map< int, int > cvn::GCNFeatureUtils::GetNearestNeighbours | ( | art::Event const & | evt, |
const std::vector< art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 211 of file GCNFeatureUtils.cxx.
std::vector< std::map< int, unsigned int > > cvn::GCNFeatureUtils::GetNeighboursForRadii | ( | art::Event const & | evt, |
const std::vector< float > & | rangeCuts, | ||
const std::string & | spLabel | ||
) | const |
Gets the number of nearest neigbours for each space point for a vector of cut values. Much more efficient that using the above functions multiple times.
Definition at line 149 of file GCNFeatureUtils.cxx.
std::vector< std::map< int, unsigned int > > cvn::GCNFeatureUtils::GetNeighboursForRadii | ( | art::Event const & | evt, |
const std::vector< float > & | rangeCuts, | ||
const std::vector< art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 168 of file GCNFeatureUtils.cxx.
std::vector< std::map< int, unsigned int > > cvn::GCNFeatureUtils::GetNeighboursForRadii | ( | art::Event const & | evt, |
const std::vector< float > & | rangeCuts, | ||
const std::map< unsigned int, art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 159 of file GCNFeatureUtils.cxx.
std::vector< float > cvn::GCNFeatureUtils::GetNodeGroundTruth | ( | detinfo::DetectorClocksData const & | clockData, |
std::vector< art::Ptr< recob::SpacePoint >> const & | spacePoints, | ||
std::vector< std::vector< art::Ptr< recob::Hit >>> const & | spToHit, | ||
float | distCut, | ||
std::vector< std::vector< float >> * | dirTruth = nullptr |
||
) | const |
Get ground truth for spacepoint deghosting graph network.
Definition at line 639 of file GCNFeatureUtils.cxx.
std::map< unsigned int, unsigned int > cvn::GCNFeatureUtils::GetParticleFlowMap | ( | const std::set< unsigned int > & | particles | ) | const |
Get hierarchy map from set of particles.
Definition at line 779 of file GCNFeatureUtils.cxx.
|
static |
Definition at line 792 of file GCNFeatureUtils.cxx.
std::map< unsigned int, float > cvn::GCNFeatureUtils::GetSpacePointChargeMap | ( | std::vector< art::Ptr< recob::SpacePoint >> const & | spacePoints, |
std::vector< std::vector< art::Ptr< recob::Hit >>> const & | sp2Hit | ||
) | const |
Use the association between space points and hits to return a charge.
Definition at line 319 of file GCNFeatureUtils.cxx.
std::map< unsigned int, float > cvn::GCNFeatureUtils::GetSpacePointChargeMap | ( | art::Event const & | evt, |
const std::string & | spLabel | ||
) | const |
Definition at line 337 of file GCNFeatureUtils.cxx.
std::map< unsigned int, float > cvn::GCNFeatureUtils::GetSpacePointMeanHitRMSMap | ( | art::Event const & | evt, |
const std::string & | spLabel | ||
) | const |
Definition at line 358 of file GCNFeatureUtils.cxx.
unsigned int cvn::GCNFeatureUtils::GetSpacePointNeighbours | ( | const recob::SpacePoint & | sp, |
art::Event const & | evt, | ||
const float | rangeCut, | ||
const std::string & | spLabel | ||
) | const |
Get the number of neighbours within rangeCut cm of this space point.
Definition at line 90 of file GCNFeatureUtils.cxx.
unsigned int cvn::GCNFeatureUtils::GetSpacePointNeighbours | ( | const recob::SpacePoint & | sp, |
art::Event const & | evt, | ||
const float | rangeCut, | ||
const std::vector< art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 98 of file GCNFeatureUtils.cxx.
int cvn::GCNFeatureUtils::GetTrackIDFromHit | ( | detinfo::DetectorClocksData const & | clockData, |
const recob::Hit & | hit | ||
) | const |
Get primary true G4 ID for hit.
Definition at line 45 of file GCNFeatureUtils.cxx.
std::map< unsigned int, int > cvn::GCNFeatureUtils::GetTrueG4ID | ( | detinfo::DetectorClocksData const & | clockData, |
std::vector< art::Ptr< recob::SpacePoint >> const & | spacePoints, | ||
std::vector< std::vector< art::Ptr< recob::Hit >>> const & | sp2Hit | ||
) | const |
Get the true G4 ID for each spacepoint using energy matching.
Definition at line 382 of file GCNFeatureUtils.cxx.
std::map< unsigned int, int > cvn::GCNFeatureUtils::GetTrueG4ID | ( | detinfo::DetectorClocksData const & | clockData, |
art::Event const & | evt, | ||
const std::string & | spLabel | ||
) | const |
Definition at line 408 of file GCNFeatureUtils.cxx.
std::map< unsigned int, int > cvn::GCNFeatureUtils::GetTrueG4IDFromHits | ( | detinfo::DetectorClocksData const & | clockData, |
std::vector< art::Ptr< recob::SpacePoint >> const & | spacePoints, | ||
std::vector< std::vector< art::Ptr< recob::Hit >>> const & | sp2Hit | ||
) | const |
Get the true G4 ID for each spacepoint using energy matching.
Definition at line 430 of file GCNFeatureUtils.cxx.
std::map< unsigned int, int > cvn::GCNFeatureUtils::GetTrueG4IDFromHits | ( | detinfo::DetectorClocksData const & | clockData, |
art::Event const & | evt, | ||
const std::string & | spLabel | ||
) | const |
Definition at line 456 of file GCNFeatureUtils.cxx.
std::map< unsigned int, int > cvn::GCNFeatureUtils::GetTruePDG | ( | detinfo::DetectorClocksData const & | clockData, |
art::Event const & | evt, | ||
const std::string & | spLabel, | ||
bool | useAbsoluteTrackID, | ||
bool | useHits | ||
) | const |
Get the true pdg code for each spacepoint.
Definition at line 478 of file GCNFeatureUtils.cxx.
std::map< int, std::pair< int, int > > cvn::GCNFeatureUtils::GetTwoNearestNeighbours | ( | art::Event const & | evt, |
const std::string & | spLabel | ||
) | const |
Get the two nearest neighbours to use for calcuation of angles between them and the node in question.
Definition at line 241 of file GCNFeatureUtils.cxx.
std::map< int, std::pair< int, int > > cvn::GCNFeatureUtils::GetTwoNearestNeighbours | ( | art::Event const & | evt, |
const std::vector< art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 261 of file GCNFeatureUtils.cxx.
std::map< int, std::pair< int, int > > cvn::GCNFeatureUtils::GetTwoNearestNeighbours | ( | art::Event const & | evt, |
const std::map< unsigned int, art::Ptr< recob::SpacePoint >> & | sps | ||
) | const |
Definition at line 251 of file GCNFeatureUtils.cxx.
|
private |
Definition at line 122 of file GCNFeatureUtils.h.