CMS 3D CMS Logo

makeEveJetCone.cc
Go to the documentation of this file.
1 #include "TEveJetCone.h"
4 
5 namespace fireworks {
6  TEveJetCone* makeEveJetCone(const reco::Jet& iData, const fireworks::Context& context) {
7  TEveJetCone* jet = new TEveJetCone();
8  jet->SetApex(TEveVector(iData.vertex().x(), iData.vertex().y(), iData.vertex().z()));
9 
11  bool haveData = true;
12  for (reco::Jet::Constituents::const_iterator itr = c.begin(); itr != c.end(); ++itr) {
13  if (!itr->isAvailable()) {
14  haveData = false;
15  break;
16  }
17  }
18 
19  double eta_size = 0.2;
20  double phi_size = 0.2;
21  if (haveData) {
22  eta_size = sqrt(iData.etaetaMoment());
23  phi_size = sqrt(iData.phiphiMoment());
24  }
25 
26  static const float offr = 5;
27  static const float offz = offr / tan(context.caloTransAngle());
28  if (iData.eta() < context.caloMaxEta())
29  jet->SetCylinder(context.caloR1(false) - offr, context.caloZ1(false) - offz);
30  else
31  jet->SetCylinder(context.caloR2(false) - offr, context.caloZ2(false) - offz);
32 
33  jet->AddEllipticCone(iData.eta(), iData.phi(), eta_size, phi_size);
34  jet->SetPickable(kTRUE);
35  return jet;
36  }
37 } // namespace fireworks
float etaetaMoment() const
eta-eta second moment, ET weighted
Base class for all types of Jets.
Definition: Jet.h:20
std::vector< Constituent > Constituents
Definition: Jet.h:23
const Point & vertex() const override
vertex position (overwritten by PF...)
float phiphiMoment() const
phi-phi second moment, ET weighted
virtual Constituents getJetConstituents() const
list of constituents
T sqrt(T t)
Definition: SSEVec.h:19
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double phi() const final
momentum azimuthal angle
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
double eta() const final
momentum pseudorapidity