1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* ReprocessTrackAction.h |
3 |
|
|
* |
4 |
|
|
* Created on: 23/dic/2009 |
5 |
|
|
* Author: N. Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#ifndef REPROCESSTRACKACTION_H_ |
9 |
|
|
#define REPROCESSTRACKACTION_H_ |
10 |
|
|
|
11 |
|
|
#include "../CollectionAction/CollectionAction.h" |
12 |
|
|
|
13 |
|
|
/*! @brief Level 1 reprocessing |
14 |
|
|
* |
15 |
|
|
* This action reprocesses the level 1 to obtain a new level 2. The level 1 can be recomputed |
16 |
|
|
* from level 0 or provided externally. Remember that the standard PamLevel2::GetPamTree needs to |
17 |
|
|
* be instructed explicitly to open level 0 informations for tracker, by appending "+TRK0" to its 3rd |
18 |
|
|
* parameter. Make sure that the PamLevel2 object you will use with this action (or generally, with every |
19 |
|
|
* code that needs level 0) has been correctly initialized. |
20 |
|
|
*/ |
21 |
|
|
class ReprocessTrackAction: public CollectionAction { |
22 |
|
|
public: |
23 |
|
|
|
24 |
|
|
/*! @brief Constructor |
25 |
|
|
* |
26 |
|
|
* @param actionName The action's name. |
27 |
|
|
* @param newTrkL1 level1 computed outside the action. If NULL, the action will compute the level 1 |
28 |
|
|
* starting from level 0. |
29 |
|
|
* @param externalFlag This can be used to control externally if the event has to be |
30 |
|
|
* reprocessed or not. If NULL, all the events will be reprocessed. If it |
31 |
|
|
* points to a bool variable, an event will be reprocessed only if this variable |
32 |
|
|
* is true. |
33 |
pam-fi |
1.2 |
* @param reprocL2 If false, only the level 1 will be recomputed (if newTrkL1 is NULL, otherwise nothing is done). |
34 |
pam-fi |
1.1 |
*/ |
35 |
pam-fi |
1.2 |
ReprocessTrackAction(const char *actionName, TrkLevel1 **newTrkL1 = NULL, bool *externalFlag = NULL, bool reprocL2 = true) : |
36 |
pam-fi |
1.3 |
CollectionAction(actionName), _newTrkL1(newTrkL1), _externalFlag(externalFlag), _reprocL2 (reprocL2), _allEvents(0), _reprocessed(0), |
37 |
pam-fi |
1.1 |
_lostTracks(0), _recoveredTracks(0) { |
38 |
|
|
|
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
/*! @brief Destructor. */ |
42 |
|
|
~ReprocessTrackAction() { |
43 |
|
|
//delete _newTrkL1; // This causes a double delete (I suppose...) |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
/* @brief The reprocessing procedure. |
47 |
|
|
* |
48 |
|
|
* This will reprocess tracker information, depending on the flags set in constructor's parameter list. |
49 |
|
|
*/ |
50 |
|
|
void OnGood(PamLevel2 *event); |
51 |
|
|
|
52 |
|
|
/*! @brief The finalization procedure. |
53 |
|
|
* |
54 |
|
|
* Produces a screen output of the refitting statistics (reprocessed events, recovered tracks and so on). |
55 |
|
|
*/ |
56 |
|
|
void Finalize() { |
57 |
|
|
cout << "\n----> Reprocessing stats:\n"; |
58 |
|
|
cout << " events : " << _allEvents << "\n"; |
59 |
|
|
cout << " reprocessed: " << _reprocessed << "\n"; |
60 |
|
|
cout << " Tracks:\n"; |
61 |
|
|
cout << " lost : " << _lostTracks << "\n"; |
62 |
|
|
cout << " recovered : " << _recoveredTracks << endl; |
63 |
|
|
|
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
private: |
67 |
|
|
|
68 |
|
|
TrkLevel1 **_newTrkL1; |
69 |
|
|
bool *_externalFlag; |
70 |
pam-fi |
1.2 |
bool _reprocL2; |
71 |
pam-fi |
1.1 |
unsigned int _allEvents, _reprocessed, _lostTracks, _recoveredTracks; |
72 |
|
|
|
73 |
|
|
}; |
74 |
|
|
|
75 |
|
|
#endif /* REPROCESSTRACKACTION_H_ */ |