CMS 3D CMS Logo

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