fastjet 2.4.5
Public Types | Public Member Functions | Public Attributes
fastjet::atlas::JetSplitMergeTool Class Reference

#include <JetSplitMergeTool.hh>

List of all members.

Public Types

typedef Jet::jet_list_t jetcollection_t

Public Member Functions

 JetSplitMergeTool ()
virtual ~JetSplitMergeTool ()
virtual int execute (jetcollection_t *theJets)
double etaTrue (Jet::constit_vect_t::iterator pj)
double phiTrue (Jet::constit_vect_t::iterator pj)
void split_merge ()

Public Attributes

double m_f
jetcollection_t m_preJet
jetcollection_t m_jet
jetcollection_tm_jetVec
int m_ctr
int m_dctr

Detailed Description

Definition at line 52 of file JetSplitMergeTool.hh.


Member Typedef Documentation

Definition at line 55 of file JetSplitMergeTool.hh.


Constructor & Destructor Documentation

fastjet::atlas::JetSplitMergeTool::JetSplitMergeTool ( )

Definition at line 27 of file JetSplitMergeTool.cc.

  :  m_f( 0.5 )
{}
fastjet::atlas::JetSplitMergeTool::~JetSplitMergeTool ( ) [virtual]

Definition at line 31 of file JetSplitMergeTool.cc.

{}

Member Function Documentation

double fastjet::atlas::JetSplitMergeTool::etaTrue ( Jet::constit_vect_t::iterator  pj)

Definition at line 181 of file JetSplitMergeTool.cc.

{
  double s = ((*pj)->e() > 0) ? +1.0 : -1.0;
  double px = (*pj)->px;
  double py = (*pj)->py;
  double pz = (*pj)->pz;
  double theta = acos(pz*s/sqrt(px*px+py*py+pz*pz));
  return -log(tan(theta/2.0));
}
int fastjet::atlas::JetSplitMergeTool::execute ( jetcollection_t theJets) [virtual]

Definition at line 37 of file JetSplitMergeTool.cc.

References fastjet::atlas::Jet::addJet(), fastjet::atlas::clear_list(), fastjet::atlas::LorentzVector::e(), m_ctr, m_dctr, m_jet, m_preJet, and split_merge().

Referenced by fastjet::ATLASConePlugin::run_clustering().

{
  m_ctr = 0;
  m_dctr = 0;

  // From the input, collection create a list of Jet//
  m_preJet.clear();
  m_jet.clear();

  jetcollection_t::iterator itrB = theJets->begin();
  jetcollection_t::iterator itrE = theJets->end(); 

  double etot =0.;
  for (;itrB!=itrE;itrB++) {
    Jet* j = new Jet(); j->addJet(*itrB);
    m_ctr +=1;
    m_preJet.push_back(j);    

    etot += j->e();    
  }

  // Split Merge Jets//
  this->split_merge();
 
  // Empty and re-fill input jetcollection_t //
  clear_list(*theJets);
  jetcollection_t::iterator it = m_jet.begin();
  jetcollection_t::iterator itE = m_jet.end();
  for(; it!=itE; ++it){    
    theJets->push_back(*it);
  }

  return 1;
}
double fastjet::atlas::JetSplitMergeTool::phiTrue ( Jet::constit_vect_t::iterator  pj)

Definition at line 191 of file JetSplitMergeTool.cc.

{
  double s = ((*pj)->e() > 0) ? +1.0 : -1.0;
  double px = (*pj)->px;
  double py = (*pj)->py;
  return atan2(py*s,px*s);
}
void fastjet::atlas::JetSplitMergeTool::split_merge ( )

Definition at line 82 of file JetSplitMergeTool.cc.

