11 |
|
|
12 |
int TrkPhSinCut::Check(PamLevel2 *event) { |
int TrkPhSinCut::Check(PamLevel2 *event) { |
13 |
|
|
14 |
if (!(event->GetTrkLevel2()->GetNTracks() == 1)) |
if (!(event->GetNTracks(trkAlg) == 1)) |
15 |
return 0; // one track exists (physical or not) |
return 0; // one track exists (physical or not) |
16 |
|
|
17 |
|
|
18 |
// selection of the physical track (see TrkId below) |
// selection of the physical track (see TrkId below) |
19 |
event->SetSortingMethod(_sortingMethod); |
event->SetSortingMethod(_sortingMethod); |
20 |
pamTrack = event->GetTrack(0); |
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 |
// NOTE: pamtrack is null pointer if no physical track is selected; this is a redundant check to find bugs in the level2 (at least one physical track should always be present, given that GetNTracks()=1 according to the previous cut). |
// return 0; |
|
if (!pamTrack) |
|
|
return 0; // redundant check |
|
25 |
|
|
26 |
trkTrack = pamTrack->GetTrkTrack(); |
|
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 |
// Check if good clusters have meaningful energy releases |
32 |
for (unsigned int ip = 0; ip < 6; ip++) { |
for (unsigned int ip = 0; ip < 6; ip++) { |
39 |
if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.)) |
if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.)) |
40 |
return 0; // check that the track is meaningful |
return 0; // check that the track is meaningful |
41 |
|
|
|
// identification of TRK-track TOF-index (this index is generally different from TRK-track TRK-index) |
|
|
iTrackTof = -1000; |
|
|
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
|
|
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkTrack->GetSeqNo()) { |
|
|
iTrackTof = i; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
42 |
return CUTOK; |
return CUTOK; |
43 |
|
|
44 |
} |
} |