FWPFLegoRecHit

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
#ifndef _FWPFLEGORECHIT_H_
#define _FWPFLEGORECHIT_H_

// -*- C++ -*-
//
// Package:     ParticleFlow
// Class  :     FWPFLegoRecHit
//
// Implementation:
//     <Notes on implementation>
//
// Original Author:  Simon Harris
//

// System include files
#include "TEveBox.h"
#include "TEveCompound.h"
#include "TEveStraightLineSet.h"

#include "TEveCaloData.h"
#include "TEveChunkManager.h"

// User include files
#include "Fireworks/Core/interface/FWViewContext.h"
#include "Fireworks/Core/interface/FWViewEnergyScale.h"
#include "Fireworks/Core/interface/Context.h"

// Forward declarations
class FWProxyBuilderBase;

//-----------------------------------------------------------------------------
// FWPFLegoRechHit
//-----------------------------------------------------------------------------
class FWPFLegoRecHit {
public:
  // ---------------- Constructor(s)/Destructor ----------------------
  FWPFLegoRecHit(const std::vector<TEveVector> &corners,
                 TEveElement *comp,
                 FWProxyBuilderBase *pb,
                 const FWViewContext *vc,
                 float e,
                 float et);
  virtual ~FWPFLegoRecHit() {}

  // --------------------- Member Functions --------------------------
  void updateScale(const FWViewContext *vc, float maxLogVal);
  void setSquareColor(Color_t c) {
    m_ls->SetMarkerColor(c);
    m_ls->SetLineColor(kBlack);
  }

  TEveBox *getTower() { return m_tower; }
  void setLine(int idx, float x1, float y1, float z1, float x2, float y2, float z2);
  void addLine(float x1, float y1, float z1, float x2, float y2, float z2);
  void addLine(const TEveVector &v1, const TEveVector &v2);
  float getEtEnergy(bool b) const { return b ? m_et : m_energy; }
  bool isTallest() const { return m_isTallest; }
  void setIsTallest(bool b);

  FWPFLegoRecHit(const FWPFLegoRecHit &) = delete;                   // Disable default
  const FWPFLegoRecHit &operator=(const FWPFLegoRecHit &) = delete;  // Disable default

private:
  // --------------------- Member Functions --------------------------
  void setupEveBox(std::vector<TEveVector> &corners, float scale);
  void buildTower(const std::vector<TEveVector> &corners, const FWViewContext *vc);
  void buildLineSet(const std::vector<TEveVector> &corners, const FWViewContext *vc);

  // ----------------------- Data Members ----------------------------
  TEveBox *m_tower;
  TEveStraightLineSet *m_ls;
  float m_energy;
  float m_et;
  bool m_isTallest;
};
#endif
//=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_