References fastjet::atlas::JetDistances::deltaPhi(), fastjet::atlas::Jet::firstConstituent(), fastjet::atlas::Jet::getConstituentNum(), fastjet::atlas::jet_from_overlap(), fastjet::atlas::Jet::lastConstituent(), m_ctr, m_dctr, m_f, m_jet, m_preJet, fastjet::atlas::LorentzVector::px, fastjet::atlas::LorentzVector::py, fastjet::atlas::Jet::removeConstituent(), and fastjet::atlas::sort_list_et().

Referenced by execute().

{
  if ( m_preJet.size() >= 2 ) {
    do {
      sort_list_et(m_preJet);
      
      jetcollection_t::iterator itr;
      jetcollection_t::iterator first = m_preJet.begin();
      jetcollection_t::iterator last  = m_preJet.end();
      
      itr=first;
      ++itr;
      bool overlap = false;
  
      for (;itr != last;++itr) {      
        double etaF = (*first)->eta();
        double phiF = (*first)->phi();
        double etaS = (*itr)->eta();
        double phiS = (*itr)->phi();
        
        Jet* oJet = jet_from_overlap( (*first),*itr);   
        m_ctr +=1; 

        Jet::constit_vect_t::iterator itro  = oJet->firstConstituent();
        Jet::constit_vect_t::iterator itroE = oJet->lastConstituent();
        
        if ( oJet->getConstituentNum() != 0 ) {
          overlap = true;
          
          // fraction
          double f = sqrt(pow(oJet->px,2)+pow(oJet->py,2))/
            sqrt(pow((*itr)->px,2)+pow((*itr)->py,2));
          
          // merge
          if ( f > m_f) {
            // we need to remove constituents !
            Jet *j = (*first);
            for ( ;itro != itroE; ++itro ) j->removeConstituent(*itro);
            (*first)->addJet(*itr);
            //m_preJet.remove(*itr);
            delete *itr;
            m_preJet.erase(itr);
            m_dctr +=1;
          }     
          
          // split      
          if ( f <= m_f) {        
            for ( ;itro != itroE; ++itro ) {          
              // Distance of first jet from ProtoJet
              double deta1 = etaF - (*itro)->eta();
              double dphi1 = fabs(JetDistances::deltaPhi(phiF,(*itro)->phi()));
              double dist1 = pow( deta1 , 2 ) + pow( dphi1 , 2 );
              
              // Distance of second jet from ProtoJet
              double deta2 = etaS - (*itro)->eta();
              double dphi2 = fabs(JetDistances::deltaPhi(phiS,(*itro)->phi()));
              double dist2 = pow( deta2 , 2 ) + pow( dphi2 , 2 );
              
              // Remove protojet from farther Jet                     
              if ( dist1 > dist2 ) (*first)->removeConstituent(*itro);
              if ( dist1 <= dist2 ) (*itr)->removeConstituent(*itro);   
            }
          }
          // Delete overlap jet     
          delete oJet;     
          m_dctr +=1;
          break; 
        }  
        else {
          // Delete overlap jet     
          delete oJet;     
          m_dctr +=1;
        }    
      }
      
      if ( overlap == false ) {
        m_jet.push_back(*first);
        //m_preJet.remove(*first);      
        m_preJet.erase(first);      
      }
      
    } while ( m_preJet.size() != 0 );    
  }
  else if ( m_preJet.size() == 1) {
    m_jet.push_back( *(m_preJet.begin()) );
  }

}

Member Data Documentation

Definition at line 75 of file JetSplitMergeTool.hh.

Referenced by execute(), and split_merge().

Definition at line 76 of file JetSplitMergeTool.hh.

Referenced by execute(), and split_merge().

Definition at line 70 of file JetSplitMergeTool.hh.

Referenced by fastjet::ATLASConePlugin::run_clustering(), and split_merge().

Definition at line 72 of file JetSplitMergeTool.hh.

Referenced by execute(), and split_merge().

Definition at line 73 of file JetSplitMergeTool.hh.

Definition at line 71 of file JetSplitMergeTool.hh.

Referenced by execute(), and split_merge().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines