Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-03 04:09:57

0001 #ifndef Fireworks_Core_Context_h
0002 #define Fireworks_Core_Context_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     Context
0007 //
0008 /**\class Context Context.h Fireworks/Core/interface/Context.h
0009 
0010    Description: Central collection of all framework managers
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Tue Sep 30 14:21:45 EDT 2008
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 
0025 // forward declarations
0026 class TEveTrackPropagator;
0027 class TEveCaloDataHist;
0028 class TEveCaloDataVec;
0029 
0030 class FWModelChangeManager;
0031 class FWSelectionManager;
0032 class FWEventItemsManager;
0033 class FWColorManager;
0034 class FWJobMetadataManager;
0035 class FWMagField;
0036 class FWGeometry;
0037 class FWBeamSpot;
0038 class CmsShowCommon;
0039 
0040 namespace fireworks {
0041   class Context {
0042   public:
0043     Context(FWModelChangeManager* iCM,
0044             FWSelectionManager* iSM,
0045             FWEventItemsManager* iEM,
0046             FWColorManager* iColorM,
0047             FWJobMetadataManager* iJMDM);
0048     virtual ~Context();
0049 
0050     void setGeom(FWGeometry* x) { m_geom = x; }
0051 
0052     // ---------- const member functions ---------------------
0053     FWModelChangeManager* modelChangeManager() const { return m_changeManager; }
0054     FWSelectionManager* selectionManager() const { return m_selectionManager; }
0055 
0056     const FWEventItemsManager* eventItemsManager() const { return m_eventItemsManager; }
0057 
0058     FWColorManager* colorManager() const { return m_colorManager; }
0059 
0060     FWJobMetadataManager* metadataManager() const { return m_metadataManager; }
0061 
0062     TEveTrackPropagator* getTrackPropagator() const { return m_propagator; }
0063     TEveTrackPropagator* getTrackerTrackPropagator() const { return m_trackerPropagator; }
0064     TEveTrackPropagator* getMuonTrackPropagator() const { return m_muonPropagator; }
0065 
0066     FWMagField* getField() const { return m_magField; }
0067     FWBeamSpot* getBeamSpot() const { return m_beamSpot; }
0068 
0069     TEveCaloDataHist* getCaloData() const { return m_caloData; }
0070     TEveCaloDataVec* getCaloDataHF() const { return m_caloDataHF; }
0071 
0072     FWGeometry* getGeom() const { return m_geom; }
0073 
0074     CmsShowCommon* commonPrefs() const;
0075 
0076     float getMaxEnergyInEvent(bool isEt) const;
0077     void voteMaxEtAndEnergy(float Et, float energy) const;
0078     void resetMaxEtAndEnergy() const;
0079 
0080     bool getHidePFBuilders() const { return m_hidePFBuilders; }
0081     void setHidePFBuilders(bool x) { m_hidePFBuilders = x; }
0082 
0083     // ---------- member functions ---------------------------
0084 
0085     void initEveElements();
0086     void deleteEveElements();
0087 
0088     // ---------- static member  ---------------------------
0089 
0090     static Context* getInstance();
0091 
0092     static float caloR1(bool offset = true);
0093     static float caloR2(bool offset = true);
0094     static float caloZ1(bool offset = true);
0095     static float caloZ2(bool offset = true);
0096 
0097     static float caloTransEta();
0098     static float caloTransAngle();
0099     static double caloMaxEta();
0100 
0101     Context(const Context&) = delete;                   // stop default
0102     const Context& operator=(const Context&) = delete;  // stop default
0103   private:
0104     // ---------- member data --------------------------------
0105     FWModelChangeManager* m_changeManager;
0106     FWSelectionManager* m_selectionManager;
0107     FWEventItemsManager* m_eventItemsManager;
0108     FWColorManager* m_colorManager;
0109     FWJobMetadataManager* m_metadataManager;
0110 
0111     FWGeometry* m_geom;
0112 
0113     TEveTrackPropagator* m_propagator;
0114     TEveTrackPropagator* m_trackerPropagator;
0115     TEveTrackPropagator* m_muonPropagator;
0116 
0117     FWMagField* m_magField;
0118     FWBeamSpot* m_beamSpot;
0119 
0120     CmsShowCommon* m_commonPrefs;
0121 
0122     mutable float m_maxEt;
0123     mutable float m_maxEnergy;
0124 
0125     mutable bool m_hidePFBuilders;
0126 
0127     TEveCaloDataHist* m_caloData;
0128     TEveCaloDataVec* m_caloDataHF;
0129 
0130     static Context* s_fwContext;
0131 
0132     // calo data
0133     static const float s_caloTransEta;
0134     static const float s_caloTransAngle;
0135     // simplified
0136     static const float s_caloR;
0137     static const float s_caloZ;
0138 
0139     // proxy-builder offsets
0140     static const float s_caloOffR;
0141     static const float s_caloOffZ;
0142   };
0143 }  // namespace fireworks
0144 
0145 #endif