CMS 3D CMS Logo

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

Public Member Functions

 FWCSCRecHitProxyBuilder (void)
 
 FWCSCRecHitProxyBuilder (const FWCSCRecHitProxyBuilder &)=delete
 
const FWCSCRecHitProxyBuilderoperator= (const FWCSCRecHitProxyBuilder &)=delete
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWCSCRecHitProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< CSCRecHit2D >
 FWSimpleProxyBuilderTemplate ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const
FWSimpleProxyBuilderTemplate
operator= (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
 
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 ()
 

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 build (const CSCRecHit2D &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 

Additional Inherited Members

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

Constructor & Destructor Documentation

FWCSCRecHitProxyBuilder::FWCSCRecHitProxyBuilder ( void  )
inline

Definition at line 20 of file FWCSCRecHitProxyBuilder.cc.

20 {}
FWCSCRecHitProxyBuilder::~FWCSCRecHitProxyBuilder ( void  )
inlineoverride

Definition at line 21 of file FWCSCRecHitProxyBuilder.cc.

21 {}
FWCSCRecHitProxyBuilder::FWCSCRecHitProxyBuilder ( const FWCSCRecHitProxyBuilder )
delete

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

References FWGeometry::contains(), CSCRecHit2D::cscDetId(), FWGeometry::find(), fwLog, relativeConstraints::geom, FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, CSCRecHit2D::localPosition(), CSCRecHit2D::localPositionError(), FWGeometry::localToGlobal(), DetId::rawId(), FWProxyBuilderBase::setupAddElement(), mathSSE::sqrt(), LocalError::xx(), and LocalError::yy().

36  {
37  const FWGeometry* geom = item()->getGeom();
38  unsigned int rawid = iData.cscDetId().rawId();
39 
40  if (!geom->contains(rawid)) {
41  fwLog(fwlog::kError) << "failed to get geometry of CSC layer with detid: " << rawid << std::endl;
42  return;
43  }
44  FWGeometry::IdToInfoItr det = geom->find(rawid);
45 
46  TEveStraightLineSet* recHitSet = new TEveStraightLineSet;
47  setupAddElement(recHitSet, &oItemHolder);
48 
49  TEvePointSet* pointSet = new TEvePointSet;
50  setupAddElement(pointSet, &oItemHolder);
51 
52  float localPositionX = iData.localPosition().x();
53  float localPositionY = iData.localPosition().y();
54 
55  float localPositionXX = sqrt(iData.localPositionError().xx());
56  float localPositionYY = sqrt(iData.localPositionError().yy());
57 
58  float localU1Point[3] = {localPositionX - localPositionXX, localPositionY, 0.0};
59 
60  float localU2Point[3] = {localPositionX + localPositionXX, localPositionY, 0.0};
61 
62  float localV1Point[3] = {localPositionX, localPositionY - localPositionYY, 0.0};
63 
64  float localV2Point[3] = {localPositionX, localPositionY + localPositionYY, 0.0};
65 
66  float globalU1Point[3];
67  float globalU2Point[3];
68  float globalV1Point[3];
69  float globalV2Point[3];
70 
71  geom->localToGlobal(*det, localU1Point, globalU1Point);
72  geom->localToGlobal(*det, localU2Point, globalU2Point);
73  geom->localToGlobal(*det, localV1Point, globalV1Point);
74  geom->localToGlobal(*det, localV2Point, globalV2Point);
75 
76  pointSet->SetNextPoint(globalU1Point[0], globalU1Point[1], globalU1Point[2]);
77  pointSet->SetNextPoint(globalU2Point[0], globalU2Point[1], globalU2Point[2]);
78  pointSet->SetNextPoint(globalV1Point[0], globalV1Point[1], globalV1Point[2]);
79  pointSet->SetNextPoint(globalV2Point[0], globalV2Point[1], globalV2Point[2]);
80 
81  recHitSet->AddLine(
82  globalU1Point[0], globalU1Point[1], globalU1Point[2], globalU2Point[0], globalU2Point[1], globalU2Point[2]);
83 
84  recHitSet->AddLine(
85  globalV1Point[0], globalV1Point[1], globalV1Point[2], globalV2Point[0], globalV2Point[1], globalV2Point[2]);
86 }
float xx() const
Definition: LocalError.h:22
CSCDetId cscDetId() const
Definition: CSCRecHit2D.h:58
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:514
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const FWEventItem * item() const
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:494
bool contains(unsigned int id) const
Definition: FWGeometry.h:139
LocalError localPositionError() const override
Definition: CSCRecHit2D.h:57
LocalPoint localPosition() const override
Definition: CSCRecHit2D.h:56
#define fwLog(_level_)
Definition: fwLog.h:45
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:137
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
const std::string & FWCSCRecHitProxyBuilder::classPurpose ( )
static

Definition at line 91 of file FWCSCRecHitProxyBuilder.cc.

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

Definition at line 91 of file FWCSCRecHitProxyBuilder.cc.

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

Definition at line 91 of file FWCSCRecHitProxyBuilder.cc.

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

Definition at line 91 of file FWCSCRecHitProxyBuilder.cc.

const FWCSCRecHitProxyBuilder& FWCSCRecHitProxyBuilder::operator= ( const FWCSCRecHitProxyBuilder )
delete
const std::string& FWCSCRecHitProxyBuilder::purpose ( ) const
inline
const std::string& FWCSCRecHitProxyBuilder::typeName ( ) const
inline
const std::string& FWCSCRecHitProxyBuilder::view ( ) const
inline