1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* CaloTrackCut.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 17-mar-2009 |
5 |
pam-fi |
1.2 |
* Author: S: Ricciarini |
6 |
pam-fi |
1.1 |
*/ |
7 |
|
|
|
8 |
|
|
/*! @file CaloTrackCut.cpp The CaloTrackCut class implementation file */ |
9 |
|
|
|
10 |
pam-fi |
1.3 |
#ifndef NO_CALOAXIS |
11 |
|
|
|
12 |
pam-fi |
1.1 |
#include "CaloTrackCut.h" |
13 |
|
|
|
14 |
|
|
int CaloTrackCut::Check(PamLevel2 *event) { |
15 |
|
|
|
16 |
|
|
// NOTE: FitAxis(L1 calo tree, axis, tolerance) method finds the X (Y) axis projection of the track into the calorimeter, by excluding clusters which are far away from the main X (Y) clustering area |
17 |
|
|
// NOTE: axis=0 => X, axis=1 => Y; tolerance in cm |
18 |
|
|
|
19 |
pam-fi |
1.2 |
Float_t rcil; |
20 |
pam-fi |
1.1 |
xCaloAxis.Reset(); |
21 |
|
|
yCaloAxis.Reset(); |
22 |
|
|
|
23 |
pam-fi |
1.2 |
if (_showerFit) { // shower fit |
24 |
|
|
rcil=1.; // tolerance (cm) |
25 |
|
|
if ( !(xCaloAxis.FitShower(event->GetCaloLevel1(), 0, rcil) ) || !(yCaloAxis.FitShower(event->GetCaloLevel1(), 1, rcil) ) ) { |
26 |
|
|
return 0; |
27 |
|
|
} |
28 |
|
|
} |
29 |
|
|
else { // single-track fit |
30 |
|
|
rcil=1.; // tolerance (cm) |
31 |
|
|
if ( !(xCaloAxis.FitAxis(event->GetCaloLevel1(), 0, rcil) ) || !(yCaloAxis.FitAxis(event->GetCaloLevel1(), 1, rcil) ) ) { |
32 |
|
|
return 0; |
33 |
|
|
} |
34 |
pam-fi |
1.1 |
} |
35 |
|
|
|
36 |
|
|
// NOTE: chi2 must be positive for the track to be meaningful |
37 |
|
|
if ( !(xCaloAxis.GetChi2() > 0 ) || !(yCaloAxis.GetChi2() > 0) ) { |
38 |
|
|
return 0; // check that the track is meaningful |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
return CUTOK; |
42 |
|
|
} |
43 |
pam-fi |
1.3 |
|
44 |
|
|
#endif /* NO_CALOAXIS */ |