fastjet::atlas::JetConeFinderTool Class Reference

#include <JetConeFinderTool.hh>

List of all members.

Public Types

typedef Jet::jet_list_t jetcollection_t

Public Member Functions

 JetConeFinderTool ()
virtual ~JetConeFinderTool ()
virtual int execute (jetcollection_t &theJets)
void reconstruct ()
Jetcalc_cone (double, double)

Public Attributes

std::string m_protoJetContainerLoc
std::string m_jetContainerLoc
double m_coneR
double m_ptcut
double m_eps
double m_seedPt
double m_etaMax
jetcollection_tm_pjetV
jetcollection_tm_jetOV
int m_cone_in_tower
std::vector< double > * m_veta
std::vector< double > * m_vphi
int m_ctr
int m_dctr

Detailed Description

Definition at line 50 of file JetConeFinderTool.hh.


Member Typedef Documentation

Definition at line 53 of file JetConeFinderTool.hh.


Constructor & Destructor Documentation

fastjet::atlas::JetConeFinderTool::JetConeFinderTool (  ) 

Definition at line 35 of file JetConeFinderTool.cc.

00035                                      :m_coneR(0.7)
00036   , m_ptcut(0.0*GeV)
00037   , m_eps(0.05)
00038   , m_seedPt(2.0*GeV)
00039   , m_etaMax(5.0)
00040 {}

fastjet::atlas::JetConeFinderTool::~JetConeFinderTool (  )  [virtual]

Definition at line 42 of file JetConeFinderTool.cc.

00043 {}


Member Function Documentation

Jet * fastjet::atlas::JetConeFinderTool::calc_cone ( double  eta,
double  phi 
)

Definition at line 181 of file JetConeFinderTool.cc.

References fastjet::atlas::Jet::addJet(), fastjet::atlas::JetDistances::deltaR(), m_coneR, m_ctr, and m_pjetV.

Referenced by reconstruct().

00182 {
00183   // Create a new Jet   
00184   Jet* j = new Jet();
00185   m_ctr +=1; 
00186 
00187   // Add all ProtoJet within m_coneR to this Jet  
00188   jetcollection_t::iterator itr  = m_pjetV->begin();
00189   jetcollection_t::iterator itrE = m_pjetV->end();
00190 
00191   for ( ; itr!=itrE; ++itr ) {
00192     double dR = JetDistances::deltaR(eta,phi,(*itr)->eta(),(*itr)->phi());
00193     if ( dR < m_coneR ) {
00194       j->addJet( (*itr) );
00195     }
00196   }    
00197 
00198   return j;
00199 }

int fastjet::atlas::JetConeFinderTool::execute ( jetcollection_t theJets  )  [virtual]

Definition at line 48 of file JetConeFinderTool.cc.

References fastjet::atlas::clear_list(), m_ctr, m_dctr, m_jetOV, m_pjetV, and reconstruct().

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

00049 {
00050   sort_jet_list<JetSorter_Et>(theJets);
00051 
00052   m_pjetV = &theJets;
00053 
00054   if(theJets.size()==0) return 0;
00055 
00056   // Initiale ctr/dctr counter for object counting.
00057   m_ctr = 0;
00058   m_dctr = 0;
00059 
00061   // Reconstruct Jets // 
00063   this->reconstruct();
00064 
00066   // ReFill JetCollection //
00068   clear_list(theJets);
00069   jetcollection_t::iterator it = m_jetOV->begin();
00070   jetcollection_t::iterator itE = m_jetOV->end();
00071   for(; it!=itE; ++it){
00072     theJets.push_back(*it);
00073   }
00074 
00075 
00076   delete m_jetOV;
00077   return 1;
00078 }

void fastjet::atlas::JetConeFinderTool::reconstruct (  ) 

Definition at line 85 of file JetConeFinderTool.cc.

References calc_cone(), fastjet::atlas::JetDistances::deltaPhi(), fastjet::atlas::LorentzVector::eta(), m_dctr, m_eps, m_etaMax, m_jetOV, m_pjetV, m_seedPt, and fastjet::atlas::LorentzVector::phi().

Referenced by execute().

