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  float absZBarycenter = 0.,
27  float sigmaRR = 0.)
28  : L1Candidate(PolarLorentzVector(pt, eta, phi, 0), hwpt, hweta, hwphi, /*hwQuality=*/isEM ? 1 : 0),
29  hOverE_(hOverE),
32  sigmaRR_(sigmaRR) {
33  setPdgId(isEM ? 22 : 130); // photon : non-photon(K0)
34  }
36  const LorentzVector& p4, float hOverE, bool isEM, float ptError = 0, int hwpt = 0, int hweta = 0, int hwphi = 0)
37  : L1Candidate(p4, hwpt, hweta, hwphi, /*hwQuality=*/isEM ? 1 : 0), hOverE_(hOverE), ptError_(ptError) {
38  setPdgId(isEM ? 22 : 130); // photon : non-photon(K0)
39  }
40 
41  float hOverE() const { return hOverE_; }
42  void setHOverE(float hOverE) { hOverE_ = hOverE; }
43 
44  void setSigmaRR(float sigmaRR) { sigmaRR_ = sigmaRR; }
45  float absZBarycenter() const { return absZBarycenter_; }
46 
48  float sigmaRR() const { return sigmaRR_; }
49 
50  float emEt() const {
51  if (hOverE_ == -1)
52  return 0;
53  return pt() / (1 + hOverE_);
54  }
55 
56  // change the pt. H/E also recalculated to keep emEt constant
57  void calibratePt(float newpt, float preserveEmEt = true);
58 
63  constituents_.emplace_back(cand, fraction);
64  }
65 
66  float ptError() const { return ptError_; }
67  void setPtError(float ptError) { ptError_ = ptError; }
68 
69  bool isEM() const { return hwQual(); }
70  void setIsEM(bool isEM) { setHwQual(isEM); }
71  unsigned int hwEmID() const { return hwQual(); }
72 
73  float egVsPionMVAOut() const { return egVsPionMVAOut_; }
75 
76  float egVsPUMVAOut() const { return egVsPUMVAOut_; }
78 
79  private:
81  // HGC dedicated quantities (0ed by default)
83 
85  };
86 
87  typedef std::vector<l1t::PFCluster> PFClusterCollection;
89 } // namespace l1t
90 #endif
std::vector< ConstituentAndFraction > ConstituentsAndFractions
Definition: PFCluster.h:14
float hOverE() const
Definition: PFCluster.h:41
float sigmaRR_
Definition: PFCluster.h:82
double pt() const final
transverse momentum
void setEgVsPionMVAOut(float egVsPionMVAOut)
Definition: PFCluster.h:74
float ptError_
Definition: PFCluster.h:80
void setHOverE(float hOverE)
Definition: PFCluster.h:42
void setHwQual(int qual)
Definition: L1Candidate.h:31
delete x;
Definition: CaloConfig.h:22
float egVsPionMVAOut_
Definition: PFCluster.h:80
void setEgVsPUMVAOut(float egVsPUMVAOut)
Definition: PFCluster.h:77
ConstituentsAndFractions constituents_
Definition: PFCluster.h:84
void calibratePt(float newpt, float preserveEmEt=true)
Definition: PFCluster.cc:3
const LorentzVector & p4() const final
four-momentum Lorentz vector
int hwQual() const
Definition: L1Candidate.h:38
float ptError() const
Definition: PFCluster.h:66
float egVsPUMVAOut() const
Definition: PFCluster.h:76
void setAbsZBarycenter(float absZBarycenter)
Definition: PFCluster.h:47
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
PFCluster(const LorentzVector &p4, float hOverE, bool isEM, float ptError=0, int hwpt=0, int hweta=0, int hwphi=0)
Definition: PFCluster.h:35
float sigmaRR() const
Definition: PFCluster.h:48
float absZBarycenter_
Definition: PFCluster.h:82
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:87
const ConstituentsAndFractions & constituentsAndFractions() const
constituent information. note that this is not going to be available in the hardware! ...
Definition: PFCluster.h:60
float absZBarycenter() const
Definition: PFCluster.h:45
float egVsPionMVAOut() const
Definition: PFCluster.h:73
bool isEM() const
Definition: PFCluster.h:69
void setIsEM(bool isEM)
Definition: PFCluster.h:70
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
float egVsPUMVAOut_
Definition: PFCluster.h:80
void setPtError(float ptError)
Definition: PFCluster.h:67
unsigned int hwEmID() const
Definition: PFCluster.h:71
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&#39;s up to you to also...
Definition: PFCluster.h:62
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, float absZBarycenter=0., float sigmaRR=0.)
Definition: PFCluster.h:17
double phi() const final
momentum azimuthal angle
void setSigmaRR(float sigmaRR)
Definition: PFCluster.h:44
void setPdgId(int pdgId) final
float emEt() const
Definition: PFCluster.h:50
edm::Ref< l1t::PFClusterCollection > PFClusterRef
Definition: PFCluster.h:88
float hOverE_
Definition: PFCluster.h:80
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
double eta() const final
momentum pseudorapidity