CMS 3D CMS Logo

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

Public Member Functions

 FWME0SegmentProxyBuilder (void)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWME0SegmentProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< ME0Segment >
 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 ME0Segment &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWME0SegmentProxyBuilder (const FWME0SegmentProxyBuilder &)=delete
 
const FWME0SegmentProxyBuilderoperator= (const FWME0SegmentProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< ME0Segment >
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 ME0Segment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const ME0SegmentmodelData (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 13 of file FWME0SegmentProxyBuilder.cc.

Constructor & Destructor Documentation

FWME0SegmentProxyBuilder::FWME0SegmentProxyBuilder ( void  )
inline

Definition at line 16 of file FWME0SegmentProxyBuilder.cc.

16 {}
FWME0SegmentProxyBuilder::~FWME0SegmentProxyBuilder ( void  )
inlineoverride

Definition at line 17 of file FWME0SegmentProxyBuilder.cc.

17 {}
FWME0SegmentProxyBuilder::FWME0SegmentProxyBuilder ( const FWME0SegmentProxyBuilder )
privatedelete

Member Function Documentation

void FWME0SegmentProxyBuilder::build ( const ME0Segment 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< ME0Segment >.

Definition at line 29 of file FWME0SegmentProxyBuilder.cc.

References FWGeometry::contains(), dir, fwLog, relativeConstraints::geom, FWGeometry::getEveShape(), FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, ME0Segment::localDirection(), ME0Segment::localPosition(), FWGeometry::localToGlobal(), ME0Segment::me0DetId(), DetId::rawId(), FWProxyBuilderBase::setupAddElement(), ME0Segment::specificRecHits(), csvLumiCalc::unit, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

31 {
32  const FWGeometry *geom = item()->getGeom();
33  unsigned int rawid = iData.me0DetId().rawId();
34 
35  if( ! geom->contains( rawid ))
36  {
37  fwLog(fwlog::kError) << "failed to get geometry of ME0 chamber with rawid: "
38  << rawid << std::endl;
39  return;
40  }
41 
42  TEveStraightLineSet* segmentSet = new TEveStraightLineSet();
43  // FIXME: This should be set elsewhere.
44  segmentSet->SetLineWidth( 5 );
45  setupAddElement( segmentSet, &oItemHolder );
46 
47  TEveGeoShape* shape = item()->getGeom()->getEveShape( rawid );
48  if( shape )
49  {
50  if( TGeoBBox* box = dynamic_cast<TGeoBBox*>( shape->GetShape()))
51  {
52  LocalPoint pos = iData.localPosition();
53  LocalVector dir = iData.localDirection();
54  LocalVector unit = dir.unit();
55 
56  double localPosition[3] = { pos.x(), pos.y(), pos.z() };
57  double localDirectionIn[3] = { dir.x(), dir.y(), dir.z() };
58  double localDirectionOut[3] = { -dir.x(), -dir.y(), -dir.z() };
59 
60  Double_t distIn = box->DistFromInside( localPosition, localDirectionIn );
61  Double_t distOut = box->DistFromInside( localPosition, localDirectionOut );
62  LocalVector vIn = unit * distIn;
63  LocalVector vOut = -unit * distOut;
64  float localSegmentInnerPoint[3] = { static_cast<float>(localPosition[0] + vIn.x()),
65  static_cast<float>(localPosition[1] + vIn.y()),
66  static_cast<float>(localPosition[2] + vIn.z())
67  };
68 
69  float localSegmentOuterPoint[3] = { static_cast<float>(localPosition[0] + vOut.x()),
70  static_cast<float>(localPosition[1] + vOut.y()),
71  static_cast<float>(localPosition[2] + vOut.z())
72  };
73 
74  float globalSegmentInnerPoint[3];
75  float globalSegmentOuterPoint[3];
76 
77  geom->localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
78 
79  segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
80  globalSegmentOuterPoint[0], globalSegmentOuterPoint[1], globalSegmentOuterPoint[2] );
81 
82  // Draw hits included in the segment
83  TEvePointSet* pointSet = new TEvePointSet;
84  // FIXME: This should be set elsewhere.
85  pointSet->SetMarkerSize(0.5);
86  pointSet->SetMarkerColor(1);
87  setupAddElement( pointSet, &oItemHolder );
88  auto recHits = iData.specificRecHits();
89  for (auto rh = recHits.begin(); rh!= recHits.end(); rh++){
90  auto me0id = rh->me0Id();
91  LocalPoint hpos = rh->localPosition();
92  float hitLocalPos[3]= {hpos.x(), hpos.y(), hpos.z()};
93  float hitGlobalPoint[3];
94  geom->localToGlobal(me0id, hitLocalPos, hitGlobalPoint);
95  pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);
96  }
97  }
98  }
99 }
const std::vector< ME0RecHit > & specificRecHits() const
Definition: ME0Segment.h:67
ME0DetId me0DetId() const
Definition: ME0Segment.h:71
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T y() const
Definition: PV3DBase.h:63
const FWEventItem * item() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:270
T z() const
Definition: PV3DBase.h:64
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:345
bool contains(unsigned int id) const
Definition: FWGeometry.h:113
LocalVector localDirection() const override
Local direction.
Definition: ME0Segment.h:43
LocalPoint localPosition() const override
Definition: ME0Segment.h:40
Vector3DBase unit() const
Definition: Vector3DBase.h:57
#define fwLog(_level_)
Definition: fwLog.h:50
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const std::string & FWME0SegmentProxyBuilder::classPurpose ( )
static

Definition at line 101 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 101 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 101 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 101 of file FWME0SegmentProxyBuilder.cc.

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