CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 

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
 

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 61 of file Context.cc.

References m_commonPrefs.

66  :
67  m_changeManager(iCM),
68  m_selectionManager(iSM),
70  m_colorManager(iColorM),
71  m_metadataManager(iJMDM),
72  m_geom(0),
73  m_propagator(0),
76  m_magField(0),
77  m_beamSpot(0),
78  m_commonPrefs(0),
79  m_maxEt(1.f),
80  m_maxEnergy(1.f),
81  m_hidePFBuilders(false),
82  m_caloData(0),
83  m_caloDataHF(0)
84 {
85  if (iColorM) // unit test
86  m_commonPrefs = new CmsShowCommon(this);
87 }
FWBeamSpot * m_beamSpot
Definition: Context.h:128
TEveTrackPropagator * m_propagator
Definition: Context.h:123
TEveCaloDataHist * m_caloData
Definition: Context.h:137
FWSelectionManager * m_selectionManager
Definition: Context.h:116
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:125
const FWGeometry * m_geom
Definition: Context.h:121
CmsShowCommon * m_commonPrefs
Definition: Context.h:130
FWMagField * m_magField
Definition: Context.h:127
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:138
double f[11][100]
FWEventItemsManager * m_eventItemsManager
Definition: Context.h:117
FWModelChangeManager * m_changeManager
Definition: Context.h:115
FWColorManager * m_colorManager
Definition: Context.h:118
bool m_hidePFBuilders
Definition: Context.h:135
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:124
FWJobMetadataManager * m_metadataManager
Definition: Context.h:119
Context::~Context ( )
virtual

Definition at line 90 of file Context.cc.

References m_commonPrefs.

91 {
92  delete m_commonPrefs;
93 }
CmsShowCommon * m_commonPrefs
Definition: Context.h:130
fireworks::Context::Context ( const Context )
private

Member Function Documentation

double Context::caloMaxEta ( )
static

Definition at line 240 of file Context.cc.

References fw3dlego::xbins_hf, and fw3dlego::xbins_hf_n.

Referenced by FWRPZViewGeometry::makeCaloOutlineRhoZ(), fireworks::makeEveJetCone(), and FWRPZView::setEtaRng().

241 {
243 }
const double xbins_hf[]
const int xbins_hf_n
float Context::caloR1 ( bool  offset = true)
static
float Context::caloR2 ( bool  offset = true)
static
float Context::caloTransAngle ( )
static

Definition at line 235 of file Context.cc.

References s_caloTransAngle.

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

236 {
237  return s_caloTransAngle;
238 }
static const float s_caloTransAngle
Definition: Context.h:142
float Context::caloTransEta ( )
static

Definition at line 230 of file Context.cc.

References s_caloTransEta.

Referenced by FWMET3DProxyBuilder::build(), FWMETProxyBuilder::buildViewType(), FWConversionProxyBuilder::requestCommon(), and FWRPZView::setEtaRng().

231 {
232  return s_caloTransEta;
233 }
static const float s_caloTransEta
Definition: Context.h:141
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 168 of file Context.cc.

169 {
170  // AMT: delete of eve-elements disabled to prevent crash on exit.
171  // A lot of eve objects use this elements (e.g. TEveCalo, TEveTrack ...)
172  // If want to have explicit delete make sure order of destruction
173  // is correct: this should be called after all scenes are destroyed.
174 }
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:128
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(), and FWLegoViewBase::setContext().

81 { return m_caloDataHF; }
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:138
FWMagField* fireworks::Context::getField ( ) const
inline
const FWGeometry* fireworks::Context::getGeom ( ) const
inline
bool fireworks::Context::getHidePFBuilders ( ) const
inline
float Context::getMaxEnergyInEvent ( bool  isEt) const

Definition at line 201 of file Context.cc.

References m_maxEnergy, and m_maxEt.

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

202 {
203  return isEt ? m_maxEt : m_maxEnergy;
204 }
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:125
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:124
TEveTrackPropagator* fireworks::Context::getTrackPropagator ( ) const
inline
void Context::initEveElements ( )

Definition at line 96 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, ntuplemaker::status, fw3dlego::xbins, fw3dlego::xbins_hf, fw3dlego::xbins_hf_n, and fw3dlego::xbins_n.