00086 {
00087   m_jetOV = new jetcollection_t();
00088 
00089   jetcollection_t::iterator tItr;
00090   jetcollection_t::iterator tItr_begin = m_pjetV->begin();
00091   jetcollection_t::iterator tItr_end   = m_pjetV->end();
00092 
00093   // order towers in pt
00094 
00095   for ( tItr=tItr_begin; tItr!=tItr_end; ++tItr ) {    
00096 
00097     // Seed Cut
00098     double tEt = (*tItr)->et();
00099     if ( tEt < m_seedPt ) break;
00100 
00101     // Tower eta, phi
00102     double etaT = (*tItr)->eta();
00103     double phiT = (*tItr)->phi();    
00104     
00105     // Iteration logic
00106     bool stable = false;
00107     bool inGeom = true;
00108     
00109     Jet* preJet;
00110     
00111     int count = 1;
00112     do { // Iteration Loop
00113 
00114       // Make cone  
00115       preJet = calc_cone(etaT,phiT);
00116       double etaC = preJet->eta();
00117       double phiC = preJet->phi();
00118       
00119       double deta = fabs(etaT - etaC);
00120       double dphi = fabs(JetDistances::deltaPhi(phiT,phiC));
00121 
00122       // Is Stable ?
00123       if ( deta < m_eps && dphi < m_eps ) 
00124         stable = true;
00125       
00126       // In Geometry ?
00127       if ( fabs(etaC) > m_etaMax ) 
00128         inGeom = false; 
00129 
00130       etaT = etaC;
00131       phiT = phiC;
00132 
00133       if ( !stable && inGeom ) {
00134         delete preJet;
00135         m_dctr +=1;
00136       }
00137       ++count;
00138 
00139     }while ( !stable && inGeom && count < 10  );      
00140   
00141     if ( count > 9 && (!stable && inGeom) ) continue;  // FIXME 9 ?
00142 
00143     // If iteration was succesfull -- check if this is a new jet and 
00144     // add it to OV.
00145 
00146     if ( stable && inGeom ) {
00147       jetcollection_t::iterator pItr   = m_jetOV->begin();
00148       jetcollection_t::iterator pItrE  = m_jetOV->end();
00149     
00150       bool newJet = true;
00151       double etaT = preJet->eta();
00152       double phiT = preJet->phi();
00153 
00154       for ( ; pItr != pItrE ; ++pItr ) {
00155         double etaC = (*pItr)->eta();
00156         double phiC = (*pItr)->phi();
00157 
00158         double deta = fabs(etaT - etaC);
00159         double dphi = fabs(JetDistances::deltaPhi(phiT,phiC));
00160 
00161         if ( deta < 0.05  && dphi < 0.05 ) { 
00162           newJet = false;
00163           break;
00164         }
00165       }
00166       if ( newJet ) {
00167         m_jetOV->push_back( preJet );
00168       }
00169       else {
00170         delete preJet;
00171         m_dctr +=1;
00172       }
00173     }
00174     else {
00175       delete preJet;
00176       m_dctr +=1;
00177     }
00178   }    
00179 }


Member Data Documentation

Definition at line 82 of file JetConeFinderTool.hh.

Definition at line 71 of file JetConeFinderTool.hh.

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

Definition at line 87 of file JetConeFinderTool.hh.

Referenced by calc_cone(), and execute().

Definition at line 88 of file JetConeFinderTool.hh.

Referenced by execute(), and reconstruct().

Definition at line 73 of file JetConeFinderTool.hh.

Referenced by reconstruct().

Definition at line 75 of file JetConeFinderTool.hh.

Referenced by reconstruct().

Definition at line 69 of file JetConeFinderTool.hh.

Definition at line 80 of file JetConeFinderTool.hh.

Referenced by execute(), and reconstruct().

Definition at line 79 of file JetConeFinderTool.hh.

Referenced by calc_cone(), execute(), and reconstruct().

Definition at line 68 of file JetConeFinderTool.hh.

Definition at line 72 of file JetConeFinderTool.hh.

Definition at line 74 of file JetConeFinderTool.hh.

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

Definition at line 84 of file JetConeFinderTool.hh.

Definition at line 85 of file JetConeFinderTool.hh.


The documentation for this class was generated from the following files:

Generated on 26 Feb 2010 for fastjet by  doxygen 1.6.1