CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
21 public:
23  virtual ~FWTracksModulesProxyBuilder( void ) {}
24 
26 
27  static bool representsSubPart( void );
28 private:
29  void build( const reco::Track& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
30 
32  const FWTracksModulesProxyBuilder& operator=( const FWTracksModulesProxyBuilder& ); // stop default
33 };
34 
35 void
36 FWTracksModulesProxyBuilder::build( const reco::Track& track, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
37 {
38  if( track.extra().isAvailable() )
39  {
40  const FWGeometry *geom = item()->getGeom();
41 
42  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
43  recIt != recItEnd; ++recIt )
44  {
45  DetId detid = ( *recIt )->geographicalId();
46  if(( *recIt )->isValid())
47  {
48  if( detid.det() == DetId::Muon )
49  {
50  if( detid.subdetId() == MuonSubdetId::DT )
51  detid = DetId( DTChamberId( detid )); // get rid of layer bits
52  }
53 
54  TEveGeoShape* shape = geom->getEveShape( detid );
55  if( shape )
56  {
57  setupAddElement( shape, &oItemHolder );
58  }
59  else
60  {
62  << "Failed to get shape extract for track-id " << iIndex << ", tracking rec hit: "
63  << "\n" << fireworks::info( detid ) << std::endl;
64  }
65  }
66  }
67  }
68 }
69 
70 bool
72 {
73  return true;
74 }
75 
const FWTracksModulesProxyBuilder & operator=(const FWTracksModulesProxyBuilder &)
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:59
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:97
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
bool isAvailable() const
Definition: Ref.h:276
const FWEventItem * item() const
static const int kAll3DBits
Definition: FWViewType.h:60
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:63
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
#define fwLog(_level_)
Definition: fwLog.h:51
std::string info(const DetId &)
Definition: TrackUtils.cc:703
static const int DT
Definition: MuonSubdetId.h:14
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:682
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65