CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
FWJetProxyBuilder Class Reference
Inheritance diagram for FWJetProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::Jet > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

virtual void cleanLocal ()
 
 FWJetProxyBuilder ()
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual void setItem (const FWEventItem *iItem)
 
virtual ~FWJetProxyBuilder ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::Jet >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
virtual ~FWSimpleProxyBuilder ()
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Protected Member Functions

virtual void buildViewType (const reco::Jet &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::Jet >
const reco::JetmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *)
 
virtual void clean ()
 
- Protected Member Functions inherited from FWProxyBuilderBase
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 

Private Types

typedef std::vector
< fireworks::jetScaleMarker
Lines_t
 

Private Member Functions

 FWJetProxyBuilder (const FWJetProxyBuilder &)
 
const FWJetProxyBuilderoperator= (const FWJetProxyBuilder &)
 
TEveElementList * requestCommon ()
 
void setTextPos (fireworks::jetScaleMarker &s, const FWViewContext *vc, FWViewType::EType)
 

Private Attributes

TEveElementList * m_common
 
std::vector
< fireworks::jetScaleMarker
m_lines
 

Additional Inherited Members

- Static Public Member Functions inherited from FWSimpleProxyBuilder
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 46 of file FWJetProxyBuilder.cc.

Member Typedef Documentation

Definition at line 78 of file FWJetProxyBuilder.cc.

Constructor & Destructor Documentation

FWJetProxyBuilder::FWJetProxyBuilder ( )

Definition at line 93 of file FWJetProxyBuilder.cc.

References m_common.

93  :
94  m_common(0)
95 {
96  m_common = new TEveElementList( "common electron scene" );
97  m_common->IncDenyDestroy();
98 }
TEveElementList * m_common
FWJetProxyBuilder::~FWJetProxyBuilder ( )
virtual

Definition at line 100 of file FWJetProxyBuilder.cc.

References m_common.

101 {
102  m_common->DecDenyDestroy();
103 }
TEveElementList * m_common
FWJetProxyBuilder::FWJetProxyBuilder ( const FWJetProxyBuilder )
private

Member Function Documentation

void FWJetProxyBuilder::buildViewType ( const reco::Jet iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  type,
const FWViewContext vc 
)
protectedvirtual

Reimplemented from FWSimpleProxyBuilderTemplate< reco::Jet >.

Definition at line 124 of file FWJetProxyBuilder.cc.

References fireworks::Context::caloR1(), fireworks::Context::caloZ1(), fireworks::Context::caloZ2(), FWDisplayProperties::color(), create_public_lumi_plots::color, FWProxyBuilderBase::context(), funct::cos(), FWEventItem::defaultDisplayProperties(), reco::dp, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), FWEventItem::getConfig(), FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), FWViewType::isProjected(), FWProxyBuilderBase::item(), kJetLabelsRhoPhiOn(), kJetLabelsRhoZOn(), FWViewType::kRhoPhi, FWViewType::kRhoZ, m_lines, fireworks::scaleMarker::m_ls, M_PI, fireworks::jetScaleMarker::m_text, siStripFEDMonitor_P5_cff::Min, phi, reco::LeafCandidate::phi(), alignCSCRings::r, requestCommon(), setTextPos(), FWProxyBuilderBase::setupAddElement(), funct::sin(), findQualityFiles::size, funct::tan(), reco::LeafCandidate::theta(), theta(), FWDisplayProperties::transparency(), FWProxyBuilderConfiguration::value(), and fireworks::Context::voteMaxEtAndEnergy().

125 {
126  // add cone from shared pool
127  TEveElementList* cones = requestCommon();
128  TEveElement::List_i coneIt = cones->BeginChildren();
129  std::advance(coneIt, iIndex);
130 
132  setupAddElement( *coneIt, &oItemHolder );
133  (*coneIt)->SetMainTransparency(TMath::Min(100, 80 + dp.transparency() / 5));
134 
135 
136  // scale markers in projected views
138  {
139  m_lines.push_back(fireworks::jetScaleMarker(new TEveScalableStraightLineSet("jetline"), iData.et(), iData.energy(), vc));
140  fireworks::jetScaleMarker& markers = m_lines.back();
141 
142  float size = 1.f; // values are saved in scale
143  double theta = iData.theta();
144  double phi = iData.phi();
145 
146  if ( type == FWViewType::kRhoZ )
147  {
148  static const float_t offr = 4;
149  float r_ecal = context().caloR1() + offr;
150  float z_ecal = context().caloZ1() + offr/tan(context().caloTransAngle());
151  double r(0);
152  if ( theta < context().caloTransAngle() || M_PI-theta < context().caloTransAngle())
153  {
154  z_ecal = context().caloZ2() + offr/tan(context().caloTransAngle());
155  r = z_ecal/fabs(cos(theta));
156  }
157  else
158  {
159  r = r_ecal/sin(theta);
160  }
161 
162  markers.m_ls->SetScaleCenter( 0., (phi>0 ? r*fabs(sin(theta)) : -r*fabs(sin(theta))), r*cos(theta) );
163  markers.m_ls->AddLine( 0., (phi>0 ? r*fabs(sin(theta)) : -r*fabs(sin(theta))), r*cos(theta),
164  0., (phi>0 ? (r+size)*fabs(sin(theta)) : -(r+size)*fabs(sin(theta))), (r+size)*cos(theta) );
165  }
166  else
167  {
168  float ecalR = context().caloR1() + 4;
169  markers.m_ls->SetScaleCenter(ecalR*cos(phi), ecalR*sin(phi), 0);
170  markers.m_ls->AddLine(ecalR*cos(phi), ecalR*sin(phi), 0, (ecalR+size)*cos(phi), (ecalR+size)*sin(phi), 0);
171  }
172 
173  markers.m_ls->SetLineWidth(4);
174  markers.m_ls->SetLineColor(dp.color());
175  FWViewEnergyScale* caloScale = vc->getEnergyScale();
176  markers.m_ls->SetScale(caloScale->getScaleFactor3D()*(caloScale->getPlotEt() ? iData.et() : iData.energy()));
177 
178  if ((type == FWViewType::kRhoZ && item()->getConfig()->value<bool>(kJetLabelsRhoZOn))||
180  {
181  markers.m_text = new FWEveText(Form("%.1f", vc->getEnergyScale()->getPlotEt() ? iData.et() : iData.energy()));
182  markers.m_text->SetMainColor( item()->defaultDisplayProperties().color());
183  setTextPos(markers, vc, type);
184  }
185 
186 
187  markers.m_ls->SetMarkerColor(markers.m_ls->GetMainColor());
188  setupAddElement( markers.m_ls, &oItemHolder );
189  if (markers.m_text) setupAddElement( markers.m_text, &oItemHolder , false);
190 
191  }
192  context().voteMaxEtAndEnergy(iData.et(), iData.energy());
193 
194 }
type
Definition: HCALResponse.h:21
virtual double energy() const GCC11_FINAL
energy
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
float getScaleFactor3D() const
virtual double et() const GCC11_FINAL
transverse energy
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
static const std::string kJetLabelsRhoPhiOn("Draw Labels in RhoPhi View")
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
FWViewEnergyScale * getEnergyScale() const
Geom::Theta< T > theta() const
static float caloZ2(bool offset=true)
Definition: Context.cc:224
virtual double theta() const GCC11_FINAL
momentum polar angle
const FWEventItem * item() const
Color_t color() const
static bool isProjected(int)
Definition: FWViewType.cc:128
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
Char_t transparency() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static float caloR1(bool offset=true)
Definition: Context.cc:209
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static const std::string kJetLabelsRhoZOn("Draw Labels in RhoZ View")
#define M_PI
Definition: BFit3D.cc:3
auto dp
Definition: deltaR.h:24
TEveScalableStraightLineSet * m_ls
Definition: scaleMarker.h:37
static float caloZ1(bool offset=true)
Definition: Context.cc:219
std::vector< fireworks::jetScaleMarker > m_lines
TEveElementList * requestCommon()
tuple size
Write out results.
void setTextPos(fireworks::jetScaleMarker &s, const FWViewContext *vc, FWViewType::EType)
bool getPlotEt() const
Definition: DDAxes.h:10
void FWJetProxyBuilder::cleanLocal ( )
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 211 of file FWJetProxyBuilder.cc.

References m_common, and m_lines.

212 {
213  m_lines.clear();
214  m_common->DestroyElements();
215 }
TEveElementList * m_common
std::vector< fireworks::jetScaleMarker > m_lines
virtual bool FWJetProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 52 of file FWJetProxyBuilder.cc.

52 { return true; }
virtual bool FWJetProxyBuilder::haveSingleProduct ( void  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 53 of file FWJetProxyBuilder.cc.

53 { return false; } // different view types
void FWJetProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
protectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 197 of file FWJetProxyBuilder.cc.

References i, FWProxyBuilderBase::increaseComponentTransparency(), FWModelId::index(), and m_lines.

199 {
200  increaseComponentTransparency(iId.index(), iCompound, "TEveJetCone", 80);
201 
202  for (Lines_t::iterator i = m_lines.begin(); i!= m_lines.end(); ++ i)
203  {
204  TEveStraightLineSetProjected* projLineSet = (TEveStraightLineSetProjected*)(*(*i).m_ls->BeginProjecteds());
205  if (projLineSet) projLineSet->UpdateProjection();
206  }
207 }
int i
Definition: DBlmapReader.cc:9
int index() const
Definition: FWModelId.h:49
std::vector< fireworks::jetScaleMarker > m_lines
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
const FWJetProxyBuilder& FWJetProxyBuilder::operator= ( const FWJetProxyBuilder )
private
FWJetProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
TEveElementList * FWJetProxyBuilder::requestCommon ( )
private

Definition at line 106 of file FWJetProxyBuilder.cc.

References create_public_lumi_plots::color, FWProxyBuilderBase::context(), edm::false, i, FWProxyBuilderBase::item(), m_common, fireworks::makeEveJetCone(), FWSimpleProxyBuilderTemplate< reco::Jet >::modelData(), and FWEventItem::size().

Referenced by buildViewType().

107 {
108  if( m_common->HasChildren() == false )
109  {
110  for (int i = 0; i < static_cast<int>(item()->size()); ++i)
111  {
112  TEveJetCone* cone = fireworks::makeEveJetCone(modelData(i), context());
113 
114  m_common->AddElement(cone);
115  cone->SetFillColor(item()->defaultDisplayProperties().color());
116  cone->SetLineColor(item()->defaultDisplayProperties().color());
117 
118  }
119  }
120  return m_common;
121 }
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
const FWEventItem * item() const
TEveElementList * m_common
size_t size() const
Definition: FWEventItem.cc:548
volatile std::atomic< bool > shutdown_flag false
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
void FWJetProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
)
protectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 218 of file FWJetProxyBuilder.cc.

References FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), i, m_lines, setTextPos(), and relativeConstraints::value.

219 {
220  for (Lines_t::iterator i = m_lines.begin(); i!= m_lines.end(); ++ i)
221  {
222  if (vc == (*i).m_vc)
223  {
224  float value = vc->getEnergyScale()->getPlotEt() ? (*i).m_et : (*i).m_energy;
225 
226  (*i).m_ls->SetScale(vc->getEnergyScale()->getScaleFactor3D() * value );
227  if ((*i).m_text)
228  {
229  (*i).m_text->SetText(Form("%.1f", value));
230  setTextPos(*i, vc, type);
231  }
232  TEveStraightLineSetProjected* projLineSet = (TEveStraightLineSetProjected*)(*(*i).m_ls->BeginProjecteds());
233  projLineSet->UpdateProjection();
234  }
235  }
236 }
type
Definition: HCALResponse.h:21
float getScaleFactor3D() const
int i
Definition: DBlmapReader.cc:9
FWViewEnergyScale * getEnergyScale() const
std::vector< fireworks::jetScaleMarker > m_lines
void setTextPos(fireworks::jetScaleMarker &s, const FWViewContext *vc, FWViewType::EType)
bool getPlotEt() const
virtual void FWJetProxyBuilder::setItem ( const FWEventItem iItem)
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 56 of file FWJetProxyBuilder.cc.

