Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:39

0001 // @(#)root/eve7:$Id$
0002 // Author: Matevz Tadel, Jochen Thaeder 2009, 2018
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT7_REveJetCone
0013 #define ROOT7_REveJetCone
0014 
0015 #include <ROOT/REveShape.hxx>
0016 #include <ROOT/REveVector.hxx>
0017 
0018 namespace ROOT {
0019 namespace Experimental {
0020 
0021 //------------------------------------------------------------------------------
0022 // REveJetCone
0023 //------------------------------------------------------------------------------
0024 
0025 class REveJetCone : public REveShape,
0026                     public REveProjectable
0027 {
0028    friend class REveJetConeProjected;
0029 
0030 private:
0031    REveJetCone(const REveJetCone &) = delete;
0032    REveJetCone &operator=(const REveJetCone &) = delete;
0033 
0034 protected:
0035    REveVector fApex;   // Apex of the cone.
0036    REveVector fAxis;   // Axis of the cone.
0037    REveVector fLimits; // Border of Barrel/Cylinder to cut the cone.
0038    Float_t fThetaC;    // Transition theta
0039    Float_t fEta, fPhi;
0040    Float_t fDEta, fDPhi;
0041    Int_t fNDiv;
0042 
0043    REveVector CalcEtaPhiVec(Float_t eta, Float_t phi) const;
0044    REveVector CalcBaseVec(Float_t eta, Float_t phi) const;
0045    REveVector CalcBaseVec(Float_t alpha) const;
0046    Bool_t IsInTransitionRegion() const;
0047 
0048 public:
0049    REveJetCone(const Text_t *n = "REveJetCone", const Text_t *t = "");
0050    ~REveJetCone() override {}
0051 
0052    Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
0053    void BuildRenderData() override;
0054 
0055    void ComputeBBox() override;
0056    TClass *ProjectedClass(const REveProjection *p) const override;
0057 
0058    void SetApex(const REveVector &a) { fApex = a; }
0059    void SetCylinder(Float_t r, Float_t z)
0060    {
0061       fLimits.Set(0, r, z);
0062       fThetaC = fLimits.Theta();
0063    }
0064    void SetRadius(Float_t r)
0065    {
0066       fLimits.Set(r, 0, 0);
0067       fThetaC = 10;
0068    }
0069 
0070    Int_t GetNDiv() const { return fNDiv; }
0071    void SetNDiv(Int_t n);
0072 
0073    Int_t AddCone(Float_t eta, Float_t phi, Float_t cone_r, Float_t length = 0);
0074    Int_t AddEllipticCone(Float_t eta, Float_t phi, Float_t reta, Float_t rphi, Float_t length = 0);
0075 };
0076 
0077 
0078 //------------------------------------------------------------------------------
0079 // REveJetConeProjected
0080 //------------------------------------------------------------------------------
0081 
0082 class REveJetConeProjected : public REveShape,
0083                              public REveProjected
0084 {
0085 private:
0086    REveJetConeProjected(const REveJetConeProjected &) = delete;
0087    REveJetConeProjected &operator=(const REveJetConeProjected &) = delete;
0088 
0089 protected:
0090    void SetDepthLocal(Float_t d) override;
0091 
0092 public:
0093    REveJetConeProjected(const std::string &n = "REveJetConeProjected", const std::string& t = "");
0094    ~REveJetConeProjected() override;
0095 
0096    void BuildRenderData() override;
0097 
0098    // For TAttBBox:
0099    void ComputeBBox() override;
0100 
0101    // Projected:
0102    void SetProjection(REveProjectionManager *mng, REveProjectable *model) override;
0103    void UpdateProjection() override;
0104 
0105    REveElement *GetProjectedAsElement() override { return this; }
0106 };
0107 
0108 } // namespace Experimental
0109 } // namespace ROOT
0110 
0111 #endif