test
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  peak.splitTime(),
50  peak.mergeTime()),
51  jet.vec(), jet.ncells(), jet.etSum(),
52  jet.centroidEta(), jet.centroidPhi(),
53  jet.etaWidth(), jet.phiWidth(),
54  jet.etaPhiCorr(), jet.fuzziness(),
55  jet.convergenceDistance(),
56  jet.recoScale(), jet.recoScaleRatio(),
57  jet.membershipFactor(),
58  jet.code(), jet.status());
59  }
60 
61 
62  template<class Real>
63  fftjet::RecombinedJet<VectorLike> jetFromStorable(
64  const reco::FFTJet<Real>& jet)
65  {
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(), p.phi(), p.magnitude(),
75  hessian, p.driftSpeed(),
76  p.magSpeed(), p.lifetime(),
77  p.scale(), p.nearestNeighborDistance(),
78  jet.f_membershipFactor(),
79  jet.f_recoScale(),
80  jet.f_recoScaleRatio(),
81  p.clusterRadius(),
82  p.clusterSeparation(), jet.f_code(),
83  jet.f_status());
84  peak.setSplitTime(p.splitTime());
85  peak.setMergeTime(p.mergeTime());
86 
87  return RecoFFTJet(peak, jet.f_vec(), jet.f_ncells(), jet.f_etSum(),
88  jet.f_centroidEta(), jet.f_centroidPhi(),
89  jet.f_etaWidth(), jet.f_phiWidth(),
90  jet.f_etaPhiCorr(), jet.f_fuzziness(),
91  pileupPt, 0.0, jet.f_convergenceDistance());
92  }
93 }
94 
95 #endif // RecoJets_FFTJetAlgorithms_jetConverters_h
Preclusters from FFTJet pattern recognition stage.
Definition: PattRecoPeak.h:16
Real f_convergenceDistance() const
Definition: FFTJet.h:72
reco::FFTJet< Real > jetToStorable(const fftjet::RecombinedJet< VectorLike > &jet)
Definition: jetConverters.h:29
int f_status() const
Definition: FFTJet.h:77
fftjet::RecombinedJet< VectorLike > jetFromStorable(const reco::FFTJet< Real > &jet)
Definition: jetConverters.h:63
Real f_centroidPhi() const
Definition: FFTJet.h:67
int f_code() const
Definition: FFTJet.h:76
Real f_membershipFactor() const
Definition: FFTJet.h:75
fftjet::RecombinedJet< VectorLike > RecoFFTJet
Real f_etSum() const
Definition: FFTJet.h:65
Real f_phiWidth() const
Definition: FFTJet.h:69
Real f_centroidEta() const
Definition: FFTJet.h:66
Real f_recoScale() const
Definition: FFTJet.h:73
Real f_ncells() const
Definition: FFTJet.h:64
const math::XYZTLorentzVector & f_vec() const
Definition: FFTJet.h:62
Storage class for jets reconstructed by FFTJet package.
Definition: FFTJet.h:19
const PattRecoPeak< Real > & f_precluster() const
Definition: FFTJet.h:61
Real f_etaWidth() const
Definition: FFTJet.h:68
Real f_etaPhiCorr() const
Definition: FFTJet.h:70
const math::XYZTLorentzVector & f_pileup() const
Definition: FFTJet.h:63
Real f_recoScaleRatio() const
Definition: FFTJet.h:74
void hessian(double hessianArray[3]) const
Definition: PattRecoPeak.h:74
Real f_fuzziness() const
Definition: FFTJet.h:71