References FWProxyBuilderConfiguration::assertParam(), FWEventItem::getConfig(), kJetLabelsRhoPhiOn(), kJetLabelsRhoZOn(), kJetOffset(), and FWProxyBuilderBase::setItem().

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.EventContentView::_addRow(), Vispa.Views.TableView.TableView::_createItem(), Vispa.Views.PropertyView.PropertyView::addCategory(), and Vispa.Views.PropertyView.PropertyView::append().

57  {
59  if (iItem) {
60  iItem->getConfig()->assertParam(kJetLabelsRhoPhiOn, false);
61  iItem->getConfig()->assertParam(kJetLabelsRhoZOn, false);
62  iItem->getConfig()->assertParam(kJetOffset, 2.1, 1.0, 5.0);
63  }
64  }
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
static const std::string kJetLabelsRhoPhiOn("Draw Labels in RhoPhi View")
static const std::string kJetOffset("Label Offset")
virtual void setItem(const FWEventItem *iItem)
static const std::string kJetLabelsRhoZOn("Draw Labels in RhoZ View")
FWGenericParameter< T > * assertParam(const std::string &name, T def)
void FWJetProxyBuilder::setTextPos ( fireworks::jetScaleMarker s,
const FWViewContext vc,
FWViewType::EType  type 
)
private

Definition at line 239 of file FWJetProxyBuilder.cc.

References FWProxyBuilderBase::context(), FWEventItem::getConfig(), FWViewContext::getEnergyScale(), fireworks::Context::getMaxEnergyInEvent(), FWViewEnergyScale::getPlotEt(), FWProxyBuilderBase::item(), kJetOffset(), ConfigFiles::l, fireworks::scaleMarker::m_energy, fireworks::scaleMarker::m_et, fireworks::scaleMarker::m_ls, FWEveText::m_offsetZ, fireworks::jetScaleMarker::m_text, FWEveTextProjected::UpdateProjection(), findQualityFiles::v, FWProxyBuilderConfiguration::value(), relativeConstraints::value, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by buildViewType(), and scaleProduct().

240 {
241  TEveChunkManager::iterator li( s.m_ls->GetLinePlex() );
242  li.next();
243  TEveStraightLineSet::Line_t &l = * ( TEveStraightLineSet::Line_t* ) li();
244  TEveVector v(l.fV2[0] - l.fV1[0], l.fV2[1] - l.fV1[1], l.fV2[2] - l.fV1[2] );
245  v.Normalize();
246 
247 
248  double off = item()->getConfig()->value<double>(kJetOffset) -1;
249  float value = vc->getEnergyScale()->getPlotEt() ? s.m_et : s.m_energy;
250  double trs = off * 130 * value/context().getMaxEnergyInEvent(vc->getEnergyScale()->getPlotEt());
251  v *= trs;
252 
253  float x = l.fV1[0] + v[0];
254  float y = l.fV1[1] + v[1];
255  float z = l.fV1[2] + v[2];
256 
258  s.m_text->RefMainTrans().SetPos(x, y, z);
259  if ((s.m_text)->BeginProjecteds() != (s.m_text)->EndProjecteds()) {
260  FWEveTextProjected* textProjected = (FWEveTextProjected*)(*(s.m_text)->BeginProjecteds());
261  textProjected->UpdateProjection();
262  }
263 
264 }
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
virtual void UpdateProjection()
float m_offsetZ
FWViewEnergyScale * getEnergyScale() const
static const std::string kJetOffset("Label Offset")
float float float z
const FWEventItem * item() const
float getMaxEnergyInEvent(bool isEt) const
Definition: Context.cc:200
TEveScalableStraightLineSet * m_ls
Definition: scaleMarker.h:37
Definition: DDAxes.h:10
bool getPlotEt() const

Member Data Documentation

TEveElementList* FWJetProxyBuilder::m_common
private
std::vector<fireworks::jetScaleMarker> FWJetProxyBuilder::m_lines
private

Definition at line 88 of file FWJetProxyBuilder.cc.

Referenced by buildViewType(), cleanLocal(), localModelChanges(), and scaleProduct().