test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
 
virtual ~FWPFBlockProxyBuilder ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::PFBlock >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
virtual ~FWSimpleProxyBuilder ()
 
- 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

virtual void buildViewType (const reco::PFBlock &, unsigned int, TEveElement &, FWViewType::EType, const FWViewContext *)
 
virtual void cleanLocal ()
 
void clusterSharedBuild (const reco::PFCluster &, TEveElement &, const FWViewContext *)
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
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 >
virtual void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context)
 
virtual void build (const reco::PFBlock &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
virtual void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context)
 
const reco::PFBlockmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *)
 
virtual void clean ()
 
- 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 37 of file FWPFBlockProxyBuilder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWPFBlockProxyBuilder::FWPFBlockProxyBuilder ( )
inline
virtual FWPFBlockProxyBuilder::~FWPFBlockProxyBuilder ( )
inlinevirtual

Definition at line 44 of file FWPFBlockProxyBuilder.h.

44 {}
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 
)
protectedvirtual

Reimplemented from FWSimpleProxyBuilderTemplate< reco::PFBlock >.

Definition at line 158 of file FWPFBlockProxyBuilder.cc.

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

160 {
162 
163  for( unsigned int i = 0; i < elements.size(); ++i )
164  {
165  reco::PFBlockElement::Type type = elements[i].type();
166  switch( type )
167  {
168  case 1: // TRACK
169  if( e_builderType == BASE )
170  setupTrackElement( elements[i], oItemHolder, vc, viewType );
171  break;
172 
173  case 4: // ECAL
174  if( e_builderType == ECAL )
175  setupClusterElement( elements[i], oItemHolder, vc, viewType, FWPFGeom::caloR1() );
176  break;
177 
178  case 5: // HCAL
179  if( e_builderType == HCAL )
180  {
181  if( viewType == FWViewType::kRhoPhiPF )
182  setupClusterElement( elements[i], oItemHolder, vc, viewType, FWPFGeom::caloR2() );
183  else // RhoZ
184  setupClusterElement( elements[i], oItemHolder, vc, viewType, context().caloR1() );
185  }
186  break;
187 
188  default: // Ignore anything that isn't wanted
189  break;
190  }
191  }
192 }
type
Definition: HCALResponse.h:21
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
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:264
const edm::OwnVector< reco::PFBlockElement > & elements() const
Definition: PFBlock.h:107
dictionary elements
float caloR1()
Definition: FWPFGeom.h:21
float caloR2()
Definition: FWPFGeom.h:25
const std::string & FWPFBlockProxyBuilder::classPurpose ( )
static

Definition at line 196 of file FWPFBlockProxyBuilder.cc.

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

Definition at line 196 of file FWPFBlockProxyBuilder.cc.

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

Definition at line 196 of file FWPFBlockProxyBuilder.cc.

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

Definition at line 196 of file FWPFBlockProxyBuilder.cc.

virtual void FWPFBlockProxyBuilder::cleanLocal ( )
inlineprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 65 of file FWPFBlockProxyBuilder.h.

References m_clusters.

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

Reimplemented from FWProxyBuilderBase.

Definition at line 56 of file FWPFBlockProxyBuilder.h.

56 { return true; }
virtual bool FWPFBlockProxyBuilder::haveSingleProduct ( void  ) const
inlineprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 59 of file FWPFBlockProxyBuilder.h.

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

Definition at line 46 of file FWPFBlockProxyBuilder.h.

48 :
49  // --------------------- Member Functions --------------------------
void FWPFBlockProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
)
protectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 6 of file FWPFBlockProxyBuilder.cc.

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

7 {
8  typedef std::vector<ScalableLines> Lines_t;
9  FWViewEnergyScale *caloScale = vc->getEnergyScale();
10 
11  if( viewType == FWViewType::kRhoPhiPF || viewType == FWViewType::kRhoZ )
12  { /* Handle the rhophi and rhoz cluster scaling */
13  for( Lines_t::iterator i = m_clusters.begin(); i != m_clusters.end(); ++i )
14  {
15  if( vc == (*i).m_vc )
16  {
17  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
18  (*i).m_ls->SetScale( caloScale->getScaleFactor3D() * value );
19  TEveProjected *proj = *(*i).m_ls->BeginProjecteds();
20  proj->UpdateProjection();
21  }
22  }
23  } /* Handle cluster scaling in lego view(s) */
24  else if( viewType == FWViewType::kLego || viewType == FWViewType::kLegoPFECAL )
25  { // Loop products
26  for( TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i )
27  {
28  if( (*i)->HasChildren() )
29  { // Loop elements of block
30  for( TEveElement::List_i j = (*i)->BeginChildren(); j != (*i)->EndChildren(); ++j )
31  {
32  if( strcmp( (*j)->GetElementName(), "BlockCluster" ) == 0 )
33  {
34  FWLegoCandidate *cluster = dynamic_cast<FWLegoCandidate*>( *j );
35  cluster->updateScale( vc, context() );
36  }
37  }
38  }
39  }
40  }
41 }
const fireworks::Context & context() const
float getScaleFactor3D() const
int i
Definition: DBlmapReader.cc:9
FWViewEnergyScale * getEnergyScale() const
std::vector< ScalableLines > m_clusters
int j
Definition: DBlmapReader.cc:9
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 112 of file FWPFBlockProxyBuilder.cc.

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

Referenced by buildViewType().

114 {
115  // Get reference to PFCluster
116  reco::PFCluster cluster = *blockElement.clusterRef();
117  TEveVector centre = TEveVector( cluster.x(), cluster.y(), cluster.z() );
118  float energy = cluster.energy();
119  float et = FWPFMaths::calculateEt( centre, energy );
120  float pt = et;
121  float eta = cluster.eta();
122  float phi = cluster.phi();
123 
125 
126  if( viewType == FWViewType::kLego || viewType == FWViewType::kLegoPFECAL )
127  {
128  FWLegoCandidate *legoCluster = new FWLegoCandidate( vc, FWProxyBuilderBase::context(), energy, et, pt, eta, phi );
129  legoCluster->SetMarkerColor( FWProxyBuilderBase::item()->defaultDisplayProperties().color() );
130  legoCluster->SetElementName( "BlockCluster" );
131  setupAddElement( legoCluster, &oItemHolder );
132  }
133  if( viewType == FWViewType::kRhoPhiPF )
134  {
136  FWPFClusterRPZUtils *clusterUtils = new FWPFClusterRPZUtils();
137  TEveScalableStraightLineSet *rpCluster = clusterUtils->buildRhoPhiClusterLineSet( cluster, vc, energy, et, r );
138  rpCluster->SetLineColor( dp.color() );
139  m_clusters.push_back( ScalableLines( rpCluster, et, energy, vc ) );
140  setupAddElement( rpCluster, &oItemHolder );
141  delete clusterUtils;
142  }
143  else if( viewType == FWViewType::kRhoZ )
144  {
146  FWPFClusterRPZUtils *clusterUtils = new FWPFClusterRPZUtils();
147  TEveScalableStraightLineSet *rzCluster = clusterUtils->buildRhoZClusterLineSet( cluster, vc, context().caloTransAngle(),
148  energy, et, r, context().caloZ1() );
149  rzCluster->SetLineColor( dp.color() );
150  m_clusters.push_back( ScalableLines( rzCluster, et, energy, vc ) );
151  setupAddElement( rzCluster, &oItemHolder );
152  delete clusterUtils;
153  }
154 }
const fireworks::Context & context() const
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
virtual const PFClusterRef & clusterRef() const
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:183
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:160
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
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:154
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
double energy() const
cluster energy
Definition: PFCluster.h:82
auto dp
Definition: deltaR.h:22
float caloZ1()
Definition: FWPFGeom.h:22
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:157
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:166
void FWPFBlockProxyBuilder::setupTrackElement ( const reco::PFBlockElement blockElement,
TEveElement &  oItemHolder,
const FWViewContext vc,
FWViewType::EType  viewType 
)
protected

Definition at line 45 of file FWPFBlockProxyBuilder.cc.

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

Referenced by buildViewType().

47 {
48  if( blockElement.trackType( reco::PFBlockElement::DEFAULT ) )
49  {
50  reco::Track track = *blockElement.trackRef();
51  FWPFTrackUtils *trackUtils = new FWPFTrackUtils();
52 
53  if( viewType == FWViewType::kLego || viewType == FWViewType::kLegoPFECAL ) // Lego views
54  {
55  TEveStraightLineSet *legoTrack = trackUtils->setupLegoTrack( track );
56  setupAddElement( legoTrack, &oItemHolder );
57  }
58  else if( viewType == FWViewType::kRhoPhiPF ) // RhoPhi view
59  {
60  TEveTrack *trk = trackUtils->setupTrack( track );
61  TEvePointSet *ps = trackUtils->getCollisionMarkers( trk );
62  setupAddElement( trk, &oItemHolder );
63  if( ps->GetN() != 0 )
64  setupAddElement( ps, &oItemHolder );
65  else
66  delete ps;
67  }
68  else if ( viewType == FWViewType::kRhoZ ) // RhoZ view
69  {
70  TEveTrack *trk = trackUtils->setupTrack( track );
71  TEvePointSet *markers = trackUtils->getCollisionMarkers( trk );
72  TEvePointSet *ps = new TEvePointSet();
73  setupAddElement( trk, &oItemHolder );
74 
75  Float_t *trackPoints = trk->GetP();
76  unsigned int last = ( trk->GetN() - 1 ) * 3;
77  float y = trackPoints[last+1];
78  float z = trackPoints[last+2];
79 
80  // Reposition any points that have been translated in RhoZ
81  for( signed int i = 0; i < markers->GetN(); ++i )
82  {
83  Float_t a,b,c;
84  markers->GetPoint( i, a, b, c );
85 
86  if( y < 0 && b > 0 )
87  b *= -1;
88  else if( y > 0 && b < 0 )
89  b *= -1;
90 
91  if( z < 0 && c > 0 )
92  c *= -1;
93  else if( z > 0 && c < 0 )
94  c *= -1;
95 
96  ps->SetNextPoint( a, b, c );
97  }
98 
99  if( ps->GetN() != 0 )
100  setupAddElement( ps, &oItemHolder );
101  else
102  delete ps;
103  delete markers;
104  }
105 
106  delete trackUtils;
107  }
108 }
int i
Definition: DBlmapReader.cc:9
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:120
virtual bool trackType(TrackType trType) const
double a
Definition: hdecay.h:121
virtual const reco::TrackRef & trackRef() const
const std::string& FWPFBlockProxyBuilder::typeName ( ) const
inline

Definition at line 46 of file FWPFBlockProxyBuilder.h.

48 :
49  // --------------------- Member Functions --------------------------
const std::string& FWPFBlockProxyBuilder::view ( ) const
inline

Definition at line 46 of file FWPFBlockProxyBuilder.h.

48 :
49  // --------------------- Member Functions --------------------------

Member Data Documentation

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

Definition at line 73 of file FWPFBlockProxyBuilder.h.

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