Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
REveJetCone.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Author: Matevz Tadel, Jochen Thaeder 2009, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT7_REveJetCone
13 #define ROOT7_REveJetCone
14 
15 #include <ROOT/REveShape.hxx>
16 #include <ROOT/REveVector.hxx>
17 
18 namespace ROOT {
19 namespace Experimental {
20 
21 //------------------------------------------------------------------------------
22 // REveJetCone
23 //------------------------------------------------------------------------------
24 
25 class REveJetCone : public REveShape,
26  public REveProjectable
27 {
28  friend class REveJetConeProjected;
29 
30 private:
31  REveJetCone(const REveJetCone &); // Not implemented
32  REveJetCone &operator=(const REveJetCone &); // Not implemented
33 
34 protected:
35  REveVector fApex; // Apex of the cone.
36  REveVector fAxis; // Axis of the cone.
37  REveVector fLimits; // Border of Barrel/Cylinder to cut the cone.
38  Float_t fThetaC; // Transition theta
39  Float_t fEta, fPhi;
40  Float_t fDEta, fDPhi;
41  Int_t fNDiv;
42 
43  REveVector CalcEtaPhiVec(Float_t eta, Float_t phi) const;
44  REveVector CalcBaseVec(Float_t eta, Float_t phi) const;
45  REveVector CalcBaseVec(Float_t alpha) const;
46  Bool_t IsInTransitionRegion() const;
47 
48 public:
49  REveJetCone(const Text_t *n = "REveJetCone", const Text_t *t = "");
50  virtual ~REveJetCone() {}
51 
52  Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
53  void BuildRenderData() override;
54 
55  void ComputeBBox() override;
56  TClass *ProjectedClass(const REveProjection *p) const override;
57 
58  void SetApex(const REveVector &a) { fApex = a; }
59  void SetCylinder(Float_t r, Float_t z)
60  {
61  fLimits.Set(0, r, z);
62  fThetaC = fLimits.Theta();
63  }
64  void SetRadius(Float_t r)
65  {
66  fLimits.Set(r, 0, 0);
67  fThetaC = 10;
68  }
69 
70  Int_t GetNDiv() const { return fNDiv; }
71  void SetNDiv(Int_t n);
72 
73  Int_t AddCone(Float_t eta, Float_t phi, Float_t cone_r, Float_t length = 0);
74  Int_t AddEllipticCone(Float_t eta, Float_t phi, Float_t reta, Float_t rphi, Float_t length = 0);
75 };
76 
77 
78 //------------------------------------------------------------------------------
79 // REveJetConeProjected
80 //------------------------------------------------------------------------------
81 
82 class REveJetConeProjected : public REveShape,
83  public REveProjected
84 {
85 private:
86  REveJetConeProjected(const REveJetConeProjected &); // Not implemented
87  REveJetConeProjected &operator=(const REveJetConeProjected &); // Not implemented
88 
89 protected:
90  void SetDepthLocal(Float_t d) override;
91 
92 public:
93  REveJetConeProjected(const std::string &n = "REveJetConeProjected", const std::string& t = "");
94  virtual ~REveJetConeProjected();
95 
96  void BuildRenderData() override;
97 
98  // For TAttBBox:
99  void ComputeBBox() override;
100 
101  // Projected:
102  void SetProjection(REveProjectionManager *mng, REveProjectable *model) override;
103  void UpdateProjection() override;
104 
105  REveElement *GetProjectedAsElement() override { return this; }
106 };
107 
108 } // namespace Experimental
109 } // namespace ROOT
110 
111 #endif