CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFPatJet3DProxyBuilder.cc
Go to the documentation of this file.
2 
3 //______________________________________________________________________________
6 
7 //______________________________________________________________________________
8 template<class T> void
9 FWPFPatJet3DProxyBuilder<T>::build(const T& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*)
10 {
11  std::vector<reco::PFCandidatePtr> consts = iData.getPFConstituents();
12 
13  typedef std::vector<reco::PFCandidatePtr>::const_iterator IC;
14 
15  for( IC ic = consts.begin(); // If consts has no constituents then the loop simply won't execute
16  ic != consts.end(); ic++ ) // and so no segmentation fault should occur
17  {
18  const reco::PFCandidatePtr pfCandPtr = *ic;
19 
20  TEveRecTrack t;
21  t.fBeta = 1;
22  t.fP = TEveVector( pfCandPtr->px(), pfCandPtr->py(), pfCandPtr->pz() );
23  t.fV = TEveVector( pfCandPtr->vertex().x(), pfCandPtr->vertex().y(), pfCandPtr->vertex().z() );
24  t.fSign = pfCandPtr->charge();
25  TEveTrack* trk = new TEveTrack(&t, FWProxyBuilderBase::context().getTrackPropagator());
26  trk->MakeTrack();
27  trk->SetLineWidth(3);
28 
29  fireworks::setTrackTypePF( *pfCandPtr, trk );
30 
31  FWProxyBuilderBase::setupAddElement( trk, &oItemHolder );
32  }
33 
34 }
35 
36 /* Classes have been created because 'concrete' types (i.e. reco::PFJet and not T) are required to register
37 a proxy builder. Each class must first register it's methods so that REGISTER_FWPROXYBUILDER macro knows
38 about them */
39 //_____________________________PF_______________________________________________
40 class FWPFJet3DProxyBuilder : public FWPFPatJet3DProxyBuilder<reco::PFJet> {
41 public:
44 
46 };
47 
48 //_____________________________PAT______________________________________________
50 public:
53 
54  REGISTER_PROXYBUILDER_METHODS(); // Register methods ready for macro
55 };
56 
57 //______________________________________________________________________________
60 
61 //______________________________________________________________________________
const fireworks::Context & context() const
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Jets made from PFObjects.
Definition: PFJet.h:21
static const int kAll3DBits
Definition: FWViewType.h:59
Analysis-level calorimeter jet class.
Definition: Jet.h:73
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
long double T