Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
mcdatadaq::NanoSliceOrder Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-05-05/MockDataDAQ/include/NanoSliceOrder.h"

Public Member Functions

 ~NanoSliceOrder ()
 
mask_t calculateOrderingWeight (const daqchannelmap::diblock_t, const daqchannelmap::dcm_id_t, const daqchannelmap::feb_t, const daqchannelmap::pixel_t, const feb_timestamp) const
 
bool print () const
 Printing shifts and masks. More...
 
bool print (const mask_t weight) const
 Print information about the weight. More...
 

Static Public Member Functions

static NanoSliceOrdergetInstance ()
 Method to obtain the class instance. More...
 

Private Member Functions

 NanoSliceOrder ()
 Constructor. More...
 
shift_t calculateShiftFromMask (const mask_t mask) const
 
mask_t getNumberWithShiftsAndMask (const uint32_t number, const shift_t shift, const mask_t mask) const
 Calculate the weight using mask and shift for a given number. More...
 

Private Attributes

shift_t shift_diblock
 Corresponding shifts. More...
 
shift_t shift_dcm
 
shift_t shift_feb
 
shift_t shift_time
 
shift_t shift_pixel
 

Static Private Attributes

static NanoSliceOrderfinstanceID = NULL
 Instance pointer for singleton class. More...
 
static const mask_t mask_diblock = 0x0FF0000000000000ULL
 Internal masks which define the nanoslice order. More...
 
static const mask_t mask_dcm = 0x000F000000000000ULL
 
static const mask_t mask_feb = 0x0000FF0000000000ULL
 
static const mask_t mask_time = 0x000000FFFFFFFF00ULL
 
static const mask_t mask_pixel = 0x00000000000000FFULL
 

Detailed Description

Definition at line 25 of file NanoSliceOrder.h.

Constructor & Destructor Documentation

mcdatadaq::NanoSliceOrder::~NanoSliceOrder ( )

Definition at line 47 of file NanoSliceOrder.cpp.

47 { }
mcdatadaq::NanoSliceOrder::NanoSliceOrder ( )
private

Constructor.

Calculating shifts

Definition at line 34 of file NanoSliceOrder.cpp.

References calculateShiftFromMask(), mask_dcm, mask_diblock, mask_feb, mask_pixel, mask_time, print(), shift_dcm, shift_diblock, shift_feb, shift_pixel, and shift_time.

Referenced by getInstance().

34  {
35 
36  /// Calculating shifts
42 
43  print();
44 }
static const mask_t mask_feb
static const mask_t mask_diblock
Internal masks which define the nanoslice order.
static const mask_t mask_pixel
shift_t shift_diblock
Corresponding shifts.
static const mask_t mask_time
static const mask_t mask_dcm
bool print() const
Printing shifts and masks.
shift_t calculateShiftFromMask(const mask_t mask) const

Member Function Documentation

mask_t mcdatadaq::NanoSliceOrder::calculateOrderingWeight ( const daqchannelmap::diblock_t  diblock,
const daqchannelmap::dcm_id_t  dcm,
const daqchannelmap::feb_t  feb,
const daqchannelmap::pixel_t  pixel,
const feb_timestamp  time 
) const

Calculate the Weight for the given nanoslice position and time Weight is calculated from the appropriate masks

Definition at line 73 of file NanoSliceOrder.cpp.

References BITFIELDSET, mask_dcm, mask_diblock, mask_feb, mask_pixel, mask_time, shift_dcm, shift_diblock, shift_feb, shift_pixel, shift_time, and ana::weight.

Referenced by mcdatadaq::DAQSimulator::getNanoSliceOrder().

78 {
79  mask_t weight = 0;
80 
83  BITFIELDSET(weight, dcm , mask_dcm, shift_dcm);
84  BITFIELDSET(weight, feb , mask_feb, shift_feb);
85  BITFIELDSET(weight, pixel , mask_pixel, shift_pixel);
86 
87  return weight;
88 }
unsigned long long mask_t
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
static const mask_t mask_feb
const Var weight
static const mask_t mask_diblock
Internal masks which define the nanoslice order.
#define BITFIELDSET(block, data, mask, shift)
static const mask_t mask_pixel
shift_t shift_diblock
Corresponding shifts.
static const mask_t mask_time
static const mask_t mask_dcm
shift_t mcdatadaq::NanoSliceOrder::calculateShiftFromMask ( const mask_t  mask) const
private

Calculate shift from a given mask Used in the constructor only

Definition at line 50 of file NanoSliceOrder.cpp.

Referenced by NanoSliceOrder().

50  {
51 
52  mask_t floating_digit = 1;
53 
54  for(shift_t idigit = 0; idigit < 64; idigit++){
55  if(mask & floating_digit) return idigit;
56  floating_digit <<= 1;
57  }// end of loop over digits
58 
59  return 0;
60 }
uint32_t shift_t
unsigned long long mask_t
NanoSliceOrder * mcdatadaq::NanoSliceOrder::getInstance ( )
static

Method to obtain the class instance.

Definition at line 25 of file NanoSliceOrder.cpp.

