20 |
|
class Jet : public Particle |
21 |
|
{ |
22 |
|
public: |
23 |
+ |
enum ECorr { |
24 |
+ |
L1 = 0, |
25 |
+ |
L2, |
26 |
+ |
L3, |
27 |
+ |
L4, |
28 |
+ |
L5, |
29 |
+ |
L6, |
30 |
+ |
L7, |
31 |
+ |
Custom |
32 |
+ |
}; |
33 |
+ |
|
34 |
|
Jet() : fMaxEInEmTowers(0), fMaxEInHadTowers(0), fEnergyFractionH(0), fEnergyFractionEm(0), |
35 |
|
fHadEnergyInHB(0), fHadEnergyInHO(0), fHadEnergyInHE(0), fHadEnergyInHF(0), |
36 |
|
fEmEnergyInEB(0), fEmEnergyInEE(0), fEmEnergyInHF(0), fTowersArea(0), fN(0), |
37 |
< |
fN60(0), fN90(0), fMatchedMCFlavor(0) {} |
38 |
< |
Jet(Double_t px, Double_t py, Double_t pz, Double_t e) : fMom(FourVector(px,py,pz,e)), |
37 |
> |
fN60(0), fN90(0), fAlpha(0), fBeta(0), fMatchedMCFlavor(0), |
38 |
> |
fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0), |
39 |
> |
fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0), |
40 |
> |
fCombinedSecondaryVertexMVABJetTagsDisc(0), fImpactParameterMVABJetTagsDisc(0), |
41 |
> |
fTrackCountingHighEffBJetTagsDisc(0), fTrackCountingHighPurBJetTagsDisc(0), |
42 |
> |
fSoftMuonBJetTagsDisc(0), fSoftMuonNoIPBJetTagsDisc(0), |
43 |
> |
fSoftElectronBJetTagsDisc(0), fL2RelativeCorrectionScale(0), |
44 |
> |
fL3AbsoluteCorrectionScale(0), fL4EMFCorrectionScale(0), |
45 |
> |
fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0) |
46 |
> |
{} |
47 |
> |
Jet(Double_t px, Double_t py, Double_t pz, Double_t e) : fRawMom(FourVector(px,py,pz,e)), |
48 |
|
fMaxEInEmTowers(0), fMaxEInHadTowers(0), fEnergyFractionH(0), fEnergyFractionEm(0), |
49 |
|
fHadEnergyInHB(0), fHadEnergyInHO(0), fHadEnergyInHE(0), fHadEnergyInHF(0), |
50 |
|
fEmEnergyInEB(0), fEmEnergyInEE(0), fEmEnergyInHF(0), fTowersArea(0), fN(0), |
51 |
< |
fN60(0), fN90(0), fMatchedMCFlavor(0) {} |
51 |
> |
fN60(0), fN90(0), fAlpha(0), fBeta(0), fMatchedMCFlavor(0), |
52 |
> |
fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0), |
53 |
> |
fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0), |
54 |
> |
fCombinedSecondaryVertexMVABJetTagsDisc(0), fImpactParameterMVABJetTagsDisc(0), |
55 |
> |
fTrackCountingHighEffBJetTagsDisc(0), fTrackCountingHighPurBJetTagsDisc(0), |
56 |
> |
fSoftMuonBJetTagsDisc(0), fSoftMuonNoIPBJetTagsDisc(0), |
57 |
> |
fSoftElectronBJetTagsDisc(0), fL2RelativeCorrectionScale(0), |
58 |
> |
fL3AbsoluteCorrectionScale(0), fL4EMFCorrectionScale(0), |
59 |
> |
fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0) |
60 |
> |
{} |
61 |
|
|
62 |
|
Double_t Alpha() const { return fAlpha; } |
63 |
|
Double_t Beta() const { return fBeta; } |
65 |
|
{ return fCombinedSecondaryVertexBJetTagsDisc; } |
66 |
|
Double_t CombinedSecondaryVertexMVABJetTagsDisc() const |
67 |
|
{ return fCombinedSecondaryVertexMVABJetTagsDisc; } |
68 |
+ |
Double_t CustomCorrectionScale() const { return fCustomCorrectionScale; } |
69 |
+ |
void DisableCorrection(ECorr c) { fCorrections.ClearBit(c); ClearMom(); } |
70 |
+ |
void DisableCorrections() { fCorrections.Clear(); ClearMom(); } |
71 |
|
Double_t EmEnergyInEB() const { return fEmEnergyInEB; } |
72 |
|
Double_t EmEnergyInEE() const { return fEmEnergyInEE; } |
73 |
|
Double_t EmEnergyInHF() const { return fEmEnergyInHF; } |
74 |
+ |
void EnableCorrection(ECorr c) { fCorrections.SetBit(c); ClearMom();} |
75 |
+ |
Bool_t CorrectionActive(ECorr c) const { return fCorrections.TestBit(c); } |
76 |
|
Double_t EnergyFractionH() const { return fEnergyFractionH; } |
77 |
|
Double_t EnergyFractionEm() const { return fEnergyFractionEm; } |
78 |
|
Double_t HadEnergyInHO() const { return fHadEnergyInHO; } |
115 |
|
*Tower(UInt_t i) const { return fTowers.At(i); } |
116 |
|
Double_t TowersArea() const { return fTowersArea; } |
117 |
|
void AddTower(const CaloTower *tower) { fTowers.Add(tower); } |
118 |
+ |
const FourVectorM &RawMom() const { return fRawMom; } |
119 |
|
void SetAlpha(Double_t val) { fAlpha = val; } |
120 |
|
void SetBeta(Double_t val) { fBeta = val; } |
121 |
|
void SetCombinedSecondaryVertexBJetTagsDisc(Double_t d) |
122 |
|
{ fCombinedSecondaryVertexBJetTagsDisc = d; } |
123 |
|
void SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d) |
124 |
< |
{ fCombinedSecondaryVertexMVABJetTagsDisc = d; } |
124 |
> |
{ fCombinedSecondaryVertexMVABJetTagsDisc = d; } |
125 |
|
void SetEmEnergyInEB(Double_t val) { fEmEnergyInEB = val; } |
126 |
|
void SetEmEnergyInEE(Double_t val) { fEmEnergyInEE = val; } |
127 |
|
void SetEmEnergyInHF(Double_t val) { fEmEnergyInHF = val; } |
135 |
|
{ fImpactParameterMVABJetTagsDisc = d; } |
136 |
|
void SetJetProbabilityBJetTagsDisc(Double_t d) { fJetProbabilityBJetTagsDisc = d; } |
137 |
|
void SetJetBProbabilityBJetTagsDisc(Double_t d) { fJetBProbabilityBJetTagsDisc = d; } |
138 |
< |
void SetMom(const FourVectorM &mom) { fMom = mom; ClearMom(); } |
138 |
> |
void SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom(); } |
139 |
|
void SetN(UShort_t n) { fN = n; } |
140 |
|
void SetN60(UShort_t n) { fN60 = n; } |
141 |
|
void SetN90(UShort_t n) { fN90 = n; } |
142 |
|
void SetMatchedMCFlavor(Int_t flavor) { fMatchedMCFlavor = flavor; } |
143 |
|
void SetMaxEInEmTowers(Double_t val) { fMaxEInEmTowers = val; } |
144 |
|
void SetMaxEInHadTowers(Double_t val) { fMaxEInHadTowers = val; } |
145 |
< |
void SetL2RelativeCorrectionScale(Double_t s ) { fL2RelativeCorrectionScale = s; } |
146 |
< |
void SetL3AbsoluteCorrectionScale(Double_t s ) { fL3AbsoluteCorrectionScale = s; } |
147 |
< |
void SetL4EMFCorrectionScale(Double_t s ) { fL4EMFCorrectionScale = s; } |
148 |
< |
void SetL5FlavorCorrectionScale(Double_t s ) { fL5FlavorCorrectionScale = s; } |
149 |
< |
void SetL7PartonCorrectionScale(Double_t s ) { fL7PartonCorrectionScale = s; } |
145 |
> |
void SetL2RelativeCorrectionScale(Double_t s ) { fL2RelativeCorrectionScale = s; ClearMom(); } |
146 |
> |
void SetL3AbsoluteCorrectionScale(Double_t s ) { fL3AbsoluteCorrectionScale = s; ClearMom(); } |
147 |
> |
void SetL4EMFCorrectionScale(Double_t s ) { fL4EMFCorrectionScale = s; ClearMom(); } |
148 |
> |
void SetL5FlavorCorrectionScale(Double_t s ) { fL5FlavorCorrectionScale = s; ClearMom(); } |
149 |
> |
void SetL7PartonCorrectionScale(Double_t s ) { fL7PartonCorrectionScale = s; ClearMom(); } |
150 |
> |
void SetCustomCorrectionScale(Double_t s) { fCustomCorrectionScale = s; ClearMom(); } |
151 |
|
void SetSimpleSecondaryVertexBJetTagsDisc(Double_t d) |
152 |
|
{ fSimpleSecondaryVertexBJetTagsDisc = d; } |
153 |
|
void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; } |
162 |
|
protected: |
163 |
|
void GetMom() const; |
164 |
|
|
165 |
< |
FourVectorM32 fMom; //four momentum of jet |
165 |
> |
FourVectorM32 fRawMom; //uncorrected four momentum of jet |
166 |
|
Double_t fMaxEInEmTowers; //maximum energy in EM towers |
167 |
|
Double_t fMaxEInHadTowers; //maximum energy in HCAL towers |
168 |
|
Double_t fEnergyFractionH; //hadronic energy fraction |
192 |
|
Double_t fSoftMuonBJetTagsDisc; // |
193 |
|
Double_t fSoftMuonNoIPBJetTagsDisc; // |
194 |
|
Double_t fSoftElectronBJetTagsDisc; // |
195 |
< |
Double_t fL2RelativeCorrectionScale; // |
196 |
< |
Double_t fL3AbsoluteCorrectionScale; // |
197 |
< |
Double_t fL4EMFCorrectionScale; // |
198 |
< |
Double_t fL5FlavorCorrectionScale; // |
199 |
< |
Double_t fL7PartonCorrectionScale; // |
200 |
< |
RefArray<CaloTower> fTowers; //calo towers assigned to this jet |
195 |
> |
Double_t fL2RelativeCorrectionScale; // |
196 |
> |
Double_t fL3AbsoluteCorrectionScale; // |
197 |
> |
Double_t fL4EMFCorrectionScale; // |
198 |
> |
Double_t fL5FlavorCorrectionScale; // |
199 |
> |
Double_t fL7PartonCorrectionScale; // |
200 |
> |
Double_t fCustomCorrectionScale; // |
201 |
> |
BitMask8 fCorrections; //mask of which corrections should be applied |
202 |
> |
RefArray<CaloTower> fTowers; //calo towers assigned to this jet |
203 |
|
|
204 |
|
ClassDef(Jet, 1) // Jet class |
205 |
|
}; |
210 |
|
{ |
211 |
|
// Get momentum values from stored values. |
212 |
|
|
213 |
< |
fCachedMom = fMom; |
213 |
> |
fCachedMom = fRawMom; |
214 |
> |
|
215 |
> |
if (CorrectionActive(L2)) |
216 |
> |
fCachedMom *= fL2RelativeCorrectionScale; |
217 |
> |
|
218 |
> |
if (CorrectionActive(L3)) |
219 |
> |
fCachedMom *= fL3AbsoluteCorrectionScale; |
220 |
> |
|
221 |
> |
if (CorrectionActive(L4)) |
222 |
> |
fCachedMom *= fL4EMFCorrectionScale; |
223 |
> |
|
224 |
> |
if (CorrectionActive(L5)) |
225 |
> |
fCachedMom *= fL5FlavorCorrectionScale; |
226 |
> |
|
227 |
> |
if (CorrectionActive(L7)) |
228 |
> |
fCachedMom *= fL7PartonCorrectionScale; |
229 |
> |
|
230 |
> |
if (CorrectionActive(Custom)) |
231 |
> |
fCachedMom *= fCustomCorrectionScale; |
232 |
|
} |
233 |
|
#endif |