CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
virtual bool haveSingleProduct () const
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
virtual ~FWGEMSegmentProxyBuilder ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< GEMSegment >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
virtual ~FWSimpleProxyBuilder ()
 
- 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

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

Additional Inherited Members

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

15 {}
virtual FWGEMSegmentProxyBuilder::~FWGEMSegmentProxyBuilder ( )
inlinevirtual

Definition at line 16 of file FWGEMSegmentProxyBuilder.cc.

16 {}
FWGEMSegmentProxyBuilder::FWGEMSegmentProxyBuilder ( const FWGEMSegmentProxyBuilder )
private

Member Function Documentation

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

Reimplemented from FWSimpleProxyBuilderTemplate< GEMSegment >.

Definition at line 36 of file FWGEMSegmentProxyBuilder.cc.

References funct::abs(), create_public_lumi_plots::color, FWGeometry::contains(), 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(), csvLumiCalc::unit, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

Definition at line 106 of file FWGEMSegmentProxyBuilder.cc.

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

Definition at line 106 of file FWGEMSegmentProxyBuilder.cc.

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

Definition at line 106 of file FWGEMSegmentProxyBuilder.cc.

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

Definition at line 106 of file FWGEMSegmentProxyBuilder.cc.

virtual bool FWGEMSegmentProxyBuilder::haveSingleProduct ( void  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 18 of file FWGEMSegmentProxyBuilder.cc.

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