Go to the documentation of this file.00001
00002
00003
00004
00005
00014
00015
00016
00017
00018
00019
00020 #include "TDatabasePDG.h"
00021 #include "TEveTrack.h"
00022
00023 #include "Fireworks/Core/interface/FWEventItem.h"
00024 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
00025 #include "Fireworks/Candidates/interface/CandidateUtils.h"
00026
00027 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00028 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
00029
00030 class FWGenParticleProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::GenParticle> {
00031
00032 public:
00033 FWGenParticleProxyBuilder() {}
00034 virtual ~FWGenParticleProxyBuilder() {}
00035
00036
00037 REGISTER_PROXYBUILDER_METHODS();
00038
00039 private:
00040 FWGenParticleProxyBuilder(const FWGenParticleProxyBuilder&);
00041
00042 const FWGenParticleProxyBuilder& operator=(const FWGenParticleProxyBuilder&);
00043
00044 void build(const reco::GenParticle& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*);
00045
00046
00047 static TDatabasePDG* s_pdg;
00048 };
00049
00050
00051
00052 TDatabasePDG* FWGenParticleProxyBuilder::s_pdg = 0;
00053
00054 void
00055 FWGenParticleProxyBuilder::build(const reco::GenParticle& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*)
00056 {
00057 if (!s_pdg)
00058 s_pdg = new TDatabasePDG();
00059
00060
00061 TEveTrack* trk = fireworks::prepareCandidate( iData, context().getTrackPropagator() );
00062 trk->MakeTrack();
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 setupAddElement(trk, &oItemHolder);
00073 }
00074
00075 REGISTER_FWPROXYBUILDER(FWGenParticleProxyBuilder, reco::GenParticle, "GenParticles", FWViewType::kAll3DBits | FWViewType::kAllRPZBits);
00076