NanoSliceOrder.h
Go to the documentation of this file.
1 /*
2  * File: NanoSliceOrder.h
3  * Author: denis
4  *
5  * This class calculates the relative weight for NanoSlice to produce nanoslice order
6  * given the position of the pixel (diblock, dcm, dcmLink, pixel) and its time.
7  * The less weight, the earlier the order is assigned for the nanoslice.
8  *
9  * Created on February 13, 2012, 4:04 PM
10  */
11 
12 #ifndef _NANOSLICEORDER_H
13 #define _NANOSLICEORDER_H
14 #include "DAQChannelMap/DAQChannelMapConstants.h"
15 #include <stdint.h>
16 
17 // using unsigned long long rather than uint64_t to ensure consistent behavior on OSX and LINUX
18 typedef uint32_t shift_t;
19 typedef unsigned long long mask_t;
20 typedef uint32_t feb_timestamp;
21 
22 namespace mcdatadaq {
23 
24 
26  public:
27  static NanoSliceOrder* getInstance(); //!< Method to obtain the class instance
29 
30  /// Calculate the Weight for the given nanoslice position and time
31  /// Weight is calculated from the appropriate masks
36  const feb_timestamp) const;
37  /// Printing shifts and masks
38  bool print() const;
39 
40  /// Print information about the weight
41  bool print(const mask_t weight) const;
42 
43  private:
44 
45  NanoSliceOrder(); ///< Constructor
46 
47  /// Calculate shift from a given mask
48  /// Used in the constructor only
50 
51  /// Calculate the weight using mask and shift for a given number
52  mask_t getNumberWithShiftsAndMask(const uint32_t number,
53  const shift_t shift,
54  const mask_t mask) const;
55 
56  private:
57 
58  static NanoSliceOrder* finstanceID; //!< Instance pointer for singleton class
59 
60 
61  /// Internal masks which define the nanoslice order
62  static const mask_t mask_diblock = 0x0FF0000000000000ULL;
63  static const mask_t mask_dcm = 0x000F000000000000ULL;
64  static const mask_t mask_feb = 0x0000FF0000000000ULL;
65  static const mask_t mask_time = 0x000000FFFFFFFF00ULL;
66  static const mask_t mask_pixel = 0x00000000000000FFULL;
67 
68  /// Corresponding shifts
74  };// end of NanoSliceOrder class
75 }// end of mcdatadaq namespace
76 
77 #endif /* _NANOSLICEORDER_H */
78 
uint32_t shift_t
unsigned long long mask_t
static NanoSliceOrder * finstanceID
Instance pointer for singleton class.
static const mask_t mask_feb
const Var weight
uint32_t pixel_t
Type for physical pixel on APD.
static NanoSliceOrder * getInstance()
Method to obtain the class instance.
static const mask_t mask_diblock
Internal masks which define the nanoslice order.
Something conflicts with RandomNumberGenerator. Keep DAQSimulator.h include below Art Framework inclu...
static const mask_t mask_pixel
uint32_t feb_t
Type for DCM link port. Counts from 0.
mask_t calculateOrderingWeight(const daqchannelmap::diblock_t, const daqchannelmap::dcm_id_t, const daqchannelmap::feb_t, const daqchannelmap::pixel_t, const feb_timestamp) const
shift_t shift_diblock
Corresponding shifts.
static const mask_t mask_time
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.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
static const mask_t mask_dcm
bool print() const
Printing shifts and masks.
uint32_t diblock_t
Type for diblocks and blocks.
shift_t calculateShiftFromMask(const mask_t mask) const
uint32_t feb_timestamp