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
 
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 (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 &)=delete
 
const Contextoperator= (const Context &)=delete
 

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() [1/2]

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

Definition at line 56 of file Context.cc.

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 }

References m_commonPrefs, and s_fwContext.

◆ ~Context()

Context::~Context ( )
virtual

Definition at line 84 of file Context.cc.

84 { delete m_commonPrefs; }

References m_commonPrefs.

◆ Context() [2/2]

fireworks::Context::Context ( const Context )
privatedelete

Member Function Documentation

◆ caloMaxEta()

double Context::caloMaxEta ( )
static

◆ caloR1()

float Context::caloR1 ( bool  offset = true)
static

◆ caloR2()

float Context::caloR2 ( bool  offset = true)
static

◆ caloTransAngle()

float Context::caloTransAngle ( )
static

◆ caloTransEta()

float Context::caloTransEta ( )
static

◆ caloZ1()

float Context::caloZ1 ( bool  offset = true)
static

◆ caloZ2()

float Context::caloZ2 ( bool  offset = true)
static

◆ colorManager()

FWColorManager* fireworks::Context::colorManager ( ) const
inline

◆ commonPrefs()

CmsShowCommon * Context::commonPrefs ( ) const

◆ deleteEveElements()

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 }

◆ eventItemsManager()

const FWEventItemsManager* fireworks::Context::eventItemsManager ( ) const
inline

◆ getBeamSpot()

FWBeamSpot* fireworks::Context::getBeamSpot ( ) const
inline

◆ getCaloData()

TEveCaloDataHist* fireworks::Context::getCaloData ( ) const
inline

◆ getCaloDataHF()

TEveCaloDataVec* fireworks::Context::getCaloDataHF ( ) const
inline

◆ getField()

FWMagField* fireworks::Context::getField ( ) const
inline

◆ getGeom()

FWGeometry* fireworks::Context::getGeom ( ) const
inline

◆ getHidePFBuilders()

bool fireworks::Context::getHidePFBuilders ( ) const
inline

◆ getInstance()

Context * Context::getInstance ( )
static

◆ getMaxEnergyInEvent()

float Context::getMaxEnergyInEvent ( bool  isEt) const

Definition at line 174 of file Context.cc.

174 { return isEt ? m_maxEt : m_maxEnergy; }

References m_maxEnergy, and m_maxEt.

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

◆ getMuonTrackPropagator()

TEveTrackPropagator* fireworks::Context::getMuonTrackPropagator ( ) const
inline

◆ getTrackerTrackPropagator()

TEveTrackPropagator* fireworks::Context::getTrackerTrackPropagator ( ) const
inline

◆ getTrackPropagator()

TEveTrackPropagator* fireworks::Context::getTrackPropagator ( ) const
inline

◆ initEveElements()

void Context::initEveElements ( )

Definition at line 86 of file Context.cc.

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 }

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 CmsShowMainBase::setup().

◆ metadataManager()

FWJobMetadataManager* fireworks::Context::metadataManager ( ) const
inline

◆ modelChangeManager()

FWModelChangeManager* fireworks::Context::modelChangeManager ( ) const
inline

Definition at line 53 of file Context.h.

53 { return m_changeManager; }

References m_changeManager.

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

◆ operator=()

const Context& fireworks::Context::operator= ( const Context )
privatedelete

◆ resetMaxEtAndEnergy()

void Context::resetMaxEtAndEnergy ( ) const

Definition at line 167 of file Context.cc.

167  {
168  // should not be zero, problems with infinte bbox
169 
170  m_maxEnergy = 1.f;
171  m_maxEt = 1.f;
172 }

References m_maxEnergy, and m_maxEt.

Referenced by FWEveViewManager::eventBegin().

◆ selectionManager()

FWSelectionManager* fireworks::Context::selectionManager ( ) const
inline

◆ setGeom()

void fireworks::Context::setGeom ( FWGeometry x)
inline

Definition at line 50 of file Context.h.

50 { m_geom = x; }

References m_geom.

Referenced by CmsShowMainBase::setup().

