Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-03 04:10:05

0001 // -*- C++ -*-
0002 // $Id: FWTracksRecHitsProxyBuilder.cc,v 1.1 2009/01/16 10:37:00 Tom Danielson
0003 //
0004 
0005 // user include files
0006 #include "TEveGeoShape.h"
0007 #include "TEvePointSet.h"
0008 
0009 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0010 #include "Fireworks/Core/interface/FWGeometry.h"
0011 #include "Fireworks/Core/interface/FWEventItem.h"
0012 #include "Fireworks/Tracks/interface/TrackUtils.h"
0013 
0014 #include "DataFormats/TrackReco/interface/Track.h"
0015 
0016 #include "Fireworks/Core/interface/fwLog.h"
0017 
0018 class FWTracksRecHitsProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Track> {
0019 public:
0020   FWTracksRecHitsProxyBuilder(void) {}
0021   ~FWTracksRecHitsProxyBuilder(void) override {}
0022 
0023   REGISTER_PROXYBUILDER_METHODS();
0024 
0025   static bool representsSubPart(void);
0026 
0027 private:
0028   using FWSimpleProxyBuilderTemplate<reco::Track>::build;
0029   void build(const reco::Track& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
0030 
0031 public:
0032   FWTracksRecHitsProxyBuilder(const FWTracksRecHitsProxyBuilder&) = delete;                   // stop default
0033   const FWTracksRecHitsProxyBuilder& operator=(const FWTracksRecHitsProxyBuilder&) = delete;  // stop default
0034 };
0035 
0036 void FWTracksRecHitsProxyBuilder::build(const reco::Track& track,
0037                                         unsigned int iIndex,
0038                                         TEveElement& oItemHolder,
0039                                         const FWViewContext*) {
0040   if (track.extra().isAvailable()) {
0041     std::vector<TVector3> points;
0042     const FWEventItem& iItem = *item();
0043     fireworks::pushPixelHits(points, iItem, track);
0044 
0045     TEvePointSet* pointSet = new TEvePointSet();
0046     for (std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
0047       pointSet->SetNextPoint(it->x(), it->y(), it->z());
0048     }
0049     setupAddElement(pointSet, &oItemHolder);
0050 
0051     fireworks::addSiStripClusters(item(), track, &oItemHolder, false, true);
0052   }
0053 }
0054 
0055 bool FWTracksRecHitsProxyBuilder::representsSubPart(void) { return true; }
0056 
0057 REGISTER_FWPROXYBUILDER(FWTracksRecHitsProxyBuilder,
0058                         reco::Track,
0059                         "TrackHits",
0060                         FWViewType::kAll3DBits | FWViewType::kAllRPZBits);