CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 15 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 17 of file SubJetAlgorithm.h.

25  :
26  ptMin_ (ptMin ),
27  nSubjets_ (subjets ),
28  zcut_ (zcut ),
30  fjJetDefinition_(fjJetDefinition),
31  doAreaFastjet_ (doAreaFastjet),
32  fjActiveArea_ (fjActiveArea),
33  voronoiRfact_ (voronoiRfact)
34  {
35 
36  }
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 41 of file SubJetAlgorithm.h.

References rcut_factor_.

41 { 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 20 of file SubJetAlgorithm.cc.

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

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

References alignCSCRings::r.

13  {
14  rcut_factor_ = r;
15 }
void SubJetAlgorithm::set_zcut ( double  z)

Definition at line 9 of file SubJetAlgorithm.cc.

References detailsBasic3DVector::z.

9  {
10  zcut_ = z;
11 }
float float float z
double SubJetAlgorithm::zcut ( ) const
inline

Definition at line 40 of file SubJetAlgorithm.h.

References zcut_.

40 { return zcut_;}

Member Data Documentation

bool SubJetAlgorithm::doAreaFastjet_
private

Definition at line 55 of file SubJetAlgorithm.h.

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

Definition at line 56 of file SubJetAlgorithm.h.

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

Definition at line 54 of file SubJetAlgorithm.h.

int SubJetAlgorithm::nSubjets_
private

Definition at line 51 of file SubJetAlgorithm.h.

double SubJetAlgorithm::ptMin_
private

Definition at line 50 of file SubJetAlgorithm.h.

double SubJetAlgorithm::rcut_factor_
private

Definition at line 53 of file SubJetAlgorithm.h.

Referenced by rcut_factor().

double SubJetAlgorithm::voronoiRfact_
private

Definition at line 57 of file SubJetAlgorithm.h.

double SubJetAlgorithm::zcut_
private

Definition at line 52 of file SubJetAlgorithm.h.

Referenced by zcut().