-
Notifications
You must be signed in to change notification settings - Fork 5
/
TStarJetVector.cxx
118 lines (100 loc) · 3.36 KB
/
TStarJetVector.cxx
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include "TStarJetVector.h"
#include "TStarJetPicoDefinitions.h"
#include <TMath.h>
#include <TVector2.h>
/////////////////////////////////////////////////////////////////////////////
// //
// TStarJetPicoVector //
// //
// TLorentzVector with "Features" //
// //
// - stores extra Int_t or Double_t information in TArrays //
// //
// - enums help to navigate through features //
// -- see TStarJetPicoReader::LoadV0s(), LoadTracks(), LoadTowers(), //
// //
// - some methods provided for convenience - setters and getters //
// -- see SetPID() and GetPID() for example //
// //
// - implements some extra functions for better compatibility with fastjet //
// //
// - can be used to store ouput jets from the jet finders! //
// -- within a derived class implement area4vector and redefine few enums //
// //
/////////////////////////////////////////////////////////////////////////////
ClassImp(TStarJetVector)
#define __TStarJetVector_NfeaturesD 7
#define __TStarJetVector_NfeaturesI 6
// #define __TStarJetVector_NfeaturesD 0
// #define __TStarJetVector_NfeaturesI 0
TStarJetVector::TStarJetVector()
: TLorentzVector()
, fFeaturesD(__TStarJetVector_NfeaturesD)
, fFeaturesI(__TStarJetVector_NfeaturesI)
, fTrigger(kFALSE)
{
Clear();
}
TStarJetVector::TStarJetVector(const TStarJetVector &v)
: TLorentzVector(v)
, fFeaturesD(v.fFeaturesD)
, fFeaturesI(v.fFeaturesI)
, fTrigger(kFALSE)
{
;
}
TStarJetVector::TStarJetVector(const TLorentzVector &lv)
: TLorentzVector(lv)
, fFeaturesD(__TStarJetVector_NfeaturesD)
, fFeaturesI(__TStarJetVector_NfeaturesI)
, fTrigger(kFALSE)
{
Clear();
}
TStarJetVector::~TStarJetVector()
{
;
}
void TStarJetVector::SetFeature(Int_t idx, Double_t value)
{
fFeaturesD[idx] = value;
}
void TStarJetVector::SetFeature(Int_t idx, Int_t value)
{
fFeaturesI[idx] = value;
}
void TStarJetVector::SetFeatureD(Int_t idx, Double_t value)
{
fFeaturesD[idx] = value;
}
void TStarJetVector::SetFeatureI(Int_t idx, Int_t value)
{
fFeaturesI[idx] = value;
}
void TStarJetVector::Clear(Option_t *option)
{
TLorentzVector::Clear(option);
fFeaturesD.Set(__TStarJetVector_NfeaturesD);
fFeaturesI.Set(__TStarJetVector_NfeaturesI);
fFeaturesD.Reset(0.0);
fFeaturesI.Reset(0);
fFeaturesI[_MATCH] = -1; // KK
fTrigger = kFALSE;
}
double TStarJetVector::phi() const
{
//
// This is for fastjet: range 0 - 2pi
//
return TVector2::Phi_0_2pi(Phi());
}
Bool_t TStarJetVector::IsChargedHadron()
{
if (fFeaturesI[_CHARGE] == _NEUTRAL)
return kFALSE;
else
if (fFeaturesI[_PID] == __STARJETPICO_ELECTRON_PID)
return kFALSE;
else
return kTRUE;
}