Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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     static float mtdEtlR1();
0102     static float mtdEtlR2();
0103     static float mtdEtlZ1(const unsigned int& disk_number = 1);
0104     static float mtdEtlZ2(const unsigned int& disk_number = 1);
0105 
0106     Context(const Context&) = delete;                   // stop default
0107     const Context& operator=(const Context&) = delete;  // stop default
0108   private:
0109     // ---------- member data --------------------------------
0110     FWModelChangeManager* m_changeManager;
0111     FWSelectionManager* m_selectionManager;
0112     FWEventItemsManager* m_eventItemsManager;
0113     FWColorManager* m_colorManager;
0114     FWJobMetadataManager* m_metadataManager;
0115 
0116     FWGeometry* m_geom;
0117 
0118     TEveTrackPropagator* m_propagator;
0119     TEveTrackPropagator* m_trackerPropagator;
0120     TEveTrackPropagator* m_muonPropagator;
0121 
0122     FWMagField* m_magField;
0123     FWBeamSpot* m_beamSpot;
0124 
0125     CmsShowCommon* m_commonPrefs;
0126 
0127     mutable float m_maxEt;
0128     mutable float m_maxEnergy;
0129 
0130     mutable bool m_hidePFBuilders;
0131 
0132     TEveCaloDataHist* m_caloData;
0133     TEveCaloDataVec* m_caloDataHF;
0134 
0135     static Context* s_fwContext;
0136 
0137     // calo data
0138     static const float s_caloTransEta;
0139     static const float s_caloTransAngle;
0140     // simplified
0141     static const float s_caloR;
0142     static const float s_caloZ;
0143 
0144     // proxy-builder offsets
0145     static const float s_caloOffR;
0146     static const float s_caloOffZ;
0147 
0148     // mtd data
0149     static const float s_mtdEtlR1;
0150     static const float s_mtdEtlR2;
0151     static const float s_mtdEtlZ1;
0152     static const float s_mtdEtlZ2;
0153     static const float s_mtdEtlOffZ;
0154   };
0155 }  // namespace fireworks
0156 
0157 #endif