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 15 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 16 of file FWME0SegmentProxyBuilder.cc.

16 {}
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 27 of file FWME0SegmentProxyBuilder.cc.

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

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 102 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