1 |
/* |
2 |
* ReprocessTrackAction.cpp |
3 |
* |
4 |
* Created on: 23/dic/2009 |
5 |
* Author: C. De Santis, N. Mori |
6 |
*/ |
7 |
|
8 |
#include "ReprocessTrackAction.h" |
9 |
|
10 |
void ReprocessTrackAction::OnGood(PamLevel2 *event) { |
11 |
|
12 |
_allEvents++; |
13 |
|
14 |
TrkLevel1 *L1; |
15 |
if (_newTrkL1) |
16 |
if (_externalFlag) |
17 |
if (!(*_externalFlag)) |
18 |
return; |
19 |
else |
20 |
L1 = *_newTrkL1; // External L1 plus flag=true |
21 |
else |
22 |
L1 = *_newTrkL1; // External L1 plus no external flag |
23 |
else { |
24 |
L1 = (TrkLevel1*) event->GetPointerTo("TrkLevel1"); // Internal L1 |
25 |
TrkLevel0 *L0 = event->GetTrkLevel0(); |
26 |
if (!L0) { |
27 |
cout << "Missing TrkLevel0 event " << endl; |
28 |
return; |
29 |
} |
30 |
L0->ProcessEvent();// re-processing level0->level1 |
31 |
L1 = event->GetTrkLevel1(); |
32 |
L1->Clear(); |
33 |
L1->SetFromLevel1Struct(); |
34 |
} |
35 |
|
36 |
// See if the event has a track before reprocessing |
37 |
TrkLevel2 *trkl2 = event->GetTrkLevel2(); |
38 |
bool hadTrack = false; |
39 |
if (trkl2->GetTrkLevel2()->GetNTracks() > 0) |
40 |
hadTrack = true; |
41 |
|
42 |
// Reprocess |
43 |
_reprocessed++; |
44 |
L1->ProcessEvent();// re-processing level1->level2 |
45 |
|
46 |
trkl2 = event->GetTrkLevel2(); |
47 |
trkl2->Clear(); |
48 |
trkl2->SetFromLevel2Struct(); |
49 |
|
50 |
// See if we gained or lost a track; |
51 |
if (trkl2->GetTrkLevel2()->GetNTracks() > 0) { |
52 |
if (!hadTrack) { |
53 |
_recoveredTracks++; |
54 |
} |
55 |
} |
56 |
else if (hadTrack) { |
57 |
_lostTracks++; |
58 |
} |
59 |
} |
60 |
|