CMS 3D CMS Logo

PFCluster.h
Go to the documentation of this file.
1 #ifndef DataFormats_L1TParticleFlow_PFCluster_h
2 #define DataFormats_L1TParticleFlow_PFCluster_h
3 
4 #include <vector>
7 
8 namespace l1t {
9 
10  class PFCluster : public L1Candidate {
11  public:
13  typedef std::pair<edm::Ptr<l1t::L1Candidate>, float> ConstituentAndFraction;
14  typedef std::vector<ConstituentAndFraction> ConstituentsAndFractions;
15 
16  PFCluster() {}
17  PFCluster(float pt,
18  float eta,
19  float phi,
20  float hOverE = 0,
21  bool isEM = false,
22  float ptError = 0,
23  int hwpt = 0,
24  int hweta = 0,
25  int hwphi = 0)
26  : L1Candidate(PolarLorentzVector(pt, eta, phi, 0), hwpt, hweta, hwphi, /*hwQuality=*/isEM ? 1 : 0),
27  hOverE_(hOverE),
28  ptError_(ptError) {
29  setPdgId(isEM ? 22 : 130); // photon : non-photon(K0)
30  }
32  const LorentzVector& p4, float hOverE, bool isEM, float ptError = 0, int hwpt = 0, int hweta = 0, int hwphi = 0)
33  : L1Candidate(p4, hwpt, hweta, hwphi, /*hwQuality=*/isEM ? 1 : 0), hOverE_(hOverE), ptError_(ptError) {
34  setPdgId(isEM ? 22 : 130); // photon : non-photon(K0)
35  }
36 
37  float hOverE() const { return hOverE_; }
38  void setHOverE(float hOverE) { hOverE_ = hOverE; }
39 
40  float emEt() const {
41  if (hOverE_ == -1)
42  return 0;
43  return pt() / (1 + hOverE_);
44  }
45 
46  // change the pt. H/E also recalculated to keep emEt constant
47  void calibratePt(float newpt, float preserveEmEt = true);
48 
53  constituents_.emplace_back(cand, fraction);
54  }
55 
56  float ptError() const { return ptError_; }
57  void setPtError(float ptError) { ptError_ = ptError; }
58 
59  bool isEM() const { return hwQual(); }
60  void setIsEM(bool isEM) { setHwQual(isEM); }
61 
62  float egVsPionMVAOut() const { return egVsPionMVAOut_; }
64 
65  float egVsPUMVAOut() const { return egVsPUMVAOut_; }
67 
68  private:
71  };
72 
73  typedef std::vector<l1t::PFCluster> PFClusterCollection;
75 } // namespace l1t
76 #endif
l1t::PFCluster::PFCluster
PFCluster(const LorentzVector &p4, float hOverE, bool isEM, float ptError=0, int hwpt=0, int hweta=0, int hwphi=0)
Definition: PFCluster.h:31
reco::LeafCandidate::setPdgId
void setPdgId(int pdgId) final
Definition: LeafCandidate.h:178
l1t::PFCluster::PFCluster
PFCluster(float pt, float eta, float phi, float hOverE=0, bool isEM=false, float ptError=0, int hwpt=0, int hweta=0, int hwphi=0)
Definition: PFCluster.h:17
l1t::PFCluster::isEM
bool isEM() const
Definition: PFCluster.h:59
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
l1t::L1Candidate::hwQual
int hwQual() const
Definition: L1Candidate.h:38
l1t::PFCluster::setIsEM
void setIsEM(bool isEM)
Definition: PFCluster.h:60
l1t::PFCluster::constituentsAndFractions
const ConstituentsAndFractions & constituentsAndFractions() const
constituent information. note that this is not going to be available in the hardware!
Definition: PFCluster.h:50
l1t::PFCluster::egVsPionMVAOut
float egVsPionMVAOut() const
Definition: PFCluster.h:62
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
l1t::PFCluster::PFCluster
PFCluster()
Definition: PFCluster.h:16
edm::Ref< l1t::PFClusterCollection >
l1t::PFCluster::setPtError
void setPtError(float ptError)
Definition: PFCluster.h:57
l1t::PFCluster::addConstituent
void addConstituent(const edm::Ptr< l1t::L1Candidate > &cand, float fraction=1.0)
adds a candidate to this cluster; note that this only records the information, it's up to you to also...
Definition: PFCluster.h:52
l1t::PFCluster::egVsPUMVAOut_
float egVsPUMVAOut_
Definition: PFCluster.h:69
l1t::L1Candidate
Definition: L1Candidate.h:15
HLT_FULL_cff.fraction
fraction
Definition: HLT_FULL_cff.py:52802
l1t::L1Candidate::setHwQual
void setHwQual(int qual)
Definition: L1Candidate.h:31
l1t::PFCluster::emEt
float emEt() const
Definition: PFCluster.h:40
l1t::PFCluster::hOverE_
float hOverE_
Definition: PFCluster.h:69
l1t::PFClusterRef
edm::Ref< l1t::PFClusterCollection > PFClusterRef
Definition: PFCluster.h:74
l1t::PFCluster::ConstituentsAndFractions
std::vector< ConstituentAndFraction > ConstituentsAndFractions
Definition: PFCluster.h:14
l1t::PFCluster::hOverE
float hOverE() const
Definition: PFCluster.h:37
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
l1t
delete x;
Definition: CaloConfig.h:22
l1t::PFCluster::setEgVsPionMVAOut
void setEgVsPionMVAOut(float egVsPionMVAOut)
Definition: PFCluster.h:63
cand
Definition: decayParser.h:32
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
L1Candidate.h
l1t::PFCluster::setHOverE
void setHOverE(float hOverE)
Definition: PFCluster.h:38
edm::Ptr
Definition: AssociationVector.h:31
l1t::PFCluster::ptError_
float ptError_
Definition: PFCluster.h:69
Ref.h
l1t::PFCluster::constituents_
ConstituentsAndFractions constituents_
Definition: PFCluster.h:70
l1t::PFCluster::calibratePt
void calibratePt(float newpt, float preserveEmEt=true)
Definition: PFCluster.cc:3
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
l1t::PFCluster::ptError
float ptError() const
Definition: PFCluster.h:56
l1t::PFCluster
Definition: PFCluster.h:10
l1t::PFCluster::egVsPionMVAOut_
float egVsPionMVAOut_
Definition: PFCluster.h:69
l1t::PFCluster::setEgVsPUMVAOut
void setEgVsPUMVAOut(float egVsPUMVAOut)
Definition: PFCluster.h:66
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
l1t::PFCluster::egVsPUMVAOut
float egVsPUMVAOut() const
Definition: PFCluster.h:65
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
l1t::PFCluster::ConstituentAndFraction
std::pair< edm::Ptr< l1t::L1Candidate >, float > ConstituentAndFraction
constituent information. note that this is not going to be available in the hardware!
Definition: PFCluster.h:13