CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWGEMSegmentProxyBuilder Class Reference
Inheritance diagram for FWGEMSegmentProxyBuilder:
FWSimpleProxyBuilderTemplate< GEMSegment > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWGEMSegmentProxyBuilder ()
 
 FWGEMSegmentProxyBuilder (const FWGEMSegmentProxyBuilder &)=delete
 
bool haveSingleProduct () const override
 
const FWGEMSegmentProxyBuilderoperator= (const FWGEMSegmentProxyBuilder &)=delete
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWGEMSegmentProxyBuilder () override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< GEMSegment >
 FWSimpleProxyBuilderTemplate ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const FWSimpleProxyBuilderTemplateoperator= (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
 
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 buildViewType (const GEMSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< GEMSegment >
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 ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void build (const GEMSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
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 buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const GEMSegmentmodelData (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 FWGEMSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWGEMSegmentProxyBuilder() [1/2]

FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( )
inline

Definition at line 15 of file FWGEMSegmentProxyBuilder.cc.

15 {}

◆ ~FWGEMSegmentProxyBuilder()

FWGEMSegmentProxyBuilder::~FWGEMSegmentProxyBuilder ( )
inlineoverride

Definition at line 16 of file FWGEMSegmentProxyBuilder.cc.

16 {}

◆ FWGEMSegmentProxyBuilder() [2/2]

FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( const FWGEMSegmentProxyBuilder )
delete

Member Function Documentation

◆ buildViewType()

void FWGEMSegmentProxyBuilder::buildViewType ( const GEMSegment iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  type,
const FWViewContext  
)
overrideprivatevirtual

Reimplemented from FWSimpleProxyBuilderTemplate< GEMSegment >.

Definition at line 34 of file FWGEMSegmentProxyBuilder.cc.

References funct::abs(), DeadROC_duringRun::dir, fwLog, GEMSegment::gemDetId(), relativeConstraints::geom, FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, FWViewType::kRhoPhi, GEMSegment::localDirection(), GEMSegment::localPosition(), DetId::rawId(), FWProxyBuilderBase::setupAddElement(), l1trig_cff::shape, unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

38  {
39  const FWGeometry* geom = item()->getGeom();
40  unsigned int rawid = iData.gemDetId().rawId();
41 
42  if (!geom->contains(rawid)) {
43  fwLog(fwlog::kError) << "failed to get geometry of GEM chamber with rawid: " << rawid << std::endl;
44  return;
45  }
46 
47  TEveStraightLineSet* segmentSet = new TEveStraightLineSet();
48  // FIXME: This should be set elsewhere.
49  segmentSet->SetLineWidth(3);
50  segmentSet->SetMarkerColor(item()->defaultDisplayProperties().color());
51  segmentSet->SetMarkerSize(0.5);
52  setupAddElement(segmentSet, &oItemHolder);
53  TEveGeoShape* shape = geom->getEveShape(rawid);
54  if (shape) {
55  if (TGeoTrap* box = dynamic_cast<TGeoTrap*>(shape->GetShape())) // Trapezoidal
56  {
57  shape->SetMainTransparency(75);
58  shape->SetMainColor(item()->defaultDisplayProperties().color());
59  segmentSet->AddElement(shape);
60 
61  LocalPoint pos = iData.localPosition();
62  LocalVector dir = iData.localDirection();
63  LocalVector unit = dir.unit();
64 
65  double localPosition[3] = {pos.x(), pos.y(), pos.z()};
66  double localDirectionIn[3] = {dir.x(), dir.y(), dir.z()};
67  double localDirectionOut[3] = {-dir.x(), -dir.y(), -dir.z()};
68 
69  Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
70  Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
71  LocalVector vIn = unit * distIn;
72  LocalVector vOut = -unit * distOut;
73  float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.x()),
74  static_cast<float>(localPosition[1] + vIn.y()),
75  static_cast<float>(localPosition[2] + vIn.z())};
76 
77  float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.x()),
78  static_cast<float>(localPosition[1] + vOut.y()),
79  static_cast<float>(localPosition[2] + vOut.z())};
80 
81  float globalSegmentInnerPoint[3];
82  float globalSegmentOuterPoint[3];
83 
84  geom->localToGlobal(
85  rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
86  if (type == FWViewType::kRhoPhi && std::abs(dir.x()) < 0.1) {
87  segmentSet->AddMarker(globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2]);
88  } else
89  segmentSet->AddLine(globalSegmentInnerPoint[0],
90  globalSegmentInnerPoint[1],
91  globalSegmentInnerPoint[2],
92  globalSegmentOuterPoint[0],
93  globalSegmentOuterPoint[1],
94  globalSegmentOuterPoint[2]);
95  }
96  }
97 }
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
LocalPoint localPosition() const override
Definition: GEMSegment.h:52
T z() const
Definition: PV3DBase.h:61
LocalVector localDirection() const override
Local direction.
Definition: GEMSegment.h:55
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Basic3DVector unit() const
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
#define fwLog(_level_)
Definition: fwLog.h:45
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
GEMDetId gemDetId() const
Definition: GEMSegment.h:83
const FWEventItem * item() const

◆ classPurpose()

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

Definition at line 102 of file FWGEMSegmentProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 102 of file FWGEMSegmentProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 102 of file FWGEMSegmentProxyBuilder.cc.

◆ classView()

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

Definition at line 102 of file FWGEMSegmentProxyBuilder.cc.

◆ haveSingleProduct()

bool FWGEMSegmentProxyBuilder::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 18 of file FWGEMSegmentProxyBuilder.cc.

18 { return false; }

◆ operator=()

const FWGEMSegmentProxyBuilder& FWGEMSegmentProxyBuilder::operator= ( const FWGEMSegmentProxyBuilder )
delete

◆ purpose()

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

◆ typeName()

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

◆ view()

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