CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
fireworks::Context Class Reference

#include <Context.h>

Public Member Functions

FWColorManagercolorManager () const
 
CmsShowCommoncommonPrefs () const
 
 Context (FWModelChangeManager *iCM, FWSelectionManager *iSM, FWEventItemsManager *iEM, FWColorManager *iColorM, FWJobMetadataManager *iJMDM)
 
void deleteEveElements ()
 
const FWEventItemsManagereventItemsManager () const
 
FWBeamSpotgetBeamSpot () const
 
TEveCaloDataHist * getCaloData () const
 
TEveCaloDataVec * getCaloDataHF () const
 
FWMagFieldgetField () const
 
const FWGeometrygetGeom () const
 
bool getHidePFBuilders () const
 
float getMaxEnergyInEvent (bool isEt) const
 
TEveTrackPropagator * getMuonTrackPropagator () const
 
TEveTrackPropagator * getTrackerTrackPropagator () const
 
TEveTrackPropagator * getTrackPropagator () const
 
void initEveElements ()
 
FWJobMetadataManagermetadataManager () const
 
FWModelChangeManagermodelChangeManager () const
 
void resetMaxEtAndEnergy () const
 
FWSelectionManagerselectionManager () const
 
void setGeom (const FWGeometry *x)
 
void setHidePFBuilders (bool x)
 
void voteMaxEtAndEnergy (float Et, float energy) const
 
virtual ~Context ()
 

Static Public Member Functions

static double caloMaxEta ()
 
static float caloR1 (bool offset=true)
 
static float caloR2 (bool offset=true)
 
static float caloTransAngle ()
 
static float caloTransEta ()
 
static float caloZ1 (bool offset=true)
 
static float caloZ2 (bool offset=true)
 
static ContextgetInstance ()
 

Private Member Functions

 Context (const Context &)
 
const Contextoperator= (const Context &)
 

Private Attributes

FWBeamSpotm_beamSpot
 
TEveCaloDataHist * m_caloData
 
TEveCaloDataVec * m_caloDataHF
 
FWModelChangeManagerm_changeManager
 
FWColorManagerm_colorManager
 
CmsShowCommonm_commonPrefs
 
FWEventItemsManagerm_eventItemsManager
 
const FWGeometrym_geom
 
bool m_hidePFBuilders
 
FWMagFieldm_magField
 
float m_maxEnergy
 
float m_maxEt
 
FWJobMetadataManagerm_metadataManager
 
TEveTrackPropagator * m_muonPropagator
 
TEveTrackPropagator * m_propagator
 
FWSelectionManagerm_selectionManager
 
TEveTrackPropagator * m_trackerPropagator
 

Static Private Attributes

static const float s_caloOffR = 10
 
static const float s_caloOffZ = s_caloOffR/tan(s_caloTransAngle)
 
static const float s_caloR = s_caloZ*tan(s_caloTransAngle)
 
static const float s_caloTransAngle = 2*atan(exp(-s_caloTransEta))
 
static const float s_caloTransEta = 1.479
 
static const float s_caloZ = 290
 
static Contexts_fwContext = NULL
 

Detailed Description

Definition at line 41 of file Context.h.

Constructor & Destructor Documentation

Context::Context ( FWModelChangeManager iCM,
FWSelectionManager iSM,
FWEventItemsManager iEM,
FWColorManager iColorM,
FWJobMetadataManager iJMDM 
)

Definition at line 57 of file Context.cc.

References m_commonPrefs, and s_fwContext.

Referenced by setHidePFBuilders().

