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 |
|
|
#include "CaloTrackCut.h" |
11 |
|
|
|
12 |
|
|
int CaloTrackCut::Check(PamLevel2 *event) { |
13 |
|
|
|
14 |
|
|
// 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 |
15 |
|
|
// NOTE: axis=0 => X, axis=1 => Y; tolerance in cm |
16 |
|
|
|
17 |
pam-fi |
1.2 |
Float_t rcil; |
18 |
pam-fi |
1.1 |
xCaloAxis.Reset(); |
19 |
|
|
yCaloAxis.Reset(); |
20 |
|
|
|
21 |
pam-fi |
1.2 |
if (_showerFit) { // shower fit |
22 |
|
|
rcil=1.; // tolerance (cm) |
23 |
|
|
if ( !(xCaloAxis.FitShower(event->GetCaloLevel1(), 0, rcil) ) || !(yCaloAxis.FitShower(event->GetCaloLevel1(), 1, rcil) ) ) { |
24 |
|
|
return 0; |
25 |
|
|
} |
26 |
|
|
} |
27 |
|
|
else { // single-track fit |
28 |
|
|
rcil=1.; // tolerance (cm) |
29 |
|
|
if ( !(xCaloAxis.FitAxis(event->GetCaloLevel1(), 0, rcil) ) || !(yCaloAxis.FitAxis(event->GetCaloLevel1(), 1, rcil) ) ) { |
30 |
|
|
return 0; |
31 |
|
|
} |
32 |
pam-fi |
1.1 |
} |
33 |
|
|
|
34 |
|
|
// NOTE: chi2 must be positive for the track to be meaningful |
35 |
|
|
if ( !(xCaloAxis.GetChi2() > 0 ) || !(yCaloAxis.GetChi2() > 0) ) { |
36 |
|
|
return 0; // check that the track is meaningful |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
return CUTOK; |
40 |
|
|
} |