Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-03 04:10:03

0001 #ifndef _FWPFTRACKUTILS_H_
0002 #define _FWPFTRACKUTILS_H_
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     ParticleFlow
0007 // Class  :     FWPFTrackSingleton, FWPFTrackUtils
0008 //
0009 // Implementation:
0010 //     <Notes on implementation>
0011 //
0012 // Original Author:  Simon Harris
0013 //       Created:    16/02/2011
0014 //
0015 
0016 // System include files
0017 #include "TEveTrack.h"
0018 #include "TEvePointSet.h"
0019 #include "TEveStraightLineSet.h"
0020 
0021 // User include files
0022 #include "Fireworks/ParticleFlow/interface/FWPFGeom.h"
0023 #include "Fireworks/ParticleFlow/interface/FWPFMaths.h"
0024 #include "Fireworks/Tracks/interface/TrackUtils.h"
0025 #include "Fireworks/Tracks/interface/estimate_field.h"
0026 #include "Fireworks/Core/interface/FWMagField.h"
0027 #include "DataFormats/TrackReco/interface/Track.h"
0028 
0029 //-----------------------------------------------------------------------------
0030 // FWPFTrackSingleton
0031 //-----------------------------------------------------------------------------
0032 /* Created as singleton because only 1 instance of propagators and magfield should be shared
0033  * between track proxybuilder classes */
0034 class FWPFTrackSingleton {
0035 public:
0036   // --------------------- Member Functions --------------------------
0037   static FWPFTrackSingleton *Instance();
0038 
0039   inline TEveTrackPropagator *getTrackerTrackPropagator() { return m_trackerTrackPropagator; }
0040   inline TEveTrackPropagator *getTrackPropagator() { return m_trackPropagator; }
0041   inline FWMagField *getField() { return m_magField; }
0042 
0043 protected:
0044   FWPFTrackSingleton(const FWPFTrackSingleton &);                   // Stop default copy constructor
0045   const FWPFTrackSingleton &operator=(const FWPFTrackSingleton &);  // Stop default assignment operator
0046 
0047   // ---------------- Constructor(s)/Destructor ----------------------
0048   FWPFTrackSingleton() { initPropagator(); }
0049   virtual ~FWPFTrackSingleton() { instanceFlag = false; }
0050 
0051 private:
0052   // --------------------- Member Functions --------------------------
0053   void initPropagator();
0054 
0055   // ----------------------- Data Members ----------------------------
0056   static FWPFTrackSingleton *pInstance;  // Pointer to instance if one exists
0057   static bool instanceFlag;
0058 
0059   TEveTrackPropagator *m_trackerTrackPropagator;
0060   TEveTrackPropagator *m_trackPropagator;
0061   FWMagField *m_magField;
0062 };
0063 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
0064 
0065 //-----------------------------------------------------------------------------
0066 // FWPFTrackUtils
0067 //-----------------------------------------------------------------------------
0068 class FWPFTrackUtils {
0069 public:
0070   // ---------------- Constructor(s)/Destructor ----------------------
0071   FWPFTrackUtils();
0072   virtual ~FWPFTrackUtils() {}
0073 
0074   // --------------------- Member Functions --------------------------
0075   TEveStraightLineSet *setupLegoTrack(const reco::Track &);
0076   TEveTrack *setupTrack(const reco::Track &);
0077   TEvePointSet *getCollisionMarkers(const TEveTrack *);
0078 
0079   FWPFTrackUtils(const FWPFTrackUtils &) = delete;                   // Stop default copy constructor
0080   const FWPFTrackUtils &operator=(const FWPFTrackUtils &) = delete;  // Stop default assignment operator
0081 
0082 private:
0083   TEveTrack *getTrack(const reco::Track &);
0084 
0085   FWPFTrackSingleton *m_singleton;
0086 };
0087 #endif
0088 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_