CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SubJetAlgorithm Class Reference

#include <SubJetAlgorithm.h>

Public Member Functions

double rcut_factor () const
 
void run (const std::vector< fastjet::PseudoJet > &cell_particles, std::vector< CompoundPseudoJet > &hardjetsOutput)
 Find the ProtoJets from the collection of input Candidates. More...
 
void set_rcut_factor (double r)
 
void set_zcut (double z)
 
 SubJetAlgorithm (double ptMin, unsigned int subjets, double zcut, double rcut_factor, std::shared_ptr< fastjet::JetDefinition > fjJetDefinition, bool doAreaFastjet, std::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea, double voronoiRfact)
 
double zcut () const
 

Private Attributes

bool doAreaFastjet_
 
std::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea_
 
std::shared_ptr< fastjet::JetDefinition > fjJetDefinition_
 
int nSubjets_
 
double ptMin_
 
double rcut_factor_
 
double voronoiRfact_
 
double zcut_
 

Detailed Description

Definition at line 14 of file SubJetAlgorithm.h.

Constructor & Destructor Documentation

◆ SubJetAlgorithm()

SubJetAlgorithm::SubJetAlgorithm ( double  ptMin,
unsigned int  subjets,
double  zcut,
double  rcut_factor,
std::shared_ptr< fastjet::JetDefinition >  fjJetDefinition,
bool  doAreaFastjet,
std::shared_ptr< fastjet::GhostedAreaSpec >  fjActiveArea,
double  voronoiRfact 
)
inline

Definition at line 16 of file SubJetAlgorithm.h.

24  : ptMin_(ptMin),
25  nSubjets_(subjets),
26  zcut_(zcut),
28  fjJetDefinition_(fjJetDefinition),
30  fjActiveArea_(fjActiveArea),
constexpr float ptMin
double zcut() const
std::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea_
double rcut_factor() const
std::shared_ptr< fastjet::JetDefinition > fjJetDefinition_

Member Function Documentation

◆ rcut_factor()

double SubJetAlgorithm::rcut_factor ( ) const
inline

Definition at line 36 of file SubJetAlgorithm.h.

References rcut_factor_.

36 { return rcut_factor_; }

◆ run()

void SubJetAlgorithm::run ( const std::vector< fastjet::PseudoJet > &  cell_particles,
std::vector< CompoundPseudoJet > &  hardjetsOutput 
)

Find the ProtoJets from the collection of input Candidates.

Definition at line 17 of file SubJetAlgorithm.cc.

References dqmdumpme::indices.

Referenced by cms::SubJetProducer::runAlgorithm().

