CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Fireworks/ParticleFlow/plugins/FWPFEcalRecHitLegoProxyBuilder.h

Go to the documentation of this file.
00001 #ifndef _FWPFEcalRecHitLegoProxyBuilder_H_
00002 #define _FWPFEcalRecHitLegoProxyBuilder_H_
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:     ParticleFlow
00007 // Class  :     FWPFEcalRecHitLegoProxyBuilder
00008 // 
00009 // Implementation:
00010 //     <Notes on implementation>
00011 //
00012 // Original Author:  Simon Harris
00013 //
00014 
00015 // System include files
00016 #include <math.h>
00017 #include "TEveCompound.h"
00018 
00019 // User include files
00020 #include "Fireworks/Core/interface/FWProxyBuilderTemplate.h"
00021 #include "Fireworks/Core/interface/FWEventItem.h"
00022 #include "Fireworks/Core/interface/FWGeometry.h"
00023 #include "Fireworks/Core/interface/Context.h"
00024 
00025 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00026 #include "Fireworks/ParticleFlow/interface/FWPFLegoRecHit.h"
00027 #include "Fireworks/ParticleFlow/interface/FWPFMaths.h"
00028 
00029 #include "Fireworks/Core/interface/FWViewContext.h"
00030 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
00031 
00032 //-----------------------------------------------------------------------------
00033 // FWPFEcalRecHitLegoProxyBuilder
00034 //-----------------------------------------------------------------------------
00035 
00036 class FWPFEcalRecHitLegoProxyBuilder : public FWProxyBuilderTemplate<EcalRecHit>
00037 {
00038    public:
00039    // ---------------- Constructor(s)/Destructor ----------------------
00040       FWPFEcalRecHitLegoProxyBuilder() : m_maxEnergy(0), m_maxEt(0), m_maxEnergyLog(0), m_maxEtLog(0) {}
00041       virtual ~FWPFEcalRecHitLegoProxyBuilder(){}
00042 
00043       static std::string typeOfBuilder() { return "simple#"; }
00044 
00045    // --------------------- Member Functions --------------------------
00046       virtual void build( const FWEventItem *iItem, TEveElementList *product, const FWViewContext* );
00047 
00048       virtual void scaleProduct( TEveElementList *parent, FWViewType::EType, const FWViewContext *vc );
00049       virtual bool havePerViewProduct( FWViewType::EType ) const { return true; }
00050       virtual void cleanLocal();
00051 
00052       // Needed by FWPFLegoRecHit
00053       TEveVector  calculateCentre( const std::vector<TEveVector> & corners ) const;
00054       float getMaxValLog(bool et) const { return et ? m_maxEtLog : m_maxEnergyLog; }
00055       float getMaxVal( bool et ) const { return et ? m_maxEt : m_maxEnergy; }
00056 
00057       REGISTER_PROXYBUILDER_METHODS();
00058 
00059    protected:
00060 
00061    // --------------------- Member Functions --------------------------
00062       virtual void localModelChanges(const FWModelId& iId, TEveElement* iCompound,
00063                                      FWViewType::EType viewType, const FWViewContext* vc);
00064 
00065    private:
00066       // Disable default copy constructor
00067       FWPFEcalRecHitLegoProxyBuilder( const FWPFEcalRecHitLegoProxyBuilder& );
00068       // Disable default assignment operator
00069       const FWPFEcalRecHitLegoProxyBuilder& operator=( const FWPFEcalRecHitLegoProxyBuilder& );
00070 
00071    // ----------------------- Data Members ----------------------------
00072       float m_maxEnergy;
00073       float m_maxEt;
00074       float m_maxEnergyLog;
00075       float m_maxEtLog;
00076       std::vector<FWPFLegoRecHit*> m_recHits;
00077 };
00078 #endif
00079 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_