Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:46

0001 // -*- C++ -*-
0002 //
0003 // Package:     Core
0004 // Class  :     FWGenParticleProxyBuilder
0005 //
0006 /**\class FWGenParticleProxyBuilder 
0007 
0008    Description: <one line class summary>
0009 
0010    Usage:
0011     <usage>
0012 
0013  */
0014 //
0015 // Original Author:
0016 //         Created:  Thu Dec  6 18:01:21 PST 2007
0017 //
0018 
0019 #include "TEveTrack.h"
0020 
0021 #include "Fireworks/Core/interface/FWEventItem.h"
0022 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0023 #include "Fireworks/Candidates/interface/CandidateUtils.h"
0024 
0025 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0026 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
0027 
0028 class FWGenParticleProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::GenParticle> {
0029 public:
0030   FWGenParticleProxyBuilder() {}
0031   ~FWGenParticleProxyBuilder() override {}
0032 
0033   // ---------- member functions ---------------------------
0034   REGISTER_PROXYBUILDER_METHODS();
0035 
0036   FWGenParticleProxyBuilder(const FWGenParticleProxyBuilder&) = delete;  // stop default
0037 
0038   const FWGenParticleProxyBuilder& operator=(const FWGenParticleProxyBuilder&) = delete;  // stop default
0039 
0040 private:
0041   using FWSimpleProxyBuilderTemplate<reco::GenParticle>::build;
0042   void build(const reco::GenParticle& iData,
0043              unsigned int iIndex,
0044              TEveElement& oItemHolder,
0045              const FWViewContext*) override;
0046 };
0047 
0048 //______________________________________________________________________________
0049 
0050 void FWGenParticleProxyBuilder::build(const reco::GenParticle& iData,
0051                                       unsigned int iIndex,
0052                                       TEveElement& oItemHolder,
0053                                       const FWViewContext*) {
0054   TEveTrack* trk = fireworks::prepareCandidate(iData, context().getTrackPropagator());
0055   trk->MakeTrack();
0056   setupAddElement(trk, &oItemHolder);
0057 }
0058 
0059 REGISTER_FWPROXYBUILDER(FWGenParticleProxyBuilder,
0060                         reco::GenParticle,
0061                         "GenParticles",
0062                         FWViewType::kAll3DBits | FWViewType::kAllRPZBits);