Fork me on GitHub

source: git/external/fastjet/plugins/CDFCones/Cluster.hh@ a0f5d71

3.4.3pre03
Last change on this file since a0f5d71 was d7d2da3, checked in by pavel <pavel@…>, 12 years ago

move branches/ModularDelphes to trunk

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[d7d2da3]1#ifndef _CLUSTER_HH_
2#define _CLUSTER_HH_
3
4//----------------------------------------------------------------------
5// This file distributed with FastJet has been obtained from
6// http://www.pa.msu.edu/~huston/Les_Houches_2005/JetClu+Midpoint-StandAlone.tgz
7//
8// Permission to distribute it with FastJet has been granted by Joey
9// Huston (see the COPYING file in the main FastJet directory for
10// details).
11// Changes from the original file are listed below.
12//----------------------------------------------------------------------
13
14// History of changes compared to the original Cluster.hh file
15//
16// 2009-01-17 Gregory Soyez <soyez@fastjet.fr>
17//
18// * put the code in the fastjet::cdf namespace
19//
20// 2007-03-10 Gavin Salam <salam@lpthe.jussieu.fr>
21//
22// * added support for the pttilde scale choice in the CDF midpoint code
23//
24// 2006-09-24 Gavin Salam <salam@lpthe.jussieu.fr>
25//
26// * added JetClu+MidPoint to FastJet
27
28#include "PhysicsTower.hh"
29#include "LorentzVector.hh"
30#include "Centroid.hh"
31#include <vector>
32
33#include <fastjet/internal/base.hh>
34
35FASTJET_BEGIN_NAMESPACE
36
37namespace cdf{
38
39class Cluster
40{
41 public:
42 std::vector<PhysicsTower> towerList;
43 LorentzVector fourVector;
44 Centroid centroid;
45 // addition by G.P.Salam; pt_tilde = sum |p_{ti}|. Maintaining this
46 // seems to add about 1% (3%) to overall timings for midpoint
47 // (jetclu) but it is useful because it makes it easy to look at
48 // other scales in the split-merge procedure
49 double pt_tilde;
50
51 Cluster()
52 {
53 clear();
54 }
55 void clear()
56 {
57 towerList.clear();
58 fourVector = LorentzVector();
59 centroid = Centroid();
60 pt_tilde = 0.0;
61 }
62 void addTower(PhysicsTower p)
63 {
64 towerList.push_back(p);
65 fourVector.add(p.fourVector);
66 centroid.add(Centroid(p.Et(),p.eta(),p.phi()));
67 pt_tilde += p.fourVector.pt();
68 }
69 void removeTower(PhysicsTower p)
70 {
71 for(std::vector<PhysicsTower>::iterator towerIter = towerList.begin(); towerIter != towerList.end(); towerIter++)
72 if(towerIter->isEqual(p)){
73 fourVector.subtract(towerIter->fourVector);
74 centroid.subtract(Centroid(towerIter->Et(),towerIter->eta(),towerIter->phi()));
75 pt_tilde -= towerIter->fourVector.pt();
76 towerList.erase(towerIter);
77 break;
78 }
79 }
80 int size(){return towerList.size();}
81};
82
83} // namespace cdf
84
85FASTJET_END_NAMESPACE
86
87#endif
Note: See TracBrowser for help on using the repository browser.