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  FWTracksModulesProxyBuilder(const FWTracksModulesProxyBuilder&) = delete; // stop default
33  const FWTracksModulesProxyBuilder& operator=(const FWTracksModulesProxyBuilder&) = delete; // stop default
34 };
35 
37  unsigned int iIndex,
38  TEveElement& oItemHolder,
39  const FWViewContext*) {
40  if (track.extra().isAvailable()) {
41  const FWGeometry* geom = item()->getGeom();
42 
43  for (trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd(); recIt != recItEnd;
44  ++recIt) {
45  DetId detid = (*recIt)->geographicalId();
46  if ((*recIt)->isValid()) {
47  if (detid.det() == DetId::Muon) {
48  if (detid.subdetId() == MuonSubdetId::DT)
49  detid = DetId(DTChamberId(detid)); // get rid of layer bits
50  }
51 
52  TEveGeoShape* shape = geom->getEveShape(detid);
53  if (shape) {
54  setupAddElement(shape, &oItemHolder);
55  } else {
56  fwLog(fwlog::kDebug) << "Failed to get shape extract for track-id " << iIndex << ", tracking rec hit: "
57  << "\n"
58  << fireworks::info(detid) << std::endl;
59  }
60  }
61  }
62  }
63 }
64 
66 
69  "TrackDets",
static const int kAllRPZBits
Definition: FWViewType.h:67
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
bool isAvailable() const
Definition: Ref.h:537
const FWEventItem * item() const
static const int kAll3DBits
Definition: FWViewType.h:68
const FWTracksModulesProxyBuilder & operator=(const FWTracksModulesProxyBuilder &)=delete
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:320
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:88
Definition: DetId.h:17
#define fwLog(_level_)
Definition: fwLog.h:45
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
std::string info(const DetId &)
Definition: TrackUtils.cc:599
static constexpr int DT
Definition: MuonSubdetId.h:11
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:91