CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWDTSegmentProxyBuilder Class Reference
Inheritance diagram for FWDTSegmentProxyBuilder:
FWSimpleProxyBuilderTemplate< DTRecSegment4D > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWDTSegmentProxyBuilder (void)
 
bool haveSingleProduct () const override
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWDTSegmentProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< DTRecSegment4D >
 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 DTRecSegment4D &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
 
 FWDTSegmentProxyBuilder (const FWDTSegmentProxyBuilder &)=delete
 
const FWDTSegmentProxyBuilderoperator= (const FWDTSegmentProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< DTRecSegment4D >
void build ()
 
virtual void build (const DTRecSegment4D &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
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 DTRecSegment4DmodelData (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 29 of file FWDTSegmentProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWDTSegmentProxyBuilder() [1/2]

FWDTSegmentProxyBuilder::FWDTSegmentProxyBuilder ( void  )
inline

Definition at line 31 of file FWDTSegmentProxyBuilder.cc.

31 {}

◆ ~FWDTSegmentProxyBuilder()

FWDTSegmentProxyBuilder::~FWDTSegmentProxyBuilder ( void  )
inlineoverride

Definition at line 32 of file FWDTSegmentProxyBuilder.cc.

32 {}

◆ FWDTSegmentProxyBuilder() [2/2]

FWDTSegmentProxyBuilder::FWDTSegmentProxyBuilder ( const FWDTSegmentProxyBuilder )
privatedelete

Member Function Documentation

◆ buildViewType()

void FWDTSegmentProxyBuilder::buildViewType ( const DTRecSegment4D iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  type,
const FWViewContext  
)
overrideprivatevirtual

Reimplemented from FWSimpleProxyBuilderTemplate< DTRecSegment4D >.

Definition at line 50 of file FWDTSegmentProxyBuilder.cc.

54  {
55  unsigned int rawid = iData.chamberId().rawId();
56  const FWGeometry* geom = item()->getGeom();
57 
58  if (!geom->contains(rawid)) {
59  fwLog(fwlog::kError) << "failed to get geometry of DT chamber with detid: " << rawid << std::endl;
60  return;
61  }
62 
63  TEveStraightLineSet* segmentSet = new TEveStraightLineSet();
64  // FIXME: This should be set elsewhere.
65  segmentSet->SetLineWidth(3);
66  setupAddElement(segmentSet, &oItemHolder);
67 
68  TEveGeoShape* shape = item()->getGeom()->getEveShape(rawid);
69  if (shape) {
70  if (TGeoBBox* box = dynamic_cast<TGeoBBox*>(shape->GetShape())) {
71  LocalPoint pos = iData.localPosition();
72  LocalVector dir = iData.localDirection();
73  LocalVector unit = dir.unit();
74 
75  double localPosition[3] = {pos.x(), pos.y(), pos.z()};
76  double localDirectionIn[3] = {dir.x(), dir.y(), dir.z()};
77  double localDirectionOut[3] = {-dir.x(), -dir.y(), -dir.z()};
78 
79  // In RhoZ view, draw segments at the middle of the chamber, otherwise they won't align with 1D rechits,
80  // for which only one coordinate is known.
81  if (type == FWViewType::kRhoZ) {
82  localPosition[0] = 0;
83  localDirectionIn[0] = 0;
84  localDirectionOut[0] = 0;
85  }
86 
87  Double_t distIn = box->DistFromInside(localPosition, localDirectionIn);
88  Double_t distOut = box->DistFromInside(localPosition, localDirectionOut);
89  LocalVector vIn = unit * distIn;
90  LocalVector vOut = -unit * distOut;
91  float localSegmentInnerPoint[3] = {static_cast<float>(localPosition[0] + vIn.x()),
92  static_cast<float>(localPosition[1] + vIn.y()),
93  static_cast<float>(localPosition[2] + vIn.z())};
94 
95  float localSegmentOuterPoint[3] = {static_cast<float>(localPosition[0] + vOut.x()),
96  static_cast<float>(localPosition[1] + vOut.y()),
97  static_cast<float>(localPosition[2] + vOut.z())};
98 
99  float globalSegmentInnerPoint[3];
100  float globalSegmentOuterPoint[3];
101 
102  geom->localToGlobal(
103  rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint);
104 
105  segmentSet->AddLine(globalSegmentInnerPoint[0],
106  globalSegmentInnerPoint[1],
107  globalSegmentInnerPoint[2],
108  globalSegmentOuterPoint[0],
109  globalSegmentOuterPoint[1],
110  globalSegmentOuterPoint[2]);
111 
112  // Draw hits included in the segment
113  TEvePointSet* pointSet = new TEvePointSet;
114  // FIXME: This should be set elsewhere.
115  pointSet->SetMarkerSize(1.5);
116  setupAddElement(pointSet, &oItemHolder);
117 
118  std::vector<DTRecHit1D> recHits;
119  const DTChamberRecSegment2D* phiSeg = iData.phiSegment();
120  const DTSLRecSegment2D* zSeg = iData.zSegment();
121  if (phiSeg) {
122  std::vector<DTRecHit1D> phiRecHits = phiSeg->specificRecHits();
123  copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits));
124  }
125  if (zSeg) {
126  std::vector<DTRecHit1D> zRecHits = zSeg->specificRecHits();
127  copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits));
128  }
129 
130  for (std::vector<DTRecHit1D>::const_iterator rh = recHits.begin(); rh != recHits.end(); ++rh) {
131  DTLayerId layerId = (*rh).wireId().layerId();
132  LocalPoint hpos = (*rh).localPosition();
133  float hitLocalPos[3] = {hpos.x(), hpos.y(), hpos.z()};
134  if (type == FWViewType::kRhoZ) {
135  // In RhoZ view, draw hits at the middle of the layer in the global Z coordinate,
136  // otherwise they won't align with 1D rechits, for which only one coordinate is known.
137  if (layerId.superLayer() == 2) {
138  hitLocalPos[1] = 0;
139  } else {
140  hitLocalPos[0] = 0;
141  }
142  }
143  float hitGlobalPoint[3];
144  geom->localToGlobal(layerId, hitLocalPos, hitGlobalPoint);
145  pointSet->SetNextPoint(hitGlobalPoint[0], hitGlobalPoint[1], hitGlobalPoint[2]);
146  }
147  }
148  }
149 }

References DTRecSegment4D::chamberId(), filterCSVwithJSON::copy, DeadROC_duringRun::dir, fwLog, relativeConstraints::geom, FWGeometry::getEveShape(), FWEventItem::getGeom(), FWProxyBuilderBase::item(), fwlog::kError, FWViewType::kRhoZ, DTRecSegment4D::localDirection(), DTRecSegment4D::localPosition(), DTRecSegment4D::phiSegment(), DetId::rawId(), FastTrackerRecHitMaskProducer_cfi::recHits, FWProxyBuilderBase::setupAddElement(), DTRecSegment2D::specificRecHits(), DTSuperLayerId::superLayer(), unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and DTRecSegment4D::zSegment().

◆ classPurpose()

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

Definition at line 154 of file FWDTSegmentProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 154 of file FWDTSegmentProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 154 of file FWDTSegmentProxyBuilder.cc.

◆ classView()

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

Definition at line 154 of file FWDTSegmentProxyBuilder.cc.

◆ haveSingleProduct()

bool FWDTSegmentProxyBuilder::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 34 of file FWDTSegmentProxyBuilder.cc.

34 { return false; }

◆ operator=()

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

◆ purpose()

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

Definition at line 36 of file FWDTSegmentProxyBuilder.cc.

38 :

◆ typeName()

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

Definition at line 36 of file FWDTSegmentProxyBuilder.cc.

38 :

◆ view()

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

Definition at line 36 of file FWDTSegmentProxyBuilder.cc.

38 :
Vector3DBase< float, LocalTag >
DTSLRecSegment2D
Definition: DTSLRecSegment2D.h:15
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
DTRecSegment4D::localDirection
LocalVector localDirection() const override
Local direction in Chamber frame.
Definition: DTRecSegment4D.h:67
FWGeometry
Definition: FWGeometry.h:27
FWDTSegmentProxyBuilder::FWDTSegmentProxyBuilder
FWDTSegmentProxyBuilder(void)
Definition: FWDTSegmentProxyBuilder.cc:31
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
FWViewType::kRhoZ
Definition: FWViewType.h:33
pos
Definition: PixelAliasList.h:18
DTRecSegment4D::chamberId
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
Definition: DTRecSegment4D.cc:256
DTSuperLayerId::superLayer
int superLayer() const
Return the superlayer number.
Definition: DTSuperLayerId.h:39
DTRecSegment4D::localPosition
LocalPoint localPosition() const override
Local position in Chamber frame.
Definition: DTRecSegment4D.h:61
DTRecSegment4D::zSegment
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
Definition: DTRecSegment4D.h:99
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
DTLayerId
Definition: DTLayerId.h:12
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
DTChamberRecSegment2D
Definition: DTChamberRecSegment2D.h:31
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
FWDTSegmentProxyBuilder
Definition: FWDTSegmentProxyBuilder.cc:29
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTRecSegment2D::specificRecHits
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
Definition: DTRecSegment2D.cc:104
fwlog::kError
Definition: fwLog.h:35
FWGeometry::getEveShape
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:324
DTRecSegment4D::phiSegment
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
Definition: DTRecSegment4D.h:96
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23