CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWCaloClusterProxyBuilder Class Reference
Inheritance diagram for FWCaloClusterProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::CaloCluster > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWCaloClusterProxyBuilder (void)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWCaloClusterProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::CaloCluster >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 ~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
 
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 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...
 

Private Member Functions

void build (const reco::CaloCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWCaloClusterProxyBuilder (const FWCaloClusterProxyBuilder &)=delete
 
const FWCaloClusterProxyBuilderoperator= (const FWCaloClusterProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::CaloCluster >
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
virtual void buildViewType (const reco::CaloCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const reco::CaloClustermodelData (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
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)
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 8 of file FWCaloClusterProxyBuilder.cc.

Constructor & Destructor Documentation

FWCaloClusterProxyBuilder::FWCaloClusterProxyBuilder ( void  )
inline

Definition at line 11 of file FWCaloClusterProxyBuilder.cc.

11 {}
FWCaloClusterProxyBuilder::~FWCaloClusterProxyBuilder ( void  )
inlineoverride

Definition at line 12 of file FWCaloClusterProxyBuilder.cc.

12 {}
FWCaloClusterProxyBuilder::FWCaloClusterProxyBuilder ( const FWCaloClusterProxyBuilder )
privatedelete

Member Function Documentation

void FWCaloClusterProxyBuilder::build ( const reco::CaloCluster iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
overrideprivatevirtual

iIndex is the index where iData is found in the container from which it came iItemHolder is the object to which you add your own objects which inherit from TEveElement

Reimplemented from FWSimpleProxyBuilderTemplate< reco::CaloCluster >.

Definition at line 25 of file FWCaloClusterProxyBuilder.cc.

References fireworks::energyTower3DCorners(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShapePars(), reco::CaloCluster::hitsAndFractions(), mps_fire::i, FWProxyBuilderBase::item(), FWProxyBuilderBase::setupAddElement(), and parallelization::uint().

26 {
27  std::vector<std::pair<DetId, float> > clusterDetIds = iData.hitsAndFractions();
28 
29  TEveBoxSet* boxset = new TEveBoxSet();
30  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
31  boxset->UseSingleColor();
32  boxset->SetPickable(true);
33 
34  for( std::vector<std::pair<DetId, float> >::iterator it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
35  it != itEnd; ++it )
36  {
37  const float* corners = item()->getGeom()->getCorners( it->first );
38 
39  if( corners == nullptr ) {
40  continue;
41  }
42 
43  std::vector<float> pnts(24);
44 
45  const uint type = ((it->first >> 28) & 0xF);
46  // HGCal
47  if(type >= 8 && type <= 10){
48 
49  const float* parameters = item()->getGeom()->getParameters( it->first );
50  const float* shapes = item()->getGeom()->getShapePars(it->first);
51 
52  if(parameters == nullptr || shapes == nullptr ){
53  continue;
54  }
55 
56  #if 0
57  const int total_points = parameters[0];
58  const int total_vertices = 3*total_points;
59  #else // using broken boxes(half hexagon) until there's support for hexagons in TEveBoxSet
60  const int total_points = 4;
61  const int total_vertices = 3*total_points;
62 
63  const float thickness = shapes[3];
64 
65  for(int i = 0; i < total_points; ++i){
66  pnts[i*3+0] = corners[i*3];
67  pnts[i*3+1] = corners[i*3+1];
68  pnts[i*3+2] = corners[i*3+2];
69 
70  pnts[(i*3+0)+total_vertices] = corners[i*3];
71  pnts[(i*3+1)+total_vertices] = corners[i*3+1];
72  pnts[(i*3+2)+total_vertices] = corners[i*3+2]+thickness;
73  }
74  #endif
75  }
76  // Not HGCal
77  else {
78  fireworks::energyTower3DCorners(corners, (*it).second, pnts);
79  }
80 
81  boxset->AddBox( &pnts[0]);
82  }
83 
84  boxset->RefitPlex();
85  setupAddElement(boxset, &oItemHolder);
86 }
type
Definition: HCALResponse.h:21
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:446
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:197
const FWEventItem * item() const
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:462
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:430
def uint(string)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const std::string & FWCaloClusterProxyBuilder::classPurpose ( )
static

Definition at line 88 of file FWCaloClusterProxyBuilder.cc.

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

Definition at line 88 of file FWCaloClusterProxyBuilder.cc.

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

Definition at line 88 of file FWCaloClusterProxyBuilder.cc.

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

Definition at line 88 of file FWCaloClusterProxyBuilder.cc.

const FWCaloClusterProxyBuilder& FWCaloClusterProxyBuilder::operator= ( const FWCaloClusterProxyBuilder )
privatedelete
const std::string& FWCaloClusterProxyBuilder::purpose ( ) const
inline
const std::string& FWCaloClusterProxyBuilder::typeName ( ) const
inline
const std::string& FWCaloClusterProxyBuilder::view ( ) const
inline