00001 #ifndef _FWPFTRACKUTILS_H_ 00002 #define _FWPFTRACKUTILS_H_ 00003 00004 // -*- C++ -*- 00005 // 00006 // Package: ParticleFlow 00007 // Class : FWPFTrackSingleton, FWPFTrackUtils 00008 // 00009 // Implementation: 00010 // <Notes on implementation> 00011 // 00012 // Original Author: Simon Harris 00013 // Created: 16/02/2011 00014 // 00015 00016 // System include files 00017 #include "TEveTrack.h" 00018 #include "TEvePointSet.h" 00019 #include "TEveStraightLineSet.h" 00020 00021 // User include files 00022 #include "Fireworks/ParticleFlow/interface/FWPFGeom.h" 00023 #include "Fireworks/ParticleFlow/interface/FWPFMaths.h" 00024 #include "Fireworks/Tracks/interface/TrackUtils.h" 00025 #include "Fireworks/Tracks/interface/estimate_field.h" 00026 #include "Fireworks/Core/interface/FWMagField.h" 00027 #include "DataFormats/TrackReco/interface/Track.h" 00028 00029 //----------------------------------------------------------------------------- 00030 // FWPFTrackSingleton 00031 //----------------------------------------------------------------------------- 00032 /* Created as singleton because only 1 instance of propagators and magfield should be shared 00033 * between track proxybuilder classes */ 00034 class FWPFTrackSingleton 00035 { 00036 public: 00037 // --------------------- Member Functions -------------------------- 00038 static FWPFTrackSingleton *Instance(); 00039 00040 inline TEveTrackPropagator *getTrackerTrackPropagator() { return m_trackerTrackPropagator; } 00041 inline TEveTrackPropagator *getTrackPropagator() { return m_trackPropagator; } 00042 inline FWMagField *getField() { return m_magField; } 00043 00044 protected: 00045 FWPFTrackSingleton( const FWPFTrackSingleton& ); // Stop default copy constructor 00046 const FWPFTrackSingleton& operator=( const FWPFTrackSingleton& ); // Stop default assignment operator 00047 00048 // ---------------- Constructor(s)/Destructor ---------------------- 00049 FWPFTrackSingleton(){ initPropagator(); } 00050 virtual ~FWPFTrackSingleton(){ instanceFlag = false; } 00051 00052 private: 00053 // --------------------- Member Functions -------------------------- 00054 void initPropagator(); 00055 00056 // ----------------------- Data Members ---------------------------- 00057 static FWPFTrackSingleton *pInstance; // Pointer to instance if one exists 00058 static bool instanceFlag; 00059 00060 TEveTrackPropagator *m_trackerTrackPropagator; 00061 TEveTrackPropagator *m_trackPropagator; 00062 FWMagField *m_magField; 00063 }; 00064 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_ 00065 00066 00067 //----------------------------------------------------------------------------- 00068 // FWPFTrackUtils 00069 //----------------------------------------------------------------------------- 00070 class FWPFTrackUtils 00071 { 00072 public: 00073 // ---------------- Constructor(s)/Destructor ---------------------- 00074 FWPFTrackUtils(); 00075 virtual ~FWPFTrackUtils(){} 00076 00077 // --------------------- Member Functions -------------------------- 00078 TEveStraightLineSet *setupLegoTrack( const reco::Track& ); 00079 TEveTrack *setupTrack( const reco::Track& ); 00080 TEvePointSet *getCollisionMarkers( const TEveTrack* ); 00081 00082 private: 00083 FWPFTrackUtils( const FWPFTrackUtils& ); // Stop default copy constructor 00084 const FWPFTrackUtils& operator=( const FWPFTrackUtils& ); // Stop default assignment operator 00085 00086 TEveTrack *getTrack( const reco::Track& ); 00087 00088 FWPFTrackSingleton *m_singleton; 00089 }; 00090 #endif 00091 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_