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
FWDTSegmentProxyBuilder Class Reference
Inheritance diagram for FWDTSegmentProxyBuilder:
FWSimpleProxyBuilderTemplate< DTRecSegment4D > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWDTSegmentProxyBuilder (void)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWDTSegmentProxyBuilder (void)
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< DTRecSegment4D >
 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 &)
 
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 ()
 

Private Member Functions

void build (const DTRecSegment4D &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
 FWDTSegmentProxyBuilder (const FWDTSegmentProxyBuilder &)
 
const FWDTSegmentProxyBuilderoperator= (const FWDTSegmentProxyBuilder &)
 

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< DTRecSegment4D >
const DTRecSegment4DmodelData (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 25 of file FWDTSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

FWDTSegmentProxyBuilder::FWDTSegmentProxyBuilder ( void  )
inline

Definition at line 28 of file FWDTSegmentProxyBuilder.cc.

28 {}
virtual FWDTSegmentProxyBuilder::~FWDTSegmentProxyBuilder ( void  )
inlinevirtual

Definition at line 29 of file FWDTSegmentProxyBuilder.cc.

29 {}
FWDTSegmentProxyBuilder::FWDTSegmentProxyBuilder ( const FWDTSegmentProxyBuilder )
private

Member Function Documentation

void FWDTSegmentProxyBuilder::build ( const DTRecSegment4D 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< DTRecSegment4D >.

Definition at line 41 of file FWDTSegmentProxyBuilder.cc.

References DTRecSegment4D::chamberId(), FWGeometry::contains(), dir, fwLog, relativeConstraints::geom, FWGeometry::getEveShape(), FWEventItem::getGeom(), FWProxyBuilderBase::item(), FWViewType::kAll3DBits, FWViewType::kAllRPZBits, fwlog::kError, DTRecSegment4D::localDirection(), DTRecSegment4D::localPosition(), FWGeometry::localToGlobal(), pos, DetId::rawId(), REGISTER_FWPROXYBUILDER, FWProxyBuilderBase::setupAddElement(), csvLumiCalc::unit, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

43 {
44  unsigned int rawid = iData.chamberId().rawId();
45  const FWGeometry *geom = item()->getGeom();
46 
47  if( ! geom->contains( rawid ))
48  {
49  fwLog( fwlog::kError ) << "failed to get geometry of DT chamber with detid: "
50  << rawid << std::endl;
51  return;
52  }
53 
54  TEveStraightLineSet* segmentSet = new TEveStraightLineSet();
55  // FIXME: This should be set elsewhere.
56  segmentSet->SetLineWidth( 3 );
57  setupAddElement( segmentSet, &oItemHolder );
58 
59  TEveGeoShape* shape = item()->getGeom()->getEveShape( rawid );
60  if( shape )
61  {
62  if( TGeoBBox* box = dynamic_cast<TGeoBBox*>( shape->GetShape()))
63  {
64  LocalPoint pos = iData.localPosition();
65  LocalVector dir = iData.localDirection();
66  LocalVector unit = dir.unit();
67 
68  double localPosition[3] = { pos.x(), pos.y(), pos.z() };
69  double localDirectionIn[3] = { dir.x(), dir.y(), dir.z() };
70  double localDirectionOut[3] = { -dir.x(), -dir.y(), -dir.z() };
71 
72  Double_t distIn = box->DistFromInside( localPosition, localDirectionIn );
73  Double_t distOut = box->DistFromInside( localPosition, localDirectionOut );
74  LocalVector vIn = unit * distIn;
75  LocalVector vOut = -unit * distOut;
76  float localSegmentInnerPoint[3] = { static_cast<float>(localPosition[0] + vIn.x()),
77  static_cast<float>(localPosition[1] + vIn.y()),
78  static_cast<float>(localPosition[2] + vIn.z())
79  };
80 
81  float localSegmentOuterPoint[3] = { static_cast<float>(localPosition[0] + vOut.x()),
82  static_cast<float>(localPosition[1] + vOut.y()),
83  static_cast<float>(localPosition[2] + vOut.z())
84  };
85 
86  float globalSegmentInnerPoint[3];
87  float globalSegmentOuterPoint[3];
88 
89  geom->localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
90 
91  segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
92  globalSegmentOuterPoint[0], globalSegmentOuterPoint[1], globalSegmentOuterPoint[2] );
93  }
94  }
95 }
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T y() const
Definition: PV3DBase.h:63
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
void localToGlobal(unsigned int id, const float *local, float *global) const
Definition: FWGeometry.cc:325
const FWEventItem * item() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual LocalVector localDirection() const
Local direction in Chamber frame.
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
string unit
Definition: csvLumiCalc.py:46
T z() const
Definition: PV3DBase.h:64
bool contains(unsigned int id) const
Definition: FWGeometry.h:98
virtual LocalPoint localPosition() const
Local position in Chamber frame.
Vector3DBase unit() const
Definition: Vector3DBase.h:57
#define fwLog(_level_)
Definition: fwLog.h:51
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:682
const FWDTSegmentProxyBuilder& FWDTSegmentProxyBuilder::operator= ( const FWDTSegmentProxyBuilder )
private
FWDTSegmentProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )