CMS 3D CMS Logo

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::smartSelector ( int  smallestPart = 0)
inline

ctor

Definition at line 14 of file smartSelector.h.

14  :
15  m_smallestPart (smallestPart) {}

Member Function Documentation

◆ accept()

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

actual selector

Definition at line 29 of file smartSelector.h.

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  }

References mps_fire::i, m_smallestPart, and position.

Referenced by esMonitoring.FDJsonServer::handle_accept().

◆ setSmallestPart()

int smartSelector::setSmallestPart ( int  smallestPart)
inline

set the smallest part only if was set to 0

Definition at line 18 of file smartSelector.h.

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

References m_smallestPart.

Member Data Documentation

◆ m_smallestPart

int smartSelector::m_smallestPart
private

Definition at line 47 of file smartSelector.h.

Referenced by accept(), and setSmallestPart().

mps_fire.i
i
Definition: mps_fire.py:428
smartSelector::m_smallestPart
int m_smallestPart
Definition: smartSelector.h:47
position
static int position[264][3]
Definition: ReadPGInfo.cc:289