CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes

CMSInsideOutAlgorithm Class Reference

#include <CMSInsideOutAlgorithm.h>

List of all members.

Classes

class  ListIteratorLesserByDeltaR

Public Types

typedef std::list
< fastjet::PseudoJet >
::iterator 
inputListIter
typedef
reco::Particle::LorentzVector 
LorentzVector

Public Member Functions

 CMSInsideOutAlgorithm (double seedObjectPt, double growthParameter, double maxSize, double minSize)
void run (const std::vector< fastjet::PseudoJet > &fInput, std::vector< fastjet::PseudoJet > &fOutput)
 Build from input candidate collection.

Private Attributes

double growthParameterSquared_
double maxSizeSquared_
double minSizeSquared_
double seedThresholdPt_

Detailed Description

Definition at line 27 of file CMSInsideOutAlgorithm.h.


Member Typedef Documentation

typedef std::list<fastjet::PseudoJet>::iterator CMSInsideOutAlgorithm::inputListIter

Definition at line 30 of file CMSInsideOutAlgorithm.h.

Definition at line 29 of file CMSInsideOutAlgorithm.h.


Constructor & Destructor Documentation

CMSInsideOutAlgorithm::CMSInsideOutAlgorithm ( double  seedObjectPt,
double  growthParameter,
double  maxSize,
double  minSize 
) [inline]

Constructor

Parameters:
seeddefines the minimum ET in GeV of an object that can seed the jet
growthparametersets the growth parameter X, i.e. [dR < X/Et_jet]
min/maxsize define the min/max size of jet in deltaR. Min is included for resolution effects
seedChargecan be the following values; -1 [don't care], 0 neutral only, 1 [tracks only]

Definition at line 52 of file CMSInsideOutAlgorithm.h.

                                                                                                        : 
         seedThresholdPt_(seedObjectPt),
         growthParameterSquared_(growthParameter*growthParameter),
         maxSizeSquared_(maxSize*maxSize),
         minSizeSquared_(minSize*minSize){};

Member Function Documentation

void CMSInsideOutAlgorithm::run ( const std::vector< fastjet::PseudoJet > &  fInput,
std::vector< fastjet::PseudoJet > &  fOutput 
)

Build from input candidate collection.

Definition at line 9 of file CMSInsideOutAlgorithm.cc.

References reco::deltaR2(), Geom::deltaR2(), collect_tpl::input, position, and python::multivaluedict::sort().

Referenced by CMSInsideOutJetProducer::runAlgorithm().

{

   //make a list of input objects
   list<fastjet::PseudoJet> input;
   for (std::vector<fastjet::PseudoJet>::const_iterator candIter  = fInput.begin();
        candIter != fInput.end(); 
        ++candIter) {
      input.push_back(*candIter);
   }

   while( !input.empty() && input.front().perp() > seedThresholdPt_ ) 
   {
      //get seed eta/phi
      double seedEta = input.front().eta();
      double seedPhi = input.front().phi();

      //find iterators to those objects that are in the max cone size
      list<inputListIter> maxCone;
      // add seed, then test elements after seed
      inputListIter iCand = input.begin();
      maxCone.push_back(iCand++);
      for(; iCand != input.end(); ++iCand)
      {
        const fastjet::PseudoJet& candidate = *iCand;
         if( reco::deltaR2(seedEta, candidate.eta(), seedPhi, candidate.phi()) < maxSizeSquared_ )
            maxCone.push_back(iCand);
      }
      //sort objects by increasing DR about the seed  directions
      maxCone.sort(ListIteratorLesserByDeltaR(seedEta, seedPhi));
      list<inputListIter>::const_iterator position = maxCone.begin(); 
      bool limitReached = false;
      double totalET    = (**position).perp();
      ++position;
      while(position != maxCone.end() && !limitReached)
      {
         const fastjet::PseudoJet& theCandidate = **position;
         double candidateET    = theCandidate.perp() + totalET; 
         double candDR2        = reco::deltaR2(seedEta, theCandidate.eta(), seedPhi, theCandidate.phi());
         if( candDR2 < minSizeSquared_ ||  candDR2*candidateET*candidateET < growthParameterSquared_ )
            totalET = candidateET;
         else
            limitReached = true;
         ++position;
      }
      //turn this into a final jet
      fastjet::PseudoJet final;
      for(list<inputListIter>::const_iterator iNewJet  = maxCone.begin();
                                              iNewJet != position;
                                            ++iNewJet)
      {
         final += **iNewJet;
         input.erase(*iNewJet);
      }
      fOutput.push_back(final);
   } // end loop over seeds
   GreaterByEtPseudoJet compJets;
   sort (fOutput.begin (), fOutput.end (), compJets);
}

Member Data Documentation

Definition at line 65 of file CMSInsideOutAlgorithm.h.

Definition at line 66 of file CMSInsideOutAlgorithm.h.

Definition at line 67 of file CMSInsideOutAlgorithm.h.

Definition at line 64 of file CMSInsideOutAlgorithm.h.