CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
FWPFBlockProxyBuilder Class Reference

#include <FWPFBlockProxyBuilder.h>

Inheritance diagram for FWPFBlockProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::PFBlock > FWSimpleProxyBuilder FWProxyBuilderBase FWPFBlockEcalProxyBuilder FWPFBlockHcalProxyBuilder

Public Types

enum  BuilderType { BASE = 0, ECAL = 1, HCAL = 2 }
 

Public Member Functions

 FWPFBlockProxyBuilder ()
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWPFBlockProxyBuilder () override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::PFBlock >
 FWSimpleProxyBuilderTemplate ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const
FWSimpleProxyBuilderTemplate
operator= (const FWSimpleProxyBuilderTemplate &)=delete
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 FWSimpleProxyBuilder (const FWSimpleProxyBuilder &)=delete
 
const FWSimpleProxyBuilderoperator= (const FWSimpleProxyBuilder &)=delete
 
 ~FWSimpleProxyBuilder () 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 &)
 
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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- 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 Member Functions

void buildViewType (const reco::PFBlock &, unsigned int, TEveElement &, FWViewType::EType, const FWViewContext *) override
 
void cleanLocal () override
 
void clusterSharedBuild (const reco::PFCluster &, TEveElement &, const FWViewContext *)
 
bool havePerViewProduct (FWViewType::EType) const override
 
bool haveSingleProduct () const override
 
void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
 
void setupClusterElement (const reco::PFBlockElement &, TEveElement &, const FWViewContext *, FWViewType::EType, float r)
 
