CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
heppy::ReclusterJets Class Reference

#include <ReclusterJets.h>

Public Types

typedef math::XYZTLorentzVector LorentzVector
 

Public Member Functions

std::vector< LorentzVectorgetGrouping (double ptMin=0.0)
 get grouping (inclusive jets) More...
 
std::vector< LorentzVectorgetGroupingExclusive (int njets)
 get grouping (exclusive jets, until n are left) More...
 
std::vector< LorentzVectorgetGroupingExclusive (double dcut)
 get grouping (exclusive jets, up to cut dcut) More...
 
 ReclusterJets (const std::vector< LorentzVector > &objects, double ktpower, double rparam)
 

Private Types

typedef boost::shared_ptr
< fastjet::ClusterSequence > 
ClusterSequencePtr
 fastjet outputs More...
 

Private Member Functions

std::vector< LorentzVectormakeP4s (const std::vector< fastjet::PseudoJet > &jets)
 

Private Attributes

std::vector< fastjet::PseudoJet > exclusiveJets_
 
ClusterSequencePtr fjClusterSeq_
 
std::vector< fastjet::PseudoJet > fjInputs_
 
std::vector< fastjet::PseudoJet > inclusiveJets_
 
double ktpower_
 
double rparam_
 

Detailed Description

Definition at line 20 of file ReclusterJets.h.

Member Typedef Documentation

typedef boost::shared_ptr<fastjet::ClusterSequence> heppy::ReclusterJets::ClusterSequencePtr
private

fastjet outputs

Definition at line 46 of file ReclusterJets.h.

Definition at line 23 of file ReclusterJets.h.

Constructor & Destructor Documentation

heppy::ReclusterJets::ReclusterJets ( const std::vector< LorentzVector > &  objects,
double  ktpower,
double  rparam 
)

Definition at line 11 of file ReclusterJets.cc.

References edm::hlt::Exception, fjClusterSeq_, fjInputs_, cmsHarvester::index, j, fwrapper::jet_def, ktpower_, python.connectstrParser::o, and rparam_.

11  :
12  ktpower_(ktpower), rparam_(rparam)
13 {
14  // define jet inputs
15  fjInputs_.clear();
16  int index=0;
17  for (const LorentzVector &o : objects) {
18  fastjet::PseudoJet j(o.Px(),o.Py(),o.Pz(),o.E());
19  j.set_user_index(index); index++; // in case we want to know which piece ended where
20  fjInputs_.push_back(j);
21  }
22 
23  // choose a jet definition
24  fastjet::JetDefinition jet_def;
25 
26  // prepare jet def
27  if (ktpower_ == 1.0) {
28  jet_def = JetDefinition(kt_algorithm, rparam_);
29  } else if (ktpower_ == 0.0) {
30  jet_def = JetDefinition(cambridge_algorithm, rparam_);
31  } else if (ktpower_ == -1.0) {
32  jet_def = JetDefinition(antikt_algorithm, rparam_);
33  } else {
34  throw cms::Exception("InvalidArgument", "Unsupported ktpower value");
35  }
36 
37  // print out some infos
38  // cout << "Clustering with " << jet_def.description() << endl;
40  // define jet clustering sequence
41  fjClusterSeq_ = ClusterSequencePtr( new fastjet::ClusterSequence( fjInputs_, jet_def));
42 }
JetDefinition jet_def
std::vector< fastjet::PseudoJet > fjInputs_
Definition: ReclusterJets.h:40
ClusterSequencePtr fjClusterSeq_
Definition: ReclusterJets.h:47
boost::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
fastjet outputs
Definition: ReclusterJets.h:46
int j
Definition: DBlmapReader.cc:9
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
Definition: analysisEnums.h:9

Member Function Documentation

std::vector< math::XYZTLorentzVector > heppy::ReclusterJets::getGrouping ( double  ptMin = 0.0)

get grouping (inclusive jets)

Definition at line 51 of file ReclusterJets.cc.

References fjClusterSeq_, inclusiveJets_, and makeP4s().

