File: Jet.cc

package info (click to toggle)
fastjet 3.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 9,540 kB
  • sloc: cpp: 78,628; python: 6,112; sh: 1,038; fortran: 673; makefile: 635; ansic: 161
file content (76 lines) | stat: -rw-r--r-- 2,123 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//----------------------------------------------------------------------
// This file distributed with FastJet has been obtained from SpartyJet
// v2.20.0 by Pierre-Antoine Delsart, Kurtis L. Geerlings, Joey
// Huston, Brian T. Martin and Chris Vermilion
// For details, see http://www.pa.msu.edu/~huston/SpartyJet/
//                  http://projects.hepforge.org/spartyjet/
//
// Changes from the original file are listed below.
//----------------------------------------------------------------------

// History of changes from the original Jet.cc file in SpartyJet v2.20
//  
// 2009-01-15  Gregory Soyez  <soyez@fastjet.fr>
// 
//        * put the code in the fastjet::atlas namespace

#include "Jet.hh"
#include <iostream>

#include "fastjet/internal/base.hh"

FASTJET_BEGIN_NAMESPACE

namespace atlas { 

Jet::Jet(Jet &jet) : LorentzVector(0,0,0,0){
  add(jet);
  m_index = jet.index();
  m_constituents = jet.m_constituents;
  //  m_area = jet.area();
  //  m_area_error = jet.area_error();
}
Jet::Jet(Jet* j){
  add(*j);
  m_index = j->index();
  m_constituents = j->m_constituents;
//   m_area = j->area();
//   m_area_error = j->area_error();
}

void Jet::addJet(Jet& j){
  add(j);
  m_constituents.insert(m_constituents.end(), j.firstConstituent(), j.lastConstituent() );
}

void Jet::addJet(Jet* j){
  add(*j) ;
  m_constituents.insert(m_constituents.end(), j->firstConstituent(), j->lastConstituent() );
}


void Jet::addConstituent(constit_vect_t::iterator first, constit_vect_t::iterator last){
  m_constituents.insert(m_constituents.end(), first, last); 
  for(; first!=last;++first) this->add( **first);
}



Jet* jet_from_overlap(Jet* j1, Jet* j2){
  Jet *j = new Jet();
  Jet::constit_vect_t::iterator it1 = j1->firstConstituent();
  Jet::constit_vect_t::iterator it1E = j1->lastConstituent();
  for(;it1!= it1E; ++it1){
    Jet::constit_vect_t::iterator it2 = j2->firstConstituent();
    Jet::constit_vect_t::iterator it2E = j2->lastConstituent();
    for(;it2!= it2E; ++it2){
      if( *it1 == *it2) j->addConstituent(*it1);
    }
    
  }
  return j;
}
}  // namespace atlas

FASTJET_END_NAMESPACE