CMS 3D CMS Logo

FWPFPatJet3DProxyBuilder.cc
Go to the documentation of this file.
3 
4 //______________________________________________________________________________
5 template <class T>
7 template <class T>
9 
10 //______________________________________________________________________________
11 template <class T>
13  unsigned int iIndex,
14  TEveElement& oItemHolder,
15  const FWViewContext*) {
16  try {
17  std::vector<reco::PFCandidatePtr> consts = iData.getPFConstituents();
18  typedef std::vector<reco::PFCandidatePtr>::const_iterator IC;
19 
20  for (IC ic = consts.begin(); // If consts has no constituents then the loop simply won't execute
21  ic != consts.end();
22  ic++) // and so no segmentation fault should occur
23  {
24  const reco::PFCandidatePtr pfCandPtr = *ic;
25 
26  TEveRecTrack t;
27  t.fBeta = 1;
28  t.fP = TEveVector(pfCandPtr->px(), pfCandPtr->py(), pfCandPtr->pz());
29  t.fV = TEveVector(pfCandPtr->vertex().x(), pfCandPtr->vertex().y(), pfCandPtr->vertex().z());
30  t.fSign = pfCandPtr->charge();
31  TEveTrack* trk = new TEveTrack(&t, FWProxyBuilderBase::context().getTrackPropagator());
32  trk->MakeTrack();
33  trk->SetLineWidth(3);
34 
35  fireworks::setTrackTypePF(*pfCandPtr, trk);
36 
37  FWProxyBuilderBase::setupAddElement(trk, &oItemHolder);
38  }
39  } catch (cms::Exception& iException) {
40  fwLog(fwlog::kError) << "FWPFPatJet3DProxyBuilder::build() Caught exception " << iException.what() << std::endl;
41  }
42 }
43 
44 /* Classes have been created because 'concrete' types (i.e. reco::PFJet and not T) are required to register
45 a proxy builder. Each class must first register it's methods so that REGISTER_FWPROXYBUILDER macro knows
46 about them */
47 //_____________________________PF_______________________________________________
48 class FWPFJet3DProxyBuilder : public FWPFPatJet3DProxyBuilder<reco::PFJet> {
49 public:
51  ~FWPFJet3DProxyBuilder() override {}
52 
54 };
55 
56 //_____________________________PAT______________________________________________
58 public:
61 
62  REGISTER_PROXYBUILDER_METHODS(); // Register methods ready for macro
63 };
64 
65 //______________________________________________________________________________
68 
69 //______________________________________________________________________________
FWPFJet3DProxyBuilder
Definition: FWPFPatJet3DProxyBuilder.cc:48
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWPatJet3DProxyBuilder::~FWPatJet3DProxyBuilder
~FWPatJet3DProxyBuilder() override
Definition: FWPFPatJet3DProxyBuilder.cc:60
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
FWPFPatJet3DProxyBuilder::FWPFPatJet3DProxyBuilder
FWPFPatJet3DProxyBuilder()
Definition: FWPFPatJet3DProxyBuilder.cc:6
cms::Exception::what
char const * what() const noexcept override
Definition: Exception.cc:103
fireworks::setTrackTypePF
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
Definition: setTrackTypePF.cc:16
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
FWPFPatJet3DProxyBuilder::~FWPFPatJet3DProxyBuilder
~FWPFPatJet3DProxyBuilder() override
Definition: FWPFPatJet3DProxyBuilder.cc:8
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWPFPatJet3DProxyBuilder.h
fwLog.h
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWViewContext
Definition: FWViewContext.h:32
FWPFPatJet3DProxyBuilder
Definition: FWPFPatJet3DProxyBuilder.h:33
edm::Ptr< PFCandidate >
FWPFJet3DProxyBuilder::FWPFJet3DProxyBuilder
FWPFJet3DProxyBuilder()
Definition: FWPFPatJet3DProxyBuilder.cc:50
FWPatJet3DProxyBuilder::FWPatJet3DProxyBuilder
FWPatJet3DProxyBuilder()
Definition: FWPFPatJet3DProxyBuilder.cc:59
T
long double T
Definition: Basic3DVectorLD.h:48
FWPFJet3DProxyBuilder::~FWPFJet3DProxyBuilder
~FWPFJet3DProxyBuilder() override
Definition: FWPFPatJet3DProxyBuilder.cc:51
reco::PFJet
Jets made from PFObjects.
Definition: PFJet.h:20
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
fwlog::kError
Definition: fwLog.h:35
cms::Exception
Definition: Exception.h:70
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
FWPatJet3DProxyBuilder
Definition: FWPFPatJet3DProxyBuilder.cc:57