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:
FWSimpleProxyBuilderTemplate< CaloParticle > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWCaloParticleProxyBuilder (void)
 
const std::string & purpose () const
 
void setItem (const FWEventItem *iItem) override
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWCaloParticleProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< CaloParticle >
 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 &)
 
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 CaloParticle &iData, unsigned int iIndex, TEveElement &oItemHolder, 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 FWSimpleProxyBuilderTemplate< CaloParticle >
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 CaloParticle &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const CaloParticlemodelData (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 23 of file FWCaloParticleProxyBuilder.cc.

Constructor & Destructor Documentation

FWCaloParticleProxyBuilder::FWCaloParticleProxyBuilder ( void  )
inline

Definition at line 26 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 27 of file FWCaloParticleProxyBuilder.cc.

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

Member Function Documentation

void FWCaloParticleProxyBuilder::build ( const CaloParticle 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< CaloParticle >.

Definition at line 47 of file FWCaloParticleProxyBuilder.cc.

References EnergyCorrector::c, CaloParticle::charge(), FWProxyBuilderBase::context(), fireworks::energyTower3DCorners(), CaloParticle::g4Tracks(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWProxyBuilderBase::item(), CaloParticle::px(), CaloParticle::py(), CaloParticle::pz(), FWProxyBuilderBase::setupAddElement(), CaloParticle::simClusters(), lumiQTWidget::t, and HiIsolationCommonParameters_cff::track.

48 {
49  TEveRecTrack t;
50  t.fBeta = 1.0;
51  t.fP = TEveVector( iData.px(), iData.py(), iData.pz() );
52  t.fV = TEveVector( iData.g4Tracks()[0].trackerSurfacePosition().x(),
53  iData.g4Tracks()[0].trackerSurfacePosition().y(),
54  iData.g4Tracks()[0].trackerSurfacePosition().z() );
55  t.fSign = iData.charge();
56 
57  TEveTrack* track = new TEveTrack(&t, context().getTrackPropagator());
58  if( t.fSign == 0 )
59  track->SetLineStyle( 7 );
60 
61  track->MakeTrack();
62  setupAddElement( track, &oItemHolder );
63  TEveBoxSet* boxset = new TEveBoxSet();
64  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
65  boxset->UseSingleColor();
66  boxset->SetPickable(true);
67  for (const auto & c : iData.simClusters())
68  {
69  auto clusterDetIds = (*c).hits_and_fractions();
70 
71 
72  for( auto it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
73  it != itEnd; ++it )
74  {
75  const float* corners = item()->getGeom()->getCorners( (*it).first );
76  if( corners == nullptr ) {
77  continue;
78  }
79  std::vector<float> pnts(24);
80  fireworks::energyTower3DCorners(corners, (*it).second, pnts);
81  boxset->AddBox( &pnts[0]);
82  }
83  }
84  boxset->RefitPlex();
85  setupAddElement(boxset, &oItemHolder);
86 }
float pz() const
z coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
Definition: CaloParticle.h:146
const fireworks::Context & context() const
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition: CaloParticle.h:81
const std::vector< SimTrack > & g4Tracks() const
Definition: CaloParticle.h:76
const FWEventItem * item() const
const SimClusterRefVector & simClusters() const
Definition: CaloParticle.h:74
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:297
float px() const
x coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
Definition: CaloParticle.h:136
float py() const
y coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
Definition: CaloParticle.h:141
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const std::string & FWCaloParticleProxyBuilder::classPurpose ( )
static

Definition at line 88 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 88 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 88 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 88 of file FWCaloParticleProxyBuilder.cc.

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

Definition at line 34 of file FWCaloParticleProxyBuilder.cc.

36 :
37  // Disable default copy constructor
void FWCaloParticleProxyBuilder::setItem ( const FWEventItem iItem)
inlineoverridevirtual
const std::string& FWCaloParticleProxyBuilder::typeName ( ) const
inline

Definition at line 34 of file FWCaloParticleProxyBuilder.cc.

36 :
37  // Disable default copy constructor
const std::string& FWCaloParticleProxyBuilder::view ( ) const
inline

Definition at line 34 of file FWCaloParticleProxyBuilder.cc.

36 :
37  // Disable default copy constructor