FastJet 3.0.2
Jet.cc
00001 //----------------------------------------------------------------------
00002 // This file distributed with FastJet has been obtained from SpartyJet
00003 // v2.20.0 by Pierre-Antoine Delsart, Kurtis L. Geerlings, Joey
00004 // Huston, Brian T. Martin and Chris Vermilion
00005 // For details, see http://www.pa.msu.edu/~huston/SpartyJet/
00006 //                  http://projects.hepforge.org/spartyjet/
00007 //
00008 // Changes from the original file are listed below.
00009 //----------------------------------------------------------------------
00010 
00011 // History of changes from the original Jet.cc file in SpartyJet v2.20
00012 //  
00013 // 2009-01-15  Gregory Soyez  <soyez@fastjet.fr>
00014 // 
00015 //        * put the code in the fastjet::atlas namespace
00016 
00017 #include "Jet.hh"
00018 #include <iostream>
00019 
00020 #include <fastjet/internal/base.hh>
00021 
00022 FASTJET_BEGIN_NAMESPACE
00023 
00024 namespace atlas { 
00025 
00026 Jet::Jet(Jet &jet) : LorentzVector(0,0,0,0){
00027   add(jet);
00028   m_index = jet.index();
00029   m_constituents = jet.m_constituents;
00030   //  m_area = jet.area();
00031   //  m_area_error = jet.area_error();
00032 }
00033 Jet::Jet(Jet* j){
00034   add(*j);
00035   m_index = j->index();
00036   m_constituents = j->m_constituents;
00037 //   m_area = j->area();
00038 //   m_area_error = j->area_error();
00039 }
00040 
00041 void Jet::addJet(Jet& j){
00042   add(j);
00043   m_constituents.insert(m_constituents.end(), j.firstConstituent(), j.lastConstituent() );
00044 }
00045 
00046 void Jet::addJet(Jet* j){
00047   add(*j) ;
00048   m_constituents.insert(m_constituents.end(), j->firstConstituent(), j->lastConstituent() );
00049 }
00050 
00051 
00052 void Jet::addConstituent(constit_vect_t::iterator first, constit_vect_t::iterator last){
00053   m_constituents.insert(m_constituents.end(), first, last); 
00054   for(; first!=last;++first) this->add( **first);
00055 }
00056 
00057 
00058 
00059 Jet* jet_from_overlap(Jet* j1, Jet* j2){
00060   Jet *j = new Jet();
00061   Jet::constit_vect_t::iterator it1 = j1->firstConstituent();
00062   Jet::constit_vect_t::iterator it1E = j1->lastConstituent();
00063   for(;it1!= it1E; ++it1){
00064     Jet::constit_vect_t::iterator it2 = j2->firstConstituent();
00065     Jet::constit_vect_t::iterator it2E = j2->lastConstituent();
00066     for(;it2!= it2E; ++it2){
00067       if( *it1 == *it2) j->addConstituent(*it1);
00068     }
00069     
00070   }
00071   return j;
00072 }
00073 }  // namespace atlas
00074 
00075 FASTJET_END_NAMESPACE
00076 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends