Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EgammaCandidates_PhotonCore_h
0002 #define EgammaCandidates_PhotonCore_h
0003 /** \class reco::PhotonCore 
0004  *  
0005  *  Core description of a Photon. It contains all relevant  
0006  *  reconstruction information i.e. references to corresponding
0007  *  SuperCluster, Conversion with its tracks and vertex as well
0008  *  as to ElectronSeed (if existing for the same SC) 
0009  *
0010  *
0011  * \author  N. Marinelli Univ. of Notre Dame
0012  * 
0013  * $Log $
0014  */
0015 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
0016 #include "DataFormats/EgammaCandidates/interface/PhotonCoreFwd.h"
0017 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0018 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0019 #include "DataFormats/EgammaReco/interface/ElectronSeed.h"
0020 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
0021 
0022 namespace reco {
0023 
0024   class PhotonCore {
0025   public:
0026     /// default constructor
0027     //    PhotonCore() { }
0028 
0029     /// To be deleted: Internal comment for Florian
0030     /// I would reserve this constructor to build the standard photons, as it was before, plus I add the initialization of the provenance
0031     PhotonCore(const reco::SuperClusterRef &scl) : superCluster_(scl), isPFlowPhoton_(false), isStandardPhoton_(true) {}
0032 
0033     // while for building photons from pf I would use the default constructor
0034     PhotonCore() : isPFlowPhoton_(false), isStandardPhoton_(false) {}
0035     // followed by the setters of the provenance and of the Ref to the wanted supercluster
0036     // at that point if in PF you have found a photon which correspond to a standard SC yuo can
0037     // set both supercluster and the two flags to true
0038     // if you have found an object which does not have a standard SC associated you set only the
0039     // one from pflow.
0040     // How does this sound ?
0041 
0042     /// destructor
0043     virtual ~PhotonCore() {}
0044 
0045     PhotonCore *clone() const { return new PhotonCore(*this); }
0046 
0047     /// set reference to SuperCluster
0048     void setSuperCluster(const reco::SuperClusterRef &r) { superCluster_ = r; }
0049     /// set reference to PFlow SuperCluster
0050     void setParentSuperCluster(const reco::SuperClusterRef &r) { parentSuperCluster_ = r; }
0051     /// add  single ConversionRef to the vector of Refs
0052     void addConversion(const reco::ConversionRef &r) { conversions_.push_back(r); }
0053     /// add  single ConversionRef to the vector of Refs
0054     void addOneLegConversion(const reco::ConversionRef &r) { conversionsOneLeg_.push_back(r); }
0055     /// set electron pixel seed ref
0056     void addElectronPixelSeed(const reco::ElectronSeedRef &r) { electronSeed_.push_back(r); }
0057     /// set the provenance
0058     void setPFlowPhoton(const bool prov) { isPFlowPhoton_ = prov; }
0059     void setStandardPhoton(const bool prov) { isStandardPhoton_ = prov; }
0060 
0061     /// get reference to SuperCluster
0062     reco::SuperClusterRef superCluster() const { return superCluster_; }
0063     /// get reference to PFlow SuperCluster
0064     reco::SuperClusterRef parentSuperCluster() const { return parentSuperCluster_; }
0065 
0066     //// comment for Florian. I have seen that in GsfElectronCore they have a getter for the supercluster
0067     // which returns the pfSuperCluster only if the standard supeclsuter is not null
0068     // But I had udnerstood from you when we spke last time that we wish to be free
0069     // to have both SCs available. Or not ?
0070 
0071     /// get vector of references to  Conversion's
0072     reco::ConversionRefVector conversions() const { return conversions_; }
0073     /// get vector of references to one leg Conversion's
0074     reco::ConversionRefVector conversionsOneLeg() const { return conversionsOneLeg_; }
0075 
0076     void setConversions(const reco::ConversionRefVector &conversions) { conversions_ = conversions; }
0077     void setConversionsOneLeg(const reco::ConversionRefVector &conversions) { conversionsOneLeg_ = conversions; }
0078 
0079     /// get reference to electron seed if existing
0080     reco::ElectronSeedRefVector electronPixelSeeds() const { return electronSeed_; }
0081     bool isPFlowPhoton() const { return isPFlowPhoton_; }
0082     bool isStandardPhoton() const { return isStandardPhoton_; }
0083 
0084   private:
0085     /// reference to a SuperCluster
0086     reco::SuperClusterRef superCluster_;
0087     // vector of references to Conversions
0088     reco::ConversionRefVector conversions_;
0089     //vector of references for 1-leg
0090     reco::ConversionRefVector conversionsOneLeg_;
0091     // vector of references to ElectronPixelSeeds
0092     reco::ElectronSeedRefVector electronSeed_;
0093     /// reference to a Particle flow SuperCluster
0094     reco::SuperClusterRef parentSuperCluster_;
0095     bool isPFlowPhoton_;
0096     bool isStandardPhoton_;
0097   };
0098 
0099 }  // namespace reco
0100 
0101 #endif