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

bool get_pruning () const
 
void run (const std::vector< fastjet::PseudoJet > &cell_particles, std::vector< CompoundPseudoJet > &hardjetsOutput, const edm::EventSetup &c)
 Find the ProtoJets from the collection of input Candidates. More...
 
void set_rcut_factor (double r)
 
void set_zcut (double z)
 
 SubJetAlgorithm (edm::InputTag mSrc, int algorithm, double centralEtaCut, double ptMin, double jetsize, unsigned int subjets, bool pruning, double zcut=0.1)
 

Private Attributes

int algorithm_
 
double centralEtaCut_
 
bool enable_pruning_
 
double jetsize_
 
edm::InputTag mSrc_
 
int nSubjets_
 
double ptMin_
 
double rcut_factor_
 
double zcut_
 

Detailed Description

Definition at line 14 of file SubJetAlgorithm.h.

Constructor & Destructor Documentation

SubJetAlgorithm::SubJetAlgorithm ( edm::InputTag  mSrc,
int  algorithm,
double  centralEtaCut,
double  ptMin,
double  jetsize,
unsigned int  subjets,
bool  pruning,
double  zcut = 0.1 
)
inline

Definition at line 16 of file SubJetAlgorithm.h.

23  :
24  mSrc_ (mSrc ),
26  centralEtaCut_ (centralEtaCut ),
27  ptMin_ (ptMin ),
28  jetsize_ (jetsize ),
29  nSubjets_ (subjets ),
30  enable_pruning_(pruning ),
31  zcut_ (zcut )
32  { }
edm::InputTag mSrc_

Member Function Documentation

bool SubJetAlgorithm::get_pruning ( ) const

Definition at line 12 of file SubJetAlgorithm.cc.

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

12  {
13  return enable_pruning_;
14 }
void SubJetAlgorithm::run ( const std::vector< fastjet::PseudoJet > &  cell_particles,
std::vector< CompoundPseudoJet > &  hardjetsOutput,
const edm::EventSetup c 
)

Find the ProtoJets from the collection of input Candidates.

Definition at line 27 of file SubJetAlgorithm.cc.

References ExpressReco_HICollisions_FallBack::algorithm.

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

29  {
30  fastjet::Strategy strategy = fastjet::Best;
31  fastjet::RecombinationScheme recombScheme = fastjet::E_scheme;
32  fastjet::JetAlgorithm algorithm = static_cast<fastjet::JetAlgorithm>(algorithm_);
33  //jet definition, as given in the configuration file, jetDef0:
34  fastjet::JetDefinition jetDef0(algorithm, jetsize_, recombScheme, strategy);
35 
36  //for actual jet clustering, either the pruned or the original version is used.
37  //For the pruned version, a new jet definition using the PrunedRecombPlugin is required:
38  std::auto_ptr<fastjet::JetDefinition> pjetdef;
39  std::auto_ptr<fastjet::PrunedRecombPlugin> PRplugin;
40  if(enable_pruning_){
41  PRplugin.reset(new fastjet::PrunedRecombPlugin(jetDef0, jetDef0, zcut_, rcut_factor_));
42  pjetdef.reset(new fastjet::JetDefinition(PRplugin.get()));
43  }
44 
45  //the jet definition which is actually used to cluster the jet is "jetDef". Either
46  // the pruned definition or the "original", unpruned one.
47  const fastjet::JetDefinition & jetDef = enable_pruning_?(*pjetdef):jetDef0;
48 
49  //cluster the jets with the jet definition jetDef:
50  fastjet::ClusterSequence clusterSeq(cell_particles, jetDef);
51  vector<fastjet::PseudoJet> inclusiveJets = clusterSeq.inclusive_jets(ptMin_);
52 
53  // These will store the indices of each subjet that
54  // are present in each jet
55  vector<vector<int> > indices(inclusiveJets.size());
56  // Loop over inclusive jets, attempt to find substructure
57  vector<fastjet::PseudoJet>::iterator jetIt = inclusiveJets.begin();
58  for ( ; jetIt != inclusiveJets.end(); ++jetIt ) {
59  //decompose into requested number of subjets:
60  vector<fastjet::PseudoJet> subjets = clusterSeq.exclusive_subjets(*jetIt, nSubjets_);
61  //create the subjets objects to put into the "output" objects
62  vector<CompoundPseudoSubJet> subjetsOutput;
63  std::vector<fastjet::PseudoJet>::const_iterator itSubJetBegin = subjets.begin(),
64  itSubJet = itSubJetBegin, itSubJetEnd = subjets.end();
65  for (; itSubJet != itSubJetEnd; ++itSubJet ){
66  // Get the transient subjet constituents from fastjet
67  vector<fastjet::PseudoJet> subjetFastjetConstituents = clusterSeq.constituents( *itSubJet );
68  // Get the indices of the constituents:
69  vector<int> constituents;
70  vector<fastjet::PseudoJet>::const_iterator fastSubIt = subjetFastjetConstituents.begin(),
71  transConstBegin = 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  // Make a CompoundPseudoSubJet object to hold this subjet and the indices of its constituents
79  subjetsOutput.push_back( CompoundPseudoSubJet( *itSubJet, constituents ) );
80  }
81  // Make a CompoundPseudoJet object to hold this hard jet, and the subjets that make it up
82  hardjetsOutput.push_back( CompoundPseudoJet( *jetIt, subjetsOutput ) );
83  }
84 }
CompoundPseudoJet holds an association of fastjet::PseudoJets that represent a &quot;hard&quot; top jet with su...
void SubJetAlgorithm::set_rcut_factor ( double  r)

Definition at line 20 of file SubJetAlgorithm.cc.

References csvReporter::r.

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

20  {
21  rcut_factor_ = r;
22 }
void SubJetAlgorithm::set_zcut ( double  z)

Definition at line 16 of file SubJetAlgorithm.cc.

References z.

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

16  {
17  zcut_ = z;
18 }
Definition: DDAxes.h:10

Member Data Documentation

int SubJetAlgorithm::algorithm_
private

Definition at line 47 of file SubJetAlgorithm.h.

double SubJetAlgorithm::centralEtaCut_
private

Definition at line 48 of file SubJetAlgorithm.h.

bool SubJetAlgorithm::enable_pruning_
private

Definition at line 52 of file SubJetAlgorithm.h.

double SubJetAlgorithm::jetsize_
private

Definition at line 50 of file SubJetAlgorithm.h.

edm::InputTag SubJetAlgorithm::mSrc_
private

Definition at line 46 of file SubJetAlgorithm.h.

int SubJetAlgorithm::nSubjets_
private

Definition at line 51 of file SubJetAlgorithm.h.

double SubJetAlgorithm::ptMin_
private

Definition at line 49 of file SubJetAlgorithm.h.

double SubJetAlgorithm::rcut_factor_
private

Definition at line 54 of file SubJetAlgorithm.h.

double SubJetAlgorithm::zcut_
private

Definition at line 53 of file SubJetAlgorithm.h.