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
 
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 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
 
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_caloData(0),
82  m_caloDataHF(0)
83 {
84  if (iColorM) // unit test
85  m_commonPrefs = new CmsShowCommon(this);
86 }
FWBeamSpot * m_beamSpot
Definition: Context.h:125
TEveTrackPropagator * m_propagator
Definition: Context.h:120
TEveCaloDataHist * m_caloData
Definition: Context.h:132
FWSelectionManager * m_selectionManager
Definition: Context.h:113
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:122
const FWGeometry * m_geom
Definition: Context.h:118
CmsShowCommon * m_commonPrefs
Definition: Context.h:127
FWMagField * m_magField
Definition: Context.h:124
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:133
double f[11][100]
FWEventItemsManager * m_eventItemsManager
Definition: Context.h:114
FWModelChangeManager * m_changeManager
Definition: Context.h:112
FWColorManager * m_colorManager
Definition: Context.h:115
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:121
FWJobMetadataManager * m_metadataManager
Definition: Context.h:116
Context::~Context ( )
virtual

Definition at line 89 of file Context.cc.

References m_commonPrefs.

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

Member Function Documentation

double Context::caloMaxEta ( )
static

Definition at line 239 of file Context.cc.

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

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

240 {
242 }
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 234 of file Context.cc.

References s_caloTransAngle.

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

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

Definition at line 229 of file Context.cc.

References s_caloTransEta.

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

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

168 {
169  // AMT: delete of eve-elements disabled to prevent crash on exit.
170  // A lot of eve objects use this elements (e.g. TEveCalo, TEveTrack ...)
171  // If want to have explicit delete make sure order of destruction
172  // is correct: this should be called after all scenes are destroyed.
173 }
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:125
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:133
FWMagField* fireworks::Context::getField ( ) const
inline

Definition at line 77 of file Context.h.

References m_magField.

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

77 { return m_magField; }
FWMagField * m_magField
Definition: Context.h:124
const FWGeometry* fireworks::Context::getGeom ( ) const
inline
float Context::getMaxEnergyInEvent ( bool  isEt) const

Definition at line 200 of file Context.cc.

References m_maxEnergy, and m_maxEt.

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

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

Definition at line 95 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().

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

69  {
70  return m_metadataManager;
71  }
FWJobMetadataManager * m_metadataManager
Definition: Context.h:116
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:112
const Context& fireworks::Context::operator= ( const Context )
private
void Context::resetMaxEtAndEnergy ( ) const

Definition at line 191 of file Context.cc.

References m_maxEnergy, and m_maxEt.

Referenced by FWEveViewManager::eventBegin().

192 {
193  // should not be zero, problems with infinte bbox
194 
195  m_maxEnergy = 1.f;
196  m_maxEt = 1.f;
197 }
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:118
Definition: DDAxes.h:10
void Context::voteMaxEtAndEnergy ( float  Et,
float  energy 
) const

Member Data Documentation

FWBeamSpot* fireworks::Context::m_beamSpot
private

Definition at line 125 of file Context.h.

Referenced by getBeamSpot(), and initEveElements().

TEveCaloDataHist* fireworks::Context::m_caloData
private

Definition at line 132 of file Context.h.

Referenced by getCaloData(), and initEveElements().

TEveCaloDataVec* fireworks::Context::m_caloDataHF
private

Definition at line 133 of file Context.h.

Referenced by getCaloDataHF(), and initEveElements().

FWModelChangeManager* fireworks::Context::m_changeManager
private

Definition at line 112 of file Context.h.

Referenced by modelChangeManager().

FWColorManager* fireworks::Context::m_colorManager
private

Definition at line 115 of file Context.h.

Referenced by colorManager().

CmsShowCommon* fireworks::Context::m_commonPrefs
private

Definition at line 127 of file Context.h.

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

FWEventItemsManager* fireworks::Context::m_eventItemsManager
private

Definition at line 114 of file Context.h.

Referenced by eventItemsManager().

const FWGeometry* fireworks::Context::m_geom
private

Definition at line 118 of file Context.h.

Referenced by getGeom(), and setGeom().

FWMagField* fireworks::Context::m_magField
private

Definition at line 124 of file Context.h.

Referenced by getField(), and initEveElements().

float fireworks::Context::m_maxEnergy
mutableprivate

Definition at line 130 of file Context.h.

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

float fireworks::Context::m_maxEt
mutableprivate

Definition at line 129 of file Context.h.

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

FWJobMetadataManager* fireworks::Context::m_metadataManager
private

Definition at line 116 of file Context.h.

Referenced by metadataManager().

TEveTrackPropagator* fireworks::Context::m_muonPropagator
private

Definition at line 122 of file Context.h.

Referenced by getMuonTrackPropagator(), and initEveElements().

TEveTrackPropagator* fireworks::Context::m_propagator
private

Definition at line 120 of file Context.h.

Referenced by getTrackPropagator(), and initEveElements().

FWSelectionManager* fireworks::Context::m_selectionManager
private

Definition at line 113 of file Context.h.

Referenced by selectionManager().

TEveTrackPropagator* fireworks::Context::m_trackerPropagator
private

Definition at line 121 of file Context.h.

Referenced by getTrackerTrackPropagator(), and initEveElements().

const float Context::s_caloOffR = 10
staticprivate

Definition at line 143 of file Context.h.

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

Definition at line 144 of file Context.h.

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

Definition at line 139 of file Context.h.

Referenced by caloR1(), and caloR2().

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

Definition at line 137 of file Context.h.

Referenced by caloTransAngle().

const float Context::s_caloTransEta = 1.479
staticprivate

Definition at line 136 of file Context.h.

Referenced by caloTransEta().

const float Context::s_caloZ = 290
staticprivate

Definition at line 140 of file Context.h.

Referenced by caloZ1(), and caloZ2().