Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "TEveTrack.h"
00016 #include "TEveTrackPropagator.h"
00017 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00018
00019
00020 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
00021 #include "Fireworks/Core/interface/FWEvePtr.h"
00022 #include "Fireworks/Core/src/CmsShowMain.h"
00023 #include "Fireworks/Core/interface/FWEventItem.h"
00024 #include "Fireworks/ParticleFlow/interface/setTrackTypePF.h"
00025
00026
00027
00028
00029
00030 class FWPFCandidate3DProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::PFCandidate>
00031 {
00032
00033 public:
00034
00035 FWPFCandidate3DProxyBuilder() {}
00036 virtual ~FWPFCandidate3DProxyBuilder();
00037
00038 REGISTER_PROXYBUILDER_METHODS();
00039
00040 private:
00041 FWPFCandidate3DProxyBuilder( const FWPFCandidate3DProxyBuilder& );
00042 const FWPFCandidate3DProxyBuilder& operator=( const FWPFCandidate3DProxyBuilder& );
00043
00044
00045 void build( const reco::PFCandidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
00046
00047 };
00048
00049
00050
00051
00052
00053 FWPFCandidate3DProxyBuilder::~FWPFCandidate3DProxyBuilder(){}
00054
00055
00056 void
00057 FWPFCandidate3DProxyBuilder::build( const reco::PFCandidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
00058 {
00059 TEveRecTrack t;
00060 t.fBeta = 1.;
00061 t.fP = TEveVector( iData.px(), iData.py(), iData.pz() );
00062 t.fV = TEveVector( iData.vertex().x(), iData.vertex().y(), iData.vertex().z() );
00063 t.fSign = iData.charge();
00064 TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator() );
00065
00066 trk->MakeTrack();
00067
00068 fireworks::setTrackTypePF( iData, trk );
00069 setupAddElement( trk, &oItemHolder );
00070 }
00071
00072
00073 REGISTER_FWPROXYBUILDER(FWPFCandidate3DProxyBuilder, reco::PFCandidate,"PF Candidates", FWViewType::kAll3DBits | FWViewType::kAllRPZBits );