Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:19

0001 /**
0002  * @file trackbase/TrkrClusterHitAssoc.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Class for associating clusters to the hits that went into them
0006  */
0007 #ifndef TRACKPID_TRACKPIDASSOC_H
0008 #define TRACKPID_TRACKPIDASSOC_H
0009 
0010 #include <phool/PHObject.h>
0011 
0012 #include <iostream>          // for cout, ostream
0013 #include <map>
0014 #include <utility>           // for pair
0015 
0016 /**
0017  * @brief Class for associating particle ID categories to tracks 
0018  *
0019  * Store the associations between particle ID categories and tracks 
0020  */
0021 class TrackPidAssoc : public PHObject
0022 {
0023 public:
0024   //! typedefs for convenience
0025   typedef std::multimap<unsigned int, unsigned int> MMap;
0026   typedef MMap::iterator Iterator;
0027   typedef MMap::const_iterator ConstIterator;
0028   typedef std::pair<Iterator, Iterator> Range;
0029   typedef std::pair<ConstIterator, ConstIterator> ConstRange;
0030   //! ctor
0031   TrackPidAssoc();
0032   //! dtor
0033   virtual ~TrackPidAssoc();
0034 
0035   void Reset();
0036 
0037   void identify(std::ostream &os = std::cout) const;
0038 
0039   /**
0040    * @brief Add association between particle ID and track
0041    * @param[in] PID index
0042    * @param[in] Index of the track
0043    */
0044   void addAssoc(unsigned int pid, unsigned int trid);
0045 
0046   /**
0047    * @brief Get all the tracks associated with PID index
0048    * @param[in] pid particle id index
0049    * @param[out] Range of tracks associated with pid
0050    */
0051   ConstRange getTracks(unsigned int pid);
0052 
0053   static const unsigned int electron = 1;
0054   static const unsigned int hadron = 2;
0055 
0056 
0057 private:
0058   MMap m_map;
0059   ClassDef(TrackPidAssoc, 1);
0060 };
0061 
0062 #endif // TRACKPID_TRACKPIDASSOC_H