CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Fireworks/GenParticle/plugins/FWGenParticleProxyBuilder.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Core
00004 // Class  :     FWGenParticleProxyBuilder
00005 //
00014 //
00015 // Original Author:
00016 //         Created:  Thu Dec  6 18:01:21 PST 2007
00017 // $Id: FWGenParticleProxyBuilder.cc,v 1.8 2012/12/02 09:09:13 amraktad Exp $
00018 // 
00019 
00020 #include "TEveTrack.h"
00021 
00022 #include "Fireworks/Core/interface/FWEventItem.h"
00023 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
00024 #include "Fireworks/Candidates/interface/CandidateUtils.h"
00025 
00026 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00027 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
00028 
00029 class FWGenParticleProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::GenParticle> {
00030 
00031 public:
00032    FWGenParticleProxyBuilder() {}
00033    virtual ~FWGenParticleProxyBuilder() {}
00034 
00035    // ---------- member functions ---------------------------
00036    REGISTER_PROXYBUILDER_METHODS();
00037 
00038 private:
00039    FWGenParticleProxyBuilder(const FWGenParticleProxyBuilder&); // stop default
00040 
00041    const FWGenParticleProxyBuilder& operator=(const FWGenParticleProxyBuilder&); // stop default
00042    
00043    void build(const reco::GenParticle& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*);
00044 
00045 };
00046 
00047 //______________________________________________________________________________
00048 
00049 
00050 void
00051 FWGenParticleProxyBuilder::build(const reco::GenParticle& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) 
00052 {
00053    TEveTrack* trk = fireworks::prepareCandidate( iData, context().getTrackPropagator() );    
00054    trk->MakeTrack();
00055    setupAddElement(trk, &oItemHolder);
00056 }
00057 
00058 REGISTER_FWPROXYBUILDER(FWGenParticleProxyBuilder, reco::GenParticle, "GenParticles", FWViewType::kAll3DBits | FWViewType::kAllRPZBits);
00059