File indexing completed on 2024-04-06 12:11:51
0001 #ifndef _FWPFEcalRecHitLegoProxyBuilder_H_
0002 #define _FWPFEcalRecHitLegoProxyBuilder_H_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <cmath>
0017 #include "TEveCompound.h"
0018
0019
0020 #include "Fireworks/Core/interface/FWProxyBuilderTemplate.h"
0021 #include "Fireworks/Core/interface/FWEventItem.h"
0022 #include "Fireworks/Core/interface/FWGeometry.h"
0023 #include "Fireworks/Core/interface/Context.h"
0024
0025 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0026 #include "Fireworks/ParticleFlow/interface/FWPFLegoRecHit.h"
0027 #include "Fireworks/ParticleFlow/interface/FWPFMaths.h"
0028
0029 #include "Fireworks/Core/interface/FWViewContext.h"
0030 #include "Fireworks/Core/interface/FWViewEnergyScale.h"
0031
0032
0033
0034
0035
0036 class FWPFEcalRecHitLegoProxyBuilder : public FWProxyBuilderTemplate<EcalRecHit> {
0037 public:
0038
0039 FWPFEcalRecHitLegoProxyBuilder() : m_maxEnergy(0), m_maxEt(0), m_maxEnergyLog(0), m_maxEtLog(0) {}
0040 ~FWPFEcalRecHitLegoProxyBuilder() override {}
0041
0042 static std::string typeOfBuilder() { return "simple#"; }
0043
0044
0045 void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
0046
0047 void scaleProduct(TEveElementList* parent, FWViewType::EType, const FWViewContext* vc) override;
0048 bool havePerViewProduct(FWViewType::EType) const override { return true; }
0049 void cleanLocal() override;
0050
0051
0052 TEveVector calculateCentre(const std::vector<TEveVector>& corners) const;
0053 float getMaxValLog(bool et) const { return et ? m_maxEtLog : m_maxEnergyLog; }
0054 float getMaxVal(bool et) const { return et ? m_maxEt : m_maxEnergy; }
0055
0056 REGISTER_PROXYBUILDER_METHODS();
0057
0058 protected:
0059
0060 void localModelChanges(const FWModelId& iId,
0061 TEveElement* iCompound,
0062 FWViewType::EType viewType,
0063 const FWViewContext* vc) override;
0064
0065 public:
0066
0067 FWPFEcalRecHitLegoProxyBuilder(const FWPFEcalRecHitLegoProxyBuilder&) = delete;
0068
0069 const FWPFEcalRecHitLegoProxyBuilder& operator=(const FWPFEcalRecHitLegoProxyBuilder&) = delete;
0070
0071 private:
0072
0073 float m_maxEnergy;
0074 float m_maxEt;
0075 float m_maxEnergyLog;
0076 float m_maxEtLog;
0077 std::vector<FWPFLegoRecHit*> m_recHits;
0078 };
0079 #endif
0080