51  {
52  // recluster jet
53  inclusiveJets_ = fastjet::sorted_by_pt(fjClusterSeq_->inclusive_jets(ptMin));
54  // return
55  return makeP4s(inclusiveJets_);
56 }
ClusterSequencePtr fjClusterSeq_
Definition: ReclusterJets.h:47
std::vector< fastjet::PseudoJet > inclusiveJets_
Definition: ReclusterJets.h:48
std::vector< LorentzVector > makeP4s(const std::vector< fastjet::PseudoJet > &jets)
std::vector< math::XYZTLorentzVector > heppy::ReclusterJets::getGroupingExclusive ( int  njets)

get grouping (exclusive jets, until n are left)

Definition at line 65 of file ReclusterJets.cc.

References exclusiveJets_, fjClusterSeq_, and makeP4s().

65  {
66  // recluster jet
67  exclusiveJets_ = fastjet::sorted_by_pt(fjClusterSeq_->exclusive_jets(njets));
68  // return
69  return makeP4s(exclusiveJets_);
70 }
std::vector< fastjet::PseudoJet > exclusiveJets_
Definition: ReclusterJets.h:49
ClusterSequencePtr fjClusterSeq_
Definition: ReclusterJets.h:47
std::vector< LorentzVector > makeP4s(const std::vector< fastjet::PseudoJet > &jets)
std::vector< math::XYZTLorentzVector > heppy::ReclusterJets::getGroupingExclusive ( double  dcut)

get grouping (exclusive jets, up to cut dcut)

Definition at line 58 of file ReclusterJets.cc.

References exclusiveJets_, fjClusterSeq_, and makeP4s().

58  {
59  // recluster jet
60  exclusiveJets_ = fastjet::sorted_by_pt(fjClusterSeq_->exclusive_jets(dcut));
61  // return
62  return makeP4s(exclusiveJets_);
63 }
std::vector< fastjet::PseudoJet > exclusiveJets_
Definition: ReclusterJets.h:49
ClusterSequencePtr fjClusterSeq_
Definition: ReclusterJets.h:47
std::vector< LorentzVector > makeP4s(const std::vector< fastjet::PseudoJet > &jets)
std::vector< math::XYZTLorentzVector > heppy::ReclusterJets::makeP4s ( const std::vector< fastjet::PseudoJet > &  jets)
private

Definition at line 44 of file ReclusterJets.cc.

Referenced by getGrouping(), and getGroupingExclusive().

44  {
45  std::vector<math::XYZTLorentzVector> JetObjectsAll;
46  for (const fastjet::PseudoJet & pj : jets) {
47  JetObjectsAll.push_back( LorentzVector( pj.px(), pj.py(), pj.pz(), pj.e() ) );
48  }
49  return JetObjectsAll;
50 }
math::XYZTLorentzVector LorentzVector
Definition: ReclusterJets.h:23
vector< PseudoJet > jets

Member Data Documentation

std::vector<fastjet::PseudoJet> heppy::ReclusterJets::exclusiveJets_
private

Definition at line 49 of file ReclusterJets.h.

Referenced by getGroupingExclusive().

ClusterSequencePtr heppy::ReclusterJets::fjClusterSeq_
private

Definition at line 47 of file ReclusterJets.h.

Referenced by getGrouping(), getGroupingExclusive(), and ReclusterJets().

std::vector<fastjet::PseudoJet> heppy::ReclusterJets::fjInputs_
private

Definition at line 40 of file ReclusterJets.h.

Referenced by ReclusterJets().

std::vector<fastjet::PseudoJet> heppy::ReclusterJets::inclusiveJets_
private

Definition at line 48 of file ReclusterJets.h.

Referenced by getGrouping().

double heppy::ReclusterJets::ktpower_
private

Definition at line 42 of file ReclusterJets.h.

Referenced by ReclusterJets().

double heppy::ReclusterJets::rparam_
private

Definition at line 43 of file ReclusterJets.h.

Referenced by ReclusterJets().