--- PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.cpp 2010/05/11 15:16:17 1.1.2.1 +++ PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.cpp 2010/05/11 15:32:09 1.1.2.2 @@ -9,10 +9,16 @@ TRandom3* RefitTrackAction::_r3 = new TRandom3(0); long int RefitTrackAction::_currEvent = -1; +TString RefitTrackAction::_currTrkParamsFile = ""; void RefitTrackAction::OnGood(PamLevel2 *event) { - TrkParams::Set("/wizard/02/pamela_software/installed/pamela/calib/trk-param/align_param-080805-GL1from7/", 5); //DA USARE SOLO PER SIMULAZIONE ROTRASL!!! + // Reload the TRK parameters only if they have been changed (ie., if another instance of + // this class used a different set of parameters. + if (_trkParamsFile != _currTrkParamsFile) { + TrkParams::Set(_trkParamsFile, 5); + _currTrkParamsFile = _trkParamsFile; + } TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack(); if (!trkTrack)