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:234
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:224
std::vector< Constituent > Constituents
Definition: Jet.h:23
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
static float caloR2(bool offset=true)
Definition: Context.cc:214
T sqrt(T t)
Definition: SSEVec.h:48
static float caloR1(bool offset=true)
Definition: Context.cc:209
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
float etaetaMoment() const
eta-eta second moment, ET weighted
Definition: Jet.cc:223
float phiphiMoment() const
phi-phi second moment, ET weighted
Definition: Jet.cc:240
static double caloMaxEta()
Definition: Context.cc:239
static float caloZ1(bool offset=true)
Definition: Context.cc:219
TEveJetCone * makeEveJetCone(const reco::Jet &iData, const fireworks::Context &context)
virtual Constituents getJetConstituents() const
list of constituents
Definition: Jet.cc:350