CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Fireworks/ParticleFlow/plugins/FWPFLegoRecHit.h

Go to the documentation of this file.
00001 #ifndef _FWPFLEGORECHIT_H_
00002 #define _FWPFLEGORECHIT_H_
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:     ParticleFlow
00007 // Class  :     FWPFLegoRecHit
00008 // 
00009 // Implementation:
00010 //     <Notes on implementation>
00011 //
00012 // Original Author:  Simon Harris
00013 //
00014 
00015 // System include files
00016 #include "TEveBox.h"
00017 #include "TEveCompound.h"
00018 #include "TEveStraightLineSet.h"
00019 
00020 #include "TEveCaloData.h"
00021 #include "TEveChunkManager.h"
00022 
00023 // User include files
00024 #include "Fireworks/Core/interface/FWViewContext.h"
00025 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
00026 #include "Fireworks/Core/interface/Context.h"
00027 
00028 // Forward declarations
00029 class FWPFEcalRecHitLegoProxyBuilder;
00030 
00031 //-----------------------------------------------------------------------------
00032 // FWPFLegoRechHit
00033 //-----------------------------------------------------------------------------
00034 class FWPFLegoRecHit
00035 {
00036    public:
00037    // ---------------- Constructor(s)/Destructor ----------------------
00038       FWPFLegoRecHit( const std::vector<TEveVector> &corners, TEveElement *comp, FWPFEcalRecHitLegoProxyBuilder*pb,
00039                       const FWViewContext *vc, float e, float et );
00040       virtual ~FWPFLegoRecHit(){}
00041 
00042    // --------------------- Member Functions --------------------------
00043       void updateScale( const FWViewContext *vc);
00044       void setSquareColor( Color_t c ) { m_ls->SetMarkerColor(c); m_ls->SetLineColor(kBlack); }
00045 
00046       TEveBox *getTower() { return m_tower; }
00047       void  setLine(int idx, float x1, float y1, float z1, float x2, float y2, float z2);
00048       void  addLine( float x1, float y1, float z1, float x2, float y2, float z2 );
00049       void  addLine( const TEveVector &v1, const TEveVector &v2 );
00050       float getEtEnergy( bool b ) const { return b ? m_et : m_energy; }
00051       bool  isTallest() const { return m_isTallest; }
00052       void  setIsTallest( bool b );
00053 
00054    private:
00055       FWPFLegoRecHit( const FWPFLegoRecHit& );                    // Disable default
00056       const FWPFLegoRecHit& operator=( const FWPFLegoRecHit& );   // Disable default
00057 
00058    // --------------------- Member Functions --------------------------
00059       void setupEveBox( const std::vector<TEveVector> &corners );
00060       void convertToTower( std::vector<TEveVector> &corners, float scale );
00061       void buildTower( const std::vector<TEveVector> &corners, const FWViewContext *vc );
00062       void buildLineSet( const std::vector<TEveVector> &corners, const FWViewContext *vc );
00063 
00064    // ----------------------- Data Members ----------------------------
00065       FWPFEcalRecHitLegoProxyBuilder   *m_builder;
00066       TEveBox                          *m_tower;
00067       TEveStraightLineSet              *m_ls;
00068       float                            m_energy;
00069       float                            m_et;
00070       bool                             m_isTallest;
00071 };
00072 #endif
00073 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_