CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
FWTrackingParticleProxyBuilder Class Reference
Inheritance diagram for FWTrackingParticleProxyBuilder:
FWSimpleProxyBuilderTemplate< TrackingParticle > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWTrackingParticleProxyBuilder (void)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual void setItem (const FWEventItem *iItem)
 
virtual ~FWTrackingParticleProxyBuilder (void)
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< TrackingParticle >
 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
 
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 ()
 

Private Member Functions

void build (const TrackingParticle &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
 FWTrackingParticleProxyBuilder (const FWTrackingParticleProxyBuilder &)
 
const
FWTrackingParticleProxyBuilder
operator= (const FWTrackingParticleProxyBuilder &)
 

Additional Inherited Members

- 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 Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< TrackingParticle >
const TrackingParticlemodelData (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
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 20 of file FWTrackingParticleProxyBuilder.cc.

Constructor & Destructor Documentation

FWTrackingParticleProxyBuilder::FWTrackingParticleProxyBuilder ( void  )
inline

Definition at line 23 of file FWTrackingParticleProxyBuilder.cc.

23 {}
virtual FWTrackingParticleProxyBuilder::~FWTrackingParticleProxyBuilder ( void  )
inlinevirtual

Definition at line 24 of file FWTrackingParticleProxyBuilder.cc.

24 {}
FWTrackingParticleProxyBuilder::FWTrackingParticleProxyBuilder ( const FWTrackingParticleProxyBuilder )
private

Member Function Documentation

void FWTrackingParticleProxyBuilder::build ( const TrackingParticle iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
privatevirtual

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< TrackingParticle >.

Definition at line 43 of file FWTrackingParticleProxyBuilder.cc.

References ParticleBase::charge(), FWProxyBuilderBase::context(), PSimHit::detUnitId(), end, relativeConstraints::geom, FWEventItem::getGeom(), FWProxyBuilderBase::item(), PSimHit::localPosition(), FWGeometry::localToGlobal(), PSimHit::momentumAtEntry(), ParticleBase::px(), ParticleBase::py(), ParticleBase::pz(), FWProxyBuilderBase::setupAddElement(), lumiQTWidget::t, PSimHit::trackId(), TrackingParticle::trackPSimHit(), ParticleBase::vx(), ParticleBase::vy(), ParticleBase::vz(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

44 {
45  TEveRecTrack t;
46  t.fBeta = 1.0;
47  t.fP = TEveVector( iData.px(), iData.py(), iData.pz() );
48  t.fV = TEveVector( iData.vx(), iData.vy(), iData.vz() );
49  t.fSign = iData.charge();
50 
51  TEveTrack* track = new TEveTrack(&t, context().getTrackPropagator());
52  if( t.fSign == 0 )
53  track->SetLineStyle( 7 );
54 
55  TEvePointSet* pointSet = new TEvePointSet;
56  setupAddElement( pointSet, track );
57  pointSet->SetMarkerSize(item()->getConfig()->value<long>("Point Size"));
58 
59  const FWGeometry *geom = item()->getGeom();
60  const std::vector<PSimHit>& hits = iData.trackPSimHit();
61 
62  float local[3];
63  float localDir[3];
64  float global[3] = { 0.0, 0.0, 0.0 };
65  float globalDir[3] = { 0.0, 0.0, 0.0 };
66  std::vector<PSimHit>::const_iterator it = hits.begin();
67  std::vector<PSimHit>::const_iterator end = hits.end();
68  if( it != end )
69  {
70  unsigned int trackid = hits.begin()->trackId();
71 
72  for( ; it != end; ++it )
73  {
74  const PSimHit& phit = (*it);
75  if( phit.trackId() != trackid )
76  {
77  trackid = phit.trackId();
78  track->AddPathMark( TEvePathMark( TEvePathMark::kDecay, TEveVector( global[0], global[1], global[2] ),
79  TEveVector( globalDir[0], globalDir[1], globalDir[2] )));
80  }
81  local[0] = phit.localPosition().x();
82  local[1] = phit.localPosition().y();
83  local[2] = phit.localPosition().z();
84  localDir[0] = phit.momentumAtEntry().x();
85  localDir[1] = phit.momentumAtEntry().y();
86  localDir[2] = phit.momentumAtEntry().z();
87  geom->localToGlobal( phit.detUnitId(), local, global );
88  geom->localToGlobal( phit.detUnitId(), localDir, globalDir );
89  pointSet->SetNextPoint( global[0], global[1], global[2] );
90  track->AddPathMark( TEvePathMark( TEvePathMark::kReference/*kDaughter*/, TEveVector( global[0], global[1], global[2] ),
91  TEveVector( globalDir[0], globalDir[1], globalDir[2] )));
92  }
93  if( hits.size() > 1 )
94  track->AddPathMark( TEvePathMark( TEvePathMark::kDecay, TEveVector( global[0], global[1], global[2] ),
95  TEveVector( globalDir[0], globalDir[1], globalDir[2] )));
96  }
97 
98  track->MakeTrack();
99  setupAddElement( track, &oItemHolder );
100 }
const fireworks::Context & context() const
int charge() const
electric charge
Definition: ParticleBase.h:54
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
const std::vector< PSimHit > & trackPSimHit() const
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T y() const
Definition: PV3DBase.h:62
void localToGlobal(unsigned int id, const float *local, float *global) const
Definition: FWGeometry.cc:325
double pz() const
z coordinate of momentum vector
Definition: ParticleBase.h:151
const FWEventItem * item() const
double px() const
x coordinate of momentum vector
Definition: ParticleBase.h:139
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T z() const
Definition: PV3DBase.h:63
double vz() const
z coordinate of vertex position
Definition: ParticleBase.h:243
#define end
Definition: vmac.h:38
double vx() const
x coordinate of vertex position
Definition: ParticleBase.h:233
unsigned int trackId() const
Definition: PSimHit.h:102
double py() const
y coordinate of momentum vector
Definition: ParticleBase.h:145
T x() const
Definition: PV3DBase.h:61
double vy() const
y coordinate of vertex position
Definition: ParticleBase.h:238
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
unsigned int detUnitId() const
Definition: PSimHit.h:93
const FWTrackingParticleProxyBuilder& FWTrackingParticleProxyBuilder::operator= ( const FWTrackingParticleProxyBuilder )
private
FWTrackingParticleProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
virtual void FWTrackingParticleProxyBuilder::setItem ( const FWEventItem iItem)
inlinevirtual