void setupTrackElement (const reco::PFBlockElement &, TEveElement &, const FWViewContext *, FWViewType::EType)
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::PFBlock >
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void build (const reco::PFBlock &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const reco::PFBlockmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- 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 localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 

Protected Attributes

BuilderType e_builderType
 
std::vector< ScalableLinesm_clusters
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Private Member Functions

 FWPFBlockProxyBuilder (const FWPFBlockProxyBuilder &)
 
const FWPFBlockProxyBuilderoperator= (const FWPFBlockProxyBuilder &)
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 

Detailed Description

Definition at line 35 of file FWPFBlockProxyBuilder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWPFBlockProxyBuilder::FWPFBlockProxyBuilder ( )
inline
FWPFBlockProxyBuilder::~FWPFBlockProxyBuilder ( )
inlineoverride

Definition at line 41 of file FWPFBlockProxyBuilder.h.

41 {}
FWPFBlockProxyBuilder::FWPFBlockProxyBuilder ( const FWPFBlockProxyBuilder )
private

Member Function Documentation

void FWPFBlockProxyBuilder::buildViewType ( const reco::PFBlock iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprotectedvirtual

Reimplemented from FWSimpleProxyBuilderTemplate< reco::PFBlock >.

Definition at line 141 of file FWPFBlockProxyBuilder.cc.

References BASE, FWPFGeom::caloR1(), FWPFGeom::caloR2(), FWProxyBuilderBase::context(), e_builderType, ECAL, reco::PFBlock::elements(), bookConverter::elements, HCAL, mps_fire::i, FWViewType::kRhoPhiPF, setupClusterElement(), setupTrackElement(), and edm::OwnVector< T, P >::size().

145  {
147 
148  for (unsigned int i = 0; i < elements.size(); ++i) {
149  reco::PFBlockElement::Type type = elements[i].type();
150  switch (type) {
151  case 1: // TRACK
152  if (e_builderType == BASE)
153  setupTrackElement(elements[i], oItemHolder, vc, viewType);
154  break;
155 
156  case 4: // ECAL
157  if (e_builderType == ECAL)
158  setupClusterElement(elements[i], oItemHolder, vc, viewType, FWPFGeom::caloR1());
159  break;
160 
161  case 5: // HCAL
162  if (e_builderType == HCAL) {
163  if (viewType == FWViewType::kRhoPhiPF)
164  setupClusterElement(elements[i], oItemHolder, vc, viewType, FWPFGeom::caloR2());
165  else // RhoZ
166  setupClusterElement(elements[i], oItemHolder, vc, viewType, context().caloR1());
167  }
168  break;
169 
170  default: // Ignore anything that isn't wanted
171  break;
172  }
173  }
174 }
const fireworks::Context & context() const
void setupTrackElement(const reco::PFBlockElement &, TEveElement &, const FWViewContext *, FWViewType::EType)
void setupClusterElement(const reco::PFBlockElement &, TEveElement &, const FWViewContext *, FWViewType::EType, float r)
size_type size() const
Definition: OwnVector.h:300
dictionary elements
float caloR1()
Definition: FWPFGeom.h:20
float caloR2()
Definition: FWPFGeom.h:26
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:85
const std::string & FWPFBlockProxyBuilder::classPurpose ( )
static

Definition at line 181 of file FWPFBlockProxyBuilder.cc.

const std::string & FWPFBlockProxyBuilder::classRegisterTypeName ( )
static

Definition at line 181 of file FWPFBlockProxyBuilder.cc.

const std::string & FWPFBlockProxyBuilder::classTypeName ( )
static

Definition at line 181 of file FWPFBlockProxyBuilder.cc.

const std::string & FWPFBlockProxyBuilder::classView ( )
static

Definition at line 181 of file FWPFBlockProxyBuilder.cc.

void FWPFBlockProxyBuilder::cleanLocal ( )
inlineoverrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 61 of file FWPFBlockProxyBuilder.h.

References m_clusters.

61 { m_clusters.clear(); }
std::vector< ScalableLines > m_clusters
void FWPFBlockProxyBuilder::clusterSharedBuild ( const reco::PFCluster ,
TEveElement &  ,
const FWViewContext  
)
protected
bool FWPFBlockProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlineoverrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 52 of file FWPFBlockProxyBuilder.h.

52 { return true; }
bool FWPFBlockProxyBuilder::haveSingleProduct ( void  ) const
inlineoverrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 55 of file FWPFBlockProxyBuilder.h.

55 { return false; } // different view types
const FWPFBlockProxyBuilder& FWPFBlockProxyBuilder::operator= ( const FWPFBlockProxyBuilder )
private
const std::string& FWPFBlockProxyBuilder::purpose ( ) const
inline

Definition at line 43 of file FWPFBlockProxyBuilder.h.

45 :
46  // --------------------- Member Functions --------------------------
void FWPFBlockProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 5 of file FWPFBlockProxyBuilder.cc.

References FWProxyBuilderBase::context(), FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), mps_fire::i, dqmiolumiharvest::j, FWViewType::kLego, FWViewType::kLegoPFECAL, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, m_clusters, FWLegoCandidate::updateScale(), and relativeConstraints::value.

5  {
6  typedef std::vector<ScalableLines> Lines_t;
7  FWViewEnergyScale *caloScale = vc->getEnergyScale();
8 
9  if (viewType == FWViewType::kRhoPhiPF ||
10  viewType == FWViewType::kRhoZ) { /* Handle the rhophi and rhoz cluster scaling */
11  for (Lines_t::iterator i = m_clusters.begin(); i != m_clusters.end(); ++i) {
12  if (vc == (*i).m_vc) {
13  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
14  (*i).m_ls->SetScale(caloScale->getScaleFactor3D() * value);
15  TEveProjected *proj = *(*i).m_ls->BeginProjecteds();
16  proj->UpdateProjection();
17  }
18  }
19  } /* Handle cluster scaling in lego view(s) */
20  else if (viewType == FWViewType::kLego || viewType == FWViewType::kLegoPFECAL) { // Loop products
21  for (TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i) {
22  if ((*i)->HasChildren()) { // Loop elements of block
23  for (TEveElement::List_i j = (*i)->BeginChildren(); j != (*i)->EndChildren(); ++j) {
24  if (strcmp((*j)->GetElementName(), "BlockCluster") == 0) {
25  FWLegoCandidate *cluster = dynamic_cast<FWLegoCandidate *>(*j);
26  cluster->updateScale(vc, context());
27  }
28  }
29  }
30  }
31  }
32 }
const fireworks::Context & context() const
float getScaleFactor3D() const
FWViewEnergyScale * getEnergyScale() const
std::vector< ScalableLines > m_clusters
void updateScale(const FWViewContext *vc, const fireworks::Context &)
bool getPlotEt() const
void FWPFBlockProxyBuilder::setupClusterElement ( const reco::PFBlockElement blockElement,
TEveElement &  oItemHolder,
const FWViewContext vc,
FWViewType::EType  viewType,
float  r 
)
protected

Definition at line 98 of file FWPFBlockProxyBuilder.cc.

References FWPFClusterRPZUtils::buildRhoPhiClusterLineSet(), FWPFClusterRPZUtils::buildRhoZClusterLineSet(), FWPFMaths::calculateEt(), FWPFGeom::caloZ1(), reco::PFBlockElement::clusterRef(), FWDisplayProperties::color(), FWProxyBuilderBase::context(), FWEventItem::defaultDisplayProperties(), relval_parameters_module::energy, reco::PFCluster::energy(), PVValHelper::eta, reco::CaloCluster::eta(), FWProxyBuilderBase::item(), FWViewType::kLego, FWViewType::kLegoPFECAL, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, m_clusters, phi, reco::CaloCluster::phi(), DiDispStaMuonMonitor_cfi::pt, FWProxyBuilderBase::setupAddElement(), fireworks::Context::voteMaxEtAndEnergy(), reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

Referenced by buildViewType().

102  {
103  // Get reference to PFCluster
104  reco::PFCluster cluster = *blockElement.clusterRef();
105  TEveVector centre = TEveVector(cluster.x(), cluster.y(), cluster.z());
106  float energy = cluster.energy();
107  float et = FWPFMaths::calculateEt(centre, energy);
108  float pt = et;
109  float eta = cluster.eta();
110  float phi = cluster.phi();
111 
113 
114  if (viewType == FWViewType::kLego || viewType == FWViewType::kLegoPFECAL) {
115  FWLegoCandidate *legoCluster = new FWLegoCandidate(vc, FWProxyBuilderBase::context(), energy, et, pt, eta, phi);
116  legoCluster->SetMarkerColor(FWProxyBuilderBase::item()->defaultDisplayProperties().color());
117  legoCluster->SetElementName("BlockCluster");
118  setupAddElement(legoCluster, &oItemHolder);
119  }
120  if (viewType == FWViewType::kRhoPhiPF) {
122  FWPFClusterRPZUtils *clusterUtils = new FWPFClusterRPZUtils();
123  TEveScalableStraightLineSet *rpCluster = clusterUtils->buildRhoPhiClusterLineSet(cluster, vc, energy, et, r);
124  rpCluster->SetLineColor(dp.color());
125  m_clusters.push_back(ScalableLines(rpCluster, et, energy, vc));
126  setupAddElement(rpCluster, &oItemHolder);
127  delete clusterUtils;
128  } else if (viewType == FWViewType::kRhoZ) {
130  FWPFClusterRPZUtils *clusterUtils = new FWPFClusterRPZUtils();
131  TEveScalableStraightLineSet *rzCluster = clusterUtils->buildRhoZClusterLineSet(
132  cluster, vc, context().caloTransAngle(), energy, et, r, context().caloZ1());
133  rzCluster->SetLineColor(dp.color());
134  m_clusters.push_back(ScalableLines(rzCluster, et, energy, vc));
135  setupAddElement(rzCluster, &oItemHolder);
136  delete clusterUtils;
137  }
138 }
const fireworks::Context & context() const
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
virtual const PFClusterRef & clusterRef() const
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
std::vector< ScalableLines > m_clusters
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
Color_t color() const
TEveScalableStraightLineSet * buildRhoZClusterLineSet(const reco::PFCluster &, const FWViewContext *, float caloTransAngle, float r, float z)
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
double energy() const
cluster energy
Definition: PFCluster.h:74
float caloZ1()
Definition: FWPFGeom.h:21
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
void FWPFBlockProxyBuilder::setupTrackElement ( const reco::PFBlockElement blockElement,
TEveElement &  oItemHolder,
const FWViewContext vc,
FWViewType::EType  viewType 
)
protected

Definition at line 35 of file FWPFBlockProxyBuilder.cc.

References a, b, c, reco::PFBlockElement::DEFAULT, FWPFTrackUtils::getCollisionMarkers(), mps_fire::i, FWViewType::kLego, FWViewType::kLegoPFECAL, FWViewType::kRhoPhiPF, FWViewType::kRhoZ, dqmdumpme::last, FWProxyBuilderBase::setupAddElement(), FWPFTrackUtils::setupLegoTrack(), FWPFTrackUtils::setupTrack(), HLT_FULL_cff::track, reco::PFBlockElement::trackRef(), reco::PFBlockElement::trackType(), y, and z.

Referenced by buildViewType().

38  {
39  if (blockElement.trackType(reco::PFBlockElement::DEFAULT)) {
40  reco::Track track = *blockElement.trackRef();
41  FWPFTrackUtils *trackUtils = new FWPFTrackUtils();
42 
43  if (viewType == FWViewType::kLego || viewType == FWViewType::kLegoPFECAL) // Lego views
44  {
45  TEveStraightLineSet *legoTrack = trackUtils->setupLegoTrack(track);
46  setupAddElement(legoTrack, &oItemHolder);
47  } else if (viewType == FWViewType::kRhoPhiPF) // RhoPhi view
48  {
49  TEveTrack *trk = trackUtils->setupTrack(track);
50  TEvePointSet *ps = trackUtils->getCollisionMarkers(trk);
51  setupAddElement(trk, &oItemHolder);
52  if (ps->GetN() != 0)
53  setupAddElement(ps, &oItemHolder);
54  else
55  delete ps;
56  } else if (viewType == FWViewType::kRhoZ) // RhoZ view
57  {
58  TEveTrack *trk = trackUtils->setupTrack(track);
59  TEvePointSet *markers = trackUtils->getCollisionMarkers(trk);
60  TEvePointSet *ps = new TEvePointSet();
61  setupAddElement(trk, &oItemHolder);
62 
63  Float_t *trackPoints = trk->GetP();
64  unsigned int last = (trk->GetN() - 1) * 3;
65  float y = trackPoints[last + 1];
66  float z = trackPoints[last + 2];
67 
68  // Reposition any points that have been translated in RhoZ
69  for (signed int i = 0; i < markers->GetN(); ++i) {
70  Float_t a, b, c;
71  markers->GetPoint(i, a, b, c);
72 
73  if (y < 0 && b > 0)
74  b *= -1;
75  else if (y > 0 && b < 0)
76  b *= -1;
77 
78  if (z < 0 && c > 0)
79  c *= -1;
80  else if (z > 0 && c < 0)
81  c *= -1;
82 
83  ps->SetNextPoint(a, b, c);
84  }
85 
86  if (ps->GetN() != 0)
87  setupAddElement(ps, &oItemHolder);
88  else
89  delete ps;
90  delete markers;
91  }
92 
93  delete trackUtils;
94  }
95 }
const edm::EventSetup & c
TEvePointSet * getCollisionMarkers(const TEveTrack *)
TEveTrack * setupTrack(const reco::Track &)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
TEveStraightLineSet * setupLegoTrack(const reco::Track &)
double b
Definition: hdecay.h:118
virtual bool trackType(TrackType trType) const
double a
Definition: hdecay.h:119
tuple last
Definition: dqmdumpme.py:56
virtual const reco::TrackRef & trackRef() const
const std::string& FWPFBlockProxyBuilder::typeName ( ) const
inline

Definition at line 43 of file FWPFBlockProxyBuilder.h.

45 :
46  // --------------------- Member Functions --------------------------
const std::string& FWPFBlockProxyBuilder::view ( ) const
inline

Definition at line 43 of file FWPFBlockProxyBuilder.h.

45 :
46  // --------------------- Member Functions --------------------------

Member Data Documentation

BuilderType FWPFBlockProxyBuilder::e_builderType
protected
std::vector<ScalableLines> FWPFBlockProxyBuilder::m_clusters
protected

Definition at line 68 of file FWPFBlockProxyBuilder.h.

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