CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
FWCSCRecHitProxyBuilder Class Reference
Inheritance diagram for FWCSCRecHitProxyBuilder:
FWSimpleProxyBuilderTemplate< CSCRecHit2D > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWCSCRecHitProxyBuilder (void)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWCSCRecHitProxyBuilder (void)
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< CSCRecHit2D >
 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
 
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 ()
 

Private Member Functions

void build (const CSCRecHit2D &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWCSCRecHitProxyBuilder (const FWCSCRecHitProxyBuilder &)
 
const FWCSCRecHitProxyBuilderoperator= (const FWCSCRecHitProxyBuilder &)
 

Additional Inherited Members

- 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...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< CSCRecHit2D >
virtual void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context)
 
virtual void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context)
 
virtual void buildViewType (const CSCRecHit2D &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const CSCRecHit2DmodelData (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 18 of file FWCSCRecHitProxyBuilder.cc.

Constructor & Destructor Documentation

FWCSCRecHitProxyBuilder::FWCSCRecHitProxyBuilder ( void  )
inline

Definition at line 21 of file FWCSCRecHitProxyBuilder.cc.

21 {}
virtual FWCSCRecHitProxyBuilder::~FWCSCRecHitProxyBuilder ( void  )
inlinevirtual

Definition at line 22 of file FWCSCRecHitProxyBuilder.cc.

22 {}
FWCSCRecHitProxyBuilder::FWCSCRecHitProxyBuilder ( const FWCSCRecHitProxyBuilder )
private

Member Function Documentation

void FWCSCRecHitProxyBuilder::build ( const CSCRecHit2D 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< CSCRecHit2D >.

Definition at line 35 of file FWCSCRecHitProxyBuilder.cc.

References FWGeometry::contains(), FWGeometry::find(), fwLog, relativeConstraints::geom, FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, FWGeometry::localToGlobal(), FWProxyBuilderBase::setupAddElement(), and mathSSE::sqrt().

38 {
39  const FWGeometry *geom = item()->getGeom();
40  unsigned int rawid = iData.cscDetId().rawId();
41 
42  if( ! geom->contains( rawid ))
43  {
44  fwLog( fwlog::kError ) << "failed to get geometry of CSC layer with detid: "
45  << rawid <<std::endl;
46  return;
47  }
48  FWGeometry::IdToInfoItr det = geom->find( rawid );
49 
50  TEveStraightLineSet* recHitSet = new TEveStraightLineSet;
51  setupAddElement( recHitSet, &oItemHolder );
52 
53  TEvePointSet* pointSet = new TEvePointSet;
54  setupAddElement( pointSet, &oItemHolder );
55 
56  float localPositionX = iData.localPosition().x();
57  float localPositionY = iData.localPosition().y();
58 
59  float localPositionXX = sqrt( iData.localPositionError().xx());
60  float localPositionYY = sqrt( iData.localPositionError().yy());
61 
62  float localU1Point[3] =
63  {
64  localPositionX - localPositionXX, localPositionY, 0.0
65  };
66 
67  float localU2Point[3] =
68  {
69  localPositionX + localPositionXX, localPositionY, 0.0
70  };
71 
72  float localV1Point[3] =
73  {
74  localPositionX, localPositionY - localPositionYY, 0.0
75  };
76 
77  float localV2Point[3] =
78  {
79  localPositionX, localPositionY + localPositionYY, 0.0
80  };
81 
82  float globalU1Point[3];
83  float globalU2Point[3];
84  float globalV1Point[3];
85  float globalV2Point[3];
86 
87  geom->localToGlobal( *det, localU1Point, globalU1Point );
88  geom->localToGlobal( *det, localU2Point, globalU2Point );
89  geom->localToGlobal( *det, localV1Point, globalV1Point );
90  geom->localToGlobal( *det, localV2Point, globalV2Point );
91 
92  pointSet->SetNextPoint( globalU1Point[0], globalU1Point[1], globalU1Point[2] );
93  pointSet->SetNextPoint( globalU2Point[0], globalU2Point[1], globalU2Point[2] );
94  pointSet->SetNextPoint( globalV1Point[0], globalV1Point[1], globalV1Point[2] );
95  pointSet->SetNextPoint( globalV2Point[0], globalV2Point[1], globalV2Point[2] );
96 
97  recHitSet->AddLine( globalU1Point[0], globalU1Point[1], globalU1Point[2],
98  globalU2Point[0], globalU2Point[1], globalU2Point[2] );
99 
100  recHitSet->AddLine( globalV1Point[0], globalV1Point[1], globalV1Point[2],
101  globalV2Point[0], globalV2Point[1], globalV2Point[2] );
102 }
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:355
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
const FWEventItem * item() const
T sqrt(T t)
Definition: SSEVec.h:48
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:325
bool contains(unsigned int id) const
Definition: FWGeometry.h:109
#define fwLog(_level_)
Definition: fwLog.h:50
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
const FWCSCRecHitProxyBuilder& FWCSCRecHitProxyBuilder::operator= ( const FWCSCRecHitProxyBuilder )
private
FWCSCRecHitProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )