CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
 
 FWME0SegmentProxyBuilder (const FWME0SegmentProxyBuilder &)=delete
 
const FWME0SegmentProxyBuilderoperator= (const FWME0SegmentProxyBuilder &)=delete
 
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 ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const
FWSimpleProxyBuilderTemplate
operator= (const FWSimpleProxyBuilderTemplate &)=delete
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 FWSimpleProxyBuilder (const FWSimpleProxyBuilder &)=delete
 
const FWSimpleProxyBuilderoperator= (const FWSimpleProxyBuilder &)=delete
 
 ~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
 

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 14 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 )
delete

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 28 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(), HLT_FULL_cff::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().

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

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

Definition at line 103 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 103 of file FWME0SegmentProxyBuilder.cc.

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

Definition at line 103 of file FWME0SegmentProxyBuilder.cc.

const FWME0SegmentProxyBuilder& FWME0SegmentProxyBuilder::operator= ( const FWME0SegmentProxyBuilder )
delete
const std::string& FWME0SegmentProxyBuilder::purpose ( ) const
inline

Definition at line 19 of file FWME0SegmentProxyBuilder.cc.

24 :
25  void build(const ME0Segment& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
const std::string& FWME0SegmentProxyBuilder::typeName ( ) const
inline

Definition at line 19 of file FWME0SegmentProxyBuilder.cc.

24 :
25  void build(const ME0Segment& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
const std::string& FWME0SegmentProxyBuilder::view ( ) const
inline

Definition at line 19 of file FWME0SegmentProxyBuilder.cc.

24 :
25  void build(const ME0Segment& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;