CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Fireworks/Candidates/plugins/FWCandidateProxyBuilder.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Candidates
00004 // Class  :     FWCandidateProxyBuilder
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Fri Dec  5 09:56:09 EST 2008
00011 // $Id: FWCandidateProxyBuilder.cc,v 1.9 2010/11/11 20:25:27 amraktad Exp $
00012 //
00013 
00014 #include "TEveTrack.h"
00015 
00016 // user include files
00017 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
00018 #include "Fireworks/Core/interface/Context.h"
00019 
00020 #include "Fireworks/Candidates/interface/CandidateUtils.h"
00021 
00022 #include "DataFormats/Candidate/interface/Candidate.h"
00023 
00024 class FWCandidateProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Candidate>  {
00025       
00026 public:
00027    FWCandidateProxyBuilder() {}
00028    virtual ~FWCandidateProxyBuilder() {}
00029 
00030    REGISTER_PROXYBUILDER_METHODS();
00031 
00032 private:
00033    FWCandidateProxyBuilder(const FWCandidateProxyBuilder&); // stop default
00034    const FWCandidateProxyBuilder& operator=(const FWCandidateProxyBuilder&); // stop default
00035 
00036    void build(const reco::Candidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*);
00037 };
00038 
00039 
00040 void 
00041 FWCandidateProxyBuilder::build(const reco::Candidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) 
00042 {
00043    TEveTrack* trk = fireworks::prepareCandidate( iData, context().getTrackPropagator() ); 
00044    
00045    trk->MakeTrack();
00046    setupAddElement(trk, &oItemHolder);
00047 }
00048 
00049 //
00050 // static member functions
00051 //
00052 REGISTER_FWPROXYBUILDER(FWCandidateProxyBuilder, reco::Candidate, "Candidates", FWViewType::kAll3DBits | FWViewType::kAllRPZBits);