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, boost::shared_ptr< fastjet::JetDefinition > fjJetDefinition, bool doAreaFastjet, boost::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea, double voronoiRfact)
 
double zcut () const
 

Private Attributes

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

Detailed Description

Definition at line 17 of file SubJetAlgorithm.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file SubJetAlgorithm.h.

References alignCSCRings::r, set_rcut_factor(), set_zcut(), and z.

27  :
28  ptMin_ (ptMin ),
29  nSubjets_ (subjets ),
30  zcut_ (zcut ),
32  fjJetDefinition_(fjJetDefinition),
34  fjActiveArea_ (fjActiveArea),
36  {
37 
38  }
doAreaFastjet
Definition: jets_cff.py:16
double zcut() const
boost::shared_ptr< fastjet::GhostedAreaSpec > fjActiveArea_
double rcut_factor() const
boost::shared_ptr< fastjet::JetDefinition > fjJetDefinition_

Member Function Documentation

double SubJetAlgorithm::rcut_factor ( ) const
inline

Definition at line 43 of file SubJetAlgorithm.h.

References rcut_factor_, and run().

43 { return rcut_factor_; }
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 22 of file SubJetAlgorithm.cc.

Referenced by rcut_factor(), and cms::SubJetProducer::runAlgorithm().

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

Definition at line 15 of file SubJetAlgorithm.cc.

References alignCSCRings::r.

Referenced by SubJetAlgorithm().

15  {
16  rcut_factor_ = r;
17 }
void SubJetAlgorithm::set_zcut ( double  z)

Definition at line 11 of file SubJetAlgorithm.cc.

Referenced by SubJetAlgorithm().

11  {
12  zcut_ = z;
13 }
double SubJetAlgorithm::zcut ( ) const
inline

Definition at line 42 of file SubJetAlgorithm.h.

References zcut_.

42 { return zcut_;}

Member Data Documentation

bool SubJetAlgorithm::doAreaFastjet_
private

Definition at line 57 of file SubJetAlgorithm.h.

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

Definition at line 58 of file SubJetAlgorithm.h.

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

Definition at line 56 of file SubJetAlgorithm.h.

int SubJetAlgorithm::nSubjets_
private

Definition at line 53 of file SubJetAlgorithm.h.

double SubJetAlgorithm::ptMin_
private

Definition at line 52 of file SubJetAlgorithm.h.

double SubJetAlgorithm::rcut_factor_
private

Definition at line 55 of file SubJetAlgorithm.h.

Referenced by rcut_factor().

double SubJetAlgorithm::voronoiRfact_
private

Definition at line 59 of file SubJetAlgorithm.h.

double SubJetAlgorithm::zcut_
private

Definition at line 54 of file SubJetAlgorithm.h.

Referenced by zcut().