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 (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 *)
 
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 (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 12 of file FWGEMSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( )
inline

Definition at line 14 of file FWGEMSegmentProxyBuilder.cc.

14 {}
FWGEMSegmentProxyBuilder::~FWGEMSegmentProxyBuilder ( )
inlineoverride

Definition at line 15 of file FWGEMSegmentProxyBuilder.cc.

15 {}
FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( const FWGEMSegmentProxyBuilder )
privatedelete

Member Function Documentation

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.

References funct::abs(), FWGeometry::contains(), DeadROC_duringRun::dir, fwLog, GEMSegment::gemDetId(), relativeConstraints::geom, FWGeometry::getEveShape(), FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, FWViewType::kRhoPhi, GEMSegment::localDirection(), GEMSegment::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().

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 }
type
Definition: HCALResponse.h:21
GEMDetId gemDetId() const
Definition: GEMSegment.h:83
LocalVector localDirection() const override
Local direction.
Definition: GEMSegment.h:55
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
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:320
T z() const
Definition: PV3DBase.h:61
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:496
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool contains(unsigned int id) const
Definition: FWGeometry.h:139
LocalPoint localPosition() const override
Definition: GEMSegment.h:52
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 & FWGEMSegmentProxyBuilder::classPurpose ( )
static

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

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

Definition at line 101 of file FWGEMSegmentProxyBuilder.cc.

bool FWGEMSegmentProxyBuilder::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 17 of file FWGEMSegmentProxyBuilder.cc.

17 { return false; }
const FWGEMSegmentProxyBuilder& FWGEMSegmentProxyBuilder::operator= ( const FWGEMSegmentProxyBuilder )
privatedelete
const std::string& FWGEMSegmentProxyBuilder::purpose ( ) const
inline
const std::string& FWGEMSegmentProxyBuilder::typeName ( ) const
inline
const std::string& FWGEMSegmentProxyBuilder::view ( ) const
inline