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),

Member Function Documentation

◆ rcut_factor()

double SubJetAlgorithm::rcut_factor ( ) const
inline

Definition at line 36 of file SubJetAlgorithm.h.

36 { return rcut_factor_; }

References 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.

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 }

References dqmdumpme::indices.

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

◆ set_rcut_factor()

void SubJetAlgorithm::set_rcut_factor ( double  r)

Definition at line 13 of file SubJetAlgorithm.cc.

13 { rcut_factor_ = r; }

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.

35 { return zcut_; }

References 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().

SubJetAlgorithm::fjActiveArea_
std::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea_
Definition: SubJetAlgorithm.h:48
SubJetAlgorithm::zcut_
double zcut_
Definition: SubJetAlgorithm.h:44
HLT_FULL_cff.voronoiRfact
voronoiRfact
Definition: HLT_FULL_cff.py:8686
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:155
SubJetAlgorithm::rcut_factor_
double rcut_factor_
Definition: SubJetAlgorithm.h:45
SubJetAlgorithm::fjJetDefinition_
std::shared_ptr< fastjet::JetDefinition > fjJetDefinition_
Definition: SubJetAlgorithm.h:46
SubJetAlgorithm::doAreaFastjet_
bool doAreaFastjet_
Definition: SubJetAlgorithm.h:47
DDAxes::z
CompoundPseudoSubJet
Definition: CompoundPseudoJet.h:32
HLT_FULL_cff.doAreaFastjet
doAreaFastjet
Definition: HLT_FULL_cff.py:8677
CompoundPseudoJet
CompoundPseudoJet holds an association of fastjet::PseudoJets that represent a "hard" top jet with su...
Definition: CompoundPseudoJet.h:56
alignCSCRings.r
r
Definition: alignCSCRings.py:93
SubJetAlgorithm::voronoiRfact_
double voronoiRfact_
Definition: SubJetAlgorithm.h:49
SubJetAlgorithm::rcut_factor
double rcut_factor() const
Definition: SubJetAlgorithm.h:36
SubJetAlgorithm::zcut
double zcut() const
Definition: SubJetAlgorithm.h:35
SubJetAlgorithm::ptMin_
double ptMin_
Definition: SubJetAlgorithm.h:42
SubJetAlgorithm::nSubjets_
int nSubjets_
Definition: SubJetAlgorithm.h:43
dqmdumpme.indices
indices
Definition: dqmdumpme.py:50