CMS 3D CMS Logo

FWSiStripDigiProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Tracks
4 // Class : FWSiStripDigiProxyBuilder
5 //
6 //
7 // Original Author:
8 // Created: Thu Dec 6 18:01:21 PST 2007
9 //
10 
11 #include "TEveStraightLineSet.h"
12 
18 
22 
24 public:
26  ~FWSiStripDigiProxyBuilder(void) override {}
27 
29 
30 private:
32  void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
35 };
36 
37 void FWSiStripDigiProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) {
38  const edm::DetSetVector<SiStripDigi>* digis = nullptr;
39 
40  iItem->get(digis);
41 
42  if (!digis) {
43  return;
44  }
45  const FWGeometry* geom = iItem->getGeom();
46 
47  for (edm::DetSetVector<SiStripDigi>::const_iterator it = digis->begin(), end = digis->end(); it != end; ++it) {
48  edm::DetSet<SiStripDigi> ds = *it;
49  const uint32_t& id = ds.id;
50 
51  const float* pars = geom->getParameters(id);
52 
53  for (edm::DetSet<SiStripDigi>::const_iterator idigi = ds.data.begin(), idigiEnd = ds.data.end(); idigi != idigiEnd;
54  ++idigi) {
55  TEveStraightLineSet* lineSet = new TEveStraightLineSet;
56  setupAddElement(lineSet, product);
57 
58  if (!geom->contains(id)) {
59  fwLog(fwlog::kWarning) << "failed get geometry and topology of SiStripDigi with detid: " << id << std::endl;
60  continue;
61  }
62  float localTop[3] = {0.0, 0.0, 0.0};
63  float localBottom[3] = {0.0, 0.0, 0.0};
64 
65  fireworks::localSiStrip((*idigi).strip(), localTop, localBottom, pars, id);
66 
67  float globalTop[3];
68  float globalBottom[3];
69  geom->localToGlobal(id, localTop, globalTop, localBottom, globalBottom);
70 
71  lineSet->AddLine(globalTop[0], globalTop[1], globalTop[2], globalBottom[0], globalBottom[1], globalBottom[2]);
72  } // end of iteration over digis
73  } // end of iteration over the DetSetVector
74 }
75 
78  "SiStripDigi",
edm::DetSetVector< SiStripDigi >
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWGeometry
Definition: FWGeometry.h:27
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
FWSiStripDigiProxyBuilder::operator=
const FWSiStripDigiProxyBuilder & operator=(const FWSiStripDigiProxyBuilder &)=delete
edm::DetSet< SiStripDigi >
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
edm::DetSet::id
det_id_type id
Definition: DetSet.h:79
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
FWSiStripDigiProxyBuilder
Definition: FWSiStripDigiProxyBuilder.cc:23
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
TrackUtils.h
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
SiStripDigi.h
mps_fire.end
end
Definition: mps_fire.py:242
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
FWGeometry.h
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
fwlog::kWarning
Definition: fwLog.h:35
FWSiStripDigiProxyBuilder::~FWSiStripDigiProxyBuilder
~FWSiStripDigiProxyBuilder(void) override
Definition: FWSiStripDigiProxyBuilder.cc:26
fwLog.h
DetSetVector.h
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
FWEventItem
Definition: FWEventItem.h:56
DetId.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
FWProxyBuilderBase
Definition: FWProxyBuilderBase.h:46
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
fireworks::localSiStrip
void localSiStrip(short strip, float *localTop, float *localBottom, const float *pars, unsigned int id)
Definition: TrackUtils.cc:263
FWSiStripDigiProxyBuilder::FWSiStripDigiProxyBuilder
FWSiStripDigiProxyBuilder(void)
Definition: FWSiStripDigiProxyBuilder.cc:25
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31