17  {
18  //for actual jet clustering, either the pruned or the original version is used.
19  //For the pruned version, a new jet definition using the PrunedRecombPlugin is required:
20  fastjet::FastPrunePlugin PRplugin(*fjJetDefinition_, *fjJetDefinition_, zcut_, rcut_factor_);
21  fastjet::JetDefinition pjetdef(&PRplugin);
22 
23  // cluster the jets with the jet definition jetDef:
24  // run algorithm
25  std::shared_ptr<fastjet::ClusterSequence> fjClusterSeq;
26  if (!doAreaFastjet_) {
27  fjClusterSeq = std::make_shared<fastjet::ClusterSequence>(cell_particles, pjetdef);
28  } else if (voronoiRfact_ <= 0) {
29  fjClusterSeq = std::shared_ptr<fastjet::ClusterSequence>(
30  new fastjet::ClusterSequenceActiveArea(cell_particles, pjetdef, *fjActiveArea_));
31  } else {
32  fjClusterSeq = std::shared_ptr<fastjet::ClusterSequence>(
33  new fastjet::ClusterSequenceVoronoiArea(cell_particles, pjetdef, fastjet::VoronoiAreaSpec(voronoiRfact_)));
34  }
35 
36  vector<fastjet::PseudoJet> inclusiveJets = fjClusterSeq->inclusive_jets(ptMin_);
37 
38  // These will store the indices of each subjet that
39  // are present in each jet
40  vector<vector<int> > indices(inclusiveJets.size());
41  // Loop over inclusive jets, attempt to find substructure
42  vector<fastjet::PseudoJet>::iterator jetIt = inclusiveJets.begin();
43  for (; jetIt != inclusiveJets.end(); ++jetIt) {
44  //decompose into requested number of subjets:
45  vector<fastjet::PseudoJet> subjets = fjClusterSeq->exclusive_subjets(*jetIt, nSubjets_);
46  //create the subjets objects to put into the "output" objects
47  vector<CompoundPseudoSubJet> subjetsOutput;
48  std::vector<fastjet::PseudoJet>::const_iterator itSubJetBegin = subjets.begin(), itSubJet = itSubJetBegin,
49  itSubJetEnd = subjets.end();
50  for (; itSubJet != itSubJetEnd; ++itSubJet) {
51  // Get the transient subjet constituents from fastjet
52  vector<fastjet::PseudoJet> subjetFastjetConstituents = fjClusterSeq->constituents(*itSubJet);
53  // Get the indices of the constituents:
54  vector<int> constituents;
55  vector<fastjet::PseudoJet>::const_iterator fastSubIt = subjetFastjetConstituents.begin(),
56  transConstEnd = subjetFastjetConstituents.end();
57  for (; fastSubIt != transConstEnd; ++fastSubIt) {
58  if (fastSubIt->user_index() >= 0) {
59  constituents.push_back(fastSubIt->user_index());
60  }
61  }
62 
63  double subJetArea =
64  (doAreaFastjet_) ? dynamic_cast<fastjet::ClusterSequenceActiveArea&>(*fjClusterSeq).area(*itSubJet) : 0.0;
65 
66  // Make a CompoundPseudoSubJet object to hold this subjet and the indices of its constituents
67  subjetsOutput.push_back(CompoundPseudoSubJet(*itSubJet, subJetArea, constituents));
68  }
69 
70  double fatJetArea =
71  (doAreaFastjet_) ? dynamic_cast<fastjet::ClusterSequenceActiveArea&>(*fjClusterSeq).area(*jetIt) : 0.0;
72 
73  // Make a CompoundPseudoJet object to hold this hard jet, and the subjets that make it up
74  hardjetsOutput.push_back(CompoundPseudoJet(*jetIt, fatJetArea, subjetsOutput));
75  }
76 }
std::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea_
CompoundPseudoJet holds an association of fastjet::PseudoJets that represent a "hard" top jet with su...
std::shared_ptr< fastjet::JetDefinition > fjJetDefinition_

◆ set_rcut_factor()

void SubJetAlgorithm::set_rcut_factor ( double  r)

Definition at line 13 of file SubJetAlgorithm.cc.

References alignCSCRings::r.

◆ set_zcut()

void SubJetAlgorithm::set_zcut ( double  z)

Definition at line 11 of file SubJetAlgorithm.cc.

11 { zcut_ = z; }

◆ zcut()

double SubJetAlgorithm::zcut ( ) const
inline

Definition at line 35 of file SubJetAlgorithm.h.

References zcut_.

35 { return zcut_; }

Member Data Documentation

◆ doAreaFastjet_

bool SubJetAlgorithm::doAreaFastjet_
private

Definition at line 47 of file SubJetAlgorithm.h.

◆ fjActiveArea_

std::shared_ptr<fastjet::GhostedAreaSpec> SubJetAlgorithm::fjActiveArea_
private

Definition at line 48 of file SubJetAlgorithm.h.

◆ fjJetDefinition_

std::shared_ptr<fastjet::JetDefinition> SubJetAlgorithm::fjJetDefinition_
private

Definition at line 46 of file SubJetAlgorithm.h.

◆ nSubjets_

int SubJetAlgorithm::nSubjets_
private

Definition at line 43 of file SubJetAlgorithm.h.

◆ ptMin_

double SubJetAlgorithm::ptMin_
private

Definition at line 42 of file SubJetAlgorithm.h.

◆ rcut_factor_

double SubJetAlgorithm::rcut_factor_
private

Definition at line 45 of file SubJetAlgorithm.h.

Referenced by rcut_factor().

◆ voronoiRfact_

double SubJetAlgorithm::voronoiRfact_
private

Definition at line 49 of file SubJetAlgorithm.h.

◆ zcut_

double SubJetAlgorithm::zcut_
private

Definition at line 44 of file SubJetAlgorithm.h.

Referenced by zcut().