CMS 3D CMS Logo

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)
 
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 ()
 
- 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 CSCSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWCSCSegmentProxyBuilder (const FWCSCSegmentProxyBuilder &)=delete
 
const FWCSCSegmentProxyBuilderoperator= (const FWCSCSegmentProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< CSCSegment >
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 CSCSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
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 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 CSCSegmentmodelData (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 24 of file FWCSCSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWCSCSegmentProxyBuilder() [1/2]

FWCSCSegmentProxyBuilder::FWCSCSegmentProxyBuilder ( void  )
inline

Definition at line 26 of file FWCSCSegmentProxyBuilder.cc.

26 {}

◆ ~FWCSCSegmentProxyBuilder()

FWCSCSegmentProxyBuilder::~FWCSCSegmentProxyBuilder ( void  )
inlineoverride

Definition at line 27 of file FWCSCSegmentProxyBuilder.cc.

27 {}

◆ FWCSCSegmentProxyBuilder() [2/2]

FWCSCSegmentProxyBuilder::FWCSCSegmentProxyBuilder ( const FWCSCSegmentProxyBuilder )
privatedelete

Member Function Documentation

◆ build()

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 39 of file FWCSCSegmentProxyBuilder.cc.

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

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

◆ classPurpose()

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

Definition at line 97 of file FWCSCSegmentProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 97 of file FWCSCSegmentProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 97 of file FWCSCSegmentProxyBuilder.cc.

◆ classView()

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

Definition at line 97 of file FWCSCSegmentProxyBuilder.cc.

◆ operator=()

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

◆ purpose()

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

Definition at line 29 of file FWCSCSegmentProxyBuilder.cc.

31 :

◆ typeName()

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

Definition at line 29 of file FWCSCSegmentProxyBuilder.cc.

31 :

◆ view()

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

Definition at line 29 of file FWCSCSegmentProxyBuilder.cc.

31 :
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
pos
Definition: PixelAliasList.h:18
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
CSCSegment::localDirection
LocalVector localDirection() const override
Local direction.
Definition: CSCSegment.h:42
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
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
FWCSCSegmentProxyBuilder
Definition: FWCSCSegmentProxyBuilder.cc:24
CSCSegment::cscDetId
CSCDetId cscDetId() const
Definition: CSCSegment.h:70
fwlog::kError
Definition: fwLog.h:35
FWCSCSegmentProxyBuilder::FWCSCSegmentProxyBuilder
FWCSCSegmentProxyBuilder(void)
Definition: FWCSCSegmentProxyBuilder.cc:26
CSCSegment::localPosition
LocalPoint localPosition() const override
Definition: CSCSegment.h:39
FWGeometry::getEveShape
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:321
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23