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 ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
virtual void buildViewType (const ME0Segment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const ME0SegmentmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
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() [1/2]

FWME0SegmentProxyBuilder::FWME0SegmentProxyBuilder ( void  )
inline

Definition at line 15 of file FWME0SegmentProxyBuilder.cc.

15 {}

◆ ~FWME0SegmentProxyBuilder()

FWME0SegmentProxyBuilder::~FWME0SegmentProxyBuilder ( void  )
inlineoverride

Definition at line 16 of file FWME0SegmentProxyBuilder.cc.

16 {}

◆ FWME0SegmentProxyBuilder() [2/2]

FWME0SegmentProxyBuilder::FWME0SegmentProxyBuilder ( const FWME0SegmentProxyBuilder )
privatedelete

Member Function Documentation

◆ build()

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.

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 }

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

◆ classPurpose()

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

◆ classView()

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

Definition at line 102 of file FWME0SegmentProxyBuilder.cc.

◆ operator=()

const FWME0SegmentProxyBuilder& FWME0SegmentProxyBuilder::operator= ( const FWME0SegmentProxyBuilder )
privatedelete

◆ purpose()

const std::string& FWME0SegmentProxyBuilder::purpose ( ) const
inline

Definition at line 18 of file FWME0SegmentProxyBuilder.cc.

20 :

◆ typeName()

const std::string& FWME0SegmentProxyBuilder::typeName ( ) const
inline

Definition at line 18 of file FWME0SegmentProxyBuilder.cc.

20 :

◆ view()

const std::string& FWME0SegmentProxyBuilder::view ( ) const
inline

Definition at line 18 of file FWME0SegmentProxyBuilder.cc.

20 :
Vector3DBase< float, LocalTag >
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWGeometry
Definition: FWGeometry.h:27
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
ME0Segment::specificRecHits
const std::vector< ME0RecHit > & specificRecHits() const
Definition: ME0Segment.h:74
pos
Definition: PixelAliasList.h:18
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
FWME0SegmentProxyBuilder::FWME0SegmentProxyBuilder
FWME0SegmentProxyBuilder(void)
Definition: FWME0SegmentProxyBuilder.cc:15
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
ME0Segment::localDirection
LocalVector localDirection() const override
Local direction.
Definition: ME0Segment.h:50
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
ME0Segment::me0DetId
ME0DetId me0DetId() const
Definition: ME0Segment.h:78
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
ME0Segment::localPosition
LocalPoint localPosition() const override
Definition: ME0Segment.h:47
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
FWME0SegmentProxyBuilder
Definition: FWME0SegmentProxyBuilder.cc:13
fwlog::kError
Definition: fwLog.h:35
FWGeometry::getEveShape
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:321
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23