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

Constructor & Destructor Documentation

◆ FWME0SegmentProxyBuilder() [1/2]

FWME0SegmentProxyBuilder::FWME0SegmentProxyBuilder ( void  )
inline

Definition at line 16 of file FWME0SegmentProxyBuilder.cc.

16 {}

◆ ~FWME0SegmentProxyBuilder()

FWME0SegmentProxyBuilder::~FWME0SegmentProxyBuilder ( void  )
inlineoverride

Definition at line 17 of file FWME0SegmentProxyBuilder.cc.

17 {}

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

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 }

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

◆ classRegisterTypeName()

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

Definition at line 103 of file FWME0SegmentProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 103 of file FWME0SegmentProxyBuilder.cc.

◆ classView()

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

Definition at line 103 of file FWME0SegmentProxyBuilder.cc.

◆ operator=()

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

◆ purpose()

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

Definition at line 19 of file FWME0SegmentProxyBuilder.cc.

21 :

◆ typeName()

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

Definition at line 19 of file FWME0SegmentProxyBuilder.cc.

21 :

◆ view()

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

Definition at line 19 of file FWME0SegmentProxyBuilder.cc.

21 :
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:16
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:14
fwlog::kError
Definition: fwLog.h:35
FWGeometry::getEveShape
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:324
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23