1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* TrkChi2DeflCut.h |
3 |
|
|
* |
4 |
|
|
* Created on: 7-apr-2009 |
5 |
|
|
* Author: Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file TrkChi2DeflCut.h The TrkChi2DeflCut class definition file */ |
9 |
|
|
|
10 |
|
|
#ifndef TRKCHI2DEFLCUT_H_ |
11 |
|
|
#define TRKCHI2DEFLCUT_H_ |
12 |
|
|
|
13 |
|
|
#include "../../PamCutBase/PamCutBase.h" |
14 |
|
|
|
15 |
|
|
#include <TH2F.h> |
16 |
|
|
|
17 |
|
|
/*! @brief The tracker chi2 vs deflection cut. |
18 |
|
|
* |
19 |
|
|
* Events whose track has been fitted with a chi2 greater than Chi2(eta) are discarded. |
20 |
|
|
* Chi2(eta) is a function which gives the maximum value of chi2 associated to a certain |
21 |
|
|
* deflection eta; in current implementation it is parameterized as: |
22 |
|
|
* |
23 |
|
|
* Chi2(eta) = p0 + p1 * eta^2 + p2 * eta ^4 |
24 |
|
|
* |
25 |
|
|
* where p0, p1 and p2 are parameters. |
26 |
|
|
*/ |
27 |
|
|
|
28 |
|
|
class TrkChi2DeflCut: public PamCut { |
29 |
|
|
|
30 |
|
|
public: |
31 |
|
|
/*! @brief Constructor. |
32 |
|
|
* |
33 |
|
|
* @param cutName The cut's name. |
34 |
|
|
* @param p0 The constant term in Chi2(eta). |
35 |
|
|
* @param p1 The coefficient or the quadratic term in Chi2(eta). |
36 |
|
|
* @param p2 The coefficient or the quartic term in Chi2(eta). |
37 |
|
|
*/ |
38 |
|
|
TrkChi2DeflCut(const char *cutName, float p0, float p1, float p2) : |
39 |
|
|
PamCut(cutName), _p0(p0), _p1(p1), _p2(p2) { |
40 |
|
|
|
41 |
|
|
#ifdef DEBUGPAMCUT |
42 |
|
|
|
43 |
|
|
TString hId; |
44 |
|
|
TString hTitle; |
45 |
|
|
|
46 |
|
|
for (UInt_t j = 0; j < 2; j++) { |
47 |
|
|
hId.Form("h_trk_chi2_vs_defl_%i_", j); |
48 |
|
|
hId.Append(TString(cutName)); |
49 |
|
|
hTitle.Form("TRK chi2 vs defl (%i)", j); |
50 |
|
|
h_trk_chi2_defl[j] = new TH2F(hId.Data(), hTitle.Data(), 50, 0, 2.5, 50, 0, 20); |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
#endif |
54 |
|
|
|
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
/*! @brief Destructor. */ |
58 |
|
|
~TrkChi2DeflCut() { |
59 |
|
|
|
60 |
|
|
#ifdef DEBUGPAMCUT |
61 |
|
|
|
62 |
|
|
for (UInt_t j = 0; j < 2; j++) { |
63 |
|
|
h_trk_chi2_defl[j]->Write(); |
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
#endif |
67 |
|
|
|
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
/*! @brief The tracker chi2 vs deflection check. |
71 |
|
|
* |
72 |
|
|
* |
73 |
|
|
* @param event The event to analyze. |
74 |
|
|
* @return #CUTOK if chi2 < Chi2(eta). |
75 |
|
|
* @return 0 if not |
76 |
|
|
*/ |
77 |
|
|
int Check(PamLevel2 *event); |
78 |
|
|
|
79 |
|
|
private: |
80 |
|
|
|
81 |
|
|
#ifdef DEBUGPAMCUT |
82 |
|
|
|
83 |
|
|
TH2F* h_trk_chi2_defl[2]; |
84 |
|
|
|
85 |
|
|
#endif |
86 |
|
|
|
87 |
|
|
float _p0, _p1, _p2; |
88 |
|
|
}; |
89 |
|
|
#endif /* TRKCHI2DEFLCUT_H_ */ |