Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef _FWPFLEGORECHIT_H_
0002 #define _FWPFLEGORECHIT_H_
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     ParticleFlow
0007 // Class  :     FWPFLegoRecHit
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 // FWPFLegoRechHit
0033 //-----------------------------------------------------------------------------
0034 class FWPFLegoRecHit {
0035 public:
0036   // ---------------- Constructor(s)/Destructor ----------------------
0037   FWPFLegoRecHit(const std::vector<TEveVector> &corners,
0038                  TEveElement *comp,
0039                  FWProxyBuilderBase *pb,
0040                  const FWViewContext *vc,
0041                  float e,
0042                  float et);
0043   virtual ~FWPFLegoRecHit() {}
0044 
0045   // --------------------- Member Functions --------------------------
0046   void updateScale(const FWViewContext *vc, float maxLogVal);
0047   void setSquareColor(Color_t c) {
0048     m_ls->SetMarkerColor(c);
0049     m_ls->SetLineColor(kBlack);
0050   }
0051 
0052   TEveBox *getTower() { return m_tower; }
0053   void setLine(int idx, float x1, float y1, float z1, float x2, float y2, float z2);
0054   void addLine(float x1, float y1, float z1, float x2, float y2, float z2);
0055   void addLine(const TEveVector &v1, const TEveVector &v2);
0056   float getEtEnergy(bool b) const { return b ? m_et : m_energy; }
0057   bool isTallest() const { return m_isTallest; }
0058   void setIsTallest(bool b);
0059 
0060   FWPFLegoRecHit(const FWPFLegoRecHit &) = delete;                   // Disable default
0061   const FWPFLegoRecHit &operator=(const FWPFLegoRecHit &) = delete;  // Disable default
0062 
0063 private:
0064   // --------------------- Member Functions --------------------------
0065   void setupEveBox(std::vector<TEveVector> &corners, float scale);
0066   void buildTower(const std::vector<TEveVector> &corners, const FWViewContext *vc);
0067   void buildLineSet(const std::vector<TEveVector> &corners, const FWViewContext *vc);
0068 
0069   // ----------------------- Data Members ----------------------------
0070   TEveBox *m_tower;
0071   TEveStraightLineSet *m_ls;
0072   float m_energy;
0073   float m_et;
0074   bool m_isTallest;
0075 };
0076 #endif
0077 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_