◆ setHidePFBuilders()

void fireworks::Context::setHidePFBuilders ( bool  x)
inline

Definition at line 81 of file Context.h.

81 { m_hidePFBuilders = x; }

References m_hidePFBuilders.

◆ voteMaxEtAndEnergy()

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

Member Data Documentation

◆ m_beamSpot

FWBeamSpot* fireworks::Context::m_beamSpot
private

Definition at line 119 of file Context.h.

Referenced by getBeamSpot(), and initEveElements().

◆ m_caloData

TEveCaloDataHist* fireworks::Context::m_caloData
private

Definition at line 128 of file Context.h.

Referenced by getCaloData(), and initEveElements().

◆ m_caloDataHF

TEveCaloDataVec* fireworks::Context::m_caloDataHF
private

Definition at line 129 of file Context.h.

Referenced by getCaloDataHF(), and initEveElements().

◆ m_changeManager

FWModelChangeManager* fireworks::Context::m_changeManager
private

Definition at line 106 of file Context.h.

Referenced by modelChangeManager().

◆ m_colorManager

FWColorManager* fireworks::Context::m_colorManager
private

Definition at line 109 of file Context.h.

Referenced by colorManager().

◆ m_commonPrefs

CmsShowCommon* fireworks::Context::m_commonPrefs
private

Definition at line 121 of file Context.h.

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

◆ m_eventItemsManager

FWEventItemsManager* fireworks::Context::m_eventItemsManager
private

Definition at line 108 of file Context.h.

Referenced by eventItemsManager().

◆ m_geom

FWGeometry* fireworks::Context::m_geom
private

Definition at line 112 of file Context.h.

Referenced by getGeom(), and setGeom().

◆ m_hidePFBuilders

bool fireworks::Context::m_hidePFBuilders
mutableprivate

Definition at line 126 of file Context.h.

Referenced by getHidePFBuilders(), and setHidePFBuilders().

◆ m_magField

FWMagField* fireworks::Context::m_magField
private

Definition at line 118 of file Context.h.

Referenced by getField(), and initEveElements().

◆ m_maxEnergy

float fireworks::Context::m_maxEnergy
mutableprivate

Definition at line 124 of file Context.h.

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

◆ m_maxEt

float fireworks::Context::m_maxEt
mutableprivate

Definition at line 123 of file Context.h.

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

◆ m_metadataManager

FWJobMetadataManager* fireworks::Context::m_metadataManager
private

Definition at line 110 of file Context.h.

Referenced by metadataManager().

◆ m_muonPropagator

TEveTrackPropagator* fireworks::Context::m_muonPropagator
private

Definition at line 116 of file Context.h.

Referenced by getMuonTrackPropagator(), and initEveElements().

◆ m_propagator

TEveTrackPropagator* fireworks::Context::m_propagator
private

Definition at line 114 of file Context.h.

Referenced by getTrackPropagator(), and initEveElements().

◆ m_selectionManager

FWSelectionManager* fireworks::Context::m_selectionManager
private

Definition at line 107 of file Context.h.

Referenced by selectionManager().

◆ m_trackerPropagator

TEveTrackPropagator* fireworks::Context::m_trackerPropagator
private

Definition at line 115 of file Context.h.

Referenced by getTrackerTrackPropagator(), and initEveElements().

◆ s_caloOffR

const float Context::s_caloOffR = 10
staticprivate

Definition at line 141 of file Context.h.

◆ s_caloOffZ

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

Definition at line 142 of file Context.h.

◆ s_caloR

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

Definition at line 137 of file Context.h.

Referenced by caloR1(), and caloR2().

◆ s_caloTransAngle

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

Definition at line 135 of file Context.h.

Referenced by caloTransAngle().

◆ s_caloTransEta

const float Context::s_caloTransEta = 1.479
staticprivate

Definition at line 134 of file Context.h.

Referenced by caloTransEta().

◆ s_caloZ

const float Context::s_caloZ = 290
staticprivate

Definition at line 138 of file Context.h.

