CMS 3D CMS Logo

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>
12  reco::FFTJet<Real> jetToStorable(const fftjet::RecombinedJet<VectorLike>& jet);
13 
14  // The function below restores the original RecombinedJet object
15  template <class Real>
16  fftjet::RecombinedJet<VectorLike> jetFromStorable(const reco::FFTJet<Real>& jet);
17 } // namespace fftjetcms
18 
20 //
21 // Implementation follows
22 //
24 
25 namespace fftjetcms {
26  template <class Real>
27  reco::FFTJet<Real> jetToStorable(const fftjet::RecombinedJet<VectorLike>& jet) {
28  typedef reco::PattRecoPeak<Real> StoredPeak;
29 
30  double hessian[3] = {0., 0., 0.};
31  const fftjet::Peak& peak(jet.precluster());
32  peak.hessian(hessian);
33 
34  return reco::FFTJet<Real>(StoredPeak(peak.eta(),
35  peak.phi(),
36  peak.magnitude(),
37  hessian,
38  peak.driftSpeed(),
39  peak.magSpeed(),
40  peak.lifetime(),
41  peak.scale(),
42  peak.nearestNeighborDistance(),
43  peak.clusterRadius(),
44  peak.clusterSeparation(),
45  peak.splitTime(),
46  peak.mergeTime()),
47  jet.vec(),
48  jet.ncells(),
49  jet.etSum(),
50  jet.centroidEta(),
51  jet.centroidPhi(),
52  jet.etaWidth(),
53  jet.phiWidth(),
54  jet.etaPhiCorr(),
55  jet.fuzziness(),
56  jet.convergenceDistance(),
57  jet.recoScale(),
58  jet.recoScaleRatio(),
59  jet.membershipFactor(),
60  jet.code(),
61  jet.status());
62  }
63 
64  template <class Real>
65  fftjet::RecombinedJet<VectorLike> jetFromStorable(const reco::FFTJet<Real>& jet) {
66  typedef reco::PattRecoPeak<Real> StoredPeak;
67  typedef fftjet::RecombinedJet<VectorLike> RecoFFTJet;
68 
69  double hessian[3] = {0., 0., 0.};
70  const StoredPeak& p(jet.f_precluster());
71  p.hessian(hessian);
72  const double pileupPt = jet.f_pileup().Pt();
73 
74  fftjet::Peak peak(p.eta(),
75  p.phi(),
76  p.magnitude(),
77  hessian,
78  p.driftSpeed(),
79  p.magSpeed(),
80  p.lifetime(),
81  p.scale(),
82  p.nearestNeighborDistance(),
83  jet.f_membershipFactor(),
84  jet.f_recoScale(),
85  jet.f_recoScaleRatio(),
86  p.clusterRadius(),
87  p.clusterSeparation(),
88  jet.f_code(),
89  jet.f_status());
90  peak.setSplitTime(p.splitTime());
91  peak.setMergeTime(p.mergeTime());
92 
93  return RecoFFTJet(peak,
94  jet.f_vec(),
95  jet.f_ncells(),
96  jet.f_etSum(),
97  jet.f_centroidEta(),
98  jet.f_centroidPhi(),
99  jet.f_etaWidth(),
100  jet.f_phiWidth(),
101  jet.f_etaPhiCorr(),
102  jet.f_fuzziness(),
103  pileupPt,
104  0.0,
105  jet.f_convergenceDistance());
106  }
107 } // namespace fftjetcms
108 
109 #endif // RecoJets_FFTJetAlgorithms_jetConverters_h
Preclusters from FFTJet pattern recognition stage.
Definition: PattRecoPeak.h:16
reco::FFTJet< Real > jetToStorable(const fftjet::RecombinedJet< VectorLike > &jet)
Definition: jetConverters.h:27
fftjet::RecombinedJet< VectorLike > jetFromStorable(const reco::FFTJet< Real > &jet)
Definition: jetConverters.h:65
fftjet::RecombinedJet< VectorLike > RecoFFTJet
Storage class for jets reconstructed by FFTJet package.
Definition: FFTJet.h:19
void hessian(double hessianArray[3]) const
Definition: PattRecoPeak.h:78