File indexing completed on 2024-04-06 12:11:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
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
0034 REGISTER_PROXYBUILDER_METHODS();
0035
0036 FWGenParticleProxyBuilder(const FWGenParticleProxyBuilder&) = delete;
0037
0038 const FWGenParticleProxyBuilder& operator=(const FWGenParticleProxyBuilder&) = delete;
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);