Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:18

0001 #ifndef RecoTracker_MkFitCore_src_CandCloner_h
0002 #define RecoTracker_MkFitCore_src_CandCloner_h
0003 
0004 #include "MkFinder.h"
0005 
0006 #include <vector>
0007 
0008 namespace mkfit {
0009 
0010   class IterationParams;
0011   class EventOfCombCandidates;
0012 
0013   //#define CC_TIME_LAYER
0014   //#define CC_TIME_ETA
0015 
0016   class CandCloner {
0017   public:
0018     // Maximum number of seeds processed in one call to processSeedRange()
0019     static const int s_max_seed_range = MPT_SIZE;
0020 
0021     CandCloner() { t_cands_for_next_lay.resize(s_max_seed_range); }
0022 
0023     void setup(const IterationParams &ip);
0024     void release();
0025 
0026     void begin_eta_bin(EventOfCombCandidates *e_o_ccs,
0027                        std::vector<UpdateIndices> *update_list,
0028                        std::vector<UpdateIndices> *overlap_list,
0029                        std::vector<std::vector<TrackCand>> *extra_cands,
0030                        int start_seed,
0031                        int n_seeds);
0032     void begin_layer(int lay);
0033     void begin_iteration();
0034 
0035     void add_cand(int idx, const IdxChi2List &cand_info) {
0036       m_hits_to_add[idx].push_back(cand_info);
0037 
0038       m_idx_max = std::max(m_idx_max, idx);
0039     }
0040 
0041     int num_cands(int idx) { return m_hits_to_add[idx].size(); }
0042 
0043     void end_iteration();
0044     void end_layer();
0045     void end_eta_bin();
0046 
0047     void doWork(int idx);
0048 
0049     void processSeedRange(int is_beg, int is_end);
0050 
0051     // Accessor for MkFitter
0052     CombCandidate &combCandWithOriginalIndex(int idx) { return mp_event_of_comb_candidates->cand(idx); }
0053 
0054   private:
0055     int m_idx_max, m_idx_max_prev;
0056     std::vector<std::vector<IdxChi2List>> m_hits_to_add;
0057 
0058     const IterationParams *mp_iteration_params = nullptr;
0059     EventOfCombCandidates *mp_event_of_comb_candidates;
0060     std::vector<UpdateIndices> *mp_kalman_update_list, *mp_kalman_overlap_list;
0061     std::vector<std::vector<TrackCand>> *mp_extra_cands;
0062 
0063 #if defined(CC_TIME_ETA) or defined(CC_TIME_LAYER)
0064     double t_eta, t_lay;
0065 #endif
0066 
0067     int m_start_seed, m_n_seeds;
0068     int m_layer;
0069 
0070     // Temporary in processSeedRange(), resized/reserved  in constructor.
0071     // Size of this one is s_max_seed_range
0072     std::vector<std::vector<TrackCand>> t_cands_for_next_lay;
0073   };
0074 
0075 }  // end namespace mkfit
0076 #endif