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
FWCSCSegmentProxyBuilder Class Reference
Inheritance diagram for FWCSCSegmentProxyBuilder:
FWSimpleProxyBuilderTemplate< CSCSegment > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWCSCSegmentProxyBuilder (void)
 
 FWCSCSegmentProxyBuilder (const FWCSCSegmentProxyBuilder &)=delete
 
const FWCSCSegmentProxyBuilderoperator= (const FWCSCSegmentProxyBuilder &)=delete
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWCSCSegmentProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< CSCSegment >
 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 CSCSegment &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< CSCSegment >
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 CSCSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const CSCSegmentmodelData (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 25 of file FWCSCSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

FWCSCSegmentProxyBuilder::FWCSCSegmentProxyBuilder ( void  )
inline

Definition at line 27 of file FWCSCSegmentProxyBuilder.cc.

27 {}
FWCSCSegmentProxyBuilder::~FWCSCSegmentProxyBuilder ( void  )
inlineoverride

Definition at line 28 of file FWCSCSegmentProxyBuilder.cc.

28 {}
FWCSCSegmentProxyBuilder::FWCSCSegmentProxyBuilder ( const FWCSCSegmentProxyBuilder )
delete

Member Function Documentation

void FWCSCSegmentProxyBuilder::build ( const CSCSegment 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< CSCSegment >.

Definition at line 40 of file FWCSCSegmentProxyBuilder.cc.

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

43  {
44  const FWGeometry* geom = item()->getGeom();
45  unsigned int rawid = iData.cscDetId().rawId();
46 
47  if (!geom->contains(rawid)) {
48  fwLog(fwlog::kError) << "failed to get geometry of CSC chamber with rawid: " << rawid << std::endl;
49  return;
50  }
51 
52  TEveStraightLineSet* segmentSet = new TEveStraightLineSet();
53  // FIXME: This should be set elsewhere.
54  segmentSet->SetLineWidth(3);
55  setupAddElement(segmentSet, &oItemHolder);
56 
57  TEveGeoShape* shape = item()->getGeom()->getEveShape(rawid);
58  if (TGeoTrap* trap = dynamic_cast<TGeoTrap*>(shape->GetShape())) // Trapezoidal
59  {
60  LocalPoint pos = iData.localPosition();
61  LocalVector dir = iData.localDirection();
62  LocalVector unit = dir.unit();
63 
64  Double_t localPosition[3] = {pos.x(), pos.y(), pos.z()};
65  Double_t localDirectionIn[3] = {dir.x(), dir.y(), dir.z()};
66  Double_t localDirectionOut[3] = {-dir.x(), -dir.y(), -dir.z()};
67 
68  float distIn = trap->DistFromInside(localPosition, localDirectionIn);
69  float distOut = trap->DistFromInside(localPosition, localDirectionOut);
70  LocalVector vIn = unit * distIn;
71  LocalVector vOut = -unit * distOut;
72  float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.x()),
73  static_cast<float>(localPosition[1] + vIn.y()),
74  static_cast<float>(localPosition[2] + vIn.z())};
75 
76  float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.x()),
77  static_cast<float>(localPosition[1] + vOut.y()),
78  static_cast<float>(localPosition[2] + vOut.z())};
79 
80  float globalSegmentInnerPoint[3];
81  float globalSegmentOuterPoint[3];
82 
83  geom->localToGlobal(
84  rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
85 
86  segmentSet->AddLine(globalSegmentInnerPoint[0],
87  globalSegmentInnerPoint[1],
88  globalSegmentInnerPoint[2],
89  globalSegmentOuterPoint[0],
90  globalSegmentOuterPoint[1],
91  globalSegmentOuterPoint[2]);
92  }
93 }
LocalPoint localPosition() const override
Definition: CSCSegment.h:39
CSCDetId cscDetId() const
Definition: CSCSegment.h:70
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
LocalVector localDirection() const override
Local direction.
Definition: CSCSegment.h:42
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
T x() const
Definition: PV3DBase.h:59
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
Basic3DVector unit() const
const std::string & FWCSCSegmentProxyBuilder::classPurpose ( )
static

Definition at line 98 of file FWCSCSegmentProxyBuilder.cc.

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

Definition at line 98 of file FWCSCSegmentProxyBuilder.cc.

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

Definition at line 98 of file FWCSCSegmentProxyBuilder.cc.

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

Definition at line 98 of file FWCSCSegmentProxyBuilder.cc.

const FWCSCSegmentProxyBuilder& FWCSCSegmentProxyBuilder::operator= ( const FWCSCSegmentProxyBuilder )
delete
const std::string& FWCSCSegmentProxyBuilder::purpose ( ) const
inline
const std::string& FWCSCSegmentProxyBuilder::typeName ( ) const
inline
const std::string& FWCSCSegmentProxyBuilder::view ( ) const
inline