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

Diff of /PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.2 by pam-fi, Tue May 11 15:32:09 2010 UTC revision 1.1.2.3 by pam-fi, Thu Jun 3 14:14:15 2010 UTC
# Line 13  TString RefitTrackAction::_currTrkParams Line 13  TString RefitTrackAction::_currTrkParams
13    
14  void RefitTrackAction::OnGood(PamLevel2 *event) {  void RefitTrackAction::OnGood(PamLevel2 *event) {
15    
16      // Do something only if at least one track exists
17      if (event->GetTrkLevel2()->GetNTracks() == 0)
18        return;
19    
20    // Reload the TRK parameters only if they have been changed (ie., if another instance of    // Reload the TRK parameters only if they have been changed (ie., if another instance of
21    // this class used a different set of parameters.    // this class used a different set of parameters).
22    if (_trkParamsFile != _currTrkParamsFile) {    if (_trkParamsFile != _currTrkParamsFile) {
23      TrkParams::Set(_trkParamsFile, 5);      TrkParams::Set(_trkParamsFile, 5);
24      _currTrkParamsFile = _trkParamsFile;      _currTrkParamsFile = _trkParamsFile;
25    }    }
26    
27      if (_sortingMethod)
28        event->SetSortingMethod(_sortingMethod);
29    TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack();    TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack();
30    if (!trkTrack)    if (!trkTrack)
31      return;      return;
# Line 88  void RefitTrackAction::OnGood(PamLevel2 Line 94  void RefitTrackAction::OnGood(PamLevel2
94    trkTrack->FitReset();    trkTrack->FitReset();
95    int fail = 0;    int fail = 0;
96    trkTrack->Fit(0, fail, 0);    trkTrack->Fit(0, fail, 0);
97    
98      if (fail) {
99        // Set a flag for the badly-refitted tracks: chi2 < 0
100        if (trkTrack->chi2 >= 0.)
101          trkTrack->chi2 = -1.;
102      }
103  }  }

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

  ViewVC Help
Powered by ViewVC 1.1.23