1 |
/* |
2 |
* CaloTrackCut.cpp |
3 |
* |
4 |
* Created on: 17-mar-2009 |
5 |
* Author: S: Ricciarini |
6 |
*/ |
7 |
|
8 |
/*! @file CaloTrackCut.cpp The CaloTrackCut class implementation file */ |
9 |
|
10 |
#ifndef NO_CALOAXIS |
11 |
|
12 |
#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 |
Float_t rcil; |
20 |
xCaloAxis.Reset(); |
21 |
yCaloAxis.Reset(); |
22 |
|
23 |
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 |
} |
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 |
|
44 |
#endif /* NO_CALOAXIS */ |