CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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>
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
Real f_convergenceDistance() const
Definition: FFTJet.h:84
reco::FFTJet< Real > jetToStorable(const fftjet::RecombinedJet< VectorLike > &jet)
Definition: jetConverters.h:27
int f_status() const
Definition: FFTJet.h:89
fftjet::RecombinedJet< VectorLike > jetFromStorable(const reco::FFTJet< Real > &jet)
Definition: jetConverters.h:65
Real f_centroidPhi() const
Definition: FFTJet.h:79
int f_code() const
Definition: FFTJet.h:88
Real f_membershipFactor() const
Definition: FFTJet.h:87
fftjet::RecombinedJet< VectorLike > RecoFFTJet
Real f_etSum() const
Definition: FFTJet.h:77
Real f_phiWidth() const
Definition: FFTJet.h:81
Real f_centroidEta() const
Definition: FFTJet.h:78
Real f_recoScale() const
Definition: FFTJet.h:85
Real f_ncells() const
Definition: FFTJet.h:76
const math::XYZTLorentzVector & f_vec() const
Definition: FFTJet.h:74
Storage class for jets reconstructed by FFTJet package.
Definition: FFTJet.h:19
const PattRecoPeak< Real > & f_precluster() const
Definition: FFTJet.h:73
Real f_etaWidth() const
Definition: FFTJet.h:80
Real f_etaPhiCorr() const
Definition: FFTJet.h:82
const math::XYZTLorentzVector & f_pileup() const
Definition: FFTJet.h:75
Real f_recoScaleRatio() const
Definition: FFTJet.h:86
void hessian(double hessianArray[3]) const
Definition: PattRecoPeak.h:78
Real f_fuzziness() const
Definition: FFTJet.h:83