CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public 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)
 
 Context (const Context &)=delete
 
void deleteEveElements ()
 
const FWEventItemsManagereventItemsManager () const
 
FWBeamSpotgetBeamSpot () const
 
TEveCaloDataHist * getCaloData () const
 
TEveCaloDataVec * getCaloDataHF () const
 
FWMagFieldgetField () 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
 
const Contextoperator= (const Context &)=delete
 
void resetMaxEtAndEnergy () const
 
FWSelectionManagerselectionManager () const
 
void setGeom (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 Attributes

FWBeamSpotm_beamSpot
 
TEveCaloDataHist * m_caloData
 
TEveCaloDataVec * m_caloDataHF
 
FWModelChangeManagerm_changeManager
 
FWColorManagerm_colorManager
 
CmsShowCommonm_commonPrefs
 
FWEventItemsManagerm_eventItemsManager
 
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 = nullptr
 

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

References m_commonPrefs, and s_fwContext.

61  : m_changeManager(iCM),
62  m_selectionManager(iSM),
64  m_colorManager(iColorM),
65  m_metadataManager(iJMDM),
66  m_geom(nullptr),
67  m_propagator(nullptr),
68  m_trackerPropagator(nullptr),
69  m_muonPropagator(nullptr),
70  m_magField(nullptr),
71  m_beamSpot(nullptr),
72  m_commonPrefs(nullptr),
73  m_maxEt(1.f),
74  m_maxEnergy(1.f),
75  m_hidePFBuilders(false),
76  m_caloData(nullptr),
77  m_caloDataHF(nullptr) {
78  if (iColorM) // unit test
79  m_commonPrefs = new CmsShowCommon(this);
80 
81  s_fwContext = this;
82 }
FWBeamSpot * m_beamSpot
Definition: Context.h:118
TEveTrackPropagator * m_propagator
Definition: Context.h:113
TEveCaloDataHist * m_caloData
Definition: Context.h:127
FWSelectionManager * m_selectionManager
Definition: Context.h:106
FWGeometry * m_geom
Definition: Context.h:111
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:115
CmsShowCommon * m_commonPrefs
Definition: Context.h:120
static Context * s_fwContext
Definition: Context.h:130
FWMagField * m_magField
Definition: Context.h:117
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:128
FWEventItemsManager * m_eventItemsManager
Definition: Context.h:107
FWModelChangeManager * m_changeManager
Definition: Context.h:105
FWColorManager * m_colorManager
Definition: Context.h:108
bool m_hidePFBuilders
Definition: Context.h:125
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:114
FWJobMetadataManager * m_metadataManager
Definition: Context.h:109
Context::~Context ( )
virtual

Definition at line 84 of file Context.cc.

References m_commonPrefs.

84 { delete m_commonPrefs; }
CmsShowCommon * m_commonPrefs
Definition: Context.h:120
fireworks::Context::Context ( const Context )
delete

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

References s_caloTransAngle.

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

189 { return s_caloTransAngle; }
static const float s_caloTransAngle
Definition: Context.h:134
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 153 of file Context.cc.

153  {
154  // AMT: delete of eve-elements disabled to prevent crash on exit.
155  // A lot of eve objects use this elements (e.g. TEveCalo, TEveTrack ...)
156  // If want to have explicit delete make sure order of destruction
157  // is correct: this should be called after all scenes are destroyed.
158 }
const FWEventItemsManager* fireworks::Context::eventItemsManager ( ) const
inline
FWBeamSpot* fireworks::Context::getBeamSpot ( ) const
inline
TEveCaloDataHist* fireworks::Context::getCaloData ( ) const
inline
TEveCaloDataVec* fireworks::Context::getCaloDataHF ( ) const
inline

Definition at line 70 of file Context.h.

References m_caloDataHF.

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

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

Definition at line 174 of file Context.cc.

References m_maxEnergy, and m_maxEt.

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

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

Definition at line 64 of file Context.h.

References m_muonPropagator.

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

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

Definition at line 63 of file Context.h.

References m_trackerPropagator.

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

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

Definition at line 86 of file Context.cc.

References caloR1(), caloR2(), caloZ1(), caloZ2(), validate-o2o-wbm::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 CmsShowMainBase::setup().

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

Definition at line 60 of file Context.h.

References m_metadataManager.

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

60 { return m_metadataManager; }
FWJobMetadataManager * m_metadataManager
Definition: Context.h:109
FWModelChangeManager* fireworks::Context::modelChangeManager ( ) const
inline

Definition at line 53 of file Context.h.

References m_changeManager.

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

53 { return m_changeManager; }
FWModelChangeManager * m_changeManager
Definition: Context.h:105
const Context& fireworks::Context::operator= ( const Context )
delete
void Context::resetMaxEtAndEnergy ( ) const

Definition at line 167 of file Context.cc.

References m_maxEnergy, and m_maxEt.

Referenced by FWEveViewManager::eventBegin().

167  {
168  // should not be zero, problems with infinte bbox
169 
170  m_maxEnergy = 1.f;
171  m_maxEt = 1.f;
172 }
FWSelectionManager* fireworks::Context::selectionManager ( ) const
inline
void fireworks::Context::setGeom ( FWGeometry x)
inline

Definition at line 50 of file Context.h.

References m_geom.

Referenced by CmsShowMainBase::setup().

50 { m_geom = x; }
FWGeometry * m_geom
Definition: Context.h:111
void fireworks::Context::setHidePFBuilders ( bool  x)
inline

Definition at line 81 of file Context.h.

References m_hidePFBuilders.

void Context::voteMaxEtAndEnergy ( float  Et,
float  energy 
) const

Member Data Documentation

FWBeamSpot* fireworks::Context::m_beamSpot
private

Definition at line 118 of file Context.h.

Referenced by getBeamSpot(), and initEveElements().

TEveCaloDataHist* fireworks::Context::m_caloData
private

Definition at line 127 of file Context.h.

Referenced by getCaloData(), and initEveElements().

TEveCaloDataVec* fireworks::Context::m_caloDataHF
private

Definition at line 128 of file Context.h.

Referenced by getCaloDataHF(), and initEveElements().

FWModelChangeManager* fireworks::Context::m_changeManager
private

Definition at line 105 of file Context.h.

Referenced by modelChangeManager().

FWColorManager* fireworks::Context::m_colorManager
private

Definition at line 108 of file Context.h.

Referenced by colorManager().

CmsShowCommon* fireworks::Context::m_commonPrefs
private

Definition at line 120 of file Context.h.

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

FWEventItemsManager* fireworks::Context::m_eventItemsManager
private

Definition at line 107 of file Context.h.

Referenced by eventItemsManager().

FWGeometry* fireworks::Context::m_geom
private

Definition at line 111 of file Context.h.

Referenced by getGeom(), and setGeom().

bool fireworks::Context::m_hidePFBuilders
mutableprivate

Definition at line 125 of file Context.h.

Referenced by getHidePFBuilders(), and setHidePFBuilders().

FWMagField* fireworks::Context::m_magField
private

Definition at line 117 of file Context.h.

Referenced by getField(), and initEveElements().

float fireworks::Context::m_maxEnergy
mutableprivate

Definition at line 123 of file Context.h.

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

float fireworks::Context::m_maxEt
mutableprivate

Definition at line 122 of file Context.h.

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

FWJobMetadataManager* fireworks::Context::m_metadataManager
private

Definition at line 109 of file Context.h.

Referenced by metadataManager().

TEveTrackPropagator* fireworks::Context::m_muonPropagator
private

Definition at line 115 of file Context.h.

Referenced by getMuonTrackPropagator(), and initEveElements().

TEveTrackPropagator* fireworks::Context::m_propagator
private

Definition at line 113 of file Context.h.

Referenced by getTrackPropagator(), and initEveElements().

FWSelectionManager* fireworks::Context::m_selectionManager
private

Definition at line 106 of file Context.h.

Referenced by selectionManager().

TEveTrackPropagator* fireworks::Context::m_trackerPropagator
private

Definition at line 114 of file Context.h.

Referenced by getTrackerTrackPropagator(), and initEveElements().

const float Context::s_caloOffR = 10
staticprivate

Definition at line 140 of file Context.h.

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

Definition at line 141 of file Context.h.

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

Definition at line 136 of file Context.h.

Referenced by caloR1(), and caloR2().

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

Definition at line 134 of file Context.h.

Referenced by caloTransAngle().

const float Context::s_caloTransEta = 1.479
staticprivate

Definition at line 133 of file Context.h.

Referenced by caloTransEta().

const float Context::s_caloZ = 290
staticprivate

Definition at line 137 of file Context.h.

Referenced by caloZ1(), and caloZ2().

Context * Context::s_fwContext = nullptr
staticprivate

Definition at line 130 of file Context.h.

Referenced by Context(), and getInstance().