#include <Calibration/Tools/interface/smartSelector.h>
Public Member Functions | |
int | accept (int eventNb, const int numberOfFractions) const |
actual selector | |
int | setSmallestPart (int smallestPart) |
set the smallest part only if was set to 0 | |
smartSelector (int smallestPart=0) | |
ctor | |
Private Attributes | |
int | m_smallestPart |
Definition at line 13 of file smartSelector.h.
smartSelector::smartSelector | ( | int | smallestPart = 0 |
) | [inline] |
actual selector
Definition at line 33 of file smartSelector.h.
References i, m_smallestPart, and sum().
00034 { 00035 if (!m_smallestPart) return 1 ; 00036 if (m_smallestPart == numberOfFractions) return 1 ; 00037 int position = eventNb % m_smallestPart ; 00038 int sum = 0 ; 00039 for (int i=1 ; i<numberOfFractions ; i *= 2) sum += i ; 00040 // std::cout << "debug f_" << numberOfFractions 00041 // << " " << sum 00042 // << " " << sum+numberOfFractions << "\n" ; 00043 if (position >= sum && 00044 position < sum + numberOfFractions) 00045 return 1 ; 00046 return 0 ; 00047 }
set the smallest part only if was set to 0
Definition at line 22 of file smartSelector.h.
References m_smallestPart.
00023 { 00024 if (!m_smallestPart) 00025 { 00026 m_smallestPart = smallestPart ; 00027 return 0 ; 00028 } 00029 else return 1 ; 00030 }
int smartSelector::m_smallestPart [private] |