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 ()
 
bool haveSingleProduct () const override
 
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 ()
 
- 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
 
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
 
 FWGEMSegmentProxyBuilder (const FWGEMSegmentProxyBuilder &)=delete
 
const FWGEMSegmentProxyBuilderoperator= (const FWGEMSegmentProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< GEMSegment >
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 GEMSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
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 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 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 12 of file FWGEMSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWGEMSegmentProxyBuilder() [1/2]

FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( )
inline

Definition at line 14 of file FWGEMSegmentProxyBuilder.cc.

14 {}

◆ ~FWGEMSegmentProxyBuilder()

FWGEMSegmentProxyBuilder::~FWGEMSegmentProxyBuilder ( )
inlineoverride

Definition at line 15 of file FWGEMSegmentProxyBuilder.cc.

15 {}

◆ FWGEMSegmentProxyBuilder() [2/2]

FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( const FWGEMSegmentProxyBuilder )
privatedelete

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 33 of file FWGEMSegmentProxyBuilder.cc.

37  {
38  const FWGeometry* geom = item()->getGeom();
39  unsigned int rawid = iData.gemDetId().rawId();
40 
41  if (!geom->contains(rawid)) {
42  fwLog(fwlog::kError) << "failed to get geometry of GEM chamber with rawid: " << rawid << std::endl;
43  return;
44  }
45 
46  TEveStraightLineSet* segmentSet = new TEveStraightLineSet();
47  // FIXME: This should be set elsewhere.
48  segmentSet->SetLineWidth(3);
49  segmentSet->SetMarkerColor(item()->defaultDisplayProperties().color());
50  segmentSet->SetMarkerSize(0.5);
51  setupAddElement(segmentSet, &oItemHolder);
52  TEveGeoShape* shape = geom->getEveShape(rawid);
53  if (shape) {
54  if (TGeoTrap* box = dynamic_cast<TGeoTrap*>(shape->GetShape())) // Trapezoidal
55  {
56  shape->SetMainTransparency(75);
57  shape->SetMainColor(item()->defaultDisplayProperties().color());
58  segmentSet->AddElement(shape);
59 
60  LocalPoint pos = iData.localPosition();
61  LocalVector dir = iData.localDirection();
62  LocalVector unit = dir.unit();
63 
64  double localPosition[3] = {pos.x(), pos.y(), pos.z()};
65  double localDirectionIn[3] = {dir.x(), dir.y(), dir.z()};
66  double localDirectionOut[3] = {-dir.x(), -dir.y(), -dir.z()};
67 
68  Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
69  Double_t distOut = box->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  if (type == FWViewType::kRhoPhi && std::abs(dir.x()) < 0.1) {
86  segmentSet->AddMarker(globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2]);
87  } else
88  segmentSet->AddLine(globalSegmentInnerPoint[0],
89  globalSegmentInnerPoint[1],
90  globalSegmentInnerPoint[2],
91  globalSegmentOuterPoint[0],
92  globalSegmentOuterPoint[1],
93  globalSegmentOuterPoint[2]);
94  }
95  }
96 }

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(), unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ classPurpose()

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

◆ classView()

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

◆ haveSingleProduct()

bool FWGEMSegmentProxyBuilder::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 17 of file FWGEMSegmentProxyBuilder.cc.

17 { return false; }

◆ operator=()

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

◆ purpose()

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

Definition at line 19 of file FWGEMSegmentProxyBuilder.cc.

21 :

◆ typeName()

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

Definition at line 19 of file FWGEMSegmentProxyBuilder.cc.

21 :

◆ view()

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

Definition at line 19 of file FWGEMSegmentProxyBuilder.cc.

21 :
Vector3DBase< float, LocalTag >
FWGEMSegmentProxyBuilder
Definition: FWGEMSegmentProxyBuilder.cc:12
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWGeometry
Definition: FWGeometry.h:27
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GEMSegment::localPosition
LocalPoint localPosition() const override
Definition: GEMSegment.h:52
pos
Definition: PixelAliasList.h:18
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder
FWGEMSegmentProxyBuilder()
Definition: FWGEMSegmentProxyBuilder.cc:14
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
GEMSegment::gemDetId
GEMDetId gemDetId() const
Definition: GEMSegment.h:83
type
type
Definition: HCALResponse.h:21
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
GEMSegment::localDirection
LocalVector localDirection() const override
Local direction.
Definition: GEMSegment.h:55
fwlog::kError
Definition: fwLog.h:35
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
FWViewType::kRhoPhi
Definition: FWViewType.h:32
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23