Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Fireworks_Calo_FWPFCandTowerProxyBuilder_h
0002 #define Fireworks_Calo_FWPFCandTowerProxyBuilder_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Calo
0006 // Class  :     FWCaloTowerProxyBuilderBase
0007 //
0008 /**\class FWCaloTowerProxyBuilderBase FWCaloTowerProxyBuilderBase.h Fireworks/Calo/interface/FWCaloTowerProxyBuilderBase.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Wed Dec  3 11:28:08 EST 2008
0019 //
0020 
0021 #include "Rtypes.h"
0022 #include <string>
0023 
0024 #include "Fireworks/Calo/interface/FWCaloDataHistProxyBuilder.h"
0025 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0026 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0027 
0028 class FWHistSliceSelector;
0029 
0030 class FWPFCandidateTowerProxyBuilder : public FWCaloDataHistProxyBuilder {
0031 public:
0032   FWPFCandidateTowerProxyBuilder();
0033   ~FWPFCandidateTowerProxyBuilder() override;
0034 
0035   virtual double getEt(const reco::PFCandidate&) const = 0;
0036 
0037   FWPFCandidateTowerProxyBuilder(const FWPFCandidateTowerProxyBuilder&) = delete;                   // stop default
0038   const FWPFCandidateTowerProxyBuilder& operator=(const FWPFCandidateTowerProxyBuilder&) = delete;  // stop default
0039 
0040 protected:
0041   void fillCaloData() override;
0042   FWHistSliceSelector* instantiateSliceSelector() override;
0043   void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
0044 
0045 private:
0046   // ---------- member data --------------------------------
0047   const reco::PFCandidateCollection* m_towers;
0048 };
0049 
0050 //
0051 // Ecal
0052 //
0053 
0054 class FWECalPFCandidateProxyBuilder : public FWPFCandidateTowerProxyBuilder {
0055 public:
0056   FWECalPFCandidateProxyBuilder() {}
0057   ~FWECalPFCandidateProxyBuilder() override {}
0058 
0059   // ---------- const member functions ---------------------
0060 
0061   double getEt(const reco::PFCandidate& iTower) const override {
0062     return iTower.ecalEnergy() * TMath::Sin(iTower.theta());
0063   }
0064 
0065   REGISTER_PROXYBUILDER_METHODS();
0066 
0067   FWECalPFCandidateProxyBuilder(const FWECalPFCandidateProxyBuilder&) = delete;                   // stop default
0068   const FWECalPFCandidateProxyBuilder& operator=(const FWECalPFCandidateProxyBuilder&) = delete;  // stop default
0069 };
0070 
0071 //
0072 // Hcal
0073 //
0074 
0075 class FWHCalPFCandidateProxyBuilder : public FWPFCandidateTowerProxyBuilder {
0076 public:
0077   FWHCalPFCandidateProxyBuilder() {}
0078   ~FWHCalPFCandidateProxyBuilder() override {}
0079 
0080   // ---------- const member functions ---------------------
0081 
0082   double getEt(const reco::PFCandidate& iTower) const override {
0083     return iTower.hcalEnergy() * TMath::Sin(iTower.theta());
0084   }
0085 
0086   REGISTER_PROXYBUILDER_METHODS();
0087 
0088   FWHCalPFCandidateProxyBuilder(const FWHCalPFCandidateProxyBuilder&) = delete;  // stop default
0089 
0090   const FWHCalPFCandidateProxyBuilder& operator=(const FWHCalPFCandidateProxyBuilder&) = delete;  // stop default
0091 };
0092 
0093 #endif