FastJet  3.1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Jet.cc
1 //----------------------------------------------------------------------
2 // This file distributed with FastJet has been obtained from SpartyJet
3 // v2.20.0 by Pierre-Antoine Delsart, Kurtis L. Geerlings, Joey
4 // Huston, Brian T. Martin and Chris Vermilion
5 // For details, see http://www.pa.msu.edu/~huston/SpartyJet/
6 // http://projects.hepforge.org/spartyjet/
7 //
8 // Changes from the original file are listed below.
9 //----------------------------------------------------------------------
10 
11 // History of changes from the original Jet.cc file in SpartyJet v2.20
12 //
13 // 2009-01-15 Gregory Soyez <soyez@fastjet.fr>
14 //
15 // * put the code in the fastjet::atlas namespace
16 
17 #include "Jet.hh"
18 #include <iostream>
19 
20 #include <fastjet/internal/base.hh>
21 
22 FASTJET_BEGIN_NAMESPACE
23 
24 namespace atlas {
25 
26 Jet::Jet(Jet &jet) : LorentzVector(0,0,0,0){
27  add(jet);
28  m_index = jet.index();
29  m_constituents = jet.m_constituents;
30  // m_area = jet.area();
31  // m_area_error = jet.area_error();
32 }
33 Jet::Jet(Jet* j){
34  add(*j);
35  m_index = j->index();
36  m_constituents = j->m_constituents;
37 // m_area = j->area();
38 // m_area_error = j->area_error();
39 }
40 
41 void Jet::addJet(Jet& j){
42  add(j);
43  m_constituents.insert(m_constituents.end(), j.firstConstituent(), j.lastConstituent() );
44 }
45 
46 void Jet::addJet(Jet* j){
47  add(*j) ;
48  m_constituents.insert(m_constituents.end(), j->firstConstituent(), j->lastConstituent() );
49 }
50 
51 
52 void Jet::addConstituent(constit_vect_t::iterator first, constit_vect_t::iterator last){
53  m_constituents.insert(m_constituents.end(), first, last);
54  for(; first!=last;++first) this->add( **first);
55 }
56 
57 
58 
59 Jet* jet_from_overlap(Jet* j1, Jet* j2){
60  Jet *j = new Jet();
61  Jet::constit_vect_t::iterator it1 = j1->firstConstituent();
62  Jet::constit_vect_t::iterator it1E = j1->lastConstituent();
63  for(;it1!= it1E; ++it1){
64  Jet::constit_vect_t::iterator it2 = j2->firstConstituent();
65  Jet::constit_vect_t::iterator it2E = j2->lastConstituent();
66  for(;it2!= it2E; ++it2){
67  if( *it1 == *it2) j->addConstituent(*it1);
68  }
69 
70  }
71  return j;
72 }
73 } // namespace atlas
74 
75 FASTJET_END_NAMESPACE
76