CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWCaloParticleProxyBuilder Class Reference
Inheritance diagram for FWCaloParticleProxyBuilder:
FWProxyBuilderBase

Public Member Functions

 FWCaloParticleProxyBuilder (void)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWCaloParticleProxyBuilder (void) 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
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () 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 FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 

Private Member Functions

void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
 FWCaloParticleProxyBuilder (const FWCaloParticleProxyBuilder &)=delete
 
const FWCaloParticleProxyBuilderoperator= (const FWCaloParticleProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
virtual void cleanLocal ()
 
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 &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 33 of file FWCaloParticleProxyBuilder.cc.

Constructor & Destructor Documentation

FWCaloParticleProxyBuilder::FWCaloParticleProxyBuilder ( void  )
inline

Definition at line 36 of file FWCaloParticleProxyBuilder.cc.

36 {}
FWCaloParticleProxyBuilder::~FWCaloParticleProxyBuilder ( void  )
inlineoverride

Definition at line 37 of file FWCaloParticleProxyBuilder.cc.

37 {}
FWCaloParticleProxyBuilder::FWCaloParticleProxyBuilder ( const FWCaloParticleProxyBuilder )
privatedelete

Member Function Documentation

void FWCaloParticleProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 50 of file FWCaloParticleProxyBuilder.cc.

References EnergyCorrector::c, universalConfigTemplate::collection, FWEventItem::get(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShapePars(), mps_fire::i, FWProxyBuilderBase::item(), and FWProxyBuilderBase::setupAddElement().

50  {
51  const CaloParticleCollection* collection = nullptr;
52  iItem->get( collection );
53 
54  if( collection == nullptr ) return;
55 
56  for( const auto & iData : *collection )
57  {
58  TEveBoxSet* boxset = new TEveBoxSet();
59  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
60  boxset->UseSingleColor();
61  boxset->SetPickable(true);
62 
63  for (const auto & c : iData.simClusters())
64  {
65  for( const auto & it : (*c).hits_and_fractions() )
66  {
67  const float* corners = item()->getGeom()->getCorners( it.first );
68  const float* parameters = item()->getGeom()->getParameters( it.first );
69  const float* shapes = item()->getGeom()->getShapePars(it.first);
70 
71  if( corners == nullptr || parameters == nullptr || shapes == nullptr ) {
72  continue;
73  }
74 
75 #if 0
76  const int total_points = parameters[0];
77  const int total_vertices = 3*total_points;
78 #else // using broken boxes(half hexagon) until there's support for hexagons in TEveBoxSet
79  const int total_points = 4;
80  const int total_vertices = 3*total_points;
81 
82  const float thickness = shapes[3];
83 
84  std::vector<float> pnts(24);
85  for(int i = 0; i < total_points; ++i){
86  pnts[i*3+0] = corners[i*3];
87  pnts[i*3+1] = corners[i*3+1];
88  pnts[i*3+2] = corners[i*3+2];
89 
90  pnts[(i*3+0)+total_vertices] = corners[i*3];
91  pnts[(i*3+1)+total_vertices] = corners[i*3+1];
92  pnts[(i*3+2)+total_vertices] = corners[i*3+2]+thickness;
93  }
94  boxset->AddBox( &pnts[0]);
95 #endif
96 
97  }
98  }
99  boxset->RefitPlex();
100  setupAddElement(boxset, product);
101  }
102 }
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:446
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:85
const FWEventItem * item() const
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:462
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:430
std::vector< CaloParticle > CaloParticleCollection
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const std::string & FWCaloParticleProxyBuilder::classPurpose ( )
static

Definition at line 104 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 104 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 104 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 104 of file FWCaloParticleProxyBuilder.cc.

const FWCaloParticleProxyBuilder& FWCaloParticleProxyBuilder::operator= ( const FWCaloParticleProxyBuilder )
privatedelete
const std::string& FWCaloParticleProxyBuilder::purpose ( ) const
inline

Definition at line 39 of file FWCaloParticleProxyBuilder.cc.

40 :
41  // Disable default copy constructor
const std::string& FWCaloParticleProxyBuilder::typeName ( ) const
inline

Definition at line 39 of file FWCaloParticleProxyBuilder.cc.

40 :
41  // Disable default copy constructor
const std::string& FWCaloParticleProxyBuilder::view ( ) const
inline

Definition at line 39 of file FWCaloParticleProxyBuilder.cc.

40 :
41  // Disable default copy constructor