source: trunk/KtJet/KtJetTable.h@ 23

Last change on this file since 23 was 2, checked in by Pavel Demin, 16 years ago

first commit

File size: 3.0 KB
Line 
1#ifndef KTJET_KTJETTABLE_H
2#define KTJET_KTJETTABLE_H
3
4#include "KtJet/KtLorentzVector.h"
5#include "KtJet/KtDistanceInterface.h"
6#include "KtJet/KtRecomInterface.h"
7#include <vector>
8#include <string>
9
10
11namespace KtJet{
12
13 /**
14 * Class KtJetTable encapsulates the jet four-momenta and Kt's in one object.
15 * Does merging and deletion of jets and returns jets, Kt's etc.
16 * Uses a KtDistance object to calculate Kt's.
17 *
18 * Usage example:
19 * CLHEP::HepLorentzVector eScheme(const CLHEP::HepLorentzVector &,
20 const CLHEP::HepLorentzVector &); // function to merge jets
21 * std::vector<KtLorentzVector> jets;
22 * // [Put some particles in "jets".]
23 * KtDistanceDeltaR ktPP(4); // 4 = pp collision
24 * KtJetTable jt(jets, ktPP, eScheme);
25
26 @author J.Butterworth J.Couchman B.Cox B.Waugh
27 */
28 class KtJetTable {
29 public:
30 KtJetTable(const std::vector<KtLorentzVector> &, KtDistance *, KtRecom *recom);
31 ~KtJetTable();
32 /* Number of jets */
33 inline int getNJets() const;
34 /** Get jet from table */
35 const KtLorentzVector & getJet(int i) const;
36 /** Kt for jet pair (i,j) */
37 KtFloat getD(int i, int j) const;
38 /** Kt of jet (i) with respect to beam */
39 KtFloat getD(int i) const;
40 /** Get indices of jet pair with min Kt */
41 std::pair<int,int> getMinDPair() const;
42 /** Get index of jet with min Kt with respect to beam */
43 int getMinDJet() const;
44 /** Combine jets (i,j) (E-scheme only so far) */
45 void mergeJets(int i, int j);
46 /** Delete jet (i) from table */
47 void killJet(int i);
48 private:
49 /** Initial number of jets/particles */
50 int m_nRows;
51 /** Jet 4-momenta */
52 std::vector<KtLorentzVector> m_jets;
53 /** Function object to define Kt distance scheme */
54 KtDistance *m_fKtDist;
55 /** Recombination scheme */
56 KtRecom *m_ktRecom;
57 // CLHEP::HepLorentzVector (*m_frecom)(const CLHEP::HepLorentzVector &, const CLHEP::HepLorentzVector &);
58 /** Kt with respect to beam */
59 std::vector<KtFloat> m_ddi;
60 /** Class to deal with pair Kt's */
61 class DijTable {
62 private:
63 /** No. of initial jets/particles */
64 int m_nRows;
65 /** No. of jets after merging etc. */
66 int m_nJets;
67 /** Vector of Kt values */
68 std::vector<KtFloat> m_table;
69 public:
70 DijTable(int nParticles=0);
71 ~DijTable();
72 /** Set size to hold nParticles particles */
73 void resize(int nParticles);
74 /** Return reference to allow Kt value to be set */
75 KtFloat & operator() (int i, int j);
76 /** Return Kt by value */
77 KtFloat operator() (int i, int j) const;
78 /** Find position of minimum Kt in table */
79 std::pair<int,int> getMin() const;
80 /** Decrement number of jets */
81 void killJet();
82 /** ??? debug only? Print contents of table */
83 void print() const;
84 };
85 /** 2D table of all pair kt's */
86 DijTable m_dPairs;
87 };
88
89#include "KtJet/KtJetTable.icc"
90
91}//end of namespace
92#endif
Note: See TracBrowser for help on using the repository browser.