13 #include "TEveJetCone.h" 14 #include "TEveScalableStraightLineSet.h" 54 void cleanLocal()
override;
69 void buildViewType(
const reco::Jet& iData,
71 TEveElement& oItemHolder,
75 void localModelChanges(
const FWModelId& iId,
76 TEveElement* iCompound,
83 typedef std::vector<fireworks::jetScaleMarker>
Lines_t;
88 TEveElementList* requestCommon();
96 m_common =
new TEveElementList(
"common electron scene");
103 if (
m_common->HasChildren() ==
false) {
104 for (
int i = 0; i < static_cast<int>(
item()->
size()); ++
i) {
107 cone->SetFillColor(
item()->defaultDisplayProperties().
color());
108 cone->SetLineColor(
item()->defaultDisplayProperties().
color());
118 TEveElement& oItemHolder,
123 TEveElement::List_i coneIt = cones->BeginChildren();
124 std::advance(coneIt, iIndex);
143 static const float_t offr = 4;
147 if (theta <
context().caloTransAngle() ||
M_PI - theta <
context().caloTransAngle()) {
149 r = z_ecal / fabs(
cos(theta));
151 r = r_ecal /
sin(theta);
154 p1.Set(0., (phi > 0 ? r * fabs(
sin(theta)) : -r * fabs(
sin(theta))), r *
cos(theta));
155 p2.Set(0., (phi > 0 ? (r + size) * fabs(
sin(theta)) : -(r + size) * fabs(
sin(theta))), (r + size) *
cos(theta));
158 p1.Set(ecalR *
cos(phi), ecalR *
sin(phi), 0);
159 p2.Set((ecalR + size) *
cos(phi), (ecalR + size) *
sin(phi), 0);
162 markers.m_ls->SetScaleCenter(p1.fX, p1.fY, p1.fZ);
163 markers.m_ls->AddLine(p1, p2);
165 markers.m_ls->SetLineWidth(4);
166 markers.m_ls->SetLineColor(dp.
color());
173 markers.m_text->SetMainColor(
item()->defaultDisplayProperties().
color());
177 markers.m_ls->SetMarkerColor(markers.m_ls->GetMainColor());
186 TEveElement* iCompound,
201 for (TEveElement::List_i
i =
m_common->BeginChildren();
i !=
m_common->EndChildren(); ++
i) {
202 TEveJetCone* cone =
dynamic_cast<TEveJetCone*
>(*i);
210 for (
auto&
c : product->RefChildren()) {
213 if (parent->NumChildren() > 1) {
214 auto compIt = parent->BeginChildren();
216 TEveScalableStraightLineSet* lineSet =
dynamic_cast<TEveScalableStraightLineSet*
>(*compIt);
223 for (TEveProjectable::ProjList_i j = lineSet->BeginProjecteds(); j != lineSet->EndProjecteds(); ++j) {
224 (*j)->UpdateProjection();
233 TEveChunkManager::iterator li(s.
m_ls->GetLinePlex());
235 TEveStraightLineSet::Line_t&
l = *(TEveStraightLineSet::Line_t*)li();
236 TEveVector
v(l.fV2[0] - l.fV1[0], l.fV2[1] - l.fV1[1], l.fV2[2] - l.fV1[2]);
244 float x = l.fV1[0] + v[0];
245 float y = l.fV1[1] + v[1];
246 float z = l.fV1[2] + v[2];
249 s.
m_text->RefMainTrans().SetPos(x, y, z);
250 if ((s.
m_text)->BeginProjecteds() != (s.
m_text)->EndProjecteds()) {
bool haveSingleProduct() const override
const fireworks::Context & context() const
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
FWProxyBuilderConfiguration * getConfig() const
float getScaleFactor3D() const
static const std::string kJetApexBeamSpot("Place Apex In BeamSpot")
void UpdateProjection() override
const FWDisplayProperties & defaultDisplayProperties() const
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const std::string kJetLabelsRhoPhiOn("Draw Labels in RhoPhi View")
static const int kAllRPZBits
double theta() const final
momentum polar angle
Base class for all types of Jets.
void voteMaxEtAndEnergy(float Et, float energy) const
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
jetScaleMarker(TEveScalableStraightLineSet *ls, float et, float e, const FWViewContext *vc)
Sin< T >::type sin(const T &t)
FWViewEnergyScale * getEnergyScale() const
Geom::Theta< T > theta() const
void getEventCenter(float *inC) const
static float caloZ2(bool offset=true)
std::vector< fireworks::jetScaleMarker > Lines_t
static const std::string kJetOffset("Label Offset")
const FWEventItem * item() const
static const int kAll3DBits
static bool isProjected(int)
Char_t transparency() const
double et() const final
transverse energy
const reco::Jet & modelData(int index)
virtual void setItem(const FWEventItem *iItem)
Cos< T >::type cos(const T &t)
void setItem(const FWEventItem *iItem) override
double energy() const final
energy
static float caloR1(bool offset=true)
Tan< T >::type tan(const T &t)
static const std::string kJetLabelsRhoZOn("Draw Labels in RhoZ View")
float getMaxEnergyInEvent(bool isEt) const
static Context * getInstance()
TEveElementList * m_common
FWGenericParameter< T > * assertParam(const std::string &name, T def)
CmsShowCommon * commonPrefs() const
et
define resolution functions of each parameter
TEveScalableStraightLineSet * m_ls
void buildViewType(const reco::Jet &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
bool havePerViewProduct(FWViewType::EType) const override
static float caloZ1(bool offset=true)
T value(const std::string &name)
void cleanLocal() override
TEveElementList * requestCommon()
const void * modelData(int iIndex) const
~FWJetProxyBuilder() override
double phi() const final
momentum azimuthal angle
void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
void setTextPos(fireworks::jetScaleMarker &s, const FWViewContext *vc, FWViewType::EType)
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)