1 |
/* |
2 |
* TrkPhSinCut.cpp |
3 |
* |
4 |
* Created on: 13-mar-2009 |
5 |
* Author: Sergio Ricciarini, Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file TrkPhSinCut.cpp The TrkPhSinCut class implementation file */ |
9 |
|
10 |
#include "TrkPhSinCut.h" |
11 |
|
12 |
int TrkPhSinCut::Check(PamLevel2 *event) { |
13 |
|
14 |
if (!(event->GetNTracks(trkAlg) == 1)) |
15 |
return 0; // one track exists (physical or not) |
16 |
|
17 |
|
18 |
// selection of the physical track (see TrkId below) |
19 |
event->SetSortingMethod(_sortingMethod); |
20 |
PamTrack *pamTrack = event->GetTrack(0,trkAlg); |
21 |
// PamTrack *pamTrack = event->GetTrackOld(0); |
22 |
// event->GetTrack(0,trkAlg)->Copy(*pamTrack); //fondamentale per i tagli successivi?!?! |
23 |
|
24 |
// return 0; |
25 |
|
26 |
|
27 |
ExtTrack* trkTrack = pamTrack->GetExtTrack(); |
28 |
// TrkTrack* trkTrack = pamTrack->GetTrkTrack(); |
29 |
if(!trkTrack)return 0; |
30 |
|
31 |
// Check if good clusters have meaningful energy releases |
32 |
for (unsigned int ip = 0; ip < 6; ip++) { |
33 |
if (trkTrack->XGood(ip) == 1 && trkTrack->GetDEDX(ip, 0) <= 0.) |
34 |
trkTrack->xgood[ip] = 0; // Set it to bad |
35 |
if (trkTrack->YGood(ip) == 1 && trkTrack->GetDEDX(ip, 1) <= 0.) |
36 |
trkTrack->ygood[ip] = 0; // Set it to bad |
37 |
} |
38 |
|
39 |
if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.)) |
40 |
return 0; // check that the track is meaningful |
41 |
|
42 |
return CUTOK; |
43 |
|
44 |
} |