--- PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.cpp 2010/06/03 14:14:15 1.1.2.3 +++ PamCut/CollectionActions/RefitTrackAction/RefitTrackAction.cpp 2010/06/07 14:30:20 1.1.2.6 @@ -11,6 +11,9 @@ long int RefitTrackAction::_currEvent = -1; TString RefitTrackAction::_currTrkParamsFile = ""; +float RefitTrackAction::_xmBackup[6], RefitTrackAction::_ymBackup[6]; +int RefitTrackAction::_layerXBackup[6], RefitTrackAction::_layerYBackup[6]; + void RefitTrackAction::OnGood(PamLevel2 *event) { // Do something only if at least one track exists @@ -30,6 +33,14 @@ if (!trkTrack) return; + // Check if good clusters have meaningful energy releases + for (UInt_t ip = 0; ip < 6; ip++) { + if (trkTrack->XGood(ip) == 1 && trkTrack->GetDEDX(ip, 0) <= 0.) + trkTrack->xgood[ip] = 0; // Set it to bad + if (trkTrack->YGood(ip) == 1 && trkTrack->GetDEDX(ip, 1) <= 0.) + trkTrack->ygood[ip] = 0; // Set it to bad + } + if (_currEvent != event->GetReadEntry()) { // Saves the original track data if the current event (recorded in the static member _currEvent) is // different from the actually processed event. This way, multiple instances of the class @@ -56,6 +67,7 @@ } // Apply the gaussian spread + for (Int_t ip = 0; ip < 6; ip++) { // gaussian distributed random number Gauss(mean,sigma) (in cm) trkTrack->xm[ip] += _r3->Gaus(0., _spreadX);