test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
smartSelector Class Reference

#include <smartSelector.h>

Public Member Functions

int accept (int eventNb, const int numberOfFractions) const
 actual selector More...
 
int setSmallestPart (int smallestPart)
 set the smallest part only if was set to 0 More...
 
 smartSelector (int smallestPart=0)
 ctor More...
 

Private Attributes

int m_smallestPart
 

Detailed Description

Definition at line 9 of file smartSelector.h.

Constructor & Destructor Documentation

smartSelector::smartSelector ( int  smallestPart = 0)
inline

ctor

Definition at line 14 of file smartSelector.h.

14  :
15  m_smallestPart (smallestPart) {}

Member Function Documentation

int smartSelector::accept ( int  eventNb,
const int  numberOfFractions 
) const
inline

actual selector

Definition at line 29 of file smartSelector.h.

References i, m_smallestPart, and position.

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

30  {
31  if (!m_smallestPart) return 1 ;
32  if (m_smallestPart == numberOfFractions) return 1 ;
33  int position = eventNb % m_smallestPart ;
34  int sum = 0 ;
35  for (int i=1 ; i<numberOfFractions ; i *= 2) sum += i ;
36 // std::cout << "debug f_" << numberOfFractions
37 // << " " << sum
38 // << " " << sum+numberOfFractions << "\n" ;
39  if (position >= sum &&
40  position < sum + numberOfFractions)
41  return 1 ;
42  return 0 ;
43  }
int i
Definition: DBlmapReader.cc:9
static int position[264][3]
Definition: ReadPGInfo.cc:509
int smartSelector::setSmallestPart ( int  smallestPart)
inline

set the smallest part only if was set to 0

Definition at line 18 of file smartSelector.h.

References m_smallestPart.

19  {
20  if (!m_smallestPart)
21  {
22  m_smallestPart = smallestPart ;
23  return 0 ;
24  }
25  else return 1 ;
26  }

Member Data Documentation

int smartSelector::m_smallestPart
private

Definition at line 47 of file smartSelector.h.

Referenced by accept(), and setSmallestPart().