CMS 3D CMS Logo

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 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
 

Private Attributes

std::vector< fireworks::scaleMarkerm_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 39 of file FWTauProxyBuilderBase.h.

Constructor & Destructor Documentation

◆ FWTauProxyBuilderBase() [1/2]

FWTauProxyBuilderBase::FWTauProxyBuilderBase ( )

Definition at line 40 of file FWTauProxyBuilderBase.cc.

40 : m_minTheta(0), m_maxTheta(0) {}

◆ ~FWTauProxyBuilderBase()

FWTauProxyBuilderBase::~FWTauProxyBuilderBase ( )
override

Definition at line 42 of file FWTauProxyBuilderBase.cc.

42 {}

◆ FWTauProxyBuilderBase() [2/2]

FWTauProxyBuilderBase::FWTauProxyBuilderBase ( const FWTauProxyBuilderBase )
privatedelete

Member Function Documentation

◆ addConstituentTracks()

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

Definition at line 123 of file FWTauProxyBuilderBase.cc.

123  {
124  for (reco::TrackRefVector::iterator i = tau.signalTracks().begin(), iEnd = tau.signalTracks().end(); i != iEnd; ++i) {
125  TEveTrack* track(nullptr);
126  if (i->isAvailable()) {
127  track = fireworks::prepareTrack(**i, context().getTrackPropagator());
128  track->MakeTrack();
129  setupAddElement(track, product);
130  }
131  }
132 }

References FWProxyBuilderBase::context(), mps_fire::i, fireworks::prepareTrack(), FWProxyBuilderBase::setupAddElement(), metsig::tau, and HLT_FULL_cff::track.

Referenced by buildBaseTau().

◆ addLeadTrack()

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

Definition at line 135 of file FWTauProxyBuilderBase.cc.

135  {
136  const reco::TrackRef leadTrack = tau.leadTrack();
137  if (!leadTrack)
138  return;
139 
140  TEveTrack* track = fireworks::prepareTrack(*leadTrack, context().getTrackPropagator());
141  if (track) {
142  track->MakeTrack();
143  setupAddElement(track, product);
144  }
145 }

References FWProxyBuilderBase::context(), singlePfTauSkim_cff::leadTrack, fireworks::prepareTrack(), FWProxyBuilderBase::setupAddElement(), metsig::tau, and HLT_FULL_cff::track.

Referenced by buildBaseTau().

◆ buildBaseTau()

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.

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 
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  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
92  TGeoBBox* sc_box = new TGeoTubeSeg(ecalR - 1, ecalR + 1, 1, min_phi * 180 / M_PI, max_phi * 180 / M_PI);
93  TEveGeoShape* shape = fireworks::getShape("spread", sc_box, item()->defaultDisplayProperties().color());
94  shape->SetPickable(kTRUE);
95  setupAddElement(shape, comp);
96 
97  marker->SetScaleCenter(ecalR * cos(phi), ecalR * sin(phi), 0);
98  marker->AddLine(ecalR * cos(phi), ecalR * sin(phi), 0, (ecalR + size) * cos(phi), (ecalR + size) * sin(phi), 0);
99  }
100  marker->SetLineWidth(4);
101  FWViewEnergyScale* caloScale = vc->getEnergyScale();
102  marker->SetScale(caloScale->getScaleFactor3D() * (caloScale->getPlotEt() ? iTau.et() : iTau.energy()));
103  setupAddElement(marker, comp);
104  m_lines.push_back(fireworks::scaleMarker(marker, iTau.et(), iTau.energy(), vc));
105 
106  context().voteMaxEtAndEnergy(iTau.et(), iTau.energy());
107  } else if (iJet) {
108  // jet
109  TEveJetCone* cone = fireworks::makeEveJetCone(*iJet, context());
110  if (item()->getConfig()->value<bool>(kTauApexBeamSpot)) {
112  cone->SetApex(TEveVector(bs->x0(), bs->y0(), bs->z0()));
113  }
115  cone->SetFillColor(dp.color());
116  cone->SetLineColor(dp.color());
117  setupAddElement(cone, comp);
118  cone->SetMainTransparency(TMath::Min(100, 80 + dp.transparency() / 5));
119  }
120 }

References addConstituentTracks(), addLeadTrack(), fireworks::addRhoZEnergyProjection(), Reference_intrackfit_cff::barrel, cms::cuda::bs, fireworks::Context::caloR1(), fireworks::Context::caloR2(), fireworks::Context::caloTransAngle(), fireworks::Context::caloZ1(), fireworks::Context::caloZ2(), AlCaHLTBitMon_QueryRunRegistry::comp, FWProxyBuilderBase::context(), funct::cos(), FWEventItem::defaultDisplayProperties(), Calorimetry_cff::dp, 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_lines, m_maxTheta, m_minTheta, m_phis, M_PI, fireworks::makeEveJetCone(), Min(), phi, reco::LeafCandidate::phi(), Pi, alignCSCRings::r, FWProxyBuilderBase::setupAddElement(), funct::sin(), findQualityFiles::size, reco::LeafCandidate::theta(), theta(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by FWPFTauProxyBuilder::buildViewType().

◆ cleanLocal()

void FWTauProxyBuilderBase::cleanLocal ( )
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 171 of file FWTauProxyBuilderBase.cc.

171 { m_lines.clear(); }

References m_lines.

◆ havePerViewProduct()

bool FWTauProxyBuilderBase::havePerViewProduct ( FWViewType::EType  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 45 of file FWTauProxyBuilderBase.h.

45 { return true; }

◆ haveSingleProduct()

bool FWTauProxyBuilderBase::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 44 of file FWTauProxyBuilderBase.h.

44 { return false; }

◆ localModelChanges()

void FWTauProxyBuilderBase::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 147 of file FWTauProxyBuilderBase.cc.

150  {
151  if (FWViewType::isProjected(viewType))
152  increaseComponentTransparency(iId.index(), iCompound, "TEveJetCone", 80);
153 }

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

◆ operator=()

const FWTauProxyBuilderBase& FWTauProxyBuilderBase::operator= ( const FWTauProxyBuilderBase )
privatedelete

◆ scaleProduct()

void FWTauProxyBuilderBase::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 155 of file FWTauProxyBuilderBase.cc.

155  {
156  if (FWViewType::isProjected(viewType)) {
157  typedef std::vector<fireworks::scaleMarker> Lines_t;
158  FWViewEnergyScale* caloScale = vc->getEnergyScale();
159  // printf("%p -> %f\n", this,caloScale->getValToHeight() );
160  for (Lines_t::iterator i = m_lines.begin(); i != m_lines.end(); ++i) {
161  if (vc == (*i).m_vc) {
162  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
163  (*i).m_ls->SetScale(caloScale->getScaleFactor3D() * value);
164  TEveProjected* proj = *(*i).m_ls->BeginProjecteds();
165  proj->UpdateProjection();
166  }
167  }
168  }
169 }

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

◆ setItem()

void FWTauProxyBuilderBase::setItem ( const FWEventItem iItem)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 44 of file FWTauProxyBuilderBase.cc.

44  {
46  if (iItem) {
47  iItem->getConfig()->assertParam(kTauApexBeamSpot, false);
48  }
49 }

References FWProxyBuilderConfiguration::assertParam(), FWEventItem::getConfig(), kTauApexBeamSpot(), and FWProxyBuilderBase::setItem().

Member Data Documentation

◆ m_lines

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

Definition at line 77 of file FWTauProxyBuilderBase.h.

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

◆ m_maxTheta

float FWTauProxyBuilderBase::m_maxTheta
protected

Definition at line 53 of file FWTauProxyBuilderBase.h.

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

◆ m_minTheta

float FWTauProxyBuilderBase::m_minTheta
protected

Definition at line 52 of file FWTauProxyBuilderBase.h.

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

◆ m_phis

std::vector<double> FWTauProxyBuilderBase::m_phis
protected

Definition at line 54 of file FWTauProxyBuilderBase.h.

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

mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
metsig::tau
Definition: SignAlgoResolutions.h:49
FWViewType::kRhoZ
Definition: FWViewType.h:33
FWViewEnergyScale::getPlotEt
bool getPlotEt() const
Definition: FWViewEnergyScale.h:47
fireworks::Context::getBeamSpot
FWBeamSpot * getBeamSpot() const
Definition: Context.h:67
FWViewType::isProjected
static bool isProjected(int)
Definition: FWViewType.cc:100
FWTauProxyBuilderBase::m_maxTheta
float m_maxTheta
Definition: FWTauProxyBuilderBase.h:53
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
edm::Ref< TrackCollection >
kTauApexBeamSpot
static const std::string kTauApexBeamSpot("Place Apex In BeamSpot")
fireworks::getShape
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:44
FWEventItem::defaultDisplayProperties
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
cms::cuda::bs
bs
Definition: HistoContainer.h:127
singlePfTauSkim_cff.leadTrack
leadTrack
Definition: singlePfTauSkim_cff.py:22
fireworks::Context::caloZ2
static float caloZ2(bool offset=true)
Definition: Context.cc:185
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:157
fireworks::Context::voteMaxEtAndEnergy
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
FWTauProxyBuilderBase::addConstituentTracks
void addConstituentTracks(const reco::BaseTau &tau, class TEveElement *product)
Definition: FWTauProxyBuilderBase.cc:123
FWProxyBuilderBase::increaseComponentTransparency
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
Definition: FWProxyBuilderBase.cc:393
reco::LeafCandidate::theta
double theta() const final
momentum polar angle
Definition: LeafCandidate.h:150
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
FWTauProxyBuilderBase::addLeadTrack
void addLeadTrack(const reco::BaseTau &tau, class TEveElement *product)
Definition: FWTauProxyBuilderBase.cc:135
FWModelId::index
int index() const
Definition: FWModelId.h:41
fireworks::addRhoZEnergyProjection
void addRhoZEnergyProjection(FWProxyBuilderBase *, TEveElement *, double r_ecal, double z_ecal, double theta_min, double theta_max, double phi)
Definition: BuilderUtils.cc:58
FWBeamSpot
Definition: FWBeamSpot.h:11
FWProxyBuilderConfiguration::assertParam
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition: FWProxyBuilderConfiguration.cc:83
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
fireworks::Context::caloR2
static float caloR2(bool offset=true)
Definition: Context.cc:182
fireworks::makeEveJetCone
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
Definition: makeEveJetCone.cc:6
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
fireworks::prepareTrack
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
value
Definition: value.py:1
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
FWTauProxyBuilderBase::m_lines
std::vector< fireworks::scaleMarker > m_lines
Definition: FWTauProxyBuilderBase.h:77
fireworks::Context::caloTransAngle
static float caloTransAngle()
Definition: Context.cc:189
FWTauProxyBuilderBase::m_phis
std::vector< double > m_phis
Definition: FWTauProxyBuilderBase.h:54
FWDisplayProperties
Definition: FWDisplayProperties.h:28
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDAxes::phi
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWViewEnergyScale::getScaleFactor3D
float getScaleFactor3D() const
Definition: FWViewEnergyScale.h:44
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
fireworks::Context::caloZ1
static float caloZ1(bool offset=true)
Definition: Context.cc:183
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
relativeConstraints.value
value
Definition: relativeConstraints.py:53
edm::RefVectorIterator
Definition: EDProductfwd.h:33
FWViewEnergyScale
Definition: FWViewEnergyScale.h:34
fireworks::scaleMarker
Definition: scaleMarker.h:25
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
FWTauProxyBuilderBase::m_minTheta
float m_minTheta
Definition: FWTauProxyBuilderBase.h:52
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
Min
T Min(T a, T b)
Definition: MathUtil.h:39
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition: FWProxyBuilderBase.cc:83
FWViewContext::getEnergyScale
FWViewEnergyScale * getEnergyScale() const
Definition: FWViewContext.cc:25
fireworks::Context::caloR1
static float caloR1(bool offset=true)
Definition: Context.cc:180
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
fireworks::getPhiRange
std::pair< double, double > getPhiRange(const std::vector< double > &phis, double phi)
Definition: BuilderUtils.cc:21