CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
FWTauProxyBuilderBase Class Reference

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

Inheritance diagram for FWTauProxyBuilderBase:
FWProxyBuilderBase FWCaloTauProxyBuilder FWPFTauProxyBuilder

Public Member Functions

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

void buildBaseTau (const reco::BaseTau &iTau, const reco::Jet *iJet, TEveElement *comp, FWViewType::EType type, const FWViewContext *vc)
 
void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
 
- 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 &)=delete
 
const FWTauProxyBuilderBaseoperator= (const FWTauProxyBuilderBase &)=delete
 

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 39 of file FWTauProxyBuilderBase.h.

Constructor & Destructor Documentation

FWTauProxyBuilderBase::FWTauProxyBuilderBase ( )
FWTauProxyBuilderBase::~FWTauProxyBuilderBase ( )
override

Definition at line 42 of file FWTauProxyBuilderBase.cc.

42 {}
FWTauProxyBuilderBase::FWTauProxyBuilderBase ( const FWTauProxyBuilderBase )
privatedelete

Member Function Documentation

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

Definition at line 127 of file FWTauProxyBuilderBase.cc.

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

Referenced by buildBaseTau().

127  {
128  for (reco::TrackRefVector::iterator i = tau.signalTracks().begin(), iEnd = tau.signalTracks().end(); i != iEnd; ++i) {
129  TEveTrack* track(nullptr);
130  if (i->isAvailable()) {
131  track = fireworks::prepareTrack(**i, context().getTrackPropagator());
132  track->MakeTrack();
133  setupAddElement(track, product);
134  }
135  }
136 }
const fireworks::Context & context() const
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:253
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
virtual const reco::TrackRefVector & signalTracks() const
Definition: BaseTau.cc:28
void FWTauProxyBuilderBase::addLeadTrack ( const reco::BaseTau tau,
class TEveElement *  product 
)
private

Definition at line 139 of file FWTauProxyBuilderBase.cc.

References FWProxyBuilderBase::context(), TauDiscriminatorTools::leadTrack, reco::BaseTau::leadTrack(), fireworks::prepareTrack(), FWProxyBuilderBase::setupAddElement(), and HiIsolationCommonParameters_cff::track.

Referenced by buildBaseTau().

139  {
140  const reco::TrackRef leadTrack = tau.leadTrack();
141  if (!leadTrack)
142  return;
143 
144  TEveTrack* track = fireworks::prepareTrack(*leadTrack, context().getTrackPropagator());
145  if (track) {
146  track->MakeTrack();
147  setupAddElement(track, product);
148  }
149 }
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 51 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, MillePedeFileConverter_cfg::e, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), fireworks::Context::getBeamSpot(), FWViewContext::getEnergyScale(), fireworks::getPhiRange(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), fireworks::getShape(), FWViewType::isProjected(), FWProxyBuilderBase::item(), FWViewType::kRhoZ, kTauApexBeamSpot(), m_maxTheta, m_minTheta, m_phis, M_PI, fireworks::makeEveJetCone(), create_public_lumi_plots::marker, Min(), phi, reco::LeafCandidate::phi(), Pi, alignCSCRings::r, FWProxyBuilderBase::setupAddElement(), funct::sin(), findQualityFiles::size, reco::LeafCandidate::theta(), theta(), FWDisplayProperties::transparency(), fireworks::Context::voteMaxEtAndEnergy(), FWBeamSpot::x0(), FWBeamSpot::y0(), and FWBeamSpot::z0().

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

55  {
56  // track
57  addLeadTrack(iTau, comp);
59 
60  // projected markers
62  double phi = iTau.phi();
63  double theta = iTau.theta();
64  double size = 1;
65 
66  bool barrel = (theta < context().caloTransAngle() || theta > (TMath::Pi() - context().caloTransAngle()));
67  float ecalR = barrel ? context().caloR1() : context().caloR2();
68  float ecalZ = barrel ? context().caloZ1() : context().caloZ2();
69 
70  TEveScalableStraightLineSet* marker = new TEveScalableStraightLineSet("energy");
71 
72  if (type == FWViewType::kRhoZ) {
73  double r(0);
74  (theta < context().caloTransAngle() || M_PI - theta < context().caloTransAngle()) ? r = ecalZ / fabs(cos(theta))
75  : r = ecalR / sin(theta);
76 
77  fireworks::addRhoZEnergyProjection(this, comp, ecalR, ecalZ, m_minTheta - 0.003, m_maxTheta + 0.003, phi);
78 
79  marker->SetScaleCenter(0., (phi > 0 ? r * fabs(sin(theta)) : -r * fabs(sin(theta))), r * cos(theta));
80  marker->AddLine(0.,
81  (phi > 0 ? r * fabs(sin(theta)) : -r * fabs(sin(theta))),
82  r * cos(theta),
83  0.,
84  (phi > 0 ? (r + size) * fabs(sin(theta)) : -(r + size) * fabs(sin(theta))),
85  (r + size) * cos(theta));
86 
87  } else {
88  std::pair<double, double> phiRange = fireworks::getPhiRange(m_phis, phi);
89  double min_phi = phiRange.first - M_PI / 36 / 2;
90  double max_phi = phiRange.second + M_PI / 36 / 2;
91  if (fabs(phiRange.first - phiRange.first) < 1e-3)
92  {
93  min_phi = phi - M_PI / 36 / 2;
94  max_phi = phi + M_PI / 36 / 2;
95  }
96  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
97  TGeoBBox* sc_box = new TGeoTubeSeg(ecalR - 1, ecalR + 1, 1, min_phi * 180 / M_PI, max_phi * 180 / M_PI);
98  TEveGeoShape* shape = fireworks::getShape("spread", sc_box, item()->defaultDisplayProperties().color());
99  shape->SetPickable(kTRUE);
100  setupAddElement(shape, comp);
101 
102  marker->SetScaleCenter(ecalR * cos(phi), ecalR * sin(phi), 0);
103  marker->AddLine(ecalR * cos(phi), ecalR * sin(phi), 0, (ecalR + size) * cos(phi), (ecalR + size) * sin(phi), 0);
104  }
105  marker->SetLineWidth(4);
106  FWViewEnergyScale* caloScale = vc->getEnergyScale();
107  marker->SetScale(caloScale->getScaleFactor3D() * (caloScale->getPlotEt() ? iTau.et() : iTau.energy()));
108  setupAddElement(marker, comp);
109 
110  context().voteMaxEtAndEnergy(iTau.et(), iTau.energy());
111  } else if (iJet) {
112  // jet
113  TEveJetCone* cone = fireworks::makeEveJetCone(*iJet, context());
114  if (item()->getConfig()->value<bool>(kTauApexBeamSpot)) {
115  FWBeamSpot* bs = context().getBeamSpot();
116  cone->SetApex(TEveVector(bs->x0(), bs->y0(), bs->z0()));
117  }
119  cone->SetFillColor(dp.color());
120  cone->SetLineColor(dp.color());
121  setupAddElement(cone, comp);
122  cone->SetMainTransparency(TMath::Min(100, 80 + dp.transparency() / 5));
123  }
124 }
size
Write out results.
const double Pi
type
Definition: HCALResponse.h:21
const fireworks::Context & context() const
float getScaleFactor3D() const
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
std::pair< double, double > getPhiRange(const std::vector< double > &phis, double phi)
Definition: BuilderUtils.cc:21
double x0() const
Definition: FWBeamSpot.cc:30
double theta() const final
momentum polar angle
static float caloTransAngle()
Definition: Context.cc:233
double z0() const
Definition: FWBeamSpot.cc:40
void addLeadTrack(const reco::BaseTau &tau, class TEveElement *product)
double y0() const
Definition: FWBeamSpot.cc:35
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:183
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:223
T Min(T a, T b)
Definition: MathUtil.h:39
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
Char_t transparency() const
FWBeamSpot * getBeamSpot() const
Definition: Context.h:78
static float caloR2(bool offset=true)
Definition: Context.cc:213
double et() const final
transverse energy
static const std::string kTauApexBeamSpot("Place Apex In BeamSpot")
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double energy() const final
energy
static float caloR1(bool offset=true)
Definition: Context.cc:208
#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:22
static float caloZ1(bool offset=true)
Definition: Context.cc:218
std::vector< double > m_phis
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:42
double phi() const final
momentum azimuthal angle
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
bool getPlotEt() const
void FWTauProxyBuilderBase::cleanLocal ( )
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 180 of file FWTauProxyBuilderBase.cc.

180 { }
bool FWTauProxyBuilderBase::havePerViewProduct ( FWViewType::EType  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 45 of file FWTauProxyBuilderBase.h.

References class-composition::parent.

45 { return true; }
bool FWTauProxyBuilderBase::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 44 of file FWTauProxyBuilderBase.h.

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

Reimplemented from FWProxyBuilderBase.

Definition at line 151 of file FWTauProxyBuilderBase.cc.

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

154  {
155  if (FWViewType::isProjected(viewType))
156  increaseComponentTransparency(iId.index(), iCompound, "TEveJetCone", 80);
157 }
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 )
privatedelete
void FWTauProxyBuilderBase::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 159 of file FWTauProxyBuilderBase.cc.

References EnergyCorrector::c, reco::LeafCandidate::energy(), reco::LeafCandidate::et(), FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), training_settings::idx, FWProxyBuilderBase::item(), FWEventItem::modelData(), and relativeConstraints::value.

159  {
160  int idx = 0;
161  for (auto& c : product->RefChildren()) {
162  // check the compound has more than one element (the first one is jet)
163  for (auto& compChld : c->RefChildren()){
164  TEveScalableStraightLineSet* lineSet = dynamic_cast<TEveScalableStraightLineSet*>(compChld);
165  if (lineSet) {
166  // compund index in the product is an index of model data in the collection
167  const void* modelData = item()->modelData(idx);
168  const reco::BaseTau* ptr = (const reco::BaseTau*)(modelData);
169  float value = vc->getEnergyScale()->getPlotEt() ? ptr->et() : ptr->energy();
170  lineSet->SetScale(vc->getEnergyScale()->getScaleFactor3D() * value);
171  for (TEveProjectable::ProjList_i j = lineSet->BeginProjecteds(); j != lineSet->EndProjecteds(); ++j) {
172  (*j)->UpdateProjection();
173  }
174  }
175  }
176  idx++;
177  }
178 }
float getScaleFactor3D() const
FWViewEnergyScale * getEnergyScale() const
const FWEventItem * item() const
double et() const final
transverse energy
double energy() const final
energy
Definition: value.py:1
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:569
bool getPlotEt() const
void FWTauProxyBuilderBase::setItem ( const FWEventItem iItem)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 44 of file FWTauProxyBuilderBase.cc.

References FWProxyBuilderConfiguration::assertParam(), FWEventItem::getConfig(), kTauApexBeamSpot(), 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().

44  {
46  if (iItem) {
47  iItem->getConfig()->assertParam(kTauApexBeamSpot, false);
48  }
49 }
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:169
static const std::string kTauApexBeamSpot("Place Apex In BeamSpot")
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)

Member Data Documentation

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