Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:26

0001 #ifndef _FWBOXRECHIT_H_
0002 #define _FWBOXRECHIT_H_
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     ParticleFlow
0007 // Class  :     FWBoxRecHit
0008 //
0009 // Implementation:
0010 //     <Notes on implementation>
0011 //
0012 // Original Author:  Simon Harris
0013 //
0014 
0015 // System include files
0016 #include "TEveBox.h"
0017 #include "TEveCompound.h"
0018 #include "TEveStraightLineSet.h"
0019 
0020 #include "TEveCaloData.h"
0021 #include "TEveChunkManager.h"
0022 
0023 // User include files
0024 #include "Fireworks/Core/interface/FWViewContext.h"
0025 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
0026 #include "Fireworks/Core/interface/Context.h"
0027 
0028 // Forward declarations
0029 class FWProxyBuilderBase;
0030 
0031 //-----------------------------------------------------------------------------
0032 // FWBoxRechHit
0033 //-----------------------------------------------------------------------------
0034 class FWBoxRecHit {
0035 public:
0036   // ---------------- Constructor(s)/Destructor ----------------------
0037   FWBoxRecHit(const std::vector<TEveVector> &corners, TEveElement *comp, float e, float et);
0038   virtual ~FWBoxRecHit() {}
0039 
0040   // --------------------- Member Functions --------------------------
0041   void updateScale(float scale, float maxLogVal, bool plotEt);
0042   void setSquareColor(Color_t c) {
0043     m_ls->SetMarkerColor(c);
0044     m_ls->SetLineColor(kBlack);
0045   }
0046 
0047   TEveBox *getTower() { return m_tower; }
0048   void setLine(int idx, float x1, float y1, float z1, float x2, float y2, float z2);
0049   void addLine(float x1, float y1, float z1, float x2, float y2, float z2);
0050   void addLine(const TEveVector &v1, const TEveVector &v2);
0051   float getEnergy(bool b) const { return b ? m_et : m_energy; }
0052   bool isTallest() const { return m_isTallest; }
0053   void setIsTallest();
0054 
0055   FWBoxRecHit(const FWBoxRecHit &) = delete;                   // Disable default
0056   const FWBoxRecHit &operator=(const FWBoxRecHit &) = delete;  // Disable default
0057 
0058 private:
0059   // --------------------- Member Functions --------------------------
0060   void setupEveBox(std::vector<TEveVector> &corners, float scale);
0061   void buildTower(const std::vector<TEveVector> &corners);
0062   void buildLineSet(const std::vector<TEveVector> &corners);
0063 
0064   // ----------------------- Data Members ----------------------------
0065   TEveBox *m_tower;
0066   TEveStraightLineSet *m_ls;
0067   float m_energy;
0068   float m_et;
0069   bool m_isTallest;
0070 };
0071 #endif
0072 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_