PamCut: TrkCuts/RigFillCut/RigFillCut.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# TrkCuts/RigFillCut/RigFillCut.cpp

Go to the documentation of this file.

    00001 /*
    00002  * RigFillCut.cpp
    00003  *
    00004  *  Created on: 27-mar-2009
    00005  *      Author: Nicola Mori, S. Ricciarini
    00006  */
    00007
    00010 #include "RigFillCut.h"
    00011
    00012 int RigFillCut::Check(PamLevel2 *event) {
    00013
    00014   float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL();
    00015
    00016   if (rigThreshold > _binning[_binning.size() - 1] || rigThreshold < _binning[0]) {
    00017     return THRESHRIGOUT;
    00018   }
    00019
    00020   float rig = event->GetTrack(0)->GetTrkTrack()->GetRigidity();
    00021
    00022   if (rig > _binning[_binning.size() - 1] || rig < _binning[0]) {
    00023     return RIGOUT;
    00024   }
    00025
    00026   return CUTOK;
    00027 }
    00028
    00029 void RigFillCut::OnGood(PamLevel2 *event) {
    00030
    00031   float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL();
    00032   float rig = event->GetTrack(0)->GetTrkTrack()->GetRigidity();
    00033
    00034   //Bin identification: value must be less than (<) bin maximum
    00035
    00036   int i = 1;
    00037   while (rig >= _binning[i]) {
    00038     i++;
    00039   }
    00040   i--;
    00041
    00042 //  cout << _binning[i] << " < " <<  rig  << " < " << _binning[i+1] << endl;
    00043
    00044   int j = 1;
    00045   while (rigThreshold >= _binning[j]) {
    00046     j++;
    00047   }
    00048   j--;
    00049
    00050 //  cout << _binning[j] << " < " <<  rigCutoff  << " < " << _binning[j+1] << endl;
    00051 //  cout << endl;
    00052
    00053   _histogram[i][j]++;
    00054 }