NDOSDAQChannelMap.cpp
Go to the documentation of this file.
1 #include "DAQChannelMap/NDOSDAQChannelMap.h"
2 #include "DAQChannelMap/DAQChannelMapOLD.h"
3 #include "DAQChannelMap/BitFields.h"
4 #include "DAQChannelMap/boundscheck.h"
5 #include "NovaDAQConventions/DAQConventions.h"
6 #include <stdio.h>
7 #include <iostream>
8 using namespace daqchannelmap;
9 
11 {
12  static DAQChannelMapOLD *oldmap = 0;
13  if (oldmap==0) oldmap = DAQChannelMapOLD::getInstance();
14  return oldmap;
15 }
16 
17 //......................................................................
18 
20 
21 //......................................................................
22 
24 
25 //......................................................................
26 
28 {
29  return gsOldDCMap()->encodeDChan(logicalchan);
30 }
31 
32 //......................................................................
33 
35 {
36  return gsOldDCMap()->encodeLChan(daqchan);
37 }
38 
39 //......................................................................
40 
42 {
43  return gsOldDCMap()->getBlockOffline(logicalchan);
44 }
45 
46 //......................................................................
47 
49 {
50  return gsOldDCMap()->getView(daqchan);
51 }
52 
53 //......................................................................
54 
56 {
57  return pixeltofiber[pixel];
58 }
59 
60 //......................................................................
61 
63 {
64  return fibertopixel[fiber];
65 }
66 
67 //......................................................................
68 
70 {
71  return gsOldDCMap()->getLocalPlaneInBlockOffline(logicalchan);
72 }
73 
74 //......................................................................
75 
76 unsigned int NDOSDAQChannelMap::computeModule(lchan logicalchan) const
77 {
78  cell_t cell = getCell(logicalchan);
79  return cell/32;
80 }
81 
82 //......................................................................
83 
85 {
86  pixel_t pixel = gsOldDCMap()->getPixel(daqchan);
87  return PixelToFiber(pixel);
88 }
89 
90 //......................................................................
91 
93 {
95 }
96 
97 //......................................................................
98 
100 {
102 }
103 
104 //......................................................................
105 
107 {
108  return gsOldDCMap()->getDiBlockType(d);
109 }
110 
111 ////////////////////////////////////////////////////////////////////////
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
unsigned int computeModule(lchan logicalchan) const
Which module in this lchan in?
DiBlock_TYPE getDiBlockType(dchan chan) const
What format is the diblock? Only relevant in NDOS.
block_t computeBlock(lchan logicalchan) const
Which block is this lchan in?
plane_t computePlaneInBlock(lchan logicalchan) const
Which global plane in this lchan in?
uint32_t pixel_t
Type for physical pixel on APD.
const unsigned int pixeltofiber[]
static DAQChannelMapOLD * getInstance()
Method to obtain the class instance.
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
uint32_t getNumberOfDCM(int detId, DiBlock_TYPE) const
Total number of DCMs in the diblock given detectorID and Diblock type.
const unsigned int fibertopixel[]
unsigned int getTotalNumberOfDiblocks() const
How many diblocks does the detector have?
lchan encodeLChan(dchan daqchan) const
Convert a DAQ channel ID to a logical channel id.
dchan encodeDChan(lchan logicalchan)
dchan encodeDChan(lchan logicalchan) const
Convert a logical channel ID to a DAQ channel id.
Prototype Near Detector on the surface at FNAL.
DetView_TYPE getView(dchan daqchan) const
Which view (X or Y) does this daq channel readout?
fiber_t computeFiberInModule(dchan daqchan) const
Which fiber does this dchan readout?
offline_plane_t getLocalPlaneInBlockOffline(lchan logicalchan) const
Returns the Plane relative to the start of the current block – Verified.
Float_t d
Definition: plot.C:236
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
static DAQChannelMapOLD * gsOldDCMap()
uint32_t getTotalNumberOfDiblocks(int detId) const
Total number of diblocks for a given detector.
uint32_t plane_t
Type for plane.
unsigned int getNumberOfDCM(DiBlock_TYPE dbt) const
How many DCMs does this diblock have?
DetView_TYPE
Types of Detector View.
block_t getBlockOffline(lchan logicalchan) const
Returns the Block that the offline channel is on – Verified.
DiBlock_TYPE
Types of Diblock.
uint32_t dchan
< DAQ Channel Map Package
DetView_TYPE getView(dchan daqchan) const
Returns the View (X or Y) from the universal daq channel number.
pixel_t FiberToPixel(fiber_t fiber) const
fiber_t PixelToFiber(pixel_t pixel) const