62  :
63  m_changeManager(iCM),
64  m_selectionManager(iSM),
66  m_colorManager(iColorM),
67  m_metadataManager(iJMDM),
68  m_geom(0),
69  m_propagator(0),
72  m_magField(0),
73  m_beamSpot(0),
74  m_commonPrefs(0),
75  m_maxEt(1.f),
76  m_maxEnergy(1.f),
77  m_hidePFBuilders(false),
78  m_caloData(0),
79  m_caloDataHF(0)
80 {
81  if (iColorM) // unit test
82  m_commonPrefs = new CmsShowCommon(this);
83 
84  s_fwContext = this;
85 }
FWBeamSpot * m_beamSpot
Definition: Context.h:130
TEveTrackPropagator * m_propagator
Definition: Context.h:125
TEveCaloDataHist * m_caloData
Definition: Context.h:139
FWSelectionManager * m_selectionManager
Definition: Context.h:118
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:127
const FWGeometry * m_geom
Definition: Context.h:123
CmsShowCommon * m_commonPrefs
Definition: Context.h:132
static Context * s_fwContext
Definition: Context.h:142
FWMagField * m_magField
Definition: Context.h:129
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:140
double f[11][100]
FWEventItemsManager * m_eventItemsManager
Definition: Context.h:119
FWModelChangeManager * m_changeManager
Definition: Context.h:117
FWColorManager * m_colorManager
Definition: Context.h:120
bool m_hidePFBuilders
Definition: Context.h:137
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:126
FWJobMetadataManager * m_metadataManager
Definition: Context.h:121
Context::~Context ( )
virtual

Definition at line 88 of file Context.cc.

References m_commonPrefs.

89 {
90  delete m_commonPrefs;
91 }
CmsShowCommon * m_commonPrefs
Definition: Context.h:132
fireworks::Context::Context ( const Context )
private

Member Function Documentation

double Context::caloMaxEta ( )
static
float Context::caloR1 ( bool  offset = true)
static
float Context::caloR2 ( bool  offset = true)
static
float Context::caloTransAngle ( )
static

Definition at line 233 of file Context.cc.

References s_caloTransAngle.

Referenced by FWTauProxyBuilderBase::buildBaseTau(), fireworks::makeEveJetCone(), fireworks::makeRhoZSuperCluster(), and setHidePFBuilders().

234 {
235  return s_caloTransAngle;
236 }
static const float s_caloTransAngle
Definition: Context.h:146
float Context::caloTransEta ( )
static
float Context::caloZ1 ( bool  offset = true)
static
float Context::caloZ2 ( bool  offset = true)
static
FWColorManager* fireworks::Context::colorManager ( ) const
inline
CmsShowCommon * Context::commonPrefs ( ) const
void Context::deleteEveElements ( )

Definition at line 166 of file Context.cc.

Referenced by setHidePFBuilders().

167 {
168  // AMT: delete of eve-elements disabled to prevent crash on exit.
169  // A lot of eve objects use this elements (e.g. TEveCalo, TEveTrack ...)
170  // If want to have explicit delete make sure order of destruction
171  // is correct: this should be called after all scenes are destroyed.
172 }
const FWEventItemsManager* fireworks::Context::eventItemsManager ( ) const
inline
FWBeamSpot* fireworks::Context::getBeamSpot ( ) const
inline

Definition at line 78 of file Context.h.

References m_beamSpot.

Referenced by FWConvTrackHitsDetailView::build(), CmsShowMainBase::draw(), FWRPZView::eventBegin(), and FWRPZView::resetOrigin().

78 { return m_beamSpot; }
FWBeamSpot * m_beamSpot
Definition: Context.h:130
TEveCaloDataHist* fireworks::Context::getCaloData ( ) const
inline
TEveCaloDataVec* fireworks::Context::getCaloDataHF ( ) const
inline

Definition at line 81 of file Context.h.

References m_caloDataHF.

Referenced by FWHFTowerProxyBuilderBase::setCaloData(), FWHGTowerProxyBuilderBase::setCaloData(), and FWLegoViewBase::setContext().

81 { return m_caloDataHF; }
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:140
FWMagField* fireworks::Context::getField ( ) const
inline

Definition at line 77 of file Context.h.

References m_magField.

Referenced by FWTrackProxyBuilder::build(), FWMuonBuilder::buildMuon(), CmsShowMainBase::draw(), and CmsShowMain::fileChangedSlot().

77 { return m_magField; }
FWMagField * m_magField
Definition: Context.h:129
const FWGeometry* fireworks::Context::getGeom ( ) const
inline
bool fireworks::Context::getHidePFBuilders ( ) const
inline
Context * Context::getInstance ( )
static

Definition at line 243 of file Context.cc.

References s_fwContext.

Referenced by fireworks::pixelLocalX(), fireworks::pixelLocalY(), and setHidePFBuilders().

