CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
jetConverters.h
Go to the documentation of this file.
1 #ifndef RecoJets_FFTJetAlgorithms_jetConverters_h
2 #define RecoJets_FFTJetAlgorithms_jetConverters_h
3 
4 #include "fftjet/RecombinedJet.hh"
5 
8 
9 namespace fftjetcms {
10  // The function below makes a storable FFTJet
11  template<class Real>
13  const fftjet::RecombinedJet<VectorLike>& jet);
14 
15  // The function below restores the original RecombinedJet object
16  template<class Real>
17  fftjet::RecombinedJet<VectorLike> jetFromStorable(
18  const reco::FFTJet<Real>& jet);
19 }
20 
22 //
23 // Implementation follows
24 //
26 
27 namespace fftjetcms {
28  template<class Real>
30  const fftjet::RecombinedJet<VectorLike>& jet)
31  {
32  typedef reco::PattRecoPeak<Real> StoredPeak;
33 
34  double hessian[3] = {0., 0., 0.};
35  const fftjet::Peak& peak(jet.precluster());
36  peak.hessian(hessian);
37 
38  return reco::FFTJet<Real>(StoredPeak(peak.eta(),
39  peak.phi(),
40  peak.magnitude(),
41  hessian,
42  peak.driftSpeed(),
43  peak.magSpeed(),
44  peak.lifetime(),
45  peak.scale(),
46  peak.nearestNeighborDistance(),
47  peak.clusterRadius(),
48  peak.clusterSeparation()),
49  jet.vec(), jet.ncells(), jet.etSum(),
50  jet.centroidEta(), jet.centroidPhi(),
51  jet.etaWidth(), jet.phiWidth(),
52  jet.etaPhiCorr(), jet.fuzziness(),
53  jet.convergenceDistance(),
54  jet.recoScale(), jet.recoScaleRatio(),
55  jet.membershipFactor(),
56  jet.code(), jet.status());
57  }
58 
59 
60  template<class Real>
61  fftjet::RecombinedJet<VectorLike> jetFromStorable(
62  const reco::FFTJet<Real>& jet)
63  {
64  typedef reco::PattRecoPeak<Real> StoredPeak;
65  typedef fftjet::RecombinedJet<VectorLike> RecoFFTJet;
66 
67  double hessian[3] = {0., 0., 0.};
68  const StoredPeak& p(jet.f_precluster());
69  p.hessian(hessian);
70  const double pileupPt = jet.f_pileup().Pt();
71 
72  return RecoFFTJet(fftjet::Peak(p.eta(), p.phi(), p.magnitude(),
73  hessian, p.driftSpeed(),
74  p.magSpeed(), p.lifetime(),
75  p.scale(), p.nearestNeighborDistance(),
76  jet.f_membershipFactor(),
77  jet.f_recoScale(),
78  jet.f_recoScaleRatio(),
79  p.clusterRadius(),
80  p.clusterSeparation(), jet.f_code(),
81  jet.f_status()),
82  jet.f_vec(), jet.f_ncells(), jet.f_etSum(),
83  jet.f_centroidEta(), jet.f_centroidPhi(),
84  jet.f_etaWidth(), jet.f_phiWidth(),
85  jet.f_etaPhiCorr(), jet.f_fuzziness(),
86  pileupPt, 0.0, jet.f_convergenceDistance());
87  }
88 }
89 
90 #endif // RecoJets_FFTJetAlgorithms_jetConverters_h
Preclusters from FFTJet pattern recognition stage.
Definition: PattRecoPeak.h:17
Real f_convergenceDistance() const
Definition: FFTJet.h:73
reco::FFTJet< Real > jetToStorable(const fftjet::RecombinedJet< VectorLike > &jet)
Definition: jetConverters.h:29
int f_status() const
Definition: FFTJet.h:78
fftjet::RecombinedJet< VectorLike > jetFromStorable(const reco::FFTJet< Real > &jet)
Definition: jetConverters.h:61
Real f_centroidPhi() const
Definition: FFTJet.h:68
int f_code() const
Definition: FFTJet.h:77
Real f_membershipFactor() const
Definition: FFTJet.h:76
fftjet::RecombinedJet< VectorLike > RecoFFTJet
Real f_etSum() const
Definition: FFTJet.h:66
Real f_phiWidth() const
Definition: FFTJet.h:70
Real f_centroidEta() const
Definition: FFTJet.h:67
Real f_recoScale() const
Definition: FFTJet.h:74
Real f_ncells() const
Definition: FFTJet.h:65
const math::XYZTLorentzVector & f_vec() const
Definition: FFTJet.h:63
Storage class for jets reconstructed by FFTJet package.
Definition: FFTJet.h:20
const PattRecoPeak< Real > & f_precluster() const
Definition: FFTJet.h:62
Real f_etaWidth() const
Definition: FFTJet.h:69
Real f_etaPhiCorr() const
Definition: FFTJet.h:71
const math::XYZTLorentzVector & f_pileup() const
Definition: FFTJet.h:64
Real f_recoScaleRatio() const
Definition: FFTJet.h:75
void hessian(double hessianArray[3]) const
Definition: PattRecoPeak.h:68
Real f_fuzziness() const
Definition: FFTJet.h:72