Fork me on GitHub

source: svn/trunk/Utilities/Fastjet/plugins/CDFCones/interface/Cluster.hh@ 416

Last change on this file since 416 was 35, checked in by Xavier Rouby, 16 years ago

first attemp towers CMS

File size: 1.4 KB
Line 
1#ifndef _CLUSTER_HH_
2#define _CLUSTER_HH_
3
4#include "../interface/PhysicsTower.hh"
5#include "../interface/LorentzVector.hh"
6#include "../interface/Centroid.hh"
7#include <vector>
8
9class Cluster
10{
11 public:
12 std::vector<PhysicsTower> towerList;
13 LorentzVector fourVector;
14 Centroid centroid;
15 // addition by G.P.Salam; pt_tilde = sum |p_{ti}|. Maintaining this
16 // seems to add about 1% (3%) to overall timings for midpoint
17 // (jetclu) but it is useful because it makes it easy to look at
18 // other scales in the split-merge procedure
19 double pt_tilde;
20
21 Cluster()
22 {
23 clear();
24 }
25 void clear()
26 {
27 towerList.clear();
28 fourVector = LorentzVector();
29 centroid = Centroid();
30 pt_tilde = 0.0;
31 }
32 void addTower(const PhysicsTower& p)
33 {
34 towerList.push_back(p);
35 fourVector.add(p.fourVector);
36 centroid.add(Centroid(p.Et(),p.eta(),p.phi()));
37 pt_tilde += p.fourVector.pt();
38 }
39 void removeTower(const PhysicsTower& p)
40 {
41 for(std::vector<PhysicsTower>::iterator towerIter = towerList.begin(); towerIter != towerList.end(); towerIter++)
42 if(towerIter->isEqual(p)){
43 fourVector.subtract(towerIter->fourVector);
44 centroid.subtract(Centroid(towerIter->Et(),towerIter->eta(),towerIter->phi()));
45 pt_tilde -= towerIter->fourVector.pt();
46 towerList.erase(towerIter);
47 break;
48 }
49 }
50 int size(){return towerList.size();}
51};
52
53#endif
Note: See TracBrowser for help on using the repository browser.