CMS 3D CMS Logo

smartSelector Class Reference

#include <Calibration/Tools/interface/smartSelector.h>

List of all members.

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


Detailed Description

Definition at line 13 of file smartSelector.h.


Constructor & Destructor Documentation

smartSelector::smartSelector ( int  smallestPart = 0  )  [inline]

ctor

Definition at line 18 of file smartSelector.h.

00018                                          : 
00019       m_smallestPart (smallestPart) {}


Member Function Documentation

int smartSelector::accept ( int  eventNb,
const int  numberOfFractions 
) const [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       }

int smartSelector::setSmallestPart ( int  smallestPart  )  [inline]

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       }


Member Data Documentation

int smartSelector::m_smallestPart [private]

Definition at line 51 of file smartSelector.h.

Referenced by accept(), and setSmallestPart().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:32:39 2009 for CMSSW by  doxygen 1.5.4