CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
const edm::EventSetup & c
static float caloTransAngle()
Definition: Context.cc:189
Base class for all types of Jets.
Definition: Jet.h:20
static float caloZ2(bool offset=true)
Definition: Context.cc:185
std::vector< Constituent > Constituents
Definition: Jet.h:23
float etaetaMoment() const
eta-eta second moment, ET weighted
const Point & vertex() const override
vertex position (overwritten by PF...)
virtual Constituents getJetConstituents() const
list of constituents
static float caloR2(bool offset=true)
Definition: Context.cc:182
T sqrt(T t)
Definition: SSEVec.h:19
static float caloR1(bool offset=true)
Definition: Context.cc:180
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
float phiphiMoment() const
phi-phi second moment, ET weighted
static double caloMaxEta()
Definition: Context.cc:191
static float caloZ1(bool offset=true)
Definition: Context.cc:183
double phi() const final
momentum azimuthal angle
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
double eta() const final
momentum pseudorapidity