CMS 3D CMS Logo

FWTracksModulesProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: FWTracksModulesProxyBuilder.cc,v 1.1 2009/01/16 10:37:00 Tom Danielson
3 //
4 
5 // user include files
6 #include "TEveGeoShape.h"
7 
12 
16 
18 
20 public:
22  ~FWTracksModulesProxyBuilder(void) override {}
23 
25 
26  static bool representsSubPart(void);
27 
28 private:
30  void build(const reco::Track& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
31 
32 public:
33  FWTracksModulesProxyBuilder(const FWTracksModulesProxyBuilder&) = delete; // stop default
34  const FWTracksModulesProxyBuilder& operator=(const FWTracksModulesProxyBuilder&) = delete; // stop default
35 };
36 
38  unsigned int iIndex,
39  TEveElement& oItemHolder,
40  const FWViewContext*) {
41  if (track.extra().isAvailable()) {
42  const FWGeometry* geom = item()->getGeom();
43 
44  for (trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd(); recIt != recItEnd;
45  ++recIt) {
46  DetId detid = (*recIt)->geographicalId();
47  if ((*recIt)->isValid()) {
48  if (detid.det() == DetId::Muon) {
49  if (detid.subdetId() == MuonSubdetId::DT)
50  detid = DetId(DTChamberId(detid)); // get rid of layer bits
51  }
52 
53  TEveGeoShape* shape = geom->getEveShape(detid);
54  if (shape) {
55  setupAddElement(shape, &oItemHolder);
56  } else {
57  fwLog(fwlog::kDebug) << "Failed to get shape extract for track-id " << iIndex << ", tracking rec hit: "
58  << "\n"
59  << fireworks::info(detid) << std::endl;
60  }
61  }
62  }
63  }
64 }
65 
67 
70  "TrackDets",
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:67
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
static const int kAll3DBits
Definition: FWViewType.h:68
const FWTracksModulesProxyBuilder & operator=(const FWTracksModulesProxyBuilder &)=delete
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
#define fwLog(_level_)
Definition: fwLog.h:45
std::string info(const DetId &)
Definition: TrackUtils.cc:599
static constexpr int DT
Definition: MuonSubdetId.h:11
const FWEventItem * item() const