References finstanceID, and NanoSliceOrder().

Referenced by mcdatadaq::DAQSimulator::getNanoSliceOrder().

25  {
26  if(finstanceID == NULL){ // Check if there is an instance active
27  finstanceID = new NanoSliceOrder(); // If there is not, make a new one
28  }
29  return finstanceID;
30 }
static NanoSliceOrder * finstanceID
Instance pointer for singleton class.
mask_t mcdatadaq::NanoSliceOrder::getNumberWithShiftsAndMask ( const uint32_t  number,
const shift_t  shift,
const mask_t  mask 
) const
private

Calculate the weight using mask and shift for a given number.

Definition at line 63 of file NanoSliceOrder.cpp.

References BITFIELDSET.

65  {
66  mask_t out_number = 0;
67  BITFIELDSET(out_number, number, shift, mask);
68 
69  return out_number;
70 }
unsigned long long mask_t
#define BITFIELDSET(block, data, mask, shift)
bool mcdatadaq::NanoSliceOrder::print ( ) const

Printing shifts and masks.

Definition at line 91 of file NanoSliceOrder.cpp.

References om::cout, shift_dcm, shift_diblock, shift_feb, shift_pixel, and shift_time.

Referenced by NanoSliceOrder().

91  {
92 
93  std::cout<<"shifts "<<shift_diblock;
94  std::cout<<" "<<shift_dcm;
95  std::cout<<" "<<shift_feb;
96  std::cout<<" "<<shift_time;
97  std::cout<<" "<<shift_pixel<<"\n";
98 
99  return true;
100 }
shift_t shift_diblock
Corresponding shifts.
OStream cout
Definition: OStream.cxx:6
bool mcdatadaq::NanoSliceOrder::print ( const mask_t  weight) const

Print information about the weight.

Definition at line 103 of file NanoSliceOrder.cpp.

References BITFIELDGET, om::cout, febshutoff_auto::dcm, geo2elec::diblock, allTimeWatchdog::endl, APDHVSetting::feb, mask_dcm, mask_diblock, mask_feb, mask_pixel, mask_time, shift_dcm, shift_diblock, shift_feb, shift_pixel, and shift_time.

103  {
104 
105 
109  const daqchannelmap::pixel_t pixel = BITFIELDGET(number, mask_pixel , shift_pixel);
111 
112  std::cout<<std::hex<<number<<"x";
113  std::cout<<std::dec;
114  std::cout<<" diblock="<<diblock;
115  std::cout<<" dcm="<<dcm;
116  std::cout<<" feb="<<feb;
117  std::cout<<" pixel="<<pixel;
118  std::cout<<" time="<<time<<std::endl;
119 
120  return true;
121 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
static const mask_t mask_feb
uint32_t pixel_t
Type for physical pixel on APD.
static const mask_t mask_diblock
Internal masks which define the nanoslice order.
#define BITFIELDGET(block, mask, shift)
static const mask_t mask_pixel
uint32_t feb_t
Type for DCM link port. Counts from 0.
shift_t shift_diblock
Corresponding shifts.
static const mask_t mask_time
OStream cout
Definition: OStream.cxx:6
uint32_t dcm_id_t
Type for DCM number, counts from 1.
static const mask_t mask_dcm
uint32_t diblock_t
Type for diblocks and blocks.
uint32_t feb_timestamp

Member Data Documentation

NanoSliceOrder * mcdatadaq::NanoSliceOrder::finstanceID = NULL
staticprivate

Instance pointer for singleton class.

Definition at line 58 of file NanoSliceOrder.h.

Referenced by getInstance().

const mask_t mcdatadaq::NanoSliceOrder::mask_dcm = 0x000F000000000000ULL
staticprivate

Definition at line 63 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

const mask_t mcdatadaq::NanoSliceOrder::mask_diblock = 0x0FF0000000000000ULL
staticprivate

Internal masks which define the nanoslice order.

Definition at line 62 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

const mask_t mcdatadaq::NanoSliceOrder::mask_feb = 0x0000FF0000000000ULL
staticprivate

Definition at line 64 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

const mask_t mcdatadaq::NanoSliceOrder::mask_pixel = 0x00000000000000FFULL
staticprivate

Definition at line 66 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

const mask_t mcdatadaq::NanoSliceOrder::mask_time = 0x000000FFFFFFFF00ULL
staticprivate

Definition at line 65 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

shift_t mcdatadaq::NanoSliceOrder::shift_dcm
private

Definition at line 70 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

shift_t mcdatadaq::NanoSliceOrder::shift_diblock
private

Corresponding shifts.

Definition at line 69 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

shift_t mcdatadaq::NanoSliceOrder::shift_feb
private

Definition at line 71 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

shift_t mcdatadaq::NanoSliceOrder::shift_pixel
private

Definition at line 73 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().

shift_t mcdatadaq::NanoSliceOrder::shift_time
private

Definition at line 72 of file NanoSliceOrder.h.

Referenced by calculateOrderingWeight(), NanoSliceOrder(), and print().


The documentation for this class was generated from the following files: