Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:45

0001 #ifndef Fireworks_Core_FWFFLooper_h
0002 #define Fireworks_Core_FWFFLooper_h
0003 
0004 #include "Fireworks/Core/interface/CmsShowMainBase.h"
0005 #include "Fireworks/FWInterface/interface/FWFFHelper.h"
0006 #include "FWCore/Framework/interface/EDLooperBase.h"
0007 #include "DataFormats/Provenance/interface/EventID.h"
0008 #include "FWCore/ServiceRegistry/interface/Service.h"
0009 #include "FWCore/Framework/interface/ESWatcher.h"
0010 #include "Fireworks/Geometry/interface/DisplayGeomRecord.h"
0011 #include <string>
0012 #include <Rtypes.h>
0013 #include <memory>
0014 
0015 namespace edm {
0016   class ParameterSet;
0017   class ActivityRegistry;
0018   class Run;
0019   class Event;
0020   class EventSetup;
0021   class ProcessingController;
0022   class ModuleChanger;
0023   class ParameterSet;
0024   class LuminosityBlockPrincipal;
0025 }  // namespace edm
0026 
0027 class FWFFNavigator;
0028 class FWFFMetadataManager;
0029 class FWPathsPopup;
0030 
0031 namespace fireworks {
0032   class Context;
0033 }
0034 
0035 class TEveManager;
0036 class TEveElement;
0037 class TEveMagField;
0038 class TEveTrackPropagator;
0039 class TRint;
0040 class TGWindow;
0041 class FWRecoGeometry;
0042 class FWRecoGeometryRecord;
0043 class RunInfo;
0044 class RunInfoRcd;
0045 class TGeoManager;
0046 class DisplayGeomRecord;
0047 
0048 class FWFFLooper : public CmsShowMainBase, public edm::EDLooperBase {
0049 public:
0050   FWFFLooper(const edm::ParameterSet &);
0051   ~FWFFLooper() override;
0052 
0053   // ---------- const member functions ---------------------
0054 
0055   // ---------- static member functions --------------------
0056 
0057   // ---------- member functions ---------------------------
0058 
0059   void attachTo(edm::ActivityRegistry &) override;
0060   void postBeginJob();
0061   void postEndJob();
0062 
0063   void beginRun(const edm::Run &, const edm::EventSetup &) override;
0064 
0065   void display(const std::string &info = "");
0066 
0067   TEveMagField *getMagField();
0068   void setupFieldForPropagator(TEveTrackPropagator *prop);
0069 
0070   void checkPosition() override;
0071   void stopPlaying() override;
0072   void autoLoadNewEvent() override;
0073 
0074   void showPathsGUI(const TGWindow *p);
0075 
0076   void quit() override;
0077 
0078   void startingNewLoop(unsigned int) override;
0079   edm::EDLooperBase::Status endOfLoop(const edm::EventSetup &, unsigned int) override;
0080   edm::EDLooperBase::Status duringLoop(const edm::Event &,
0081                                        const edm::EventSetup &,
0082                                        edm::ProcessingController &) override;
0083   void requestChanges(const std::string &, const edm::ParameterSet &);
0084 
0085   void remakeGeometry(const DisplayGeomRecord &dgRec);
0086 
0087 private:
0088   FWFFLooper(const FWFFLooper &);                   // stop default
0089   const FWFFLooper &operator=(const FWFFLooper &);  // stop default
0090 
0091   void loadDefaultGeometryFile(void);
0092 
0093   edm::Service<FWFFHelper> m_appHelper;
0094   std::unique_ptr<FWFFNavigator> m_navigator;
0095   std::unique_ptr<FWFFMetadataManager> m_metadataManager;
0096   std::unique_ptr<fireworks::Context> m_context;
0097 
0098   TEveManager *m_EveManager;
0099   TRint *m_Rint;
0100 
0101   TEveMagField *m_MagField;
0102 
0103   bool m_AllowStep;
0104   bool m_ShowEvent;
0105   bool m_firstTime;
0106   FWPathsPopup *m_pathsGUI;
0107 
0108   typedef std::map<std::string, edm::ParameterSet> ModuleChanges;
0109   ModuleChanges m_scheduledChanges;
0110   edm::EventID m_nextEventId;
0111   bool m_autoReload;
0112   bool m_isFirstEvent;
0113   bool m_isLastEvent;
0114 
0115   edm::ESWatcher<DisplayGeomRecord> m_geomWatcher;
0116   const edm::ESGetToken<FWRecoGeometry, FWRecoGeometryRecord> m_recoGeomToken;
0117   const edm::ESGetToken<RunInfo, RunInfoRcd> m_runInfoToken;
0118   const edm::ESGetToken<TGeoManager, DisplayGeomRecord> m_displayGeomToken;
0119 };
0120 
0121 #endif