Referenced by caloZ1(), and caloZ2().

◆ s_fwContext

Context * Context::s_fwContext = nullptr
staticprivate

Definition at line 131 of file Context.h.

Referenced by Context(), and getInstance().

fireworks::Context::m_eventItemsManager
FWEventItemsManager * m_eventItemsManager
Definition: Context.h:108
fw3dlego::xbins
const double xbins[]
Definition: fw3dlego_xbins.cc:16
fireworks::Context::s_caloTransAngle
static const float s_caloTransAngle
Definition: Context.h:135
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
fireworks::Context::m_propagator
TEveTrackPropagator * m_propagator
Definition: Context.h:114
mps_update.status
status
Definition: mps_update.py:69
fireworks::Context::m_selectionManager
FWSelectionManager * m_selectionManager
Definition: Context.h:107
CmsShowCommon::getRnrPTBMarkers
bool getRnrPTBMarkers() const
Definition: CmsShowCommon.h:76
fireworks::Context::m_trackerPropagator
TEveTrackPropagator * m_trackerPropagator
Definition: Context.h:115
CmsShowCommon::getProjTrackBreaking
UChar_t getProjTrackBreaking() const
Definition: CmsShowCommon.h:75
DDAxes::x
fireworks::Context::m_metadataManager
FWJobMetadataManager * m_metadataManager
Definition: Context.h:110
fw3dlego::xbins_n
const int xbins_n
Definition: fw3dlego_xbins.cc:15
fireworks::Context::s_caloTransEta
static const float s_caloTransEta
Definition: Context.h:134
fw3dlego::xbins_hf_n
const int xbins_hf_n
Definition: fw3dlego_xbins.cc:24
fireworks::Context::caloZ2
static float caloZ2(bool offset=true)
Definition: Context.cc:185
FWMagField
Definition: FWMagField.h:14
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
fireworks::Context::m_geom
FWGeometry * m_geom
Definition: Context.h:112
fireworks::Context::m_beamSpot
FWBeamSpot * m_beamSpot
Definition: Context.h:119
FWBeamSpot
Definition: FWBeamSpot.h:11
fireworks::Context::caloR2
static float caloR2(bool offset=true)
Definition: Context.cc:182
fireworks::Context::m_colorManager
FWColorManager * m_colorManager
Definition: Context.h:109
fireworks::Context::m_changeManager
FWModelChangeManager * m_changeManager
Definition: Context.h:106
fireworks::Context::m_commonPrefs
CmsShowCommon * m_commonPrefs
Definition: Context.h:121
fireworks::Context::m_caloData
TEveCaloDataHist * m_caloData
Definition: Context.h:128
fireworks::Context::s_caloZ
static const float s_caloZ
Definition: Context.h:138
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
Max
T Max(T a, T b)
Definition: MathUtil.h:44
fireworks::Context::m_caloDataHF
TEveCaloDataVec * m_caloDataHF
Definition: Context.h:129
fireworks::Context::m_muonPropagator
TEveTrackPropagator * m_muonPropagator
Definition: Context.h:116
fireworks::Context::caloZ1
static float caloZ1(bool offset=true)
Definition: Context.cc:183
fireworks::Context::m_magField
FWMagField * m_magField
Definition: Context.h:118
fw3dlego::xbins_hf
const double xbins_hf[]
Definition: fw3dlego_xbins.cc:25
fireworks::Context::s_caloR
static const float s_caloR
Definition: Context.h:137
fireworks::Context::s_fwContext
static Context * s_fwContext
Definition: Context.h:131
fireworks::Context::m_maxEt
float m_maxEt
Definition: Context.h:123
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
dummy
Definition: DummySelector.h:38
CmsShowCommon
Definition: CmsShowCommon.h:43
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
fireworks::Context::m_hidePFBuilders
bool m_hidePFBuilders
Definition: Context.h:126
fireworks::Context::m_maxEnergy
float m_maxEnergy
Definition: Context.h:124
fireworks::Context::caloR1
static float caloR1(bool offset=true)
Definition: Context.cc:180