244 {
245  return s_fwContext;
246 }
static Context * s_fwContext
Definition: Context.h:142
float Context::getMaxEnergyInEvent ( bool  isEt) const

Definition at line 199 of file Context.cc.

References m_maxEnergy, and m_maxEt.

Referenced by FWPFCandidateDetailView::addHits(), getGeom(), FWJetProxyBuilder::setTextPos(), and FWEveView::setupEnergyScale().

200 {
201  return isEt ? m_maxEt : m_maxEnergy;
202 }
TEveTrackPropagator* fireworks::Context::getMuonTrackPropagator ( ) const
inline

Definition at line 75 of file Context.h.

References m_muonPropagator.

Referenced by FWMuonBuilder::buildMuon(), CmsShowCommon::setDrawBreakMarkers(), and CmsShowCommon::setTrackBreakMode().

75 { return m_muonPropagator; }
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:127
TEveTrackPropagator* fireworks::Context::getTrackerTrackPropagator ( ) const
inline

Definition at line 74 of file Context.h.

References m_trackerPropagator.

Referenced by FWTrackProxyBuilder::build(), CmsShowCommon::setDrawBreakMarkers(), and CmsShowCommon::setTrackBreakMode().

74 { return m_trackerPropagator; }
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:126
TEveTrackPropagator* fireworks::Context::getTrackPropagator ( ) const
inline
void Context::initEveElements ( )

Definition at line 94 of file Context.cc.

References caloR1(), caloR2(), caloZ1(), caloZ2(), f, CmsShowCommon::getProjTrackBreaking(), CmsShowCommon::getRnrPTBMarkers(), m_beamSpot, m_caloData, m_caloDataHF, m_commonPrefs, m_magField, m_muonPropagator, m_propagator, m_trackerPropagator, Pi, mps_update::status, fw3dlego::xbins, fw3dlego::xbins_hf, fw3dlego::xbins_hf_n, and fw3dlego::xbins_n.

Referenced by setHidePFBuilders(), and CmsShowMainBase::setup().

95 {
96  m_magField = new FWMagField();
97  m_beamSpot = new FWBeamSpot();
98 
99 
100  float propagatorOffR = 5;
101  float propagatorOffZ = propagatorOffR*caloZ1(false)/caloR1(false);
102 
103  // common propagator, helix stepper
104  m_propagator = new TEveTrackPropagator();
105  m_propagator->SetMagFieldObj(m_magField, false);
106  m_propagator->SetMaxR(caloR2()-propagatorOffR);
107  m_propagator->SetMaxZ(caloZ2()-propagatorOffZ);
108  m_propagator->SetDelta(0.01);
109  m_propagator->SetProjTrackBreaking(m_commonPrefs->getProjTrackBreaking());
110  m_propagator->SetRnrPTBMarkers(m_commonPrefs->getRnrPTBMarkers());
111  m_propagator->IncDenyDestroy();
112  // tracker propagator
113  m_trackerPropagator = new TEveTrackPropagator();
114  m_trackerPropagator->SetStepper( TEveTrackPropagator::kRungeKutta );
115  m_trackerPropagator->SetMagFieldObj(m_magField, false);
116  m_trackerPropagator->SetDelta(0.01);
117  m_trackerPropagator->SetMaxR(caloR1()-propagatorOffR);
118  m_trackerPropagator->SetMaxZ(caloZ2()-propagatorOffZ);
119  m_trackerPropagator->SetProjTrackBreaking(m_commonPrefs->getProjTrackBreaking());
120  m_trackerPropagator->SetRnrPTBMarkers(m_commonPrefs->getRnrPTBMarkers());
121  m_trackerPropagator->IncDenyDestroy();
122  // muon propagator
123  m_muonPropagator = new TEveTrackPropagator();
124  m_muonPropagator->SetStepper( TEveTrackPropagator::kRungeKutta );
125  m_muonPropagator->SetMagFieldObj(m_magField, false);
126  m_muonPropagator->SetDelta(0.05);
127  m_muonPropagator->SetMaxR(850.f);
128  m_muonPropagator->SetMaxZ(1100.f);
129  m_muonPropagator->SetProjTrackBreaking(m_commonPrefs->getProjTrackBreaking());
130  m_muonPropagator->SetRnrPTBMarkers(m_commonPrefs->getRnrPTBMarkers());
131  m_muonPropagator->IncDenyDestroy();
132 
133  // general calo data
134  {
135  m_caloData = new TEveCaloDataHist();
136  m_caloData->IncDenyDestroy();
137 
138  // Phi range is always in the (-Pi, Pi) without a shift.
139  // Set wrap to false for the optimisation on TEveCaloData::GetCellList().
140  m_caloData->SetWrapTwoPi(false);
141 
142  Bool_t status = TH1::AddDirectoryStatus();
143  TH1::AddDirectory(kFALSE); //Keeps histogram from going into memory
144  TH2F* dummy = new TH2F("background",
145  "background",
147  72, -1*TMath::Pi(), TMath::Pi());
148 
149  TH1::AddDirectory(status);
150  Int_t sliceIndex = m_caloData->AddHistogram(dummy);
151  (m_caloData)->RefSliceInfo(sliceIndex).Setup("background", 0., 0);
152  }
153  // HF calo data
154  {
155  m_caloDataHF = new TEveCaloDataVec(1);
156  m_caloDataHF->IncDenyDestroy();
157  m_caloDataHF->SetWrapTwoPi(false);
158  m_caloDataHF->RefSliceInfo(0).Setup("bg", 0.3, kRed);
159  m_caloDataHF->SetEtaBins(new TAxis(fw3dlego::xbins_hf_n - 1, fw3dlego::xbins_hf));
160  Double_t off = 10 * TMath::DegToRad();
161  m_caloDataHF->SetPhiBins(new TAxis(36, -TMath::Pi() -off, TMath::Pi() -off));
162  }
163 }
const double Pi
FWBeamSpot * m_beamSpot
Definition: Context.h:130
TEveTrackPropagator * m_propagator
Definition: Context.h:125
bool getRnrPTBMarkers() const
Definition: CmsShowCommon.h:77
const double xbins[]
TEveCaloDataHist * m_caloData
Definition: Context.h:139
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:127
static float caloZ2(bool offset=true)
Definition: Context.cc:223
CmsShowCommon * m_commonPrefs
Definition: Context.h:132
static float caloR2(bool offset=true)
Definition: Context.cc:213
UChar_t getProjTrackBreaking() const
Definition: CmsShowCommon.h:76
FWMagField * m_magField
Definition: Context.h:129
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:140
static float caloR1(bool offset=true)
Definition: Context.cc:208
double f[11][100]
const int xbins_n
const double xbins_hf[]
static float caloZ1(bool offset=true)
Definition: Context.cc:218
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:126
const int xbins_hf_n
FWJobMetadataManager* fireworks::Context::metadataManager ( ) const
inline

Definition at line 69 of file Context.h.

References m_metadataManager.

Referenced by FWGUIManager::addData(), FWDetailViewManager::findViewersFor(), and CmsShowNavigator::getProcessList().

69  {
70  return m_metadataManager;
71  }
FWJobMetadataManager * m_metadataManager
Definition: Context.h:121
FWModelChangeManager* fireworks::Context::modelChangeManager ( ) const
inline

Definition at line 54 of file Context.h.

References m_changeManager.

Referenced by FWGUIManager::createList().

54  {
55  return m_changeManager;
56  }
FWModelChangeManager * m_changeManager
Definition: Context.h:117
const Context& fireworks::Context::operator= ( const Context )
private

Referenced by setHidePFBuilders().

void Context::resetMaxEtAndEnergy ( ) const

Definition at line 190 of file Context.cc.

References m_maxEnergy, and m_maxEt.

Referenced by FWEveViewManager::eventBegin(), and getGeom().

191 {
192  // should not be zero, problems with infinte bbox
193 
194  m_maxEnergy = 1.f;
195  m_maxEt = 1.f;
196 }
FWSelectionManager* fireworks::Context::selectionManager ( ) const
inline
void fireworks::Context::setGeom ( const FWGeometry x)
inline

Definition at line 51 of file Context.h.

References m_geom.

