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 | Protected Attributes | Private Member Functions | Private Attributes
FWTauProxyBuilderBase Class Reference

#include <Fireworks/Calo/interface/FWTauProxyBuilderBase.h>

Inheritance diagram for FWTauProxyBuilderBase:
FWProxyBuilderBase FWCaloTauProxyBuilder FWPFTauProxyBuilder

Public Member Functions

virtual void cleanLocal ()
 
 FWTauProxyBuilderBase ()
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual ~FWTauProxyBuilderBase ()
 
- 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 &)
 
virtual void setItem (const FWEventItem *iItem)
 
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

void buildBaseTau (const reco::BaseTau &iTau, const reco::Jet *iJet, TEveElement *comp, FWViewType::EType type, const FWViewContext *vc)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
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 &)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 

Protected Attributes

float m_maxTheta
 
float m_minTheta
 
std::vector< double > m_phis
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Private Member Functions

void addConstituentTracks (const reco::BaseTau &tau, class TEveElement *product)
 
void addLeadTrack (const reco::BaseTau &tau, class TEveElement *product)
 
 FWTauProxyBuilderBase (const FWTauProxyBuilderBase &)
 
const FWTauProxyBuilderBaseoperator= (const FWTauProxyBuilderBase &)
 

Private Attributes

std::vector
< fireworks::scaleMarker
m_lines
 

Additional Inherited Members

- 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
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 41 of file FWTauProxyBuilderBase.h.

Constructor & Destructor Documentation

FWTauProxyBuilderBase::FWTauProxyBuilderBase ( )

Definition at line 36 of file FWTauProxyBuilderBase.cc.

36  :
37  m_minTheta(0),
38  m_maxTheta(0)
39 {
40 }
FWTauProxyBuilderBase::~FWTauProxyBuilderBase ( )
virtual

Definition at line 42 of file FWTauProxyBuilderBase.cc.

43 {
44 }
FWTauProxyBuilderBase::FWTauProxyBuilderBase ( const FWTauProxyBuilderBase )
private

Member Function Documentation

void FWTauProxyBuilderBase::addConstituentTracks ( const reco::BaseTau tau,
class TEveElement *  product 
)
private

Definition at line 121 of file FWTauProxyBuilderBase.cc.

References edm::RefVector< C, T, F >::begin(), FWProxyBuilderBase::context(), edm::RefVector< C, T, F >::end(), i, fireworks::prepareTrack(), FWProxyBuilderBase::setupAddElement(), and reco::BaseTau::signalTracks().

Referenced by buildBaseTau().

122 {
123  for( reco::TrackRefVector::iterator i = tau.signalTracks().begin(), iEnd = tau.signalTracks().end();
124  i != iEnd; ++i ) {
125  TEveTrack* track( 0 );
126  if( i->isAvailable() ) {
127  track = fireworks::prepareTrack( **i, context().getTrackPropagator() );
128  track->MakeTrack();
129  setupAddElement( track, product );
130  }
131  }
132 }
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:69
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
virtual const reco::TrackRefVector & signalTracks() const
Definition: BaseTau.cc:28
void FWTauProxyBuilderBase::addLeadTrack ( const reco::BaseTau tau,
class TEveElement *  product 
)
private

Definition at line 136 of file FWTauProxyBuilderBase.cc.

References FWProxyBuilderBase::context(), singlePfTauSkim_cff::leadTrack, reco::BaseTau::leadTrack(), fireworks::prepareTrack(), and FWProxyBuilderBase::setupAddElement().

Referenced by buildBaseTau().

137 {
138  const reco::TrackRef leadTrack = tau.leadTrack();
139  if( !leadTrack ) return;
140 
141  TEveTrack* track = fireworks::prepareTrack( *leadTrack, context().getTrackPropagator() );
142  if( track )
143  {
144  track->MakeTrack();
145  setupAddElement( track, product );
146  }
147 }
const fireworks::Context & context() const
virtual reco::TrackRef leadTrack() const
Definition: BaseTau.cc:26
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:69
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void FWTauProxyBuilderBase::buildBaseTau ( const reco::BaseTau iTau,
const reco::Jet iJet,
TEveElement *  comp,
FWViewType::EType  type,
const FWViewContext vc 
)
protected

Definition at line 47 of file FWTauProxyBuilderBase.cc.

References addConstituentTracks(), addLeadTrack(), fireworks::addRhoZEnergyProjection(), Reference_intrackfit_cff::barrel, fireworks::Context::caloR1(), fireworks::Context::caloR2(), fireworks::Context::caloTransAngle(), fireworks::Context::caloZ1(), fireworks::Context::caloZ2(), FWDisplayProperties::color(), create_public_lumi_plots::color, FWProxyBuilderBase::context(), funct::cos(), FWEventItem::defaultDisplayProperties(), reco::dp, alignCSCRings::e, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), FWViewContext::getEnergyScale(), fireworks::getPhiRange(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), fireworks::getShape(), FWViewType::isProjected(), FWProxyBuilderBase::item(), FWViewType::kRhoZ, m_lines, m_maxTheta, m_minTheta, m_phis, M_PI, fireworks::makeEveJetCone(), cmsHarvester::marker, siStripFEDMonitor_P5_cff::Min, phi, reco::LeafCandidate::phi(), Pi, alignCSCRings::r, FWProxyBuilderBase::setupAddElement(), funct::sin(), findQualityFiles::size, theta(), reco::LeafCandidate::theta(), FWDisplayProperties::transparency(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by FWPFTauProxyBuilder::buildViewType(), and FWCaloTauProxyBuilder::buildViewType().

48 {
49  // track
50  addLeadTrack( iTau, comp );
51  addConstituentTracks( iTau, comp );
52 
53  // projected markers
55  {
56  double phi = iTau.phi();
57  double theta = iTau.theta();
58  double size = 1;
59 
60  bool barrel = (theta< context().caloTransAngle() || theta > (TMath::Pi() - context().caloTransAngle()));
61  float ecalR = barrel ? context().caloR1() : context().caloR2();
62  float ecalZ = barrel ? context().caloZ1() : context().caloZ2();
63 
64  TEveScalableStraightLineSet* marker = new TEveScalableStraightLineSet( "energy" );
65 
66  if( type == FWViewType::kRhoZ )
67  {
68  double r(0);
69  ( theta < context().caloTransAngle() || M_PI-theta < context().caloTransAngle()) ?
70  r = ecalZ/fabs(cos(theta)) :
71  r = ecalR/sin(theta);
72 
73  fireworks::addRhoZEnergyProjection( this, comp, ecalR, ecalZ, m_minTheta-0.003, m_maxTheta+0.003, phi);
74 
75  marker->SetScaleCenter( 0., (phi>0 ? r*fabs(sin(theta)) : -r*fabs(sin(theta))), r*cos(theta) );
76  marker->AddLine(0., (phi>0 ? r*fabs(sin(theta)) : -r*fabs(sin(theta))), r*cos(theta),
77  0., (phi>0 ? (r+size)*fabs(sin(theta)) : -(r+size)*fabs(sin(theta))), (r+size)*cos(theta) );
78 
79  }
80  else
81  {
82  std::pair<double,double> phiRange = fireworks::getPhiRange( m_phis, phi );
83  double min_phi = phiRange.first-M_PI/36/2;
84  double max_phi = phiRange.second+M_PI/36/2;
85  if( fabs(phiRange.first-phiRange.first)<1e-3 ) {
86  min_phi = phi-M_PI/36/2;
87  max_phi = phi+M_PI/36/2;
88  }
89  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
90  TGeoBBox *sc_box = new TGeoTubeSeg(ecalR - 1, ecalR + 1, 1, min_phi * 180 / M_PI, max_phi * 180 / M_PI);
91  TEveGeoShape *shape = fireworks::getShape( "spread", sc_box, item()->defaultDisplayProperties().color() );
92  shape->SetPickable(kTRUE);
93  setupAddElement( shape, comp );
94 
95  marker->SetScaleCenter(ecalR*cos(phi), ecalR*sin(phi), 0);
96  marker->AddLine( ecalR*cos( phi ), ecalR*sin( phi ), 0,
97  ( ecalR+size )*cos( phi ), ( ecalR+size )*sin( phi ), 0);
98  }
99  marker->SetLineWidth(4);
100  FWViewEnergyScale* caloScale = vc->getEnergyScale();
101  marker->SetScale(caloScale->getScaleFactor3D()*(caloScale->getPlotEt() ? iTau.et() : iTau.energy()));
102  setupAddElement( marker, comp );
103  m_lines.push_back(fireworks::scaleMarker(marker, iTau.et(), iTau.energy(), vc));
104 
105  context().voteMaxEtAndEnergy( iTau.et(), iTau.energy());
106  }
107  else if (iJet)
108  {
109  // jet
110  TEveJetCone* cone = fireworks::makeEveJetCone(*iJet, context());
112  cone->SetFillColor(dp.color());
113  cone->SetLineColor(dp.color());
114  setupAddElement( cone, comp );
115  cone->SetMainTransparency(TMath::Min(100, 80 + dp.transparency() / 5));
116  }
117 }
const double Pi
type
Definition: HCALResponse.h:21
virtual double energy() const GCC11_FINAL
energy
const fireworks::Context & context() const
float getScaleFactor3D() const
virtual double et() const GCC11_FINAL
transverse energy
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
std::pair< double, double > getPhiRange(const std::vector< double > &phis, double phi)
Definition: BuilderUtils.cc:21
static float caloTransAngle()
Definition: Context.cc:234
void addLeadTrack(const reco::BaseTau &tau, class TEveElement *product)
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
void addConstituentTracks(const reco::BaseTau &tau, class TEveElement *product)
static bool isProjected(int)
Definition: FWViewType.cc:128
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
Char_t transparency() const
static float caloR2(bool offset=true)
Definition: Context.cc:214
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static float caloR1(bool offset=true)
Definition: Context.cc:209
#define M_PI
void addRhoZEnergyProjection(FWProxyBuilderBase *, TEveElement *, double r_ecal, double z_ecal, double theta_min, double theta_max, double phi)
Definition: BuilderUtils.cc:60
auto dp
Definition: deltaR.h:24
static float caloZ1(bool offset=true)
Definition: Context.cc:219
std::vector< double > m_phis
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:42
std::vector< fireworks::scaleMarker > m_lines
tuple size
Write out results.
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
bool getPlotEt() const
Definition: DDAxes.h:10
void FWTauProxyBuilderBase::cleanLocal ( )
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 179 of file FWTauProxyBuilderBase.cc.

References m_lines.

180 {
181  m_lines.clear();
182 }
std::vector< fireworks::scaleMarker > m_lines
virtual bool FWTauProxyBuilderBase::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 48 of file FWTauProxyBuilderBase.h.

48 { return true; }
virtual bool FWTauProxyBuilderBase::haveSingleProduct ( void  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 47 of file FWTauProxyBuilderBase.h.

47 { return false; }
void FWTauProxyBuilderBase::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
protectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 150 of file FWTauProxyBuilderBase.cc.

References FWProxyBuilderBase::increaseComponentTransparency(), FWModelId::index(), and FWViewType::isProjected().

152 {
153  if (FWViewType::isProjected(viewType))
154  increaseComponentTransparency(iId.index(), iCompound, "TEveJetCone", 80);
155 }
static bool isProjected(int)
Definition: FWViewType.cc:128
int index() const
Definition: FWModelId.h:49
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
const FWTauProxyBuilderBase& FWTauProxyBuilderBase::operator= ( const FWTauProxyBuilderBase )
private
void FWTauProxyBuilderBase::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 158 of file FWTauProxyBuilderBase.cc.

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

159 {
160  if (FWViewType::isProjected(viewType))
161  {
162  typedef std::vector<fireworks::scaleMarker> Lines_t;
163  FWViewEnergyScale* caloScale = vc->getEnergyScale();
164  // printf("%p -> %f\n", this,caloScale->getValToHeight() );
165  for (Lines_t::iterator i = m_lines.begin(); i!= m_lines.end(); ++ i)
166  {
167  if (vc == (*i).m_vc)
168  {
169  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
170  (*i).m_ls->SetScale(caloScale->getScaleFactor3D()*value);
171  TEveProjected* proj = *(*i).m_ls->BeginProjecteds();
172  proj->UpdateProjection();
173  }
174  }
175  }
176 }
float getScaleFactor3D() const
int i
Definition: DBlmapReader.cc:9
FWViewEnergyScale * getEnergyScale() const
static bool isProjected(int)
Definition: FWViewType.cc:128
std::vector< fireworks::scaleMarker > m_lines
bool getPlotEt() const

Member Data Documentation

std::vector<fireworks::scaleMarker> FWTauProxyBuilderBase::m_lines
private

Definition at line 71 of file FWTauProxyBuilderBase.h.

Referenced by buildBaseTau(), cleanLocal(), and scaleProduct().

float FWTauProxyBuilderBase::m_maxTheta
protected
float FWTauProxyBuilderBase::m_minTheta
protected
std::vector<double> FWTauProxyBuilderBase::m_phis
protected