Referenced by CmsShowMainBase::setup().

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

Definition at line 54 of file Context.h.

References m_changeManager.

Referenced by FWEventItem::changeManager(), and FWGUIManager::createList().

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

Definition at line 192 of file Context.cc.

References m_maxEnergy, and m_maxEt.

Referenced by FWEveViewManager::eventBegin().

193 {
194  // should not be zero, problems with infinte bbox
195 
196  m_maxEnergy = 1.f;
197  m_maxEt = 1.f;
198 }
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, and x.

Referenced by CmsShowMainBase::loadGeometry().

51 { m_geom = x; }
const FWGeometry * m_geom
Definition: Context.h:121
Definition: DDAxes.h:10
void fireworks::Context::setHidePFBuilders ( bool  x)
inline

Definition at line 92 of file Context.h.

References m_hidePFBuilders, and x.

92 { m_hidePFBuilders = x; }
bool m_hidePFBuilders
Definition: Context.h:135
Definition: DDAxes.h:10
void Context::voteMaxEtAndEnergy ( float  Et,
float  energy 
) const

Member Data Documentation

FWBeamSpot* fireworks::Context::m_beamSpot
private

Definition at line 128 of file Context.h.

Referenced by getBeamSpot(), and initEveElements().

TEveCaloDataHist* fireworks::Context::m_caloData
private

Definition at line 137 of file Context.h.

Referenced by getCaloData(), and initEveElements().

TEveCaloDataVec* fireworks::Context::m_caloDataHF
private

Definition at line 138 of file Context.h.

Referenced by getCaloDataHF(), and initEveElements().

FWModelChangeManager* fireworks::Context::m_changeManager
private

Definition at line 115 of file Context.h.

Referenced by modelChangeManager().

FWColorManager* fireworks::Context::m_colorManager
private

Definition at line 118 of file Context.h.

Referenced by colorManager().

CmsShowCommon* fireworks::Context::m_commonPrefs
private

Definition at line 130 of file Context.h.

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

FWEventItemsManager* fireworks::Context::m_eventItemsManager
private

Definition at line 117 of file Context.h.

Referenced by eventItemsManager().

const FWGeometry* fireworks::Context::m_geom
private

Definition at line 121 of file Context.h.

Referenced by getGeom(), and setGeom().

bool fireworks::Context::m_hidePFBuilders
mutableprivate

Definition at line 135 of file Context.h.

Referenced by getHidePFBuilders(), and setHidePFBuilders().

FWMagField* fireworks::Context::m_magField
private

Definition at line 127 of file Context.h.

Referenced by getField(), and initEveElements().

float fireworks::Context::m_maxEnergy
mutableprivate

Definition at line 133 of file Context.h.

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

float fireworks::Context::m_maxEt
mutableprivate

Definition at line 132 of file Context.h.

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

FWJobMetadataManager* fireworks::Context::m_metadataManager
private

Definition at line 119 of file Context.h.

Referenced by metadataManager().

TEveTrackPropagator* fireworks::Context::m_muonPropagator
private

Definition at line 125 of file Context.h.

Referenced by getMuonTrackPropagator(), and initEveElements().

TEveTrackPropagator* fireworks::Context::m_propagator
private

Definition at line 123 of file Context.h.

Referenced by getTrackPropagator(), and initEveElements().

FWSelectionManager* fireworks::Context::m_selectionManager
private

Definition at line 116 of file Context.h.

Referenced by selectionManager().

TEveTrackPropagator* fireworks::Context::m_trackerPropagator
private

Definition at line 124 of file Context.h.

Referenced by getTrackerTrackPropagator(), and initEveElements().

const float Context::s_caloOffR = 10
staticprivate

Definition at line 148 of file Context.h.

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

Definition at line 149 of file Context.h.

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

Definition at line 144 of file Context.h.

Referenced by caloR1(), and caloR2().

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

Definition at line 142 of file Context.h.

Referenced by caloTransAngle().

const float Context::s_caloTransEta = 1.479
staticprivate

Definition at line 141 of file Context.h.

Referenced by caloTransEta().

const float Context::s_caloZ = 290
staticprivate

Definition at line 145 of file Context.h.

Referenced by caloZ1(), and caloZ2().