Referenced by CmsShowMainBase::loadGeometry().

51 { m_geom = x; }
const FWGeometry * m_geom
Definition: Context.h:123
void fireworks::Context::setHidePFBuilders ( bool  x)
inline
void Context::voteMaxEtAndEnergy ( float  Et,
float  energy 
) const

Member Data Documentation

FWBeamSpot* fireworks::Context::m_beamSpot
private

Definition at line 130 of file Context.h.

Referenced by getBeamSpot(), and initEveElements().

TEveCaloDataHist* fireworks::Context::m_caloData
private

Definition at line 139 of file Context.h.

Referenced by getCaloData(), and initEveElements().

TEveCaloDataVec* fireworks::Context::m_caloDataHF
private

Definition at line 140 of file Context.h.

Referenced by getCaloDataHF(), and initEveElements().

FWModelChangeManager* fireworks::Context::m_changeManager
private

Definition at line 117 of file Context.h.

Referenced by modelChangeManager().

FWColorManager* fireworks::Context::m_colorManager
private

Definition at line 120 of file Context.h.

Referenced by colorManager().

CmsShowCommon* fireworks::Context::m_commonPrefs
private

Definition at line 132 of file Context.h.

Referenced by commonPrefs(), Context(), initEveElements(), and ~Context().

FWEventItemsManager* fireworks::Context::m_eventItemsManager
private

Definition at line 119 of file Context.h.

Referenced by eventItemsManager().

const FWGeometry* fireworks::Context::m_geom
private

Definition at line 123 of file Context.h.

Referenced by getGeom(), and setGeom().

bool fireworks::Context::m_hidePFBuilders
mutableprivate

Definition at line 137 of file Context.h.

Referenced by getHidePFBuilders(), and setHidePFBuilders().

FWMagField* fireworks::Context::m_magField
private

Definition at line 129 of file Context.h.

Referenced by getField(), and initEveElements().

float fireworks::Context::m_maxEnergy
mutableprivate

Definition at line 135 of file Context.h.

Referenced by getMaxEnergyInEvent(), resetMaxEtAndEnergy(), and voteMaxEtAndEnergy().

float fireworks::Context::m_maxEt
mutableprivate

Definition at line 134 of file Context.h.

Referenced by getMaxEnergyInEvent(), resetMaxEtAndEnergy(), and voteMaxEtAndEnergy().

FWJobMetadataManager* fireworks::Context::m_metadataManager
private

Definition at line 121 of file Context.h.

Referenced by metadataManager().

TEveTrackPropagator* fireworks::Context::m_muonPropagator
private

Definition at line 127 of file Context.h.

Referenced by getMuonTrackPropagator(), and initEveElements().

TEveTrackPropagator* fireworks::Context::m_propagator
private

Definition at line 125 of file Context.h.

Referenced by getTrackPropagator(), and initEveElements().

FWSelectionManager* fireworks::Context::m_selectionManager
private

Definition at line 118 of file Context.h.

Referenced by selectionManager().

TEveTrackPropagator* fireworks::Context::m_trackerPropagator
private

Definition at line 126 of file Context.h.

Referenced by getTrackerTrackPropagator(), and initEveElements().

const float Context::s_caloOffR = 10
staticprivate

Definition at line 152 of file Context.h.

const float Context::s_caloOffZ = s_caloOffR/tan(s_caloTransAngle)
staticprivate

Definition at line 153 of file Context.h.

const float Context::s_caloR = s_caloZ*tan(s_caloTransAngle)
staticprivate

Definition at line 148 of file Context.h.

Referenced by caloR1(), and caloR2().

const float Context::s_caloTransAngle = 2*atan(exp(-s_caloTransEta))
staticprivate

Definition at line 146 of file Context.h.

Referenced by caloTransAngle().

const float Context::s_caloTransEta = 1.479
staticprivate

Definition at line 145 of file Context.h.

Referenced by caloTransEta().

const float Context::s_caloZ = 290
staticprivate

Definition at line 149 of file Context.h.

Referenced by caloZ1(), and caloZ2().

Context * Context::s_fwContext = NULL
staticprivate

Definition at line 142 of file Context.h.

Referenced by Context(), and getInstance().