CMS 3D CMS Logo

FWPhase2TrackerCluster1DProxyBuilder.cc
Go to the documentation of this file.
1 
2 // -*- C++ -*-
3 //
4 // Package: Tracks
5 // Class : FWPhase2TrackerCluster1DProxyBuilder
6 //
7 //
8 
9 #include "TEvePointSet.h"
10 #include "TEveStraightLineSet.h"
11 #include "TEveCompound.h"
12 #include "TEveBox.h"
18 
20 
22 public:
25 
27 
30 
31 private:
33  void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
34 };
35 
37  TEveElementList* product,
38  const FWViewContext*) {
39  const Phase2TrackerCluster1DCollectionNew* pixels = nullptr;
40 
41  iItem->get(pixels);
42 
43  if (!pixels) {
44  fwLog(fwlog::kWarning) << "failed get SiPixelDigis" << std::endl;
45  return;
46  }
47 
48  for (Phase2TrackerCluster1DCollectionNew::const_iterator set = pixels->begin(), setEnd = pixels->end(); set != setEnd;
49  ++set) {
50  unsigned int id = set->detId();
51 
52  const FWGeometry* geom = iItem->getGeom();
53  const float* pars = geom->getParameters(id);
54  const float* shape = geom->getShapePars(id);
55 
57 
59  itc != edc;
60  ++itc) {
61  TEveElement* itemHolder = createCompound();
62  product->AddElement(itemHolder);
63 
64  TEvePointSet* pointSet = new TEvePointSet;
65 
66  if (!geom->contains(id)) {
67  fwLog(fwlog::kWarning) << "failed get geometry of Phase2TrackerCluster1D with detid: " << id << std::endl;
68  continue;
69  }
70 
71  float localPoint[3] = {fireworks::phase2PixelLocalX((*itc).center(), pars, shape),
72  fireworks::phase2PixelLocalY((*itc).column(), pars, shape),
73  0.0};
74 
75  float globalPoint[3];
76  geom->localToGlobal(id, localPoint, globalPoint);
77 
78  pointSet->SetNextPoint(globalPoint[0], globalPoint[1], globalPoint[2]);
79 
80  setupAddElement(pointSet, itemHolder);
81  }
82  }
83 }
84 
87  "Phase2TrackerCluster1D",
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWGeometry
Definition: FWGeometry.h:27
FWPhase2TrackerCluster1DProxyBuilder::FWPhase2TrackerCluster1DProxyBuilder
FWPhase2TrackerCluster1DProxyBuilder(void)
Definition: FWPhase2TrackerCluster1DProxyBuilder.cc:23
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
FWEventItem::get
void get(const T *&oData) const
Definition: FWEventItem.h:78
FWProxyBuilderBase.h
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:530
FWProxyBuilderBase::createCompound
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
Definition: FWProxyBuilderBase.cc:374
TrackUtils.h
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
edmNew::DetSet
Definition: DetSetNew.h:22
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
FWPhase2TrackerCluster1DProxyBuilder::operator=
const FWPhase2TrackerCluster1DProxyBuilder & operator=(const FWPhase2TrackerCluster1DProxyBuilder &)=delete
FWGeometry.h
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
fwlog::kWarning
Definition: fwLog.h:35
fwLog.h
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
FWPhase2TrackerCluster1DProxyBuilder
Definition: FWPhase2TrackerCluster1DProxyBuilder.cc:21
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
edmNew::DetSetVector
Definition: DetSetNew.h:13
FWEventItem
Definition: FWEventItem.h:56
Phase2TrackerCluster1D.h
FWProxyBuilderBase
Definition: FWProxyBuilderBase.h:46
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
fireworks::phase2PixelLocalY
float phase2PixelLocalY(const double mpy, const float *, const float *)
Definition: TrackUtils.cc:255
fireworks::phase2PixelLocalX
float phase2PixelLocalX(const double mpx, const float *, const float *)
Definition: TrackUtils.cc:249
FWPhase2TrackerCluster1DProxyBuilder::~FWPhase2TrackerCluster1DProxyBuilder
~FWPhase2TrackerCluster1DProxyBuilder(void) override
Definition: FWPhase2TrackerCluster1DProxyBuilder.cc:24
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31