.. _program_listing_file_larflow_PrepFlowMatchData_PrepMatchTriplets.h: Program Listing for File PrepMatchTriplets.h ============================================ |exhale_lsh| :ref:`Return to documentation for file ` (``larflow/PrepFlowMatchData/PrepMatchTriplets.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef __LARFLOW_PREP_PREPLARMATCHDATA_H__ #define __LARFLOW_PREP_PREPLARMATCHDATA_H__ #include #include "bytesobject.h" #include #include "larcv/core/DataFormat/Image2D.h" #include "larcv/core/DataFormat/EventImage2D.h" #include "larcv/core/DataFormat/EventChStatus.h" #include "larcv/core/DataFormat/IOManager.h" #include "larcv/core/Processor/ProcessBase.h" #include "larflow/LArFlowConstants/LArFlowConstants.h" #include "FlowTriples.h" #include "TH2D.h" namespace larflow { namespace prep { class PrepMatchTriplets { public: PrepMatchTriplets() {}; virtual ~PrepMatchTriplets() {}; void process( const std::vector& adc_v, const std::vector& badch_v, const float adc_threshold, const bool check_wire_interection = false ); void process( larcv::IOManager& iolcv, std::string wire_producer, std::string chstatus_producer, const float adc_threshold=10.0, const bool check_wire_intersection=false ); void make_truth_vector( const std::vector& larflow_v ); std::vector plot_sparse_images( std::string hist_stem_name ); std::vector plot_truth_images( std::string hist_stem_name ); std::vector< larcv::ImageMeta > _imgmeta_v; std::vector< std::vector< FlowTriples::PixData_t > > _sparseimg_vv; std::vector< std::vector > _triplet_v; std::vector< int > _truth_v; std::vector< std::vector > _truth_2plane_v; std::vector< float > _weight_v; std::vector< larflow::FlowDir_t > _flowdir_v; std::vector< float > _triarea_v; std::vector< std::vector > _pos_v; void clear(); // python/numpy functions, to help network interface PyObject* make_sparse_image( int plane ); // 2 plane preparation PyObject* make_2plane_match_array( larflow::FlowDir_t kdir, const int max_num_samples, const std::vector& idx_v, const int start_idx, const bool withtruth, int& nsamples ); PyObject* sample_2plane_matches( larflow::FlowDir_t kdir, const int& nsamples, int& nfilled, bool withtruth ); PyObject* get_chunk_2plane_matches( larflow::FlowDir_t kdir, const int& start_index, const int& max_num_pairs, int& last_index, int& num_pairs_filled, bool with_truth ); // Triplet preparation PyObject* make_triplet_array( const int max_num_samples, const std::vector& idx_v, const int start_idx, const bool withtruth, int& nsamples ); PyObject* sample_triplet_matches( const int& num_max_samples, int& nfilled, bool withtruth ); PyObject* get_chunk_triplet_matches( const int& start_index, const int& max_num_pairs, int& last_index, int& num_pairs_filled, bool with_truth ); PyObject* sample_hard_example_matches( const int& nsamples, const int& nhard_samples, PyObject* triplet_scores, int& nfilled, bool withtruth ); //std::vector plot_triplet_index_array( PyObject* np_index, PyObject* np_sparseimg, std::string hist_stem_name ); private: static bool _setup_numpy; }; } } #endif