Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_L1TParticleFlow_HPSPFTau_H
0002 #define DataFormats_L1TParticleFlow_HPSPFTau_H
0003 
0004 #include "DataFormats/L1TParticleFlow/interface/PFCandidate.h"  // l1t::PFCandidate, l1t::PFCandidateRef, l1t::PFCandidateRefVector
0005 #include "DataFormats/JetReco/interface/CaloJet.h"
0006 #include "DataFormats/Candidate/interface/LeafCandidate.h"  // reco::LeafCandidate
0007 #include "DataFormats/Candidate/interface/Particle.h"       // reco::Particle::LorentzVector
0008 #include "DataFormats/L1Trigger/interface/VertexWord.h"
0009 
0010 #include <ostream>
0011 
0012 namespace l1t {
0013 
0014   class HPSPFTau : public reco::LeafCandidate {
0015   public:
0016     /// default constructor
0017     HPSPFTau();
0018 
0019     /// destructor
0020     ~HPSPFTau() override;
0021 
0022     /// accessor functions for reco level quantities
0023     bool isChargedPFCandSeeded() const { return seedChargedPFCand_.isNonnull(); }
0024     bool isJetSeeded() const { return seedJet_.isNonnull(); }
0025 
0026     const l1t::PFCandidateRef& seedChargedPFCand() const { return seedChargedPFCand_; }
0027     const reco::CaloJetRef& seedJet() const { return seedJet_; }
0028     const l1t::PFCandidateRef& leadChargedPFCand() const { return leadChargedPFCand_; }
0029 
0030     const l1t::PFCandidateRefVector& signalAllL1PFCandidates() const { return signalAllL1PFCandidates_; }
0031     const l1t::PFCandidateRefVector& signalChargedHadrons() const { return signalChargedHadrons_; }
0032     const l1t::PFCandidateRefVector& signalElectrons() const { return signalElectrons_; }
0033     const l1t::PFCandidateRefVector& signalNeutralHadrons() const { return signalNeutralHadrons_; }
0034     const l1t::PFCandidateRefVector& signalPhotons() const { return signalPhotons_; }
0035     const l1t::PFCandidateRefVector& signalMuons() const { return signalMuons_; }
0036 
0037     const l1t::PFCandidateRefVector& stripAllL1PFCandidates() const { return stripAllL1PFCandidates_; }
0038     const l1t::PFCandidateRefVector& stripElectrons() const { return stripElectrons_; }
0039     const l1t::PFCandidateRefVector& stripPhotons() const { return stripPhotons_; }
0040 
0041     const l1t::PFCandidateRefVector& isoAllL1PFCandidates() const { return isoAllL1PFCandidates_; }
0042     const l1t::PFCandidateRefVector& isoChargedHadrons() const { return isoChargedHadrons_; }
0043     const l1t::PFCandidateRefVector& isoElectrons() const { return isoElectrons_; }
0044     const l1t::PFCandidateRefVector& isoNeutralHadrons() const { return isoNeutralHadrons_; }
0045     const l1t::PFCandidateRefVector& isoPhotons() const { return isoPhotons_; }
0046     const l1t::PFCandidateRefVector& isoMuons() const { return isoMuons_; }
0047 
0048     const l1t::PFCandidateRefVector& sumAllL1PFCandidates() const { return sumAllL1PFCandidates_; }
0049     const l1t::PFCandidateRefVector& sumChargedHadrons() const { return sumChargedHadrons_; }
0050     const l1t::PFCandidateRefVector& sumElectrons() const { return sumElectrons_; }
0051     const l1t::PFCandidateRefVector& sumNeutralHadrons() const { return sumNeutralHadrons_; }
0052     const l1t::PFCandidateRefVector& sumPhotons() const { return sumPhotons_; }
0053     const l1t::PFCandidateRefVector& sumMuons() const { return sumMuons_; }
0054 
0055     const l1t::VertexWordRef& primaryVertex() const { return primaryVertex_; }
0056 
0057     enum Kind { kUndefined, kOneProng0Pi0, kOneProng1Pi0, kThreeProng0Pi0, kThreeProng1Pi0 };
0058     Kind tauType() const { return tauType_; }
0059 
0060     const reco::Particle::LorentzVector& stripP4() const { return stripP4_; }
0061 
0062     float sumAllL1PFCandidatesPt() const { return sumAllL1PFCandidatesPt_; }
0063     float signalConeSize() const { return signalConeSize_; }
0064     float isolationConeSize() const { return signalConeSize_; }
0065 
0066     float sumChargedIso() const { return sumChargedIso_; }
0067     float sumNeutralIso() const { return sumNeutralIso_; }
0068     float sumCombinedIso() const { return sumCombinedIso_; }
0069     float sumChargedIsoPileup() const { return sumChargedIsoPileup_; }
0070     float z() const { return z_; }
0071 
0072     bool passTightIso() const { return passTightIso_; }
0073     bool passMediumIso() const { return passMediumIso_; }
0074     bool passLooseIso() const { return passLooseIso_; }
0075     bool passVLooseIso() const { return passVLooseIso_; }
0076 
0077     bool passTightRelIso() const { return passTightRelIso_; }
0078     bool passMediumRelIso() const { return passMediumRelIso_; }
0079     bool passLooseRelIso() const { return passLooseRelIso_; }
0080     bool passVLooseRelIso() const { return passVLooseRelIso_; }
0081 
0082     void setSeedChargedPFCand(l1t::PFCandidateRef seedChargedPFCand) { seedChargedPFCand_ = seedChargedPFCand; }
0083     void setSeedJet(reco::CaloJetRef seedJet) { seedJet_ = seedJet; }
0084     void setLeadChargedPFCand(l1t::PFCandidateRef leadChargedPFCand) { leadChargedPFCand_ = leadChargedPFCand; }
0085 
0086     void setSignalAllL1PFCandidates(l1t::PFCandidateRefVector signalAllL1PFCandidates) {
0087       signalAllL1PFCandidates_ = signalAllL1PFCandidates;
0088     }
0089     void setSignalChargedHadrons(l1t::PFCandidateRefVector signalChargedHadrons) {
0090       signalChargedHadrons_ = signalChargedHadrons;
0091     }
0092     void setSignalElectrons(l1t::PFCandidateRefVector signalElectrons) { signalElectrons_ = signalElectrons; }
0093     void setSignalNeutralHadrons(l1t::PFCandidateRefVector signalNeutralHadrons) {
0094       signalNeutralHadrons_ = signalNeutralHadrons;
0095     }
0096     void setSignalPhotons(l1t::PFCandidateRefVector signalPhotons) { signalPhotons_ = signalPhotons; }
0097     void setSignalMuons(l1t::PFCandidateRefVector signalMuons) { signalMuons_ = signalMuons; }
0098 
0099     void setStripAllL1PFCandidates(l1t::PFCandidateRefVector stripAllL1PFCandidates) {
0100       stripAllL1PFCandidates_ = stripAllL1PFCandidates;
0101     }
0102     void setStripElectrons(l1t::PFCandidateRefVector stripElectrons) { stripElectrons_ = stripElectrons; }
0103     void setStripPhotons(l1t::PFCandidateRefVector stripPhotons) { stripPhotons_ = stripPhotons; }
0104 
0105     void setIsoAllL1PFCandidates(l1t::PFCandidateRefVector isoAllL1PFCandidates) {
0106       isoAllL1PFCandidates_ = isoAllL1PFCandidates;
0107     }
0108     void setIsoChargedHadrons(l1t::PFCandidateRefVector isoChargedHadrons) { isoChargedHadrons_ = isoChargedHadrons; }
0109     void setIsoElectrons(l1t::PFCandidateRefVector isoElectrons) { isoElectrons_ = isoElectrons; }
0110     void setIsoNeutralHadrons(l1t::PFCandidateRefVector isoNeutralHadrons) { isoNeutralHadrons_ = isoNeutralHadrons; }
0111     void setIsoPhotons(l1t::PFCandidateRefVector isoPhotons) { isoPhotons_ = isoPhotons; }
0112     void setIsoMuons(l1t::PFCandidateRefVector isoMuons) { isoMuons_ = isoMuons; }
0113 
0114     void setSumAllL1PFCandidates(l1t::PFCandidateRefVector sumAllL1PFCandidates) {
0115       sumAllL1PFCandidates_ = sumAllL1PFCandidates;
0116     }
0117     void setSumChargedHadrons(l1t::PFCandidateRefVector sumChargedHadrons) { sumChargedHadrons_ = sumChargedHadrons; }
0118     void setSumElectrons(l1t::PFCandidateRefVector sumElectrons) { sumElectrons_ = sumElectrons; }
0119     void setSumNeutralHadrons(l1t::PFCandidateRefVector sumNeutralHadrons) { sumNeutralHadrons_ = sumNeutralHadrons; }
0120     void setSumPhotons(l1t::PFCandidateRefVector sumPhotons) { sumPhotons_ = sumPhotons; }
0121     void setSumMuons(l1t::PFCandidateRefVector sumMuons) { sumMuons_ = sumMuons; }
0122 
0123     void setPrimaryVertex(l1t::VertexWordRef primaryVertex) { primaryVertex_ = primaryVertex; }
0124 
0125     void setTauType(Kind tauType) { tauType_ = tauType; }
0126 
0127     void setStripP4(reco::Particle::LorentzVector& stripP4) { stripP4_ = stripP4; }
0128 
0129     void setSumAllL1PFCandidatesPt(float sumAllL1PFCandidatesPt) { sumAllL1PFCandidatesPt_ = sumAllL1PFCandidatesPt; }
0130     void setSignalConeSize(float signalConeSize) { signalConeSize_ = signalConeSize; }
0131     void setisolationConeSize(float isolationConeSize) { signalConeSize_ = isolationConeSize; }
0132 
0133     void setSumChargedIso(float sumChargedIso) { sumChargedIso_ = sumChargedIso; }
0134     void setSumNeutralIso(float sumNeutralIso) { sumNeutralIso_ = sumNeutralIso; }
0135     void setSumCombinedIso(float sumCombinedIso) { sumCombinedIso_ = sumCombinedIso; }
0136     void setSumChargedIsoPileup(float sumChargedIsoPileup) { sumChargedIsoPileup_ = sumChargedIsoPileup; }
0137     void setZ(float Z) { z_ = Z; }
0138 
0139     void setPassTightIso(bool passTightIso) { passTightIso_ = passTightIso; }
0140     void setPassMediumIso(bool passMediumIso) { passMediumIso_ = passMediumIso; }
0141     void setPassLooseIso(bool passLooseIso) { passLooseIso_ = passLooseIso; }
0142     void setPassVLooseIso(bool passVLooseIso) { passVLooseIso_ = passVLooseIso; }
0143 
0144     void setPassTightRelIso(bool passTightRelIso) { passTightRelIso_ = passTightRelIso; }
0145     void setPassMediumRelIso(bool passMediumRelIso) { passMediumRelIso_ = passMediumRelIso; }
0146     void setPassLooseRelIso(bool passLooseRelIso) { passLooseRelIso_ = passLooseRelIso; }
0147     void setPassVLooseRelIso(bool passVLooseRelIso) { passVLooseRelIso_ = passVLooseRelIso; }
0148 
0149   private:
0150     l1t::PFCandidateRef seedChargedPFCand_;
0151     reco::CaloJetRef seedJet_;
0152     l1t::PFCandidateRef leadChargedPFCand_;
0153 
0154     l1t::PFCandidateRefVector signalAllL1PFCandidates_;
0155     l1t::PFCandidateRefVector signalChargedHadrons_;
0156     l1t::PFCandidateRefVector signalElectrons_;
0157     l1t::PFCandidateRefVector signalNeutralHadrons_;
0158     l1t::PFCandidateRefVector signalPhotons_;
0159     l1t::PFCandidateRefVector signalMuons_;
0160 
0161     l1t::PFCandidateRefVector stripAllL1PFCandidates_;
0162     l1t::PFCandidateRefVector stripElectrons_;
0163     l1t::PFCandidateRefVector stripPhotons_;
0164 
0165     l1t::PFCandidateRefVector isoAllL1PFCandidates_;
0166     l1t::PFCandidateRefVector isoChargedHadrons_;
0167     l1t::PFCandidateRefVector isoElectrons_;
0168     l1t::PFCandidateRefVector isoNeutralHadrons_;
0169     l1t::PFCandidateRefVector isoPhotons_;
0170     l1t::PFCandidateRefVector isoMuons_;
0171 
0172     l1t::PFCandidateRefVector sumAllL1PFCandidates_;
0173     l1t::PFCandidateRefVector sumChargedHadrons_;
0174     l1t::PFCandidateRefVector sumElectrons_;
0175     l1t::PFCandidateRefVector sumNeutralHadrons_;
0176     l1t::PFCandidateRefVector sumPhotons_;
0177     l1t::PFCandidateRefVector sumMuons_;
0178 
0179     l1t::VertexWordRef primaryVertex_;
0180     Kind tauType_;
0181 
0182     reco::Particle::LorentzVector stripP4_;
0183 
0184     float sumAllL1PFCandidatesPt_;
0185     float signalConeSize_;
0186     float isolationConeSize_;
0187 
0188     float sumChargedIso_;
0189     float sumNeutralIso_;
0190     float sumCombinedIso_;
0191     float sumChargedIsoPileup_;  // charged PFCands failing dz cut (maybe useful to correct neutral isolation for pile-up contributions by applying delta-beta corrections)
0192 
0193     bool passTightIso_;
0194     bool passMediumIso_;
0195     bool passLooseIso_;
0196     bool passVLooseIso_;
0197 
0198     bool passTightRelIso_;
0199     bool passMediumRelIso_;
0200     bool passLooseRelIso_;
0201     bool passVLooseRelIso_;
0202 
0203     float z_;
0204   };
0205 
0206 }  // namespace l1t
0207 
0208 /// print to stream
0209 std::ostream& operator<<(std::ostream& os, const l1t::HPSPFTau& l1PFTau);
0210 
0211 void printPFCand(ostream& os, const l1t::PFCandidate& l1PFCand, const l1t::VertexWordRef& primaryVertex);
0212 void printPFCand(ostream& os, const l1t::PFCandidate& l1PFCand, float primaryVertexZ);
0213 
0214 #endif