/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/TrkExpectedTrk.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: TrkExpectedTrk.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
00004 //
00005 // Description:
00006 //      Class TrkExpectedTrack Stores lists of expected hits for a given 
00007 //    set of tracks. 
00008 //
00009 // Environment:
00010 //      Software developed for Babar experiment @ Slac B-factory.
00011 //
00012 // Author List:
00013 //      Eric A Charles         UW-Madison 
00014 //
00015 //------------------------------------------------------------------------
00016 
00017 #ifndef TRKEXPECTEDTRACK_HH
00018 #define TRKEXPECTEDTRACK_HH
00019 
00020 //-------------
00021 // C Headers --
00022 //-------------
00023 extern "C" {
00024 }
00025 
00026 //---------------
00027 // C++ Headers --
00028 //---------------
00029 #include <map>
00030 #include <vector>
00031 #include <algorithm>
00032 #include <iostream>
00033 
00034 //----------------------
00035 // Base Class Headers --
00036 //----------------------
00037 
00038 //-------------------------------
00039 // Collaborating Class Headers --
00040 //-------------------------------
00041 
00042 #include "MdcRecoUtil/PdtPid.h"
00043 #include "TrkBase/TrkFitTypeKey.h"
00044 
00045 //------------------------------------
00046 // Collaborating Class Declarations --
00047 //------------------------------------
00048 
00049 class TrkRecoTrk;
00050 class TrkRep;
00051 class TrkFit;
00052 class TrkExpectedHotSet;
00053 class TrkExpectedHot;
00054 class TrkHitOnTrk;
00055 class TrkFundHit;
00056 class TrkExpectedMap;
00057 class TrkDetElemId;
00058 class GTrack;
00059 
00060 //              ---------------------
00061 //              -- Class Interface --
00062 //              ---------------------
00063 
00064 class TrkExpectedTrk {
00065 
00066 //--------------------
00067 // Instance Members --
00068 //--------------------
00069 
00070 public:
00071 
00072   // Constructor
00073   
00074   // c'tor from a track, uses the default fit unless overridden,
00075   // this also registers the expected track in the map,
00076   // finally, it sets the tracks fit type as the default type,
00077   // it does not, however, actully make the TrkExpectedHotSets
00078   TrkExpectedTrk( const TrkRecoTrk* aTrack,
00079                   const PdtPid::PidType = PdtPid::null,
00080                   const GTrack* gTrk = 0,
00081                   TrkExpectedMap* exMap = 0 );
00082 
00083   // Destructor
00084   virtual ~TrkExpectedTrk( );
00085   
00086   // Operators
00087   bool operator==( const TrkExpectedTrk& rhs ) const {
00088     return this == &rhs; 
00089   }
00090    
00091   // Selectors (const)
00092   const TrkHitOnTrk* getHot( const TrkFundHit* hit,
00093                              const TrkFitTypeKey& key ) const;
00094 
00095   const TrkRep* refRep() const{
00096     return _refRep;
00097   }
00098 
00099   const GTrack* gTrack() const {
00100     return _gTrk;
00101   }
00102 
00103   const TrkRecoTrk* track() const;
00104 
00105   // these are ways of getting the hots sets
00106   // by element id 
00107   const TrkExpectedHotSet* exHotSet( const TrkDetElemId& elemId ) const;
00108   // by hot and fund hit
00109   const TrkExpectedHotSet* exHotSet( const TrkHitOnTrk* hot ) const;
00110   const TrkExpectedHotSet* exHotSet( const TrkFundHit* hit ) const;
00111 
00112   // these are ways of getting the ex hots them-selves
00113   // by element id
00114   const TrkExpectedHot* exHot( const TrkDetElemId& elemId,
00115                                const TrkFitTypeKey key = TrkFitTypeKey(0) ) const;
00116   
00117   // by hot and fund hit
00118   const TrkExpectedHot* exHot( const TrkHitOnTrk* hot ) const;
00119   const TrkExpectedHot* exHot( const TrkFundHit* hit,
00120                                const TrkFitTypeKey key = TrkFitTypeKey(0)) const;
00121 
00122   void fillExHotSets( std::vector<TrkExpectedHotSet*>& hotSets ) const;
00123   void fillExHots( const TrkFitTypeKey& key, 
00124                   std::vector<TrkExpectedHot*>& hots ) const;
00125 
00126   // get the number of overlaps with a rep
00127   int overLap( const TrkRep* rep ) const
00128   {
00129           // FIXME: std::count doesn't work with the BaBar config of Sun WS6U1..
00130     // return std::count(_reps.begin(),_reps.end(),rep);
00131     typedef std::vector<const TrkRep*>::const_iterator i_t;
00132     int j=0;
00133     for (i_t i=_reps.begin(); i!=_reps.end();++i) {
00134             if (*i == rep) ++j;
00135     }
00136     return j;
00137   }
00138 
00139   //Accessing methods for the class private members:
00140   const std::map<TrkDetElemId, TrkExpectedHotSet*>& expectedHots() const 
00141   {
00142     return _exHotTable;
00143   }
00144 
00145   // modifiers
00146   void printFit( const TrkFitTypeKey& key, 
00147                  std::ostream& os = std::cout ) const;
00148 
00149 protected:
00150 
00151   // Helper functions
00152   // add in the un-parsed hots from a rep
00153   bool parseHotFromMap( const TrkHitOnTrk* hot, const bool fillGaps );
00154   bool parseHotSetFromMap( TrkExpectedHotSet* hotSet,
00155                            const TrkFitTypeKey& key );
00156   bool parseHotSetFromMap( TrkExpectedHotSet* hotSet );
00157   bool parseHotsFromMap( const TrkFitTypeKey& key );
00158   bool parseHotsFromMap( );
00159 
00160   const TrkRep* getRep( const TrkRecoTrk* aTrk,
00161                         const PdtPid::PidType type ) const;
00162 
00163   bool addExHotSet( const TrkDetElemId& elemId,
00164                     TrkExpectedHotSet* val );
00165 
00166 private:
00167   // friends
00168   friend class TrkExpectedHotFactory;
00169 
00170   // Data members
00171   std::vector<const TrkRep*> _reps;
00172   const TrkExpectedMap* _parentMap;
00173   std::map<TrkDetElemId,TrkExpectedHotSet*> _exHotTable;
00174   const TrkRep* _refRep;
00175   const GTrack* _gTrk;
00176 };
00177 
00178 #endif

Generated on Tue Nov 29 23:13:42 2016 for BOSS_7.0.2 by  doxygen 1.4.7