Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-03 04:10:03

0001 #ifndef _FWPFBLOCKPROXYBUILDER_H_
0002 #define _FWPFBLOCKPROXYBUILDER_H_
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     ParticleFlow
0007 // Class  :     FWPFBlockProxyBuilder
0008 //
0009 // Implementation:
0010 //     <Notes on implementation>
0011 //
0012 // Original Author:  Simon Harris
0013 //       Created:    14/02/2011
0014 //
0015 
0016 // System include files
0017 #include <cmath>
0018 #include "TEveScalableStraightLineSet.h"
0019 
0020 // User include files
0021 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0022 #include "Fireworks/Core/interface/FWEventItem.h"
0023 #include "Fireworks/Core/interface/Context.h"
0024 
0025 #include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
0026 #include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
0027 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
0028 
0029 #include "Fireworks/ParticleFlow/interface/FWPFTrackUtils.h"
0030 #include "Fireworks/ParticleFlow/interface/FWPFClusterRPZUtils.h"
0031 
0032 //-----------------------------------------------------------------------------
0033 // FWPFBlockProxyBuilder
0034 //-----------------------------------------------------------------------------
0035 class FWPFBlockProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::PFBlock> {
0036 public:
0037   enum BuilderType { BASE = 0, ECAL = 1, HCAL = 2 };
0038 
0039   // ---------------- Constructor(s)/Destructor ----------------------
0040   FWPFBlockProxyBuilder() : e_builderType(BASE) {}
0041   ~FWPFBlockProxyBuilder() override {}
0042 
0043   REGISTER_PROXYBUILDER_METHODS();
0044 
0045 protected:
0046   // --------------------- Member Functions --------------------------
0047   void setupTrackElement(const reco::PFBlockElement&, TEveElement&, const FWViewContext*, FWViewType::EType);
0048   void setupClusterElement(const reco::PFBlockElement&, TEveElement&, const FWViewContext*, FWViewType::EType, float r);
0049   void clusterSharedBuild(const reco::PFCluster&, TEveElement&, const FWViewContext*);
0050 
0051   using FWProxyBuilderBase::havePerViewProduct;
0052   bool havePerViewProduct(FWViewType::EType) const override { return true; }
0053 
0054   using FWProxyBuilderBase::haveSingleProduct;
0055   bool haveSingleProduct() const override { return false; }  // different view types
0056 
0057   using FWProxyBuilderBase::scaleProduct;
0058   void scaleProduct(TEveElementList* parent, FWViewType::EType, const FWViewContext* vc) override;
0059 
0060   using FWProxyBuilderBase::cleanLocal;
0061   void cleanLocal() override { m_clusters.clear(); }
0062 
0063   using FWSimpleProxyBuilderTemplate<reco::PFBlock>::buildViewType;
0064   void buildViewType(const reco::PFBlock&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) override;
0065 
0066   // ----------------------- Data Members ----------------------------
0067   BuilderType e_builderType;
0068   std::vector<ScalableLines> m_clusters;
0069 
0070 private:
0071   FWPFBlockProxyBuilder(const FWPFBlockProxyBuilder&);
0072   const FWPFBlockProxyBuilder& operator=(const FWPFBlockProxyBuilder&);
0073 };
0074 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
0075 
0076 //-----------------------------------------------------------------------------
0077 // FWPFBlockEcalProxyBuilder
0078 //-----------------------------------------------------------------------------
0079 class FWPFBlockEcalProxyBuilder : public FWPFBlockProxyBuilder {
0080 public:
0081   FWPFBlockEcalProxyBuilder() { e_builderType = ECAL; }
0082   ~FWPFBlockEcalProxyBuilder() override {}
0083 
0084   REGISTER_PROXYBUILDER_METHODS();
0085 
0086   FWPFBlockEcalProxyBuilder(const FWPFBlockEcalProxyBuilder&) = delete;
0087   const FWPFBlockEcalProxyBuilder& operator=(const FWPFBlockEcalProxyBuilder&) = delete;
0088 };
0089 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
0090 
0091 //-----------------------------------------------------------------------------
0092 // FWPFBlockHcalProxyBuilder
0093 //-----------------------------------------------------------------------------
0094 class FWPFBlockHcalProxyBuilder : public FWPFBlockProxyBuilder {
0095 public:
0096   FWPFBlockHcalProxyBuilder() { e_builderType = HCAL; }
0097   ~FWPFBlockHcalProxyBuilder() override {}
0098 
0099   REGISTER_PROXYBUILDER_METHODS();
0100 
0101   FWPFBlockHcalProxyBuilder(const FWPFBlockHcalProxyBuilder&) = delete;
0102   const FWPFBlockHcalProxyBuilder& operator=(const FWPFBlockHcalProxyBuilder&) = delete;
0103 };
0104 #endif
0105 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_