/[PAMELA software]/PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.h
ViewVC logotype

Annotation of /PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.4 - (hide annotations) (download)
Mon Jun 7 13:33:15 2010 UTC (14 years, 6 months ago) by pam-fi
Branch: V8
Changes since 1.1.2.3: +11 -5 lines
File MIME type: text/plain
Bug fixed in handling the original parameters of the track.

1 pam-fi 1.1.2.1 /*
2     * RefitTrackAction.h
3     *
4     * Created on: 10/may/2010
5     * Author: N. Mori
6     */
7    
8     #ifndef REFITTRACKACTION_H_
9     #define REFITTRACKACTION_H_
10    
11     #include "../CollectionAction/CollectionAction.h"
12     #include <TRandom3.h>
13    
14     /*! @brief Track refitting.
15     *
16     * This action refits the TRK track using only level 2 data. This means that it will use the same
17     * clusters which are associated to the track, with the possibility to mask or shift some of them.
18 pam-fi 1.1.2.3 * If a refit fails the event will not be discarded (since this is not a cut) but chi2 will be negative,
19     * and the event will be subsequently discarded by an eventual TrkPhSinCut.
20     * This action can be used also before TrkPhSinCut, since it checks for the existence of at least
21     * one track before refitting. The refitted track is always the first "physical" track; the ordering
22 pam-fi 1.1.2.4 * criterion can be set using #SetSortingMethod(). If, instead, this action is placed after a TrkPhsinCut
23 pam-fi 1.1.2.3 * it is not necessary to set this parameter, since the value used for TrkPhSinCut will be automatically
24     * used (of course, it can be used as well if a different ordering may be needed).
25 pam-fi 1.1.2.4 * Before fitting, the track parameters (measured impact positions and "good" flags) are reset to the
26     * original values. This means that if two or more RefitTrackAction objects are used, each of them will
27     * try to refit the original track of the current event (applying its own mask and spreads), regardless of
28     * what was obtained with previous refits.
29 pam-fi 1.1.2.1 * For a complete reprocess and fit use #ReprocessTrackAction.
30     */
31     class RefitTrackAction: public CollectionAction {
32     public:
33    
34     /*! @brief Constructor
35     *
36     * @param actionName The action's name.
37     * @param spreadX The width of the gaussian spread applied to all the X view coordinates, in cm.
38     * @param spreadY The width of the gaussian spread applied to all the Y view coordinates, in cm.
39     * @param maskedViews The excluded views. 0 means that all the views will be used, while #T6X means that the
40     * X view of the last tracker plane will be ignored. For other combinations, sum up the values
41     * defined in #TRKLAYERS: T1X + T1Y will exclude the whole first plane, for example.
42 pam-fi 1.1.2.2 * @param trkParamsFile The file containing the tracker parameters to be used. Default value corresponds to the standard
43     * parameters used for data reduction.
44 pam-fi 1.1.2.1 */
45 pam-fi 1.1.2.4 RefitTrackAction(const char *actionName, float spreadX = 0., float spreadY = 0., int maskedViews = 0,
46 pam-fi 1.1.2.3 TString trkParamsFile = "") :
47     CollectionAction(actionName), _spreadX(spreadX), _spreadY(spreadY), _maskedViews(maskedViews), _trkParamsFile(
48     trkParamsFile), _sortingMethod(NULL) {
49 pam-fi 1.1.2.1
50     }
51    
52     /*! @brief Destructor. */
53     ~RefitTrackAction() {
54     }
55    
56     /* @brief The refitting procedure.
57     *
58     * This will refit the tracker track introducing the mask and spreads defined in the constructor.
59 pam-fi 1.1.2.4 *
60     * @param event The event to analyze.
61 pam-fi 1.1.2.1 */
62     void OnGood(PamLevel2 *event);
63    
64     /*! @brief The finalization procedure. */
65     void Finalize() {
66    
67     }
68    
69 pam-fi 1.1.2.4 /*! @brief Sets the track sorting criterion.
70 pam-fi 1.1.2.3 *
71     * The action refits the first track, which is the one obtained with PamLevel2::GetTrack(0). This method can
72     * be used to set the sorting criterion used to determine which track is the first.
73     *
74     * @param sortingMethod The sorting method. Format has to be compatible with the argument of PamLevel2::SetSortingMethod.
75     */
76     void SetSortingMethod(const char *sortingMethod) {
77     _sortingMethod = sortingMethod;
78     }
79    
80 pam-fi 1.1.2.1 private:
81    
82     float _spreadX, _spreadY;
83     int _maskedViews;
84    
85     static TRandom3 *_r3;
86     static long int _currEvent;
87    
88 pam-fi 1.1.2.4 static float _xmBackup[], _ymBackup[];
89     static int _layerXBackup[], _layerYBackup[];
90 pam-fi 1.1.2.2
91     TString _trkParamsFile;
92     static TString _currTrkParamsFile;
93 pam-fi 1.1.2.3
94     const char *_sortingMethod;
95 pam-fi 1.1.2.1 };
96    
97     #endif /* REFITTRACKACTION_H_ */

  ViewVC Help
Powered by ViewVC 1.1.23