Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-17 23:57:48

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<std::vector<TrackCand>> *extra_cands,
0029                        int start_seed,
0030                        int n_seeds);
0031     void begin_layer(int lay);
0032     void begin_iteration();
0033 
0034     void add_cand(int idx, const IdxChi2List &cand_info) {
0035       m_hits_to_add[idx].push_back(cand_info);
0036 
0037       m_idx_max = std::max(m_idx_max, idx);
0038     }
0039 
0040     int num_cands(int idx) { return m_hits_to_add[idx].size(); }
0041 
0042     void end_iteration();
0043     void end_layer();
0044     void end_eta_bin();
0045 
0046     void doWork(int idx);
0047 
0048     void processSeedRange(int is_beg, int is_end);
0049 
0050     // Accessor for MkFitter
0051     CombCandidate &combCandWithOriginalIndex(int idx) { return mp_event_of_comb_candidates->cand(idx); }
0052 
0053   private:
0054     int m_idx_max, m_idx_max_prev;
0055     std::vector<std::vector<IdxChi2List>> m_hits_to_add;
0056 
0057     const IterationParams *mp_iteration_params = nullptr;
0058     EventOfCombCandidates *mp_event_of_comb_candidates;
0059     std::vector<UpdateIndices> *mp_kalman_update_list;
0060     std::vector<std::vector<TrackCand>> *mp_extra_cands;
0061 
0062 #if defined(CC_TIME_ETA) or defined(CC_TIME_LAYER)
0063     double t_eta, t_lay;
0064 #endif
0065 
0066     int m_start_seed, m_n_seeds;
0067     int m_layer;
0068 
0069     // Temporary in processSeedRange(), resized/reserved  in constructor.
0070     // Size of this one is s_max_seed_range
0071     std::vector<std::vector<TrackCand>> t_cands_for_next_lay;
0072   };
0073 
0074 }  // end namespace mkfit
0075 #endif