Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:51

0001 #ifndef __PFBlockElementSuperCluster__
0002 #define __PFBlockElementSuperCluster__
0003 
0004 #include <iostream>
0005 
0006 #include "DataFormats/ParticleFlowReco/interface/PFBlockElement.h"
0007 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0008 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0009 
0010 namespace reco {
0011 
0012   /// \brief Cluster Element.
0013   ///
0014   /// this class contains a reference to a PFCluster
0015   class PFBlockElementSuperCluster final : public PFBlockElement {
0016   public:
0017     PFBlockElementSuperCluster() {}
0018 
0019     /// \brief constructor.
0020     /// type must be equal to PS1, PS2, ECAL, HCAL.
0021     /// \todo add a protection against the other types...
0022     PFBlockElementSuperCluster(const SuperClusterRef& ref)
0023         : PFBlockElement(PFBlockElement::SC),
0024           superClusterRef_(ref),
0025           trackIso_(0.),
0026           ecalIso_(0.),
0027           hcalIso_(0.),
0028           HoE_(0.),
0029           fromGsfElectron_(false),
0030           fromPhoton_(false),
0031           fromPFSuperCluster_(false) {}
0032 
0033     PFBlockElement* clone() const override { return new PFBlockElementSuperCluster(*this); }
0034 
0035     /// \return reference to the corresponding cluster
0036     const SuperClusterRef& superClusterRef() const { return superClusterRef_; }
0037 
0038     /// \return reference to seeding photon
0039     const PhotonRef& photonRef() const { return photonRef_; }
0040 
0041     void Dump(std::ostream& out = std::cout, const char* tab = " ") const override;
0042 
0043     /// set the track Iso
0044     void setTrackIso(float val) { trackIso_ = val; }
0045 
0046     /// set the ecal Iso
0047     void setEcalIso(float val) { ecalIso_ = val; }
0048 
0049     /// set the had Iso
0050     void setHcalIso(float val) { hcalIso_ = val; }
0051 
0052     /// set H/E
0053     void setHoE(float val) { HoE_ = val; }
0054 
0055     /// set provenance
0056     void setFromGsfElectron(bool val) { fromGsfElectron_ = val; }
0057 
0058     /// set provenance
0059     void setFromPhoton(bool val) { fromPhoton_ = val; }
0060 
0061     void setFromPFSuperCluster(bool val) { fromPFSuperCluster_ = val; }
0062 
0063     /// set photonRef
0064     void setPhotonRef(const PhotonRef& ref) { photonRef_ = ref; }
0065 
0066     /// \return the track isolation
0067     float trackIso() const { return trackIso_; }
0068 
0069     /// \return the ecal isolation
0070     float ecalIso() const { return ecalIso_; }
0071 
0072     /// \return the had isolation
0073     float hcalIso() const { return hcalIso_; }
0074 
0075     /// \return Hoe
0076     float hoverE() const { return HoE_; }
0077 
0078     /// \return provenance
0079     bool fromGsfElectron() const { return fromGsfElectron_; }
0080 
0081     /// \return provenance
0082     bool fromPhoton() const { return fromPhoton_; }
0083 
0084     //SuperCluster comes from a PFSuperCluster (and can therefore be matched
0085     // by ref back to the initial PFClusters)
0086     bool fromPFSuperCluster() const { return fromPFSuperCluster_; }
0087 
0088   private:
0089     /// reference to the corresponding cluster
0090     SuperClusterRef superClusterRef_;
0091     PhotonRef photonRef_;
0092 
0093     float trackIso_;
0094     float ecalIso_;
0095     float hcalIso_;
0096     float HoE_;
0097 
0098     bool fromGsfElectron_;
0099     bool fromPhoton_;
0100     bool fromPFSuperCluster_;
0101   };
0102 }  // namespace reco
0103 
0104 #endif