CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/Fireworks/Core/interface/Context.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_Context_h
00002 #define Fireworks_Core_Context_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     Context
00007 //
00016 //
00017 // Original Author:  Chris Jones
00018 //         Created:  Tue Sep 30 14:21:45 EDT 2008
00019 // $Id: Context.h,v 1.22 2011/03/07 18:23:28 matevz Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 
00026 // forward declarations
00027 class TEveTrackPropagator;
00028 class TEveCaloDataHist;
00029 class TEveCaloDataVec;
00030 
00031 class FWModelChangeManager;
00032 class FWSelectionManager;
00033 class FWEventItemsManager;
00034 class FWColorManager;
00035 class FWJobMetadataManager;
00036 class FWMagField;
00037 class FWGeometry;
00038 class FWBeamSpot;
00039 class CmsShowCommon;
00040 
00041 namespace fireworks {
00042 class Context {
00043 
00044 public:
00045    Context(FWModelChangeManager* iCM,
00046            FWSelectionManager*   iSM,
00047            FWEventItemsManager*  iEM,
00048            FWColorManager*       iColorM,
00049            FWJobMetadataManager* iJMDM);
00050    virtual ~Context();
00051 
00052    void  setGeom(const FWGeometry* x) { m_geom = x; }
00053 
00054    // ---------- const member functions ---------------------
00055    FWModelChangeManager* modelChangeManager() const {
00056       return m_changeManager;
00057    }
00058    FWSelectionManager* selectionManager() const {
00059       return m_selectionManager;
00060    }
00061 
00062    const FWEventItemsManager* eventItemsManager() const {
00063       return m_eventItemsManager;
00064    }
00065       
00066    FWColorManager* colorManager() const {
00067       return m_colorManager;
00068    }
00069 
00070    FWJobMetadataManager* metadataManager() const {
00071       return m_metadataManager;
00072    }
00073 
00074    TEveTrackPropagator* getTrackPropagator()        const { return m_propagator;        }
00075    TEveTrackPropagator* getTrackerTrackPropagator() const { return m_trackerPropagator; }
00076    TEveTrackPropagator* getMuonTrackPropagator()    const { return m_muonPropagator;    }
00077 
00078    FWMagField*          getField()             const { return m_magField; }
00079    FWBeamSpot*          getBeamSpot()          const { return m_beamSpot; }
00080 
00081    TEveCaloDataHist*    getCaloData()   const { return m_caloData; }
00082    TEveCaloDataVec*     getCaloDataHF() const { return m_caloDataHF; }
00083 
00084    const  FWGeometry* getGeom()  const { return m_geom; }   
00085 
00086    CmsShowCommon* commonPrefs() const;
00087 
00088    float getMaxEnergyInEvent(bool isEt) const;
00089    void  voteMaxEtAndEnergy(float Et, float energy) const;
00090    void  resetMaxEtAndEnergy() const;
00091 
00092    // ---------- member functions ---------------------------
00093   
00094    void initEveElements();
00095    void deleteEveElements();
00096 
00097    // ---------- static member  ---------------------------
00098 
00099    static float  caloR1(bool offset = true);
00100    static float  caloR2(bool offset = true);
00101    static float  caloZ1(bool offset = true);
00102    static float  caloZ2(bool offset = true);
00103 
00104    static float  caloTransEta();
00105    static float  caloTransAngle();
00106    static double caloMaxEta();
00107 
00108 private:
00109    Context(const Context&); // stop default
00110    const Context& operator=(const Context&); // stop default
00111 
00112    // ---------- member data --------------------------------
00113    FWModelChangeManager *m_changeManager;
00114    FWSelectionManager   *m_selectionManager;
00115    FWEventItemsManager  *m_eventItemsManager;
00116    FWColorManager       *m_colorManager;
00117    FWJobMetadataManager *m_metadataManager;
00118 
00119    const FWGeometry     *m_geom;
00120 
00121    TEveTrackPropagator  *m_propagator;
00122    TEveTrackPropagator  *m_trackerPropagator;
00123    TEveTrackPropagator  *m_muonPropagator;
00124 
00125    FWMagField           *m_magField;
00126    FWBeamSpot           *m_beamSpot;
00127 
00128    CmsShowCommon        *m_commonPrefs;
00129 
00130    mutable float                 m_maxEt;
00131    mutable float                 m_maxEnergy;
00132 
00133    TEveCaloDataHist     *m_caloData;
00134    TEveCaloDataVec      *m_caloDataHF;
00135 
00136    // calo data
00137    static const float s_caloTransEta;
00138    static const float s_caloTransAngle;
00139    // simplified 
00140    static const float s_caloR; 
00141    static const float s_caloZ;
00142 
00143    // proxy-builder offsets
00144    static const float s_caloOffR;
00145    static const float s_caloOffZ;
00146 };
00147 }
00148 
00149 #endif