Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
daqchannelmap::DAQChannelMapOLD Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DAQChannelMap/cxx/include/DAQChannelMapOLD.h"

Inheritance diagram for daqchannelmap::DAQChannelMapOLD:
daqchannelmap::DAQChannelMapBaseOLD

Public Member Functions

 ~DAQChannelMapOLD ()
 Default Destructor. More...
 
dchan encodeDChan (lchan logicalchan)
 
dchan encodeDChan (const int detector, const offline_plane_t plane_0, const offline_cell_t cell_0) const
 
lchan encodeLChan (dchan daqchan)
 
dchan encodeDChan (int detId, diblock_t, dcm_id_t, dcm_link_t, pixel_t) const
 Encoding Routine to correctly pack the DAQ specific channel parameters into a single 32bit identifier. More...
 
lchan encodeLChan (int detId, offline_plane_t, offline_cell_t) const
 Encoding Routine to correctly pack the Offline specific channel parameters into a single 32bit identifier. More...
 
dchan l2d (offline_plane_t, offline_cell_t, int detId)
 Convience Methods for accessing DAQ parameters from the logical space. More...
 
int getDetector (dchan daqchan) const
 Decodes detector identity from universal channel number. More...
 
diblock_t getDiBlock (dchan daqchan) const
 Decodes Diblock number from universal daq channel number. More...
 
dcm_id_t getDCM (dchan daqchan) const
 Decodes DCM position on the diblock from universal daq channel number. More...
 
dcm_link_t getDCMLink (dchan daqchan) const
 Decodes Link Port on the DCM from the universal daq channel number. More...
 
pixel_t getPixel (dchan daqchan) const
 Decodes APD pixel number from the universal daq channel number. More...
 
DetView_TYPE getView (dchan daqchan) const
 Returns the View (X or Y) from the universal daq channel number. More...
 
offline_cell_t getCell (dchan daqchan) const
 Returns the cell position, as referenced relative to the full detector, of the daq channel. More...
 
offline_cell_t getCell (const int detector_id, const diblock_t diblock_number, const dcm_id_t dcm_id, const dcm_link_t dcm_link_id, const apd_pixel_t apd_pixel_id) const
 
offline_plane_t getPlane (dchan daqchan)
 Returns the plane position, as referenced relative to the full detector, of the daq channel. More...
 
offline_plane_t getPlane (const int detector_id, const diblock_t diblock_id, const dcm_id_t dcm_id, const dcm_link_t dcm_link_id)
 Returns the Plane in coordinates relative to the dcm (i.e. 0-31) More...
 
uint32_t getLocalModuleInDCM (const int detector_id, dcm_id_t, dcm_link_t, const DiBlock_TYPE) const
 Returns the module number (0 or 1) to which a given module belongs. More...
 
DiBlock_TYPE getDiBlockType (dchan daqchan) const
 Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified. More...
 
DiBlock_TYPE getDiBlockTypeOffline (lchan logicalchan) const
 Returns the DiBlock type (i.e. AB, BA, AA) of the offline channel – Verified. More...
 
DetBlock_TYPE getBlockType (lchan logicalchan) const
 Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified. More...
 
DetBlock_TYPE getBlockType (block_t, int detId) const
 Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified. More...
 
int getDetectorOffline (lchan logicalchan) const
 Returns the detector that the offline channel belongs to – Verified. More...
 
offline_plane_t getPlaneOffline (lchan logicalchan) const
 Returns the plane (detector wide) that the offline channel belongs to – Verified. More...
 
offline_cell_t getCellOffline (lchan logicalchan) const
 Returns the cell the cell on the current plane that the offline channel belongs to – Verified. More...
 
block_t getBlockOffline (lchan logicalchan) const
 Returns the Block that the offline channel is on – Verified. More...
 
diblock_t getDiBlockOffline (lchan logicalchan) const
 Returns the DiBlock that the offline channel is on – Verified. More...
 
uint32_t getLocalBlockInDiblockOffline (lchan logicalchan) const
 If it's the upstream block in the diblock, then it's 0, if not, it's 1. More...
 
DetView_TYPE getViewOffline (lchan logicalchan) const
 Returns the Plane type that the offline channel is on. More...
 
DetPlane_TYPE getPlaneTypeOffline (lchan logicalchan) const
 Returns the View that the offline channel is on. More...
 
DetPlane_TYPE getPlaneType (int detId, dcm_id_t, DiBlock_TYPE) const
 
DetPlane_TYPE getPlaneType (int detId, dcm_id_t, DiBlock_TYPE, uint32_t &number_of_x_dcm) const
 
offline_plane_t getLocalPlaneInDiblockOffline (lchan logicalchan) const
 Returns the Plane relative to the start of the current diblock – Verified. More...
 
offline_plane_t getLocalPlaneInBlockOffline (lchan logicalchan) const
 Returns the Plane relative to the start of the current block – Verified. More...
 
offline_plane_t getLocalPlaneInDiblockViewOffline (lchan logicalchan) const
 Returns the Plane number relative to the current view and diblock – Verified. More...
 
offline_plane_t getLocalPlaneInDiblockView (const int detector, dcm_link_t, const DiBlock_TYPE) const
 Returns the Plane number relative to the current view and diblock – Verified. More...
 
offline_plane_t getLocalPlaneInDiblockView (const int detector, const offline_plane_t plane_0) const
 
offline_plane_t getLocalPlaneInDiblockView (const int detector, const offline_plane_t plane_0, const block_t block_number) const
 
offline_plane_t getLocalPlaneInDiblockView (const int detector, const offline_plane_t plane_0, const block_t block_number, const DetPlane_TYPE plane_type) const
 
offline_plane_t getPlaneViewOffline (lchan logicalchan)
 Returns the Plane number relative to the current view – Verified. More...
 
dcm_id_t getDCMOffline (lchan logicalchan) const
 
dcm_id_t getDCM (const int detector, const offline_plane_t plane_offline_0, const offline_cell_t cell_offline_0) const
 
dcm_id_t getDCM (const int detector, const DetPlane_TYPE plane_type, const DiBlock_TYPE diblock_type, const online_cell_t online_cell_0) const
 
uint32_t getLocalModuleInDCMOffline (lchan) const
 Returns the module number (0 or 1) to which a given module belongs. More...
 
uint32_t getLocalModuleInDCMOffline (online_cell_t, DiBlock_TYPE) const
 
uint32_t getCellDCMLocalOffline (lchan logicalchan) const
 
pixel_t getPixelOffline (lchan logicalchan) const
 
pixel_t getPixel (const int detector, const offline_plane_t plane_0, const offline_cell_t cell_0) const
 
pixel_t getPixel (const online_cell_t online_cell_0, const DiBlock_TYPE diblock_type) const
 
dcm_link_t getDCMLinkOffline (lchan logicalchan) const
 
dcm_link_t getDCMLink (const int detector, const offline_plane_t plane_0, const offline_cell_t cell_0) const
 
dcm_link_t getDCMLink (const int detector, const offline_plane_t plane_0, const online_cell_t online_cell_0, const DiBlock_TYPE diblock_type, const block_t block_number, const DetPlane_TYPE plane_type) const
 
bool print (dchan daqchan)
 
bool printOffline (lchan logicalchan)
 Print Information about the Offline logical Channel. More...
 
bool print () const
 Print all detectors info. More...
 
bool print (const int detId, const offline_plane_t) const
 
pixel_t APDPixel2Pixel (apd_pixel_t) const
 Pixel number from APDPixel. More...
 
apd_pixel_t pixel2APDPixel (pixel_t) const
 APDPixel number from Pixel. More...
 
DiBlock_TYPE getDiBlockType (int detId, diblock_t) const
 Diblock type given detectorID and diblock number. More...
 
uint32_t getNumberOfPlanesInBlock (int detId, block_t) const
 Number of planes in the block given detectorID and block number. More...
 
uint32_t getNumberOfPlanesInBlock (DetBlock_TYPE) const
 Number of planes in the block given block type. More...
 
uint32_t getNumberOfPlanesInDiblock (int detId, diblock_t) const
 Number of planes in the diblock given detectorID and diblock number. More...
 
uint32_t getNumberOfPlanesInDiblock (DiBlock_TYPE) const
 Number of planes in the diblock given diblock type. More...
 
uint32_t getNumberOfPlanesBeforeBlock (int detId, block_t) const
 Number of planes before block or diblock. More...
 
uint32_t getNumberOfPlanesBeforeDiblock (int detId, diblock_t) const
 
uint32_t getNumberOfPlaneTypeInBlock (DetBlock_TYPE, DetPlane_TYPE) const
 Number of planes (X or Y) in the block given block type and type of plane(X or Y) More...
 
uint32_t getNumberOfPlaneTypeInDiblock (DiBlock_TYPE, DetPlane_TYPE) const
 Number of planes (X or Y) in the diblock given diblock type and type of plane(X or Y) More...
 
DetBlock_TYPE getBlockType (DiBlock_TYPE, uint32_t local_block_number_in_diblock) const
 Block type given diblock type an local block in diblock. More...
 
DetPlane_TYPE getStartPlaneTypeInBlock (DetBlock_TYPE) const
 Starting plane in the block given its type. More...
 
DetPlane_TYPE getPlaneType (const int detId, const offline_plane_t) const
 get Plane type More...
 
int getDetectorIDMinimum () const
 Get minimum detector ID. More...
 
int getDetectorIDMaximum () const
 Get maximum detector ID. More...
 
uint32_t getBlockNumber (int detId, offline_plane_t) const
 The block number given the detectorID and offline plane number. More...
 
uint32_t getDiblockNumber (int detId, offline_plane_t) const
 The diblock number given the detectorID and offline plane number. More...
 
uint32_t getDiblockNumber (const block_t) const
 
uint32_t getLocalBlockInDiblock (const block_t) const
 
offline_plane_t getLocalPlaneInBlock (int detId, offline_plane_t) const
 Local plane in block number given the detectorID and offline plane number. More...
 
offline_plane_t getLocalPlaneInDiblock (int detId, offline_plane_t) const
 Local plane in diblock number given the detectorID and offline plane number. More...
 
DetView_TYPE getOtherView (DetView_TYPE) const
 opposite plane view from the input. For instance Y = getOtherView(X) More...
 
DetPlane_TYPE getOtherPlaneType (DetPlane_TYPE) const
 opposite plane view from the input. For instance Y = getOtherView(X) More...
 
DetView_TYPE detPlaneToDetView (DetPlane_TYPE) const
 Conversion from DetPlane_TYPE to DetView_TYPE. More...
 
DetPlane_TYPE detViewToDetPlane (DetView_TYPE) const
 Conversion from DetView_TYPE to DetPlane_TYPE. More...
 
uint32_t getNumberOfXDCM (int detId, DiBlock_TYPE) const
 Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type. More...
 
uint32_t getNumberOfYDCM (int detId, DiBlock_TYPE) const
 Number of DCMs for vertical planes in the diblock given detectorID and Diblock type. More...
 
uint32_t getNumberOfDCM (int detId, DiBlock_TYPE) const
 Total number of DCMs in the diblock given detectorID and Diblock type. More...
 
uint32_t getNumberOfChannelsInXPlane (int detId) const
 Number of channels in X plane for a given detectorID. More...
 
uint32_t getNumberOfChannelsInYPlane (int detId) const
 Number of channels in Y plane for a given detectorID. More...
 
uint32_t getNumberOfChannelsInPlane (const int detId, const DetPlane_TYPE) const
 Get Number of channels in plane. More...
 
uint32_t getNumberOfChannelsInPlane (const int detId, const offline_plane_t) const
 
uint32_t getNumberOfCellsPerDCM (DiBlock_TYPE) const
 Number of cells per DCM for a given diblock type. More...
 
uint32_t getTotalNumberOfBlocks (int detId) const
 Total number of blocks for a given detector. More...
 
uint32_t getTotalNumberOfDiblocks (int detId) const
 Total number of diblocks for a given detector. More...
 
uint32_t getTotalNumberOfPlanes (const int detId) const
 Total number of Planes in the detector. More...
 
const char * errorString (DAQChanMapErrorCodes err_code) const
 

Static Public Member Functions

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

Protected Member Functions

 DAQChannelMapOLD ()
 

Private Member Functions

dcm_id_t getFirstDCMInViewOffline (lchan logicalchan) const
 
dcm_id_t getFirstDCMInView (int detector, DetPlane_TYPE, DiBlock_TYPE) const
 
dcm_id_t getFirstDCMInView (const DetPlane_TYPE, const uint32_t number_of_x_dcms) const
 
dcm_id_t getLastDCMInViewOffline (lchan logicalchan) const
 
dcm_id_t getLastDCMInView (int detector, DetPlane_TYPE, DiBlock_TYPE) const
 
uint32_t getLocalBlockInDiblock (const int detector, const offline_plane_t) const
 
uint32_t getLocalBlockInDiblock (DiBlock_TYPE, offline_plane_t local_plane_in_diblock_in_view, DetPlane_TYPE) const
 
uint32_t getLocalBlockInDiblock (const DiBlock_TYPE, const offline_plane_t local_plane_in_diblock_in_view, const DetPlane_TYPE, DetBlock_TYPE &current_block_type, DetBlock_TYPE &first_block_type, uint32_t &number_of_planes_of_the_same_type_in_first_block_of_the_diblock) const
 Optionally we can also calculate DetBlock_TYPE. More...
 
offline_plane_t getLocalPlaneInDiblock (offline_plane_t local_plane_in_diblock_view, DiBlock_TYPE, DetPlane_TYPE)
 
online_cell_t getOnlineCellOffline (lchan logicalchan) const
 
online_cell_t getOnlineCell (int detId, dcm_id_t, dcm_link_t, pixel_t, DiBlock_TYPE) const
 
online_cell_t getOnlineCell (const int detId, const dcm_id_t, const dcm_link_t, const pixel_t, const DiBlock_TYPE, const DetPlane_TYPE) const
 
online_cell_t getOnlineCell (const int detId, const dcm_id_t, const dcm_link_t, const pixel_t, const DiBlock_TYPE, const DetPlane_TYPE, const uint32_t number_of_x_dcms) const
 
online_cell_t getLocalCellInDCM (online_cell_t, DiBlock_TYPE) const
 
offline_cell_t onlineCellToOfflineCell (online_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
 Offline to Online and vice versa. More...
 
online_cell_t offlineCellToOnlineCell (offline_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
 
uint32_t ConvertCell (uint32_t input_cell, int detId, DetPlane_TYPE, DiBlock_TYPE) const
 If input cell if offline_cell, then the output is online cell. More...
 
bool printBinary (uint32_t)
 
bool printHex (uint32_t)
 

Static Private Attributes

static DAQChannelMapOLD_instanceID = NULL
 Instance pointer for singleton class. More...
 

Detailed Description

The DAQ Channel Map Class is a singleton class designed to provide translation functions between the DAQ numbering schemes and the physics (physical) layout of the detector channels.

Definition at line 32 of file DAQChannelMapOLD.h.

Constructor & Destructor Documentation

DAQChannelMapOLD::~DAQChannelMapOLD ( )

Default Destructor.

Definition at line 30 of file DAQChannelMapOLD.cpp.

DAQChannelMapOLD::DAQChannelMapOLD ( )
protected

Definition at line 29 of file DAQChannelMapOLD.cpp.

Referenced by getInstance().

29 { }// end of DAQChannelMapOLD constructor

Member Function Documentation

pixel_t DAQChannelMapBaseOLD::APDPixel2Pixel ( apd_pixel_t  apd_pixel) const
inherited

Pixel number from APDPixel.

Definition at line 759 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_apdPixel2CellMapArray.

Referenced by getCell().

759 {return _apdPixel2CellMapArray[apd_pixel];}
uint32_t DAQChannelMapOLD::ConvertCell ( uint32_t  input_cell,
int  detId,
DetPlane_TYPE  plane_type,
DiBlock_TYPE  diblock_type 
) const
private

If input cell if offline_cell, then the output is online cell.

If the plane is vertical, then the order is reversed

If the plane is horizontal, then the order is the same

Definition at line 1063 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInYPlane(), daqchannelmap::MC_ND_DIBLOCK, and daqchannelmap::YZ_PLANE.

Referenced by offlineCellToOnlineCell(), and onlineCellToOfflineCell().

1067  {
1068 
1069  /// If the plane is vertical, then the order is reversed
1070  if(plane_type == YZ_PLANE){
1071  // If this is the NearDet muon catcher, then there are only 64 cells (not 96)
1072  // in the YZ_PLANE.
1073  if(diblock_type == MC_ND_DIBLOCK)
1074  return 64 - input_cell -1;
1075  // Otherwise, we can use the default number of Y channels.
1076  return getNumberOfChannelsInYPlane(detector) - input_cell - 1;
1077  }// end of if the plane is horizontal
1078 
1079  /// If the plane is horizontal, then the order is the same
1080  return input_cell;
1081 }
Identifier for the vertical plane.
Identifider for NearDet Muon catcher.
uint32_t getNumberOfChannelsInYPlane(int detId) const
Number of channels in Y plane for a given detectorID.
DetView_TYPE DAQChannelMapBaseOLD::detPlaneToDetView ( DetPlane_TYPE  detector_plane_type) const
inherited

Conversion from DetPlane_TYPE to DetView_TYPE.

Definition at line 940 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::X_VIEW, daqchannelmap::XZ_PLANE, and daqchannelmap::Y_VIEW.

Referenced by getView(), and getViewOffline().

940  {
941  if(detector_plane_type == XZ_PLANE)return X_VIEW;
942  return Y_VIEW;
943 }
Identifier for the Y measuring view of the detector (side)
Identifier for the horizontal plane.
Identifier for the X measuring view of the detector (top)
DetPlane_TYPE DAQChannelMapBaseOLD::detViewToDetPlane ( DetView_TYPE  view_type) const
inherited

Conversion from DetView_TYPE to DetPlane_TYPE.

Definition at line 946 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::X_VIEW, daqchannelmap::XZ_PLANE, and daqchannelmap::YZ_PLANE.

946  {
947  if(view_type == X_VIEW)return XZ_PLANE;
948  return YZ_PLANE;
949 }
Identifier for the vertical plane.
Identifier for the horizontal plane.
Identifier for the X measuring view of the detector (top)
dchan DAQChannelMapOLD::encodeDChan ( lchan  logicalchan)

Definition at line 57 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getCellOffline(), getDetectorOffline(), and getPlaneOffline().

Referenced by daqchannelmap::NDOSDAQChannelMap::encodeDChan(), encodeDChan(), l2d(), and printOffline().

57  {
58 
59  const int detector = getDetectorOffline(chan);
60  const offline_plane_t plane_0 = getPlaneOffline(chan);
61  const offline_cell_t cell_0 = getCellOffline(chan);
62  //const DiBlock_TYPE diblock_type = getDiBlockTypeOffline(chan);
63  //uint32_t cell_1 = 1;
64 
65 // // Test for MC DCM 2...
66 // if(detector==novadaq::cnv::kNEARDET && diblock_type==MC_ND_DIBLOCK){
67 // const DetPlane_TYPE plane_type = getPlaneTypeOffline(chan);
68 // const dcm_id_t dcm_id = getDCM(detector, plane_type, diblock_type, 10000203);
69 
70 // if(dcm_id==2){
71 // cell_1 = 63 - cell_0 - 32;
72 // }
73 // else cell_1 = cell_0;
74 // }
75 // else cell_1 = cell_0;
76 
77 
78  return encodeDChan(detector, plane_0, cell_0);
79 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t offline_cell_t
< DAQ Channel Map Package
dchan encodeDChan(lchan logicalchan)
offline_cell_t getCellOffline(lchan logicalchan) const
Returns the cell the cell on the current plane that the offline channel belongs to – Verified...
dchan DAQChannelMapOLD::encodeDChan ( const int  detector,
const offline_plane_t  plane_0,
const offline_cell_t  cell_0 
) const

Definition at line 83 of file DAQChannelMapOLD.cpp.

References encodeDChan(), daqchannelmap::DAQChannelMapBaseOLD::getBlockNumber(), getDCM(), getDCMLink(), daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), getDiBlockType(), getPixel(), getPlaneType(), offlineCellToOnlineCell(), and daqchannelmap::DAQChannelMapBaseOLD::pixel2APDPixel().

85  {
86 
87  const block_t block_number = getBlockNumber(detector, plane_0);
88  const diblock_t diblock_number = getDiblockNumber(block_number);
89  const DiBlock_TYPE diblock_type = getDiBlockType(detector, diblock_number);
90  const DetPlane_TYPE plane_type = getPlaneType(detector, plane_0);
91  const online_cell_t online_cell_0 = offlineCellToOnlineCell(cell_0, detector, plane_type, diblock_type);
92 
93 
94  const dcm_id_t dcm_id = getDCM(detector, plane_type, diblock_type, online_cell_0);
95  const dcm_link_t dcm_link = getDCMLink(detector, plane_0, online_cell_0, diblock_type, block_number, plane_type);
96 
97  const pixel_t pixel = getPixel(online_cell_0, diblock_type);
98 
99  const apd_pixel_t apd_pixel = pixel2APDPixel(pixel);
100 
101 
102  //std::cout<<" diblock: "<<diblock_number<<" diblock type: "<<diblock_type<<" dcm: "<<dcm_id<<" feb: "<<dcm_link<<" pixel: "<<apd_pixel<<std::endl;
103 
104  return encodeDChan(detector, diblock_number, dcm_id, dcm_link, apd_pixel);
105 
106 }
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
uint32_t pixel_t
Type for physical pixel on APD.
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
dchan encodeDChan(lchan logicalchan)
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t getBlockNumber(int detId, offline_plane_t) const
The block number given the detectorID and offline plane number.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
uint32_t diblock_t
Type for diblocks and blocks.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
online_cell_t offlineCellToOnlineCell(offline_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
apd_pixel_t pixel2APDPixel(pixel_t) const
APDPixel number from Pixel.
dchan DAQChannelMapOLD::encodeDChan ( int  detId,
diblock_t  diblock,
dcm_id_t  dcmid,
dcm_link_t  dcmport,
pixel_t  pixel 
) const

Encoding Routine to correctly pack the DAQ specific channel parameters into a single 32bit identifier.

Definition at line 33 of file DAQChannelMapOLD.cpp.

References BITFIELDSET, febshutoff_auto::chan, daqchannelmap::MASK_DCMID, daqchannelmap::MASK_DCMPORT, daqchannelmap::MASK_DETECTOR, daqchannelmap::MASK_DIBLOCK, daqchannelmap::MASK_PIXELID, daqchannelmap::SHIFT_DCMID, daqchannelmap::SHIFT_DCMPORT, daqchannelmap::SHIFT_DETECTOR, daqchannelmap::SHIFT_DIBLOCK, and daqchannelmap::SHIFT_PIXELID.

35  {
36  dchan chan = 0x0;
39  BITFIELDSET(chan,dcmid, MASK_DCMID, SHIFT_DCMID);
40  BITFIELDSET(chan,dcmport, MASK_DCMPORT, SHIFT_DCMPORT);
42  return chan;
43 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
APD Pixel Number (8bit), valid range 0-31.
Detector ID, (4bit), valid range 1-4.
Diblock ID, (6bit), valid range 1-15.
DCM ID, (6bit), valid range 1-12.
#define BITFIELDSET(block, data, mask, shift)
Definition: BitFields.h:24
DCM Link Port (8bit), valid range 0-63.
uint32_t dchan
< DAQ Channel Map Package
lchan DAQChannelMapOLD::encodeLChan ( dchan  daqchan)

Definition at line 110 of file DAQChannelMapOLD.cpp.

References fillBadChanDBTables::det, getCell(), getDCM(), getDCMLink(), getDetector(), getDiBlock(), getPixel(), and getPlane().

Referenced by daqchannelmap::NDOSDAQChannelMap::encodeLChan(), l2d(), and print().

110  {
111 
112  const int det = getDetector(chan);
113  const diblock_t diblock_id = getDiBlock(chan);
114  const dcm_id_t dcm_id = getDCM(chan);
115  const dcm_link_t dcm_link_id = getDCMLink(chan);
116  const apd_pixel_t apd_pixel_id = getPixel(chan);
117 
118 
119  const offline_plane_t plane_0 = getPlane(det, diblock_id, dcm_id, dcm_link_id);
120  const offline_cell_t cell_0 = getCell(det, diblock_id, dcm_id, dcm_link_id, apd_pixel_id);
121 
122  return encodeLChan(det, plane_0, cell_0);
123 }
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
diblock_t getDiBlock(dchan daqchan) const
Decodes Diblock number from universal daq channel number.
uint32_t offline_cell_t
< DAQ Channel Map Package
int getDetector(dchan daqchan) const
Decodes detector identity from universal channel number.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
offline_plane_t getPlane(dchan daqchan)
Returns the plane position, as referenced relative to the full detector, of the daq channel...
uint32_t diblock_t
Type for diblocks and blocks.
offline_cell_t getCell(dchan daqchan) const
Returns the cell position, as referenced relative to the full detector, of the daq channel...
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
lchan DAQChannelMapOLD::encodeLChan ( int  detId,
offline_plane_t  plane_0,
offline_cell_t  cell_0 
) const

Encoding Routine to correctly pack the Offline specific channel parameters into a single 32bit identifier.

Definition at line 46 of file DAQChannelMapOLD.cpp.

References BITFIELDSET, febshutoff_auto::chan, daqchannelmap::MASK_OFFLINE_CELL, daqchannelmap::MASK_OFFLINE_DETECTOR, daqchannelmap::MASK_OFFLINE_PLANE, daqchannelmap::SHIFT_OFFLINE_CELL, daqchannelmap::SHIFT_OFFLINE_DETECTOR, and daqchannelmap::SHIFT_OFFLINE_PLANE.

const char * DAQChannelMapBaseOLD::errorString ( DAQChanMapErrorCodes  err_code) const
inherited

Definition at line 964 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::ERROR_BLOCK_OUTRANGE, daqchannelmap::ERROR_CELL_OUTRANGE, daqchannelmap::ERROR_CHAN_OUTRANGE, daqchannelmap::ERROR_DCM_OUTRANGE, daqchannelmap::ERROR_DIBLOCK_OUTRANGE, daqchannelmap::ERROR_GENERAL, daqchannelmap::ERROR_MODULE_OUTRANGE, daqchannelmap::ERROR_PIXEL_OUTRANGE, daqchannelmap::ERROR_PLANE_OUTRANGE, daqchannelmap::ERROR_PORT_OUTRANGE, daqchannelmap::ERROR_UNDEFINED, daqchannelmap::ERROR_UNKNOWN, daqchannelmap::ERROR_UNKNOWN_CELL, daqchannelmap::ERROR_UNKNOWN_DCM, daqchannelmap::ERROR_UNKNOWN_DET, daqchannelmap::ERROR_UNKNOWN_DIBLOCK, daqchannelmap::ERROR_UNKNOWN_DIBLOCK_TYPE, daqchannelmap::ERROR_UNKNOWN_LINK, and daqchannelmap::ERROR_UNKNOWN_VIEW.

964  {
965  switch(err_code){
966  case ERROR_GENERAL: return "General Error"; break;
967  case ERROR_UNKNOWN: return "Unknown Error"; break;
968  case ERROR_UNDEFINED: return "Undefined Error"; break;
969  case ERROR_CHAN_OUTRANGE: return "Channel Out of Range"; break;
970  case ERROR_PLANE_OUTRANGE: return "Plane Out of Range"; break;
971  case ERROR_BLOCK_OUTRANGE: return "Block Out of Range"; break;
972  case ERROR_DIBLOCK_OUTRANGE: return "DiBlock Out of Range"; break;
973  case ERROR_DCM_OUTRANGE: return "DCM Out of Range"; break;
974  case ERROR_PORT_OUTRANGE: return "Port Out of Range"; break;
975  case ERROR_PIXEL_OUTRANGE: return "Pixel Out of Range"; break;
976  case ERROR_CELL_OUTRANGE: return "Cell Out of Range"; break;
977  case ERROR_MODULE_OUTRANGE: return "Module Out of Range"; break;
978  case ERROR_UNKNOWN_DIBLOCK: return "Unknown Diblock"; break;
979  case ERROR_UNKNOWN_DIBLOCK_TYPE: return "Unknown Diblock Type"; break;
980  case ERROR_UNKNOWN_DCM: return "Unknown DCM"; break;
981  case ERROR_UNKNOWN_LINK: return "Unknown Link"; break;
982  case ERROR_UNKNOWN_VIEW: return "Unknown Readout View"; break;
983  case ERROR_UNKNOWN_DET: return "Unknown Detector"; break;
984  case ERROR_UNKNOWN_CELL: return "Unknown Cell"; break;
985 
986  default:
987  return "Error Code Not Found";
988  break;
989  }
990 
991  return "Error with Error";
992 }
uint32_t DAQChannelMapBaseOLD::getBlockNumber ( int  detId,
offline_plane_t  plane_0 
) const
inherited
uint32_t DAQChannelMapOLD::getBlockOffline ( lchan  logicalchan) const

Returns the Block that the offline channel is on – Verified.

Definition at line 237 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, daqchannelmap::DAQChannelMapBaseOLD::getBlockNumber(), getDetectorOffline(), and getPlaneOffline().

Referenced by daqchannelmap::NDOSDAQChannelMap::computeBlock(), getBlockType(), getLocalBlockInDiblockOffline(), and getLocalPlaneInDiblockViewOffline().

237  {
238 
239  const int detector = getDetectorOffline(chan);
240  const offline_plane_t plane_0 = getPlaneOffline(chan); // plane starts from 0 in Offline
241 
242  return getBlockNumber(detector, plane_0);
243 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t getBlockNumber(int detId, offline_plane_t) const
The block number given the detectorID and offline plane number.
DetBlock_TYPE DAQChannelMapBaseOLD::getBlockType ( DiBlock_TYPE  diblock_type,
uint32_t  local_block_number_in_diblock 
) const
inherited
DetBlock_TYPE DAQChannelMapOLD::getBlockType ( lchan  logicalchan) const

Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.

Definition at line 364 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getBlockOffline(), and getDetectorOffline().

Referenced by getBlockType(), getLocalBlockInDiblock(), getLocalPlaneInDiblockView(), getLocalPlaneInDiblockViewOffline(), and getPlaneTypeOffline().

364  {
365  const int detector = getDetectorOffline(logicalchan);
366  const uint32_t block_number = getBlockOffline(logicalchan);
367 
368  return getBlockType(block_number, detector);
369 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
block_t getBlockOffline(lchan logicalchan) const
Returns the Block that the offline channel is on – Verified.
DetBlock_TYPE DAQChannelMapOLD::getBlockType ( block_t  blockID,
int  detId 
) const

Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.

Definition at line 372 of file DAQChannelMapOLD.cpp.

References getBlockType(), daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), getDiBlockType(), and getLocalBlockInDiblock().

372  {
373 
374  const diblock_t diblockID = getDiblockNumber(blockID); //< we count diblocks from 1
375  const uint32_t local_block_number_in_diblock = getLocalBlockInDiblock(blockID); //< we count from 0
376 
377  const DiBlock_TYPE diblock_type = getDiBlockType(detector, diblockID);// calling base
378 
379  return getBlockType(diblock_type, local_block_number_in_diblock);
380 }
uint32_t getLocalBlockInDiblock(const int detector, const offline_plane_t) const
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t diblock_t
Type for diblocks and blocks.
DiBlock_TYPE
Types of Diblock.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
offline_cell_t DAQChannelMapOLD::getCell ( dchan  daqchan) const

Returns the cell position, as referenced relative to the full detector, of the daq channel.

Returns the Cell in coordinates relative to the detector view (i.e. 1-"a big number" for far det)

straight extractions

Definition at line 320 of file DAQChannelMapOLD.cpp.

References getDCM(), getDCMLink(), getDetector(), getDiBlock(), and getPixel().

Referenced by encodeLChan(), and print().

320  {
321 
322  /// straight extractions
323  const int detector_id = getDetector(daqchan);
324  const diblock_t diblock_number = getDiBlock(daqchan);
325  const dcm_id_t dcm_id = getDCM(daqchan);
326  const dcm_link_t dcm_link_id = getDCMLink(daqchan);
327  const apd_pixel_t apd_pixel_id = getPixel(daqchan);
328 
329  return getCell(detector_id, diblock_number, dcm_id, dcm_link_id, apd_pixel_id);
330 }
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
diblock_t getDiBlock(dchan daqchan) const
Decodes Diblock number from universal daq channel number.
int getDetector(dchan daqchan) const
Decodes detector identity from universal channel number.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
uint32_t diblock_t
Type for diblocks and blocks.
offline_cell_t getCell(dchan daqchan) const
Returns the cell position, as referenced relative to the full detector, of the daq channel...
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
offline_cell_t DAQChannelMapOLD::getCell ( const int  detector_id,
const diblock_t  diblock_number,
const dcm_id_t  dcm_id,
const dcm_link_t  dcm_link_id,
const apd_pixel_t  apd_pixel_id 
) const

Definition at line 334 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::APDPixel2Pixel(), getDiBlockType(), getOnlineCell(), getPlaneType(), and onlineCellToOfflineCell().

339  {
340 
341 
342  const DiBlock_TYPE diblock_type = getDiBlockType(detector_id, diblock_number);
343 
344  const pixel_t pixel_id = APDPixel2Pixel(apd_pixel_id);
345 
346  uint32_t number_of_x_dcm = 0;
347  const DetPlane_TYPE plane_type = getPlaneType(detector_id, dcm_id, diblock_type, number_of_x_dcm);
348  const online_cell_t online_cell = getOnlineCell(detector_id, dcm_id, dcm_link_id, pixel_id, diblock_type, plane_type, number_of_x_dcm);
349 
350  return onlineCellToOfflineCell(online_cell, detector_id, plane_type, diblock_type);
351 }
offline_cell_t onlineCellToOfflineCell(online_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
Offline to Online and vice versa.
uint32_t pixel_t
Type for physical pixel on APD.
online_cell_t getOnlineCell(int detId, dcm_id_t, dcm_link_t, pixel_t, DiBlock_TYPE) const
pixel_t APDPixel2Pixel(apd_pixel_t) const
Pixel number from APDPixel.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
uint32_t daqchannelmap::DAQChannelMapOLD::getCellDCMLocalOffline ( lchan  logicalchan) const
offline_cell_t DAQChannelMapOLD::getCellOffline ( lchan  logicalchan) const

Returns the cell the cell on the current plane that the offline channel belongs to – Verified.

Definition at line 230 of file DAQChannelMapOLD.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_CELL_OUTRANGE, getDetectorOffline(), daqchannelmap::MASK_OFFLINE_CELL, daqchannelmap::NUM_CELLS, daqchannelmap::DAQChannelMapBaseOLD::NUM_DIBLOCK_DET, and daqchannelmap::SHIFT_OFFLINE_CELL.

Referenced by encodeDChan(), getDCMLinkOffline(), getDCMOffline(), getOnlineCellOffline(), getPixelOffline(), and printOffline().

230  {
231  return BOUNDSCHECK(
234 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
#define BITFIELDGET(block, mask, shift)
Definition: BitFields.h:23
#define BOUNDSCHECK(value, min, max, err)
Definition: boundscheck.h:22
Cell Number, (10bit), valid range 1-384 (far det)
static const unsigned int NUM_DIBLOCK_DET[]
dcm_id_t DAQChannelMapOLD::getDCM ( dchan  daqchan) const
dcm_id_t DAQChannelMapOLD::getDCM ( const int  detector,
const offline_plane_t  plane_offline_0,
const offline_cell_t  cell_offline_0 
) const

Definition at line 554 of file DAQChannelMapOLD.cpp.

References getDCM(), daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), getDiBlockType(), getPlaneType(), and offlineCellToOnlineCell().

556  {
557 
558  const diblock_t diblock_number = getDiblockNumber(detector, plane_offline_0);
559  const DiBlock_TYPE diblock_type = getDiBlockType(detector, diblock_number);
560 
561  const DetPlane_TYPE plane_type = getPlaneType(detector, plane_offline_0);
562 
563  const online_cell_t online_cell_0 = offlineCellToOnlineCell(cell_offline_0, detector, plane_type, diblock_type);
564 
565  return getDCM(detector, plane_type, diblock_type, online_cell_0);
566 }
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
uint32_t diblock_t
Type for diblocks and blocks.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
online_cell_t offlineCellToOnlineCell(offline_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
dcm_id_t DAQChannelMapOLD::getDCM ( const int  detector,
const DetPlane_TYPE  plane_type,
const DiBlock_TYPE  diblock_type,
const online_cell_t  online_cell_0 
) const

For NearDet the first DCM is half-populated

Definition at line 570 of file DAQChannelMapOLD.cpp.

References getFirstDCMInView(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfCellsPerDCM(), novadaq::cnv::kNEARDET, daqchannelmap::MC_ND_DIBLOCK, daqchannelmap::NUM_CELLS, and daqchannelmap::XZ_PLANE.

574 {
575 
576  const dcm_id_t first_dcm_in_view = getFirstDCMInView(detector, plane_type, diblock_type);
577 
578  // Treat the NearDet muon catcher as a special case.
579  if(detector == novadaq::cnv::kNEARDET && diblock_type == MC_ND_DIBLOCK) {
580  // This one is simple: If this is a vertical (XZ) plane, then this is DCM 1.
581  // If this is a horizontal (YZ) plane, then this is DCM 2.
582  if(plane_type == XZ_PLANE) return 1;
583  else return 2;
584  }
585 
586  /// For NearDet the first DCM is half-populated
587  // NOTE: "first_dcm_in_view == 1" really is asking "Is this the XZ_VIEW?" but this is
588  // how it was originally coded and I don't want to mess with something that
589  // isn't broken.
590  if(detector == novadaq::cnv::kNEARDET && first_dcm_in_view == 1) {
591  if(online_cell_0 >= NUM_CELLS)
592  return first_dcm_in_view + 1;
593 
594  return first_dcm_in_view;
595  }
596 
597  return first_dcm_in_view + online_cell_0 / getNumberOfCellsPerDCM(diblock_type);
598 }
Identifider for NearDet Muon catcher.
uint32_t getNumberOfCellsPerDCM(DiBlock_TYPE) const
Number of cells per DCM for a given diblock type.
dcm_id_t getFirstDCMInView(int detector, DetPlane_TYPE, DiBlock_TYPE) const
Identifier for the horizontal plane.
Near Detector in the NuMI cavern.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
dcm_link_t DAQChannelMapOLD::getDCMLink ( dchan  daqchan) const
dcm_link_t DAQChannelMapOLD::getDCMLink ( const int  detector,
const offline_plane_t  plane_0,
const offline_cell_t  cell_0 
) const

Definition at line 634 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getBlockNumber(), getDCMLink(), daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), getDiBlockType(), getPlaneType(), and offlineCellToOnlineCell().

636  {
637 
638 
639  const DetPlane_TYPE plane_type = getPlaneType(detector, plane_0);
640 
641  const block_t block_number = getBlockNumber(detector, plane_0);
642  const diblock_t diblock_number = getDiblockNumber(block_number);
643  const DiBlock_TYPE diblock_type = getDiBlockType(detector, diblock_number);
644 
645  const online_cell_t online_cell_0 = offlineCellToOnlineCell(cell_0, detector, plane_type, diblock_type);
646 
647 
648  return getDCMLink(detector, plane_0, online_cell_0, diblock_type, block_number, plane_type);
649 }// end of getDCMLinkOffline
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t getBlockNumber(int detId, offline_plane_t) const
The block number given the detectorID and offline plane number.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
uint32_t diblock_t
Type for diblocks and blocks.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
online_cell_t offlineCellToOnlineCell(offline_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
dcm_link_t DAQChannelMapOLD::getDCMLink ( const int  detector,
const offline_plane_t  plane_0,
const online_cell_t  online_cell_0,
const DiBlock_TYPE  diblock_type,
const block_t  block_number,
const DetPlane_TYPE  plane_type 
) const

For FarDet and NearDet, the calculation is different than it is for NDOS

Calculate DCM link number according to NOvA-doc-4219 This math is true for NDOS only

Definition at line 653 of file DAQChannelMapOLD.cpp.

References febshutoff_auto::dcm, getDCM(), getLocalModuleInDCMOffline(), getLocalPlaneInDiblockView(), novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, and daqchannelmap::MC_ND_DIBLOCK.

658  {
659 
660  // For the NearDet, FEBs 32-63 in DCM 1 are not instrumented but there is no gap in cells.
661  // So if we are in DCM 2, we need to shift global cell number by 32 to compensate for this gap.
662  const uint32_t dcm = getDCM(detector, plane_type, diblock_type, online_cell_0);
663  online_cell_t temp_cell = online_cell_0;
664  if(detector == novadaq::cnv::kNEARDET && dcm == 2 && diblock_type != MC_ND_DIBLOCK)
665  temp_cell += 32;
666 
667  const uint32_t local_module = getLocalModuleInDCMOffline(temp_cell, diblock_type); //< either 0 or 1 (or 2 in the MC)
668  const offline_plane_t local_plane_in_diblock_view = getLocalPlaneInDiblockView(detector, plane_0, block_number, plane_type);
669 
670  /// For FarDet and NearDet, the calculation is different than it is for NDOS
672 
673  // Treat the NearDet muon catcher as a special case
674  if(detector == novadaq::cnv::kNEARDET && diblock_type == MC_ND_DIBLOCK) {
675  return local_plane_in_diblock_view + 11*local_module;
676  // comment..
677  // return local_plane_in_diblock_view + 11*(1-local_module);
678  }
679 
680  // Otherwise this is a "normal" FarDet or NearDet diblock.
681  return local_plane_in_diblock_view + 32*local_module;
682  }
683 
684  // Otherwise, this must be NDOS
685 
686  /// Calculate DCM link number according to NOvA-doc-4219
687  /// This math is true for NDOS only
688  dcm_link_t dcm_link = local_plane_in_diblock_view + 16*local_module;
689  if(local_plane_in_diblock_view > 15) dcm_link += 16;
690 
691  return dcm_link;
692 }// end of getDCMLinkOffline
Identifider for NearDet Muon catcher.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
uint32_t getLocalModuleInDCMOffline(lchan) const
Returns the module number (0 or 1) to which a given module belongs.
offline_plane_t getLocalPlaneInDiblockView(const int detector, dcm_link_t, const DiBlock_TYPE) const
Returns the Plane number relative to the current view and diblock – Verified.
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
dcm_link_t DAQChannelMapOLD::getDCMLinkOffline ( lchan  logicalchan) const

Definition at line 624 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getCellOffline(), getDCMLink(), getDetectorOffline(), and getPlaneOffline().

Referenced by printOffline().

624  {
625 
626  const int detector = getDetectorOffline(chan);
627  const offline_plane_t plane_0 = getPlaneOffline(chan);
628  const offline_cell_t cell_0 = getCellOffline(chan);
629 
630  return getDCMLink(detector, plane_0, cell_0);
631 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
uint32_t offline_cell_t
< DAQ Channel Map Package
offline_cell_t getCellOffline(lchan logicalchan) const
Returns the cell the cell on the current plane that the offline channel belongs to – Verified...
dcm_id_t DAQChannelMapOLD::getDCMOffline ( lchan  logicalchan) const

Definition at line 543 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getCellOffline(), getDCM(), getDetectorOffline(), and getPlaneOffline().

Referenced by printOffline().

543  {
544 
545  const int detector = getDetectorOffline(chan);
546  const offline_plane_t plane_0 = getPlaneOffline(chan);
547  const offline_cell_t cell_0 = getCellOffline(chan);
548 
549  return getDCM(detector, plane_0, cell_0);
550 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t offline_cell_t
< DAQ Channel Map Package
offline_cell_t getCellOffline(lchan logicalchan) const
Returns the cell the cell on the current plane that the offline channel belongs to – Verified...
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
int DAQChannelMapOLD::getDetector ( dchan  daqchan) const
int DAQChannelMapBaseOLD::getDetectorIDMaximum ( ) const
inherited

Get maximum detector ID.

Definition at line 751 of file DAQChannelMapBaseOLD.cpp.

References novadaq::cnv::kNDetector.

int DAQChannelMapBaseOLD::getDetectorIDMinimum ( ) const
inherited

Get minimum detector ID.

Definition at line 748 of file DAQChannelMapBaseOLD.cpp.

References novadaq::cnv::kNEARDET.

748 {return novadaq::cnv::kNEARDET;}
Near Detector in the NuMI cavern.
int DAQChannelMapOLD::getDetectorOffline ( lchan  logicalchan) const

Returns the detector that the offline channel belongs to – Verified.

Definition at line 208 of file DAQChannelMapOLD.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_UNKNOWN_DET, novadaq::cnv::kNDetector, novadaq::cnv::kUNKNOWN_DET, daqchannelmap::MASK_OFFLINE_DETECTOR, and daqchannelmap::SHIFT_OFFLINE_DETECTOR.

Referenced by encodeDChan(), getBlockOffline(), getBlockType(), getCellOffline(), getDCMLinkOffline(), getDCMOffline(), getDiBlockOffline(), getDiBlockTypeOffline(), getFirstDCMInViewOffline(), getLastDCMInViewOffline(), getLocalPlaneInBlockOffline(), getLocalPlaneInDiblockOffline(), getLocalPlaneInDiblockViewOffline(), getOnlineCellOffline(), getPixelOffline(), getPlaneOffline(), getPlaneViewOffline(), and printOffline().

diblock_t DAQChannelMapOLD::getDiBlock ( dchan  daqchan) const
uint32_t DAQChannelMapBaseOLD::getDiblockNumber ( int  detId,
offline_plane_t  plane_0 
) const
inherited
uint32_t DAQChannelMapBaseOLD::getDiblockNumber ( const block_t  block_number) const
inherited

Definition at line 778 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::BLOCK_OFFSET, and daqchannelmap::DIBLOCK_OFFSET.

779 {
780  // WARNING: Assumption of 2 blocks per diblock.
781  return DIBLOCK_OFFSET + (block_number - BLOCK_OFFSET)/2;
782 }
do we count diblocks from 0 or 1
do we count blocks from 0 or 1
uint32_t DAQChannelMapOLD::getDiBlockOffline ( lchan  logicalchan) const

Returns the DiBlock that the offline channel is on – Verified.

Definition at line 245 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetectorOffline(), daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), and getPlaneOffline().

Referenced by getDiBlockTypeOffline(), getPlaneViewOffline(), and printOffline().

245  {
246  const int detector = getDetectorOffline(chan);
247  const offline_plane_t plane_0 = getPlaneOffline(chan); // plane starts from 0 in Offline
248 
249  return getDiblockNumber(detector, plane_0);
250 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
DiBlock_TYPE DAQChannelMapBaseOLD::getDiBlockType ( int  detId,
diblock_t  diblock_number 
) const
inherited
DiBlock_TYPE DAQChannelMapOLD::getDiBlockType ( dchan  daqchan) const

Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.

Returns the type of diblock that the channel was on.

Definition at line 174 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetector(), and getDiBlock().

Referenced by encodeDChan(), getBlockType(), getCell(), getDCM(), getDCMLink(), daqchannelmap::NDOSDAQChannelMap::getDiBlockType(), getDiBlockTypeOffline(), getPixel(), getPlane(), getPlaneViewOffline(), and getView().

174  {
175  const int detector = getDetector(daqchan);
176  const diblock_t diblock_number = getDiBlock(daqchan);
177 
178  return getDiBlockType(detector, diblock_number);//calling base
179 }
diblock_t getDiBlock(dchan daqchan) const
Decodes Diblock number from universal daq channel number.
int getDetector(dchan daqchan) const
Decodes detector identity from universal channel number.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t diblock_t
Type for diblocks and blocks.
DiBlock_TYPE DAQChannelMapOLD::getDiBlockTypeOffline ( lchan  logicalchan) const

Returns the DiBlock type (i.e. AB, BA, AA) of the offline channel – Verified.

Definition at line 356 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetectorOffline(), getDiBlockOffline(), and getDiBlockType().

Referenced by getFirstDCMInViewOffline(), getLastDCMInViewOffline(), getLocalModuleInDCMOffline(), and getOnlineCellOffline().

356  {
357  const diblock_t diblock_id = getDiBlockOffline(chan);
358  const int detector = getDetectorOffline(chan);
359 
360  return getDiBlockType(detector, diblock_id);// calling base
361 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t diblock_t
Type for diblocks and blocks.
diblock_t getDiBlockOffline(lchan logicalchan) const
Returns the DiBlock that the offline channel is on – Verified.
dcm_id_t DAQChannelMapOLD::getFirstDCMInView ( int  detector,
DetPlane_TYPE  plane_type,
DiBlock_TYPE  diblock_type 
) const
private

First DCM in the view. if the channel is in a XZ plane, the DCM is 1. Otherwise, it's 7 for the far detector, 3 for the near detector, and 2 for NDOS

If it's XZ plane, then the first DCM is 1

Otherwise, it's the next DCM after the last XZ DCM

Definition at line 724 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfXDCM(), and daqchannelmap::XZ_PLANE.

Referenced by getDCM(), getFirstDCMInViewOffline(), getLastDCMInView(), and getOnlineCell().

724  {
725 
726  /// If it's XZ plane, then the first DCM is 1
727  if(plane_type == XZ_PLANE) return 1;
728 
729  /// Otherwise, it's the next DCM after the last XZ DCM
730  return getNumberOfXDCM(detector, diblock_type) + 1;
731 }
uint32_t getNumberOfXDCM(int detId, DiBlock_TYPE) const
Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type.
Identifier for the horizontal plane.
dcm_id_t DAQChannelMapOLD::getFirstDCMInView ( const DetPlane_TYPE  plane_type,
const uint32_t  number_of_x_dcms 
) const
private

If it's XZ plane, then the first DCM is 1

Otherwise, it's the next DCM after the last XZ DCM

Definition at line 734 of file DAQChannelMapOLD.cpp.

References daqchannelmap::XZ_PLANE.

734  {
735 
736  // WARNING: This functions allows you to override the constants defined in DAQChannelMapOLDConstants.h!!!
737 
738  /// If it's XZ plane, then the first DCM is 1
739  if(plane_type == XZ_PLANE) return 1;
740 
741  /// Otherwise, it's the next DCM after the last XZ DCM
742  return number_of_x_dcms + 1;
743 }
Identifier for the horizontal plane.
dcm_id_t DAQChannelMapOLD::getFirstDCMInViewOffline ( lchan  chan) const
private

First DCM in the view. if the channel is in a YZ plane, the DCM is 1. Otherwise, it's 7 for the far detector and 2 for NDOS

First DCM in the view. if the channel is in a XZ plane, the DCM is 1. Otherwise, it's 7 for the far detector, 3 for the near detector, and 2 for NDOS

Definition at line 712 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetectorOffline(), getDiBlockTypeOffline(), getFirstDCMInView(), and getPlaneTypeOffline().

712  {
713 
714  const DetPlane_TYPE plane_type = getPlaneTypeOffline(chan);
715  const int detector = getDetectorOffline(chan);
716  const DiBlock_TYPE diblock_type = getDiBlockTypeOffline(chan);
717 
718  return getFirstDCMInView(detector, plane_type, diblock_type);
719 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
dcm_id_t getFirstDCMInView(int detector, DetPlane_TYPE, DiBlock_TYPE) const
DiBlock_TYPE getDiBlockTypeOffline(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the offline channel – Verified.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
DetPlane_TYPE getPlaneTypeOffline(lchan logicalchan) const
Returns the View that the offline channel is on.
DAQChannelMapOLD * DAQChannelMapOLD::getInstance ( )
static

Method to obtain the class instance.

getInstance method returns the current instance if there is one or creates the initial instance if there is not one

Definition at line 21 of file DAQChannelMapOLD.cpp.

References _instanceID, and DAQChannelMapOLD().

Referenced by gsOldDCMap().

21  {
22  if(_instanceID == NULL){ // Check if there is an instance active
23  _instanceID = new DAQChannelMapOLD(); // If there is not, make a new one
24  }
25  return _instanceID;
26 }
static DAQChannelMapOLD * _instanceID
Instance pointer for singleton class.
dcm_id_t DAQChannelMapOLD::getLastDCMInView ( int  detector,
DetPlane_TYPE  plane_type,
DiBlock_TYPE  diblock_type 
) const
private

If it's XZ plane, then the first DCM is NUM_X_DCMS

So, it's vertical (YZ) plane

Definition at line 758 of file DAQChannelMapOLD.cpp.

References getFirstDCMInView(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfXDCM(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfYDCM(), and daqchannelmap::XZ_PLANE.

Referenced by getLastDCMInViewOffline().

758  {
759 
760 
761  /// If it's XZ plane, then the first DCM is NUM_X_DCMS
762  if(plane_type == XZ_PLANE) return getNumberOfXDCM(detector, diblock_type);
763 
764  /// So, it's vertical (YZ) plane
765 
766  return getFirstDCMInView(detector, plane_type, diblock_type) + getNumberOfYDCM(detector, diblock_type) - 1;
767 }
dcm_id_t getFirstDCMInView(int detector, DetPlane_TYPE, DiBlock_TYPE) const
uint32_t getNumberOfXDCM(int detId, DiBlock_TYPE) const
Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type.
uint32_t getNumberOfYDCM(int detId, DiBlock_TYPE) const
Number of DCMs for vertical planes in the diblock given detectorID and Diblock type.
Identifier for the horizontal plane.
dcm_id_t DAQChannelMapOLD::getLastDCMInViewOffline ( lchan  logicalchan) const
private

Definition at line 749 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetectorOffline(), getDiBlockTypeOffline(), getLastDCMInView(), and getPlaneTypeOffline().

749  {
750 
751  const DetPlane_TYPE plane_type = getPlaneTypeOffline(chan);
752  const int detector = getDetectorOffline(chan);
753  const DiBlock_TYPE diblock_type = getDiBlockTypeOffline(chan);
754 
755  return getLastDCMInView(detector, plane_type, diblock_type);
756 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
dcm_id_t getLastDCMInView(int detector, DetPlane_TYPE, DiBlock_TYPE) const
DiBlock_TYPE getDiBlockTypeOffline(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the offline channel – Verified.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
DetPlane_TYPE getPlaneTypeOffline(lchan logicalchan) const
Returns the View that the offline channel is on.
uint32_t DAQChannelMapBaseOLD::getLocalBlockInDiblock ( const block_t  block_number) const
inherited

Definition at line 785 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::BLOCK_OFFSET, and ODD.

786 {
787  return ODD(block_number-BLOCK_OFFSET);
788 }
#define ODD(x)
do we count blocks from 0 or 1
uint32_t DAQChannelMapOLD::getLocalBlockInDiblock ( const int  detector,
const offline_plane_t  plane_0 
) const
private

Definition at line 896 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getBlockNumber().

Referenced by getBlockType(), getLocalBlockInDiblockOffline(), getLocalPlaneInDiblock(), and getLocalPlaneInDiblockView().

896  {
897  const uint32_t block_number = getBlockNumber(detector, plane_0);
898  return getLocalBlockInDiblock(block_number);
899 }
uint32_t getLocalBlockInDiblock(const int detector, const offline_plane_t) const
uint32_t getBlockNumber(int detId, offline_plane_t) const
The block number given the detectorID and offline plane number.
uint32_t DAQChannelMapOLD::getLocalBlockInDiblock ( DiBlock_TYPE  diblock_type,
offline_plane_t  local_plane_in_diblock_in_view,
DetPlane_TYPE  plane_type 
) const
private

calling base

Get Number of planes of the same type in that first diblock. Needed to figure out which block current plane belongs to

Definition at line 878 of file DAQChannelMapOLD.cpp.

References getBlockType(), and daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlaneTypeInBlock().

880  {
881 
882  // WARNING: Hardcoded assumption of 2 blocks per diblock!
883 
884  const DetBlock_TYPE first_block_of_diblock_type = getBlockType(diblock_type, (uint32_t)0);/// calling base
885 
886  /// Get Number of planes of the same type in that first diblock.
887  /// Needed to figure out which block current plane belongs to
888  const uint32_t number_of_planes_of_the_same_type_in_first_block_of_the_diblock = getNumberOfPlaneTypeInBlock(first_block_of_diblock_type, plane_type);
889 
890  if(local_plane_in_diblock_in_view < number_of_planes_of_the_same_type_in_first_block_of_the_diblock) return 0;
891 
892  return 1;
893 }
DetBlock_TYPE
Types of Block.
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t getNumberOfPlaneTypeInBlock(DetBlock_TYPE, DetPlane_TYPE) const
Number of planes (X or Y) in the block given block type and type of plane(X or Y) ...
uint32_t DAQChannelMapOLD::getLocalBlockInDiblock ( const DiBlock_TYPE  diblock_type,
const offline_plane_t  local_plane_in_diblock_in_view,
const DetPlane_TYPE  plane_type,
DetBlock_TYPE current_block_type,
DetBlock_TYPE first_block_type,
uint32_t &  number_of_planes_of_the_same_type_in_first_block_of_the_diblock 
) const
private

Optionally we can also calculate DetBlock_TYPE.

calling base

Get Number of planes of the same type in that first diblock. Needed to figure out which block current plane belongs to

Definition at line 904 of file DAQChannelMapOLD.cpp.

References getBlockType(), and daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlaneTypeInBlock().

910  {
911 
912  first_block_type = getBlockType(diblock_type, (uint32_t)0);/// calling base
913 
914  /// Get Number of planes of the same type in that first diblock.
915  /// Needed to figure out which block current plane belongs to
916  number_of_planes_of_the_same_type_in_first_block_of_the_diblock = getNumberOfPlaneTypeInBlock(first_block_type, plane_type);
917 
918  if(local_plane_in_diblock_in_view < number_of_planes_of_the_same_type_in_first_block_of_the_diblock) {
919  output_block_type = first_block_type;
920  return 0;
921  }
922 
923  output_block_type = getBlockType(diblock_type, (uint32_t)1);
924  return 1;
925 }
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t getNumberOfPlaneTypeInBlock(DetBlock_TYPE, DetPlane_TYPE) const
Number of planes (X or Y) in the block given block type and type of plane(X or Y) ...
uint32_t DAQChannelMapOLD::getLocalBlockInDiblockOffline ( lchan  logicalchan) const

If it's the upstream block in the diblock, then it's 0, if not, it's 1.

Definition at line 698 of file DAQChannelMapOLD.cpp.

References elec2geo::block, getBlockOffline(), and getLocalBlockInDiblock().

Referenced by getLocalPlaneInDiblockViewOffline().

698  {
699  const uint32_t block = getBlockOffline(logicalchan);
700 
701  return getLocalBlockInDiblock(block);
702 }// end of getLocalBlockInDiblockOffline
uint32_t getLocalBlockInDiblock(const int detector, const offline_plane_t) const
block
print "ROW IS " print row
Definition: elec2geo.py:31
block_t getBlockOffline(lchan logicalchan) const
Returns the Block that the offline channel is on – Verified.
online_cell_t DAQChannelMapOLD::getLocalCellInDCM ( online_cell_t  online_cell_0,
DiBlock_TYPE  diblock_type 
) const
private

Definition at line 811 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfCellsPerDCM(), and daqchannelmap::MC_ND_DIBLOCK.

Referenced by getLocalModuleInDCMOffline(), and getPixel().

811  {
812 
813  const online_cell_t number_of_cells_per_dcm = getNumberOfCellsPerDCM(diblock_type);
814 
815  // Treat the NearDet muon catcher as a special case since the number of modules in the NearDet MC is not
816  // the same as the "normal" NearDet diblocks (and there are no DAQChannelMapOLD constants that specify the
817  // difference between number of modules in a NearDet diblock vs. number of modules in a NearDet MC diblock.)
818  // It would probably be more work than it is worth to add this, so we will just catch this special case.
819  // Since there is only one DCM per view, then online_cell_0 IS the local cell in the DCM in this case (for
820  // either view.)
821  if(diblock_type == MC_ND_DIBLOCK) return online_cell_0;
822 
823  // return online_cell_0 - (online_cell_0 / number_of_cells_per_dcm)*number_of_cells_per_dcm;
824  // OR... ...we could just use modulo instead...
825  return online_cell_0 % number_of_cells_per_dcm;
826 }
Identifider for NearDet Muon catcher.
uint32_t getNumberOfCellsPerDCM(DiBlock_TYPE) const
Number of cells per DCM for a given diblock type.
uint32_t DAQChannelMapOLD::getLocalModuleInDCM ( const int  detector_id,
dcm_id_t  dcm_id,
dcm_link_t  dcm_link,
const DiBlock_TYPE  diblock_type 
) const

Returns the module number (0 or 1) to which a given module belongs.

Compute for FarDet or NearDet according to the above comment

NearDet muon catcher must be treated differently

Otherwise this must be NDOS, and compute according to the above comment

Muon catcher screws things up

If not NearDet or NDOS, then must be FarDet.

Definition at line 263 of file DAQChannelMapOLD.cpp.

References novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, daqchannelmap::MC_DIBLOCK, and daqchannelmap::MC_ND_DIBLOCK.

Referenced by getOnlineCell().

263  {
264 
265  // if(detector_id == novadaq::cnv::kFARDET) return dcm_link/32;
266 
267  /// Compute for FarDet or NearDet according to the above comment
268  if(detector_id == novadaq::cnv::kNEARDET){
269 
270  /// NearDet muon catcher must be treated differently
271  if(detector_id == novadaq::cnv::kNEARDET && diblock_type == MC_ND_DIBLOCK) {
272 
273  // The mapping for each DCM in the NearDet MC is different (go team!!!)
274  // There are 11 planes and the FEBs are plugged in in numerical order with
275  // no gaps (0-32 for the top, 0-21 for the side) so dividing by 11 tells you
276  // which module you are in.
277  if(dcm_id == 1) {
278  if(dcm_link > 32) return -1; // Flag as uninstrumented.
279  else return dcm_link/11;
280  }
281 
282  // The FEBs for DCM 2 are plugged in in reverse order, which is why I have
283  // to do the 1-(module) thing.
284  if(dcm_id == 2) {
285  if(dcm_link > 21) return -1; // Flag as uninstrumented.
286  else return dcm_link/11;
287  // else return 1 - (dcm_link/11); This was implemented when the FEBs were switched for Mod 0 and Mod 1.
288  }
289 
290  // Otherwise this is DCM 3 or 4 which for the NearDet MC is uninstrumented.
291  return -1;
292 
293  }
294 
295  // Otherwise this is a "normal" NearDet diblock.
296  if(dcm_id==3){
297  if(dcm_link/32 == 0) return 1;
298  else if(dcm_link/32 == 1) return 0;
299  }
300  else return dcm_link / 32 ;
301  }
302 
303  /// Otherwise this must be NDOS, and compute according to the above comment
304 
305  if(detector_id == novadaq::cnv::kNDOS){
306  /// Muon catcher screws things up
307  if(diblock_type == MC_DIBLOCK) return dcm_link / 16;
308 
309  return (dcm_link % 32)/16;
310  }
311 
312  /// If not NearDet or NDOS, then must be FarDet.
313  return dcm_link/32;
314 }
Identifider for NearDet Muon catcher.
Prototype Near Detector on the surface at FNAL.
Near Detector in the NuMI cavern.
Identifider for NDOS Muon catcher.
uint32_t DAQChannelMapOLD::getLocalModuleInDCMOffline ( lchan  chan) const

Returns the module number (0 or 1) to which a given module belongs.

Definition at line 790 of file DAQChannelMapOLD.cpp.

References getDiBlockTypeOffline(), and getOnlineCellOffline().

Referenced by getDCMLink().

790  {
791 
792  const online_cell_t online_cell_0 = getOnlineCellOffline(chan);
793  const DiBlock_TYPE diblock_type = getDiBlockTypeOffline(chan);
794 
795  return getLocalModuleInDCMOffline(online_cell_0, diblock_type);
796 }
DiBlock_TYPE getDiBlockTypeOffline(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the offline channel – Verified.
uint32_t getLocalModuleInDCMOffline(lchan) const
Returns the module number (0 or 1) to which a given module belongs.
DiBlock_TYPE
Types of Diblock.
online_cell_t getOnlineCellOffline(lchan logicalchan) const
uint32_t DAQChannelMapOLD::getLocalModuleInDCMOffline ( online_cell_t  online_cell_0,
DiBlock_TYPE  diblock_type 
) const

This is what it should be. But Muon catcher screws things up

Definition at line 799 of file DAQChannelMapOLD.cpp.

References getLocalCellInDCM(), and daqchannelmap::NUM_PIXELS.

799  {
800 
801  // NOTE: No special exception was ever made here for the NDOS muon catcher in the original code
802  // despite the comment below. I don't know if this case is being treated correctly or not.
803 
804  /// This is what it should be. But Muon catcher screws things up
805  const online_cell_t local_cell_in_dcm = getLocalCellInDCM(online_cell_0, diblock_type);
806 
807  return local_cell_in_dcm / NUM_PIXELS;
808 }
online_cell_t getLocalCellInDCM(online_cell_t, DiBlock_TYPE) const
offline_plane_t DAQChannelMapBaseOLD::getLocalPlaneInBlock ( int  detId,
offline_plane_t  plane_0 
) const
inherited
offline_plane_t DAQChannelMapOLD::getLocalPlaneInBlockOffline ( lchan  logicalchan) const

Returns the Plane relative to the start of the current block – Verified.

Definition at line 392 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetectorOffline(), daqchannelmap::DAQChannelMapBaseOLD::getLocalPlaneInBlock(), and getPlaneOffline().

Referenced by daqchannelmap::NDOSDAQChannelMap::computePlaneInBlock(), getLocalPlaneInDiblockViewOffline(), and getPlaneTypeOffline().

392  {
393  const int detector = getDetectorOffline(chan);
394  const offline_plane_t plane_0 = getPlaneOffline(chan); // plane starts from 0 in Offline
395 
396  return getLocalPlaneInBlock(detector, plane_0);
397 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
offline_plane_t getLocalPlaneInBlock(int detId, offline_plane_t) const
Local plane in block number given the detectorID and offline plane number.
offline_plane_t DAQChannelMapBaseOLD::getLocalPlaneInDiblock ( int  detId,
offline_plane_t  plane_0 
) const
inherited

Local plane in diblock number given the detectorID and offline plane number.

Definition at line 880 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_planesInDiblockDetectorArray, daqchannelmap::DAQChannelMapBaseOLD::_planesInDiblockDetectorSize, daqchannelmap::DIBLOCK_OFFSET, and daqchannelmap::DAQChannelMapBaseOLD::getLocalPlaneInBlockOrDiblock().

881 {
883 }
do we count diblocks from 0 or 1
offline_plane_t getLocalPlaneInBlockOrDiblock(int detId, offline_plane_t, const numberOfPlanesInBlockDetector_t &, const BlockNumerationOffset) const
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblock ( offline_plane_t  local_plane_in_diblock_view,
DiBlock_TYPE  diblock_type,
DetPlane_TYPE  plane_type 
)
private

Does the block starts with a different plane?

If it's the first block. We can calculate plane easily

So, it's the second block. Need to do some magic

To find local plane in the (second) block in the view we subtract number of planes of the same type in the first diblock from the local plane in diblock view

Definition at line 930 of file DAQChannelMapOLD.cpp.

References getLocalBlockInDiblock(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlanesInBlock(), and daqchannelmap::DAQChannelMapBaseOLD::getStartPlaneTypeInBlock().

Referenced by getLocalPlaneInDiblockOffline(), and getPlane().

932  {
933  DetBlock_TYPE current_block_type;
934  DetBlock_TYPE first_block_type;
935  uint32_t number_of_planes_of_the_same_type_in_first_block_of_the_diblock;
936 
937  const uint32_t local_block_in_diblock = getLocalBlockInDiblock(diblock_type, local_plane_in_diblock_view, plane_type, current_block_type,first_block_type,number_of_planes_of_the_same_type_in_first_block_of_the_diblock);
938 
939  const DetPlane_TYPE start_plane_type = getStartPlaneTypeInBlock(current_block_type);
940 
941  /// Does the block starts with a different plane?
942  uint32_t is_block_starts_with_different_plane = 0;
943  if(plane_type != start_plane_type) is_block_starts_with_different_plane = 1;
944 
945  /// If it's the first block. We can calculate plane easily
946  if(local_block_in_diblock == 0)
947  return local_plane_in_diblock_view*2 + is_block_starts_with_different_plane;
948 
949  /// So, it's the second block. Need to do some magic
950 
951  /// To find local plane in the (second) block in the view we subtract
952  /// number of planes of the same type in the first diblock from the local plane in diblock view
953  const offline_plane_t local_plane_in_block_view = local_plane_in_diblock_view - number_of_planes_of_the_same_type_in_first_block_of_the_diblock;
954 
955  return getNumberOfPlanesInBlock(first_block_type) + local_plane_in_block_view*2 + is_block_starts_with_different_plane;
956 }
DetBlock_TYPE
Types of Block.
uint32_t getLocalBlockInDiblock(const int detector, const offline_plane_t) const
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t getNumberOfPlanesInBlock(int detId, block_t) const
Number of planes in the block given detectorID and block number.
DetPlane_TYPE
Types of Detector Plane.
DetPlane_TYPE getStartPlaneTypeInBlock(DetBlock_TYPE) const
Starting plane in the block given its type.
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblockOffline ( lchan  logicalchan) const

Returns the Plane relative to the start of the current diblock – Verified.

Definition at line 384 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getDetectorOffline(), getLocalPlaneInDiblock(), and getPlaneOffline().

384  {
385  const int detector = getDetectorOffline(chan);
386  const offline_plane_t plane_0 = getPlaneOffline(chan); //< plane starts from 0 in Offline
387 
388  return getLocalPlaneInDiblock(detector, plane_0);
389 }
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
offline_plane_t getLocalPlaneInDiblock(offline_plane_t local_plane_in_diblock_view, DiBlock_TYPE, DetPlane_TYPE)
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblockView ( const int  detector,
dcm_link_t  dcm_link_id,
const DiBlock_TYPE  diblock_type 
) const

Returns the Plane number relative to the current view and diblock – Verified.

For the FarDet and NearDet, the math is simple

Otherwise, this is NDOS.

DCM links are counted from 0. Refer to NOvA-doc-4219.

Muon catcher screws things up. We use 1 DCM for muon catcher in each view

Definition at line 848 of file DAQChannelMapOLD.cpp.

References novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, daqchannelmap::MC_DIBLOCK, and daqchannelmap::MC_ND_DIBLOCK.

Referenced by getDCMLink(), getLocalPlaneInDiblockView(), and getPlane().

848  {
849 
850  /// For the FarDet and NearDet, the math is simple
852 
853  // Treat the NearDet muon catcher as a special case.
854  if(diblock_type == MC_ND_DIBLOCK) {
855  // The FEBs (dcm_links) on the NearDet MC are plugged in in numerical order with no gaps
856  // and there are 11 planes in either view. So dcm_link_id % 11 will tell you the local
857  // plane in view for an FEB in this case.
858  return dcm_link_id % 11;
859  }
860 
861  // Otherwise its a normal FarDet or NearDet diblock.
862  return dcm_link_id % 32;
863  }
864 
865  /// Otherwise, this is NDOS.
866 
867  /// DCM links are counted from 0. Refer to NOvA-doc-4219.
868  if(dcm_link_id < 32) return dcm_link_id % 16;
869 
870  /// Muon catcher screws things up. We use 1 DCM for muon catcher in each view
871  if(diblock_type == MC_DIBLOCK) return (dcm_link_id - 32) % 16;
872 
873  return 16 + (dcm_link_id - 32) % 16;
874 
875 }
Identifider for NearDet Muon catcher.
Far Detector at Ash River, MN.
Near Detector in the NuMI cavern.
Identifider for NDOS Muon catcher.
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblockView ( const int  detector,
const offline_plane_t  plane_0 
) const

Definition at line 449 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getBlockNumber(), and getLocalPlaneInDiblockView().

451  {
452  const block_t block_number = getBlockNumber(detector, plane_0);
453  return getLocalPlaneInDiblockView(detector, plane_0, block_number);
454 }
uint32_t getBlockNumber(int detId, offline_plane_t) const
The block number given the detectorID and offline plane number.
offline_plane_t getLocalPlaneInDiblockView(const int detector, dcm_link_t, const DiBlock_TYPE) const
Returns the Plane number relative to the current view and diblock – Verified.
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblockView ( const int  detector,
const offline_plane_t  plane_0,
const block_t  block_number 
) const

otherwise, we need to calculate how many planes of the same view were in the first diblock

The first block of the diblock - it's the one before the current

View of the plane

Add the number of planes in the view for that diblock

Definition at line 457 of file DAQChannelMapOLD.cpp.

References getBlockType(), getLocalBlockInDiblock(), daqchannelmap::DAQChannelMapBaseOLD::getLocalPlaneInBlock(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlaneTypeInBlock(), and getPlaneType().

460  {
461 
462  const offline_plane_t local_plane_in_block = getLocalPlaneInBlock(detector, plane_0);
463 
464  offline_plane_t local_plane_in_diblock_view = local_plane_in_block / 2;
465 
466  const int local_block_in_diblock = getLocalBlockInDiblock(block_number);
467 
468  if(local_block_in_diblock == 0){
469  return local_plane_in_diblock_view;
470  }
471 
472  /// otherwise, we need to calculate how many planes of the same view
473  /// were in the first diblock
474 
475  /// The first block of the diblock - it's the one before the current
476  const block_t block_id_of_the_first_block_in_diblock = block_number - 1;
477  const DetBlock_TYPE block_type_of_the_first_block_in_diblock = getBlockType(block_id_of_the_first_block_in_diblock, detector);
478 
479  /// View of the plane
480  const DetPlane_TYPE plane_type = getPlaneType(detector, plane_0);
481 
482  /// Add the number of planes in the view for that diblock
483  local_plane_in_diblock_view += getNumberOfPlaneTypeInBlock(block_type_of_the_first_block_in_diblock, plane_type);
484 
485  return local_plane_in_diblock_view;
486 }
DetBlock_TYPE
Types of Block.
uint32_t getLocalBlockInDiblock(const int detector, const offline_plane_t) const
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
offline_plane_t getLocalPlaneInBlock(int detId, offline_plane_t) const
Local plane in block number given the detectorID and offline plane number.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
DetPlane_TYPE
Types of Detector Plane.
uint32_t getNumberOfPlaneTypeInBlock(DetBlock_TYPE, DetPlane_TYPE) const
Number of planes (X or Y) in the block given block type and type of plane(X or Y) ...
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblockView ( const int  detector,
const offline_plane_t  plane_0,
const block_t  block_number,
const DetPlane_TYPE  plane_type 
) const

otherwise, we need to calculate how many planes of the same view were in the first diblock

The first block of the diblock - it's the one before the current

Add the number of planes in the view for that diblock

Definition at line 490 of file DAQChannelMapOLD.cpp.

References getBlockType(), getLocalBlockInDiblock(), daqchannelmap::DAQChannelMapBaseOLD::getLocalPlaneInBlock(), and daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlaneTypeInBlock().

494  {
495 
496  const offline_plane_t local_plane_in_block = getLocalPlaneInBlock(detector, plane_0);
497 
498  offline_plane_t local_plane_in_diblock_view = local_plane_in_block / 2;
499 
500  const int local_block_in_diblock = getLocalBlockInDiblock(block_number);
501 
502  if(local_block_in_diblock == 0){
503  return local_plane_in_diblock_view;
504  }
505 
506  /// otherwise, we need to calculate how many planes of the same view
507  /// were in the first diblock
508 
509  /// The first block of the diblock - it's the one before the current
510  const block_t block_id_of_the_first_block_in_diblock = block_number - 1;
511  const DetBlock_TYPE block_type_of_the_first_block_in_diblock = getBlockType(block_id_of_the_first_block_in_diblock, detector);
512 
513  /// Add the number of planes in the view for that diblock
514  local_plane_in_diblock_view += getNumberOfPlaneTypeInBlock(block_type_of_the_first_block_in_diblock, plane_type);
515 
516  return local_plane_in_diblock_view;
517 }
DetBlock_TYPE
Types of Block.
uint32_t getLocalBlockInDiblock(const int detector, const offline_plane_t) const
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
offline_plane_t getLocalPlaneInBlock(int detId, offline_plane_t) const
Local plane in block number given the detectorID and offline plane number.
uint32_t getNumberOfPlaneTypeInBlock(DetBlock_TYPE, DetPlane_TYPE) const
Number of planes (X or Y) in the block given block type and type of plane(X or Y) ...
offline_plane_t DAQChannelMapOLD::getLocalPlaneInDiblockViewOffline ( lchan  logicalchan) const

Returns the Plane number relative to the current view and diblock – Verified.

otherwise, we need to calculate how many planes of the same view were in the first diblock

The first block of the diblock - it's the one before the current

View of the plane

Add the number of planes in the view for that diblock

Definition at line 418 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getBlockOffline(), getBlockType(), getDetectorOffline(), getLocalBlockInDiblockOffline(), getLocalPlaneInBlockOffline(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlaneTypeInBlock(), and getPlaneTypeOffline().

Referenced by getPlaneViewOffline().

418  {
419 
420  const offline_plane_t local_plane_in_block = getLocalPlaneInBlockOffline(chan);
421 
422  offline_plane_t local_plane_in_block_view = local_plane_in_block / 2;
423 
424  const int local_block_in_diblock = getLocalBlockInDiblockOffline(chan);
425 
426  if(local_block_in_diblock == 0) {
427  return local_plane_in_block_view;
428  }
429 
430  /// otherwise, we need to calculate how many planes of the same view
431  /// were in the first diblock
432 
433  const int detector = getDetectorOffline(chan);
434 
435  /// The first block of the diblock - it's the one before the current
436  const block_t block_id_of_the_first_block_in_diblock = getBlockOffline(chan) - 1;
437  const DetBlock_TYPE block_type_of_the_first_block_in_diblock = getBlockType(block_id_of_the_first_block_in_diblock, detector);
438 
439  /// View of the plane
440  const DetPlane_TYPE plane_type = getPlaneTypeOffline(chan);
441 
442  /// Add the number of planes in the view for that diblock
443  local_plane_in_block_view += getNumberOfPlaneTypeInBlock(block_type_of_the_first_block_in_diblock, plane_type);
444 
445  return local_plane_in_block_view;
446 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
DetBlock_TYPE
Types of Block.
uint32_t getLocalBlockInDiblockOffline(lchan logicalchan) const
If it&#39;s the upstream block in the diblock, then it&#39;s 0, if not, it&#39;s 1.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
offline_plane_t getLocalPlaneInBlockOffline(lchan logicalchan) const
Returns the Plane relative to the start of the current block – Verified.
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
block_t getBlockOffline(lchan logicalchan) const
Returns the Block that the offline channel is on – Verified.
DetPlane_TYPE
Types of Detector Plane.
uint32_t getNumberOfPlaneTypeInBlock(DetBlock_TYPE, DetPlane_TYPE) const
Number of planes (X or Y) in the block given block type and type of plane(X or Y) ...
DetPlane_TYPE getPlaneTypeOffline(lchan logicalchan) const
Returns the View that the offline channel is on.
uint32_t DAQChannelMapBaseOLD::getNumberOfCellsPerDCM ( DiBlock_TYPE  diblock_type) const
inherited

Number of cells per DCM for a given diblock type.

Definition at line 826 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_numberOfCellsPerDCMInDiblockArray.

Referenced by getDCM(), getLocalCellInDCM(), and getOnlineCell().

826 { return _numberOfCellsPerDCMInDiblockArray[diblock_type];}
uint32_t * _numberOfCellsPerDCMInDiblockArray
Number of cells that each DCM caries for each diblock type.
uint32_t DAQChannelMapBaseOLD::getNumberOfChannelsInPlane ( const int  detId,
const DetPlane_TYPE  plane_type 
) const
inherited

Get Number of channels in plane.

Definition at line 797 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInXPlane(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInYPlane(), and daqchannelmap::XZ_PLANE.

Referenced by daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInPlane(), and daqchannelmap::DAQChannelMapBaseOLD::print().

797  {
798 
799  if(plane_type == XZ_PLANE)
801 
803 }
uint32_t getNumberOfChannelsInYPlane(int detId) const
Number of channels in Y plane for a given detectorID.
Identifier for the horizontal plane.
uint32_t getNumberOfChannelsInXPlane(int detId) const
Number of channels in X plane for a given detectorID.
uint32_t DAQChannelMapBaseOLD::getNumberOfChannelsInPlane ( const int  detId,
const offline_plane_t  plane_0 
) const
inherited

Definition at line 805 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInPlane(), and daqchannelmap::DAQChannelMapBaseOLD::getPlaneType().

805  {
807 }
uint32_t getNumberOfChannelsInPlane(const int detId, const DetPlane_TYPE) const
Get Number of channels in plane.
DetPlane_TYPE getPlaneType(const int detId, const offline_plane_t) const
get Plane type
uint32_t DAQChannelMapBaseOLD::getNumberOfChannelsInXPlane ( int  detId) const
inherited

Number of channels in X plane for a given detectorID.

Definition at line 793 of file DAQChannelMapBaseOLD.cpp.

References runNovaSAM::detector, and daqchannelmap::DAQChannelMapBaseOLD::NUM_XCHAN_PLANE.

Referenced by daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInPlane().

793 {return NUM_XCHAN_PLANE[detector];}
static const unsigned int NUM_XCHAN_PLANE[]
uint32_t DAQChannelMapBaseOLD::getNumberOfChannelsInYPlane ( int  detId) const
inherited

Number of channels in Y plane for a given detectorID.

Definition at line 794 of file DAQChannelMapBaseOLD.cpp.

References runNovaSAM::detector, and daqchannelmap::DAQChannelMapBaseOLD::NUM_YCHAN_PLANE.

Referenced by ConvertCell(), and daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInPlane().

794 {return NUM_YCHAN_PLANE[detector];}
static const unsigned int NUM_YCHAN_PLANE[]
uint32_t DAQChannelMapBaseOLD::getNumberOfDCM ( int  detId,
DiBlock_TYPE  diblock_type 
) const
inherited

Total number of DCMs in the diblock given detectorID and Diblock type.

Definition at line 792 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfXDCM(), and daqchannelmap::DAQChannelMapBaseOLD::getNumberOfYDCM().

Referenced by daqchannelmap::NDOSDAQChannelMap::getNumberOfDCM().

792 {return getNumberOfXDCM(detector, diblock_type) + getNumberOfYDCM(detector, diblock_type);}
uint32_t getNumberOfXDCM(int detId, DiBlock_TYPE) const
Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type.
uint32_t getNumberOfYDCM(int detId, DiBlock_TYPE) const
Number of DCMs for vertical planes in the diblock given detectorID and Diblock type.
uint32_t DAQChannelMapBaseOLD::getNumberOfPlanesBeforeBlock ( int  detId,
block_t  block 
) const
inherited

Number of planes before block or diblock.

Definition at line 768 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_planesBeforeBlockDetectorArray, elec2geo::block, and runNovaSAM::detector.

block
print "ROW IS " print row
Definition: elec2geo.py:31
uint32_t DAQChannelMapBaseOLD::getNumberOfPlanesBeforeDiblock ( int  detId,
diblock_t  diblock 
) const
inherited
uint32_t DAQChannelMapBaseOLD::getNumberOfPlanesInBlock ( int  detId,
block_t  block 
) const
inherited
uint32_t DAQChannelMapBaseOLD::getNumberOfPlanesInBlock ( DetBlock_TYPE  block_type) const
inherited

Number of planes in the block given block type.

Definition at line 771 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_planesInBlockTypeArray.

771 {return _planesInBlockTypeArray[block_type];}
uint32_t DAQChannelMapBaseOLD::getNumberOfPlanesInDiblock ( int  detId,
diblock_t  diblock 
) const
inherited
uint32_t DAQChannelMapBaseOLD::getNumberOfPlanesInDiblock ( DiBlock_TYPE  diblock_type) const
inherited

Number of planes in the diblock given diblock type.

Definition at line 772 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_planesInDiblockTypeArray.

772 {return _planesInDiblockTypeArray[diblock_type];}
uint32_t DAQChannelMapBaseOLD::getNumberOfPlaneTypeInBlock ( DetBlock_TYPE  block_type,
DetPlane_TYPE  plane_type 
) const
inherited

Number of planes (X or Y) in the block given block type and type of plane(X or Y)

Definition at line 809 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_numberOfTypePlanesInBlockArray.

Referenced by getLocalBlockInDiblock(), getLocalPlaneInDiblockView(), getLocalPlaneInDiblockViewOffline(), and daqchannelmap::DAQChannelMapBaseOLD::initPlanesInDiblockID().

809  {
810  return _numberOfTypePlanesInBlockArray[plane_type-1][block_type];
811 }
uint32_t ** _numberOfTypePlanesInBlockArray
Keyed bu the DetPlane_TYPE and.
uint32_t DAQChannelMapBaseOLD::getNumberOfPlaneTypeInDiblock ( DiBlock_TYPE  diblock_type,
DetPlane_TYPE  plane_type 
) const
inherited

Number of planes (X or Y) in the diblock given diblock type and type of plane(X or Y)

Definition at line 813 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_numberOfTypePlanesInDiBlockArray.

Referenced by getPlaneViewOffline().

813  {
814  return _numberOfTypePlanesInDiBlockArray[plane_type-1][diblock_type];
815 }
uint32_t ** _numberOfTypePlanesInDiBlockArray
Keyed bu the DetPlane_TYPE and.
uint32_t DAQChannelMapBaseOLD::getNumberOfXDCM ( int  detId,
DiBlock_TYPE  diblock_type 
) const
inherited

Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type.

Definition at line 790 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_numberOfXDCMsInDiblockDetectorArray, and runNovaSAM::detector.

Referenced by getFirstDCMInView(), getLastDCMInView(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfDCM(), and getPlaneType().

uint32_t DAQChannelMapBaseOLD::getNumberOfYDCM ( int  detId,
DiBlock_TYPE  diblock_type 
) const
inherited

Number of DCMs for vertical planes in the diblock given detectorID and Diblock type.

Definition at line 791 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_numberOfYDCMsInDiblockDetectorArray, and runNovaSAM::detector.

Referenced by getLastDCMInView(), and daqchannelmap::DAQChannelMapBaseOLD::getNumberOfDCM().

online_cell_t DAQChannelMapOLD::getOnlineCell ( int  detId,
dcm_id_t  dcm_id,
dcm_link_t  dcm_link,
pixel_t  pixel,
DiBlock_TYPE  diblock_type 
) const
private

Definition at line 959 of file DAQChannelMapOLD.cpp.

References getPlaneType().

Referenced by getCell().

963  {
964  const DetPlane_TYPE plane_type = getPlaneType(detector, dcm_id, diblock_type);
965  return getOnlineCell(detector, dcm_id, dcm_link, pixel, diblock_type, plane_type);
966 }
online_cell_t getOnlineCell(int detId, dcm_id_t, dcm_link_t, pixel_t, DiBlock_TYPE) const
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
DetPlane_TYPE
Types of Detector Plane.
online_cell_t DAQChannelMapOLD::getOnlineCell ( const int  detId,
const dcm_id_t  dcm_id,
const dcm_link_t  dcm_link,
const pixel_t  pixel,
const DiBlock_TYPE  diblock_type,
const DetPlane_TYPE  plane_type 
) const
private

The NearDet has an uninstrumented section in DCM 01 in diblocks 1-3. Nothing is plugged into FEBs 32-63, yet there is no gap in cell number.

If we are in DCM 2, we have to subtract 32 due to this gap.

If we are in the bottom half of DCM 1 (FEBs 32-63) then this is hardware with nothing plugged in, so return a BIG number.

Definition at line 969 of file DAQChannelMapOLD.cpp.

References getBrightness::cell, getFirstDCMInView(), getLocalModuleInDCM(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfCellsPerDCM(), novadaq::cnv::kNEARDET, daqchannelmap::MC_ND_DIBLOCK, and daqchannelmap::NUM_PIXELS.

974  {
975 
976  const dcm_id_t first_dcm_in_view = getFirstDCMInView(detector, plane_type, diblock_type);
977  const uint32_t local_module_in_dcm = getLocalModuleInDCM(detector, dcm_id, dcm_link, diblock_type);
978 
979  online_cell_t cell = getNumberOfCellsPerDCM(diblock_type)*(dcm_id - first_dcm_in_view) + NUM_PIXELS*local_module_in_dcm + pixel;
980 
981  /// The NearDet has an uninstrumented section in DCM 01 in diblocks 1-3. Nothing is plugged
982  /// into FEBs 32-63, yet there is no gap in cell number.
983 
984  /// If we are in DCM 2, we have to subtract 32 due to this gap.
985  if(detector == novadaq::cnv::kNEARDET && dcm_id == 2 && diblock_type != MC_ND_DIBLOCK)
986  return cell - 32;
987 
988  /// If we are in the bottom half of DCM 1 (FEBs 32-63) then this is hardware with nothing plugged in,
989  /// so return a BIG number.
990  if(detector == novadaq::cnv::kNEARDET && dcm_id == 1 && diblock_type != MC_ND_DIBLOCK && dcm_link >= 32)
991  return -1;
992 
993  // Otherwise, we do not have to do this special correction.
994  return cell;
995 
996 }
Identifider for NearDet Muon catcher.
uint32_t getNumberOfCellsPerDCM(DiBlock_TYPE) const
Number of cells per DCM for a given diblock type.
dcm_id_t getFirstDCMInView(int detector, DetPlane_TYPE, DiBlock_TYPE) const
Near Detector in the NuMI cavern.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t getLocalModuleInDCM(const int detector_id, dcm_id_t, dcm_link_t, const DiBlock_TYPE) const
Returns the module number (0 or 1) to which a given module belongs.
online_cell_t DAQChannelMapOLD::getOnlineCell ( const int  detId,
const dcm_id_t  dcm_id,
const dcm_link_t  dcm_link,
const pixel_t  pixel,
const DiBlock_TYPE  diblock_type,
const DetPlane_TYPE  plane_type,
const uint32_t  number_of_x_dcms 
) const
private

The NearDet has an uninstrumented section in DCM 01 in diblocks 1-3. Nothing is plugged into FEBs 32-63, yet there is no gap in cell number.

If we are in DCM 2, we have to subtract 32 due to this gap.

If we are in the bottom half of DCM 1 (FEBs 32-63) then this is hardware with nothing plugged in, so return a BIG number.

Definition at line 999 of file DAQChannelMapOLD.cpp.

References getBrightness::cell, getFirstDCMInView(), getLocalModuleInDCM(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfCellsPerDCM(), novadaq::cnv::kNEARDET, daqchannelmap::MC_ND_DIBLOCK, and daqchannelmap::NUM_PIXELS.

1005  {
1006 
1007  // WARNING: This function allows you to override the constants defined in DAQCHannelMapConstants.h!!!
1008 
1009  const dcm_id_t first_dcm_in_view = getFirstDCMInView(plane_type, number_of_x_dcms);
1010  const uint32_t local_module_in_dcm = getLocalModuleInDCM(detector, dcm_id, dcm_link, diblock_type);
1011 
1012  online_cell_t cell = getNumberOfCellsPerDCM(diblock_type)*(dcm_id - first_dcm_in_view) + NUM_PIXELS*local_module_in_dcm + pixel;
1013 
1014  /// The NearDet has an uninstrumented section in DCM 01 in diblocks 1-3. Nothing is plugged
1015  /// into FEBs 32-63, yet there is no gap in cell number.
1016 
1017  /// If we are in DCM 2, we have to subtract 32 due to this gap.
1018  if(detector == novadaq::cnv::kNEARDET && dcm_id == 2 && diblock_type != MC_ND_DIBLOCK)
1019  return cell - 32;
1020 
1021  /// If we are in the bottom half of DCM 1 (FEBs 32-63) then this is hardware with nothing plugged in,
1022  /// so return a BIG number.
1023  if(detector == novadaq::cnv::kNEARDET && dcm_id == 1 && diblock_type != MC_ND_DIBLOCK && dcm_link >= 32)
1024  return -1;
1025 
1026  // Otherwise, we do not have to do this special correction.
1027  return cell;
1028 
1029 }
Identifider for NearDet Muon catcher.
uint32_t getNumberOfCellsPerDCM(DiBlock_TYPE) const
Number of cells per DCM for a given diblock type.
dcm_id_t getFirstDCMInView(int detector, DetPlane_TYPE, DiBlock_TYPE) const
Near Detector in the NuMI cavern.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t getLocalModuleInDCM(const int detector_id, dcm_id_t, dcm_link_t, const DiBlock_TYPE) const
Returns the module number (0 or 1) to which a given module belongs.
online_cell_t DAQChannelMapOLD::getOnlineCellOffline ( lchan  logicalchan) const
private

Definition at line 1035 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getCellOffline(), getDetectorOffline(), getDiBlockTypeOffline(), getPlaneTypeOffline(), and offlineCellToOnlineCell().

Referenced by getLocalModuleInDCMOffline().

1035  {
1036 
1037  const offline_cell_t cell_offline_0 = getCellOffline(chan);
1038  const DetPlane_TYPE plane_type = getPlaneTypeOffline(chan);
1039  const int detector = getDetectorOffline(chan);
1040  const DiBlock_TYPE diblock_type = getDiBlockTypeOffline(chan);
1041 
1042  return offlineCellToOnlineCell(cell_offline_0, detector, plane_type, diblock_type);
1043 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_cell_t
< DAQ Channel Map Package
DiBlock_TYPE getDiBlockTypeOffline(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the offline channel – Verified.
offline_cell_t getCellOffline(lchan logicalchan) const
Returns the cell the cell on the current plane that the offline channel belongs to – Verified...
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
online_cell_t offlineCellToOnlineCell(offline_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
DetPlane_TYPE getPlaneTypeOffline(lchan logicalchan) const
Returns the View that the offline channel is on.
DetPlane_TYPE DAQChannelMapBaseOLD::getOtherPlaneType ( DetPlane_TYPE  input_plane_type) const
inherited

opposite plane view from the input. For instance Y = getOtherView(X)

Definition at line 958 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::XZ_PLANE, and daqchannelmap::YZ_PLANE.

Referenced by getPlaneTypeOffline(), and daqchannelmap::DAQChannelMapBaseOLD::initPlaneTypePlaneNumber().

958  {
959  if(input_plane_type == XZ_PLANE)return YZ_PLANE;
960  return XZ_PLANE;
961 }
Identifier for the vertical plane.
Identifier for the horizontal plane.
DetView_TYPE DAQChannelMapBaseOLD::getOtherView ( DetView_TYPE  input_view) const
inherited

opposite plane view from the input. For instance Y = getOtherView(X)

Definition at line 952 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::X_VIEW, and daqchannelmap::Y_VIEW.

952  {
953  if(input_view == X_VIEW)return Y_VIEW;
954  return X_VIEW;
955 }
Identifier for the Y measuring view of the detector (side)
Identifier for the X measuring view of the detector (top)
pixel_t DAQChannelMapOLD::getPixel ( dchan  daqchan) const
pixel_t DAQChannelMapOLD::getPixel ( const int  detector,
const offline_plane_t  plane_0,
const offline_cell_t  cell_0 
) const

Definition at line 602 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), getDiBlockType(), getPixel(), getPlaneType(), and offlineCellToOnlineCell().

604  {
605 
606  const DetPlane_TYPE plane_type = getPlaneType(detector, plane_0);
607  const diblock_t diblock_number = getDiblockNumber(detector, plane_0);
608  const DiBlock_TYPE diblock_type = getDiBlockType(detector, diblock_number);
609  const online_cell_t online_cell_0 = offlineCellToOnlineCell(cell_0, detector, plane_type, diblock_type);
610 
611  return getPixel(online_cell_0, diblock_type);
612 }
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
uint32_t diblock_t
Type for diblocks and blocks.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
online_cell_t offlineCellToOnlineCell(offline_cell_t, int detId, DetPlane_TYPE, DiBlock_TYPE) const
pixel_t DAQChannelMapOLD::getPixel ( const online_cell_t  online_cell_0,
const DiBlock_TYPE  diblock_type 
) const

Definition at line 615 of file DAQChannelMapOLD.cpp.

References getLocalCellInDCM(), and daqchannelmap::NUM_PIXELS.

616  {
617  const online_cell_t local_cell_in_dcm = getLocalCellInDCM(online_cell_0, diblock_type);
618 
619  return local_cell_in_dcm % NUM_PIXELS;
620  }
online_cell_t getLocalCellInDCM(online_cell_t, DiBlock_TYPE) const
pixel_t DAQChannelMapOLD::getPixelOffline ( lchan  logicalchan) const

Definition at line 770 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, getCellOffline(), getDetectorOffline(), getPixel(), and getPlaneOffline().

Referenced by printOffline().

770  {
771 
772  const int detector = getDetectorOffline(chan);
773  const offline_plane_t plane_0 = getPlaneOffline(chan);
774  const offline_cell_t cell_0 = getCellOffline(chan);
775 
776  return getPixel(detector, plane_0, cell_0);
777 
778  // NOTE: The 4 lines below were originally in this code un-commented. I saw no way that
779  // these lines could have been reached due to the return statement above, but Denis
780  // is full of mystery so I didn't want to delete them just in case we needed them...
781 
782  // const online_cell_t online_cell_0 = getOnlineCellOffline(chan);
783  // const DiBlock_TYPE diblock_type = getDiBlockTypeOffline(chan);
784  // const online_cell_t local_cell_in_dcm = getLocalCellInDCM(online_cell_0, diblock_type);
785  // return local_cell_in_dcm % NUM_PIXELS;
786 }
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t offline_cell_t
< DAQ Channel Map Package
offline_cell_t getCellOffline(lchan logicalchan) const
Returns the cell the cell on the current plane that the offline channel belongs to – Verified...
offline_plane_t DAQChannelMapOLD::getPlane ( dchan  daqchan)

Returns the plane position, as referenced relative to the full detector, of the daq channel.

Returns the Plane in coordinates relative to the dcm (i.e. 0-31)

Definition at line 183 of file DAQChannelMapOLD.cpp.

References getDCM(), getDCMLink(), getDetector(), and getDiBlock().

Referenced by encodeLChan(), and print().

183  {
184 
185  const int detector_id = getDetector(daqchan);
186  const diblock_t diblock_id = getDiBlock(daqchan);
187  const dcm_id_t dcm_id = getDCM(daqchan);
188  const dcm_link_t dcm_link_id = getDCMLink(daqchan);
189 
190  return getPlane(detector_id, diblock_id, dcm_id, dcm_link_id);
191 }
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
diblock_t getDiBlock(dchan daqchan) const
Decodes Diblock number from universal daq channel number.
int getDetector(dchan daqchan) const
Decodes detector identity from universal channel number.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
offline_plane_t getPlane(dchan daqchan)
Returns the plane position, as referenced relative to the full detector, of the daq channel...
uint32_t diblock_t
Type for diblocks and blocks.
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
offline_plane_t DAQChannelMapOLD::getPlane ( const int  detector_id,
const diblock_t  diblock_id,
const dcm_id_t  dcm_id,
const dcm_link_t  dcm_link_id 
)

Returns the Plane in coordinates relative to the dcm (i.e. 0-31)

Now Based on (detector_id, diblock_id, dcm_id, dcm_link_id), calculate these variables

Definition at line 195 of file DAQChannelMapOLD.cpp.

References getDiBlockType(), getLocalPlaneInDiblock(), getLocalPlaneInDiblockView(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlanesBeforeDiblock(), and getPlaneType().

195  {
196 
197  /// Now Based on (detector_id, diblock_id, dcm_id, dcm_link_id), calculate these variables
198  const DiBlock_TYPE diblock_type = getDiBlockType(detector_id, diblock_id);// calling base
199  const offline_plane_t local_plane_in_diblock_view = getLocalPlaneInDiblockView(detector_id, dcm_link_id, diblock_type);
200  const DetPlane_TYPE plane_type = getPlaneType(detector_id, dcm_id, diblock_type);
201 
202  return getNumberOfPlanesBeforeDiblock(detector_id, diblock_id)
203  +getLocalPlaneInDiblock(local_plane_in_diblock_view, diblock_type, plane_type);
204 }
uint32_t getNumberOfPlanesBeforeDiblock(int detId, diblock_t) const
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
offline_plane_t getLocalPlaneInDiblock(offline_plane_t local_plane_in_diblock_view, DiBlock_TYPE, DetPlane_TYPE)
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
offline_plane_t getLocalPlaneInDiblockView(const int detector, dcm_link_t, const DiBlock_TYPE) const
Returns the Plane number relative to the current view and diblock – Verified.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
offline_plane_t DAQChannelMapOLD::getPlaneOffline ( lchan  logicalchan) const

Returns the plane (detector wide) that the offline channel belongs to – Verified.

Definition at line 220 of file DAQChannelMapOLD.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_PLANE_OUTRANGE, getDetectorOffline(), daqchannelmap::MASK_OFFLINE_PLANE, daqchannelmap::DAQChannelMapBaseOLD::NUM_DIBLOCK_DET, and daqchannelmap::SHIFT_OFFLINE_PLANE.

Referenced by encodeDChan(), getBlockOffline(), getDCMLinkOffline(), getDCMOffline(), getDiBlockOffline(), getLocalPlaneInBlockOffline(), getLocalPlaneInDiblockOffline(), getPixelOffline(), and printOffline().

220  {
221 
223 
224  return BOUNDSCHECK(
227 }
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
Plane Number,(18bit), valid range 0-930 (far det)
#define BITFIELDGET(block, mask, shift)
Definition: BitFields.h:23
#define BOUNDSCHECK(value, min, max, err)
Definition: boundscheck.h:22
static const unsigned int NUM_DIBLOCK_DET[]
DetPlane_TYPE DAQChannelMapBaseOLD::getPlaneType ( const int  detId,
const offline_plane_t  plane_0 
) const
inherited

get Plane type

Definition at line 754 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_planeType_planeNumberArray, and runNovaSAM::detId.

Referenced by daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInPlane(), and daqchannelmap::DAQChannelMapBaseOLD::print().

754  {
756 }
uint32_t ** _planeType_planeNumberArray
Plane type as a function of offline plane number and DetectorID.
DetPlane_TYPE
Types of Detector Plane.
DetPlane_TYPE DAQChannelMapOLD::getPlaneType ( int  detId,
dcm_id_t  dcm_id,
DiBlock_TYPE  diblock_type 
) const

Definition at line 829 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfXDCM(), daqchannelmap::XZ_PLANE, and daqchannelmap::YZ_PLANE.

Referenced by encodeDChan(), getCell(), getDCM(), getDCMLink(), getLocalPlaneInDiblockView(), getOnlineCell(), getPixel(), getPlane(), and getView().

829  {
830  if(dcm_id <= getNumberOfXDCM(detector_id, diblock_type)) return XZ_PLANE;
831 
832  return YZ_PLANE;
833 }
Identifier for the vertical plane.
uint32_t getNumberOfXDCM(int detId, DiBlock_TYPE) const
Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type.
Identifier for the horizontal plane.
DetPlane_TYPE DAQChannelMapOLD::getPlaneType ( int  detId,
dcm_id_t  dcm_id,
DiBlock_TYPE  diblock_type,
uint32_t &  number_of_x_dcm 
) const

Definition at line 836 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getNumberOfXDCM(), daqchannelmap::XZ_PLANE, and daqchannelmap::YZ_PLANE.

836  {
837 
838  // I don't understand why we are passing in number_of_x_dcm by reference when there is a function that
839  // will get this value for you.
840 
841  number_of_x_dcm = getNumberOfXDCM(detector_id, diblock_type);
842 
843  if(dcm_id <= getNumberOfXDCM(detector_id, diblock_type)) return XZ_PLANE;
844  return YZ_PLANE;
845 }
Identifier for the vertical plane.
uint32_t getNumberOfXDCM(int detId, DiBlock_TYPE) const
Number of DCMs for horizontal planes in the diblock given detectorID and Diblock type.
Identifier for the horizontal plane.
DetPlane_TYPE DAQChannelMapOLD::getPlaneTypeOffline ( lchan  logicalchan) const

Returns the View that the offline channel is on.

If local plane is even, then the view is the same as the one that the block starts with

Definition at line 405 of file DAQChannelMapOLD.cpp.

References EVEN, getBlockType(), getLocalPlaneInBlockOffline(), daqchannelmap::DAQChannelMapBaseOLD::getOtherPlaneType(), and daqchannelmap::DAQChannelMapBaseOLD::getStartPlaneTypeInBlock().

Referenced by getFirstDCMInViewOffline(), getLastDCMInViewOffline(), getLocalPlaneInDiblockViewOffline(), getOnlineCellOffline(), getPlaneViewOffline(), and getViewOffline().

405  {
406  const DetBlock_TYPE block_type = getBlockType(chan);
407  const uint32_t local_plane_in_block = getLocalPlaneInBlockOffline(chan);
408 
409  const DetPlane_TYPE start_plane_type = getStartPlaneTypeInBlock(block_type);
410 
411  /// If local plane is even, then the view is the same as the one that the block starts with
412  if(EVEN(local_plane_in_block)) return start_plane_type;
413 
414  return getOtherPlaneType(start_plane_type);
415 }
DetBlock_TYPE
Types of Block.
DetPlane_TYPE getOtherPlaneType(DetPlane_TYPE) const
opposite plane view from the input. For instance Y = getOtherView(X)
offline_plane_t getLocalPlaneInBlockOffline(lchan logicalchan) const
Returns the Plane relative to the start of the current block – Verified.
DetBlock_TYPE getBlockType(lchan logicalchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
DetPlane_TYPE
Types of Detector Plane.
DetPlane_TYPE getStartPlaneTypeInBlock(DetBlock_TYPE) const
Starting plane in the block given its type.
#define EVEN(x)
< DAQ Channel Map Package
offline_plane_t DAQChannelMapOLD::getPlaneViewOffline ( lchan  logicalchan)

Returns the Plane number relative to the current view – Verified.

the plane number that the current channel is on in the local diblock

Definition at line 522 of file DAQChannelMapOLD.cpp.

References runNovaSAM::detector, geo2elec::diblock, getDetectorOffline(), getDiBlockOffline(), getDiBlockType(), getLocalPlaneInDiblockViewOffline(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfPlaneTypeInDiblock(), and getPlaneTypeOffline().

522  {
523 
525  const int detector = getDetectorOffline(chan);
526  const DetPlane_TYPE plane_type = getPlaneTypeOffline(chan);
527 
528  // Sum the number of planes in this view prior to the current diblock
529  // that the channel is from
530 
531  /// the plane number that the current channel is on in the local diblock
532  uint32_t total_planes = getLocalPlaneInDiblockViewOffline(chan);
533 
534  for(uint32_t idiblock = 0; idiblock < diblock; ++idiblock){
535  const DiBlock_TYPE diblock_type = getDiBlockType(detector, idiblock);// calling base
536  total_planes += getNumberOfPlaneTypeInDiblock(diblock_type, plane_type);
537  }// end of loop over diblocks
538 
539  return total_planes;
540 }
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t getNumberOfPlaneTypeInDiblock(DiBlock_TYPE, DetPlane_TYPE) const
Number of planes (X or Y) in the diblock given diblock type and type of plane(X or Y) ...
uint32_t diblock_t
Type for diblocks and blocks.
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
offline_plane_t getLocalPlaneInDiblockViewOffline(lchan logicalchan) const
Returns the Plane number relative to the current view and diblock – Verified.
diblock_t getDiBlockOffline(lchan logicalchan) const
Returns the DiBlock that the offline channel is on – Verified.
DetPlane_TYPE getPlaneTypeOffline(lchan logicalchan) const
Returns the View that the offline channel is on.
DetPlane_TYPE DAQChannelMapBaseOLD::getStartPlaneTypeInBlock ( DetBlock_TYPE  block_type) const
inherited
uint32_t DAQChannelMapBaseOLD::getTotalNumberOfBlocks ( int  detId) const
inherited

Total number of blocks for a given detector.

Total number of diblocks in the detector

Definition at line 829 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::getTotalNumberOfDiblocks().

Referenced by daqchannelmap::DAQChannelMapBaseOLD::initPlanesInBlockAndDiblockDetector().

829 { return 2 * getTotalNumberOfDiblocks(detector);}
uint32_t getTotalNumberOfDiblocks(int detId) const
Total number of diblocks for a given detector.
uint32_t DAQChannelMapBaseOLD::getTotalNumberOfDiblocks ( int  detId) const
inherited
uint32_t DAQChannelMapBaseOLD::getTotalNumberOfPlanes ( const int  detId) const
inherited

Total number of Planes in the detector.

Definition at line 833 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_totalNumberOfPlanes, and runNovaSAM::detId.

Referenced by daqchannelmap::DAQChannelMapBaseOLD::print().

833 { return _totalNumberOfPlanes[detId];}
std::vector< uint32_t > _totalNumberOfPlanes
DetView_TYPE DAQChannelMapOLD::getView ( dchan  daqchan) const

Returns the View (X or Y) from the universal daq channel number.

Definition at line 162 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::detPlaneToDetView(), getDCM(), getDetector(), getDiBlockType(), and getPlaneType().

Referenced by daqchannelmap::NDOSDAQChannelMap::getView().

162  {
163  const int detector_id = getDetector(daqchan);
164  const dcm_id_t dcm_id = getDCM(daqchan);
165  const DiBlock_TYPE diblock_type = getDiBlockType(daqchan);
166 
167  const DetPlane_TYPE plane_type = getPlaneType(detector_id, dcm_id, diblock_type);
168 
169  return detPlaneToDetView(plane_type);
170 }
DetView_TYPE detPlaneToDetView(DetPlane_TYPE) const
Conversion from DetPlane_TYPE to DetView_TYPE.
int getDetector(dchan daqchan) const
Decodes detector identity from universal channel number.
DiBlock_TYPE getDiBlockType(dchan daqchan) const
Returns the DiBlock type (i.e. AB, BA, AA) of the daq channel – Verified.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
DetPlane_TYPE getPlaneType(int detId, dcm_id_t, DiBlock_TYPE) const
DetPlane_TYPE
Types of Detector Plane.
DiBlock_TYPE
Types of Diblock.
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
DetView_TYPE DAQChannelMapOLD::getViewOffline ( lchan  logicalchan) const

Returns the Plane type that the offline channel is on.

Definition at line 400 of file DAQChannelMapOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::detPlaneToDetView(), and getPlaneTypeOffline().

400  {
402 }
DetView_TYPE detPlaneToDetView(DetPlane_TYPE) const
Conversion from DetPlane_TYPE to DetView_TYPE.
DetPlane_TYPE getPlaneTypeOffline(lchan logicalchan) const
Returns the View that the offline channel is on.
dchan DAQChannelMapOLD::l2d ( offline_plane_t  plane,
offline_cell_t  cell,
int  detId 
)

Convience Methods for accessing DAQ parameters from the logical space.

Definition at line 705 of file DAQChannelMapOLD.cpp.

References encodeDChan(), and encodeLChan().

online_cell_t DAQChannelMapOLD::offlineCellToOnlineCell ( offline_cell_t  offline_cell_0,
int  detId,
DetPlane_TYPE  plane_type,
DiBlock_TYPE  diblock_type 
) const
private

Definition at line 1054 of file DAQChannelMapOLD.cpp.

References ConvertCell().

Referenced by encodeDChan(), getDCM(), getDCMLink(), getOnlineCellOffline(), and getPixel().

1058  {
1059  return ConvertCell((uint32_t)offline_cell_0, detector, plane_type, diblock_type);
1060 }
uint32_t ConvertCell(uint32_t input_cell, int detId, DetPlane_TYPE, DiBlock_TYPE) const
If input cell if offline_cell, then the output is online cell.
offline_cell_t DAQChannelMapOLD::onlineCellToOfflineCell ( online_cell_t  online_cell_0,
int  detId,
DetPlane_TYPE  plane_type,
DiBlock_TYPE  diblock_type 
) const
private

Offline to Online and vice versa.

Definition at line 1046 of file DAQChannelMapOLD.cpp.

References ConvertCell().

Referenced by getCell().

1050  {
1051  return ConvertCell((uint32_t)online_cell_0, detector, plane_type, diblock_type);
1052 }
uint32_t ConvertCell(uint32_t input_cell, int detId, DetPlane_TYPE, DiBlock_TYPE) const
If input cell if offline_cell, then the output is online cell.
apd_pixel_t DAQChannelMapBaseOLD::pixel2APDPixel ( pixel_t  pixel) const
inherited

APDPixel number from Pixel.

Definition at line 760 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::DAQChannelMapBaseOLD::_cell2ApdPixelMapArray.

Referenced by encodeDChan(), and printOffline().

760 {return _cell2ApdPixelMapArray[pixel];}
bool DAQChannelMapBaseOLD::print ( ) const
inherited

Print all detectors info.

loop over detectors

working with legal detector IDs only

Definition at line 694 of file DAQChannelMapBaseOLD.cpp.

References om::cout, daqchannelmap::DAQChannelMapBaseOLD::getTotalNumberOfPlanes(), novadaq::cnv::kNDetector, and novadaq::cnv::kUNKNOWN_DET.

694  {
695 
696  std::cout<<__PRETTY_FUNCTION__<<"\n";
697 
698  /// loop over detectors
699  for(uint32_t idet = 0; idet < novadaq::cnv::kNDetector; idet++){
700 
701  /// working with legal detector IDs only
702  if(idet > novadaq::cnv::kUNKNOWN_DET && idet<novadaq::cnv::kNDetector){
703 
704  std::cout<<"Detector ID"<<idet<<"\n";
705 
706  const uint32_t number_of_planes = getTotalNumberOfPlanes(idet);
707 
708  for(offline_plane_t iplane = 0; iplane < number_of_planes; ++iplane){
709  print(idet, iplane);
710  std::cout<<"\n";
711  }
712  }
713  }// end of loop over detectors
714 
715 
716  return true;
717 
718 }
uint32_t getTotalNumberOfPlanes(const int detId) const
Total number of Planes in the detector.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
bool print() const
Print all detectors info.
OStream cout
Definition: OStream.cxx:6
bool DAQChannelMapBaseOLD::print ( const int  detId,
const offline_plane_t  iplane 
) const
inherited

current block number

Definition at line 720 of file DAQChannelMapBaseOLD.cpp.

References daqchannelmap::BLOCK_OFFSET, om::cout, daqchannelmap::DAQChannelMapBaseOLD::getBlockNumber(), daqchannelmap::DAQChannelMapBaseOLD::getBlockType(), daqchannelmap::DAQChannelMapBaseOLD::getDiblockNumber(), daqchannelmap::DAQChannelMapBaseOLD::getDiBlockType(), daqchannelmap::DAQChannelMapBaseOLD::getNumberOfChannelsInPlane(), and daqchannelmap::DAQChannelMapBaseOLD::getPlaneType().

720  {
721 
722 
723  /// current block number
724  const diblock_t diblock_number = getDiblockNumber(idet, iplane);
725  const block_t block_number = getBlockNumber(idet, iplane);
726 
727  const DiBlock_TYPE diblock_type = getDiBlockType(idet, diblock_number);
728 
729  const uint32_t local_block_number_in_diblock = (block_number - BLOCK_OFFSET) % 2;
730 
731  const DetBlock_TYPE block_type = getBlockType(diblock_type, local_block_number_in_diblock);
732 
733 
734  std::cout<<"Plane="<<iplane
735  <<" Diblock type="<<diblock_type
736  <<" Block type="<<block_type
737  <<" local_block_number_in_diblock="<<local_block_number_in_diblock
738  <<" Plane type="<<getPlaneType(idet, iplane)
739  <<" NumberOfChannels="<<getNumberOfChannelsInPlane(idet, iplane);
740 
741  return true;
742 }
DetBlock_TYPE
Types of Block.
uint32_t getNumberOfChannelsInPlane(const int detId, const DetPlane_TYPE) const
Get Number of channels in plane.
DiBlock_TYPE getDiBlockType(int detId, diblock_t) const
Diblock type given detectorID and diblock number.
DetBlock_TYPE getBlockType(DiBlock_TYPE, uint32_t local_block_number_in_diblock) const
Block type given diblock type an local block in diblock.
do we count blocks from 0 or 1
uint32_t getBlockNumber(int detId, offline_plane_t) const
The block number given the detectorID and offline plane number.
OStream cout
Definition: OStream.cxx:6
uint32_t diblock_t
Type for diblocks and blocks.
DetPlane_TYPE getPlaneType(const int detId, const offline_plane_t) const
get Plane type
DiBlock_TYPE
Types of Diblock.
uint32_t getDiblockNumber(int detId, offline_plane_t) const
The diblock number given the detectorID and offline plane number.
bool DAQChannelMapOLD::print ( dchan  daqchan)

Definition at line 1084 of file DAQChannelMapOLD.cpp.

References om::cout, fillBadChanDBTables::det, geo2elec::diblock, encodeLChan(), getCell(), getDCM(), getDCMLink(), getDetector(), getDiBlock(), novadaq::cnv::DetInfo::GetName(), getPixel(), getPlane(), printBinary(), and printHex().

1084  {
1085 
1086  const int det = getDetector(chan);
1087  const diblock_t diblock = getDiBlock(chan);
1088  const dcm_id_t dcm_id = getDCM(chan);
1089  const dcm_link_t dcm_link = getDCMLink(chan);
1090  const pixel_t pixel = getPixel(chan);
1091 
1092  const offline_plane_t plane_0 = getPlane(chan);
1093  const offline_cell_t cell_0 = getCell(chan);
1094 
1095  const lchan offline_channel = encodeLChan(det, plane_0, cell_0);
1096 
1097  std::cout<<"DAQChannel=";printHex(chan);
1098  std::cout<<"(";printBinary(chan);std::cout<<")";
1099  std::cout<<"\n";
1100 
1101  std::cout<<" Detector="<<det<<"("<<novadaq::cnv::DetInfo::GetName(det)<<")";
1102  std::cout<<" Diblock="<<diblock;
1103  std::cout<<" DCM="<<dcm_id;
1104  std::cout<<" DCMLink="<<dcm_link;
1105  std::cout<<" Pixel="<<pixel;
1106 
1107  std::cout<<" ";
1108 
1109  std::cout<<" Plane="<<plane_0;
1110  std::cout<<" Cell="<<cell_0;
1111 
1112  std::cout<<"\n";
1113  std::cout<<" OfflineChannel=";
1114  printHex(offline_channel);std::cout<<"(";printBinary(offline_channel);std::cout<<")";
1115 
1116  std::cout<<"\n";
1117 
1118  return true;
1119 }
static std::string GetName(int id)
pixel_t getPixel(dchan daqchan) const
Decodes APD pixel number from the universal daq channel number.
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
uint32_t pixel_t
Type for physical pixel on APD.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
dcm_link_t getDCMLink(dchan daqchan) const
Decodes Link Port on the DCM from the universal daq channel number.
diblock_t getDiBlock(dchan daqchan) const
Decodes Diblock number from universal daq channel number.
uint32_t offline_cell_t
< DAQ Channel Map Package
int getDetector(dchan daqchan) const
Decodes detector identity from universal channel number.
OStream cout
Definition: OStream.cxx:6
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
offline_plane_t getPlane(dchan daqchan)
Returns the plane position, as referenced relative to the full detector, of the daq channel...
uint32_t diblock_t
Type for diblocks and blocks.
offline_cell_t getCell(dchan daqchan) const
Returns the cell position, as referenced relative to the full detector, of the daq channel...
dcm_id_t getDCM(dchan daqchan) const
Decodes DCM position on the diblock from universal daq channel number.
bool DAQChannelMapOLD::printBinary ( uint32_t  value)
private

Definition at line 1161 of file DAQChannelMapOLD.cpp.

References om::cout, and MECModelEnuComparisons::i.

Referenced by print(), and printOffline().

1161  {
1162 
1163  const int SHIFT = 8 * sizeof( unsigned ) - 1;
1164  const unsigned MASK = 1 << SHIFT;
1165 
1166  for ( int i = 1; i <= SHIFT + 1; i++ ){
1167  std::cout << ( value & MASK ? '1' : '0' );
1168  value <<= 1;
1169 
1170  if ( i % 8 == 0 ) std::cout << ' ';
1171  }
1172 
1173  return true;
1174 }// end of printBinary
const XML_Char int const XML_Char * value
Definition: expat.h:331
OStream cout
Definition: OStream.cxx:6
bool DAQChannelMapOLD::printHex ( uint32_t  value)
private

Definition at line 1178 of file DAQChannelMapOLD.cpp.

References printf().

Referenced by print(), and printOffline().

1178  {
1179  printf("0x%08x",value);
1180 
1181  return true;
1182 }// end of printHex
const XML_Char int const XML_Char * value
Definition: expat.h:331
printf("%d Experimental points found\n", nlines)
bool DAQChannelMapOLD::printOffline ( lchan  logicalchan)

Print Information about the Offline logical Channel.

Definition at line 1122 of file DAQChannelMapOLD.cpp.

References om::cout, fillBadChanDBTables::det, geo2elec::diblock, encodeDChan(), getCellOffline(), getDCMLinkOffline(), getDCMOffline(), getDetectorOffline(), getDiBlockOffline(), novadaq::cnv::DetInfo::GetName(), getPixelOffline(), getPlaneOffline(), daqchannelmap::DAQChannelMapBaseOLD::pixel2APDPixel(), printBinary(), and printHex().

1122  {
1123 
1124  const int det = getDetectorOffline(chan);
1125  const offline_plane_t plane_0 = getPlaneOffline(chan);
1126  const offline_cell_t cell_0 = getCellOffline(chan);
1127 
1129  const dcm_id_t dcm_id = getDCMOffline(chan);
1130  const dcm_link_t dcm_link = getDCMLinkOffline(chan);
1131  const apd_pixel_t apd_pixel = pixel2APDPixel(getPixelOffline(chan));
1132 
1133  const dchan daq_channel = encodeDChan(det, diblock, dcm_id, dcm_link, apd_pixel);
1134 
1135  std::cout<<"OfflineChannel=";printHex(chan);
1136  std::cout<<"(";printBinary(chan);std::cout<<")";
1137  std::cout<<"\n";
1138 
1139  std::cout<<"Detector="<<det<<"("<<novadaq::cnv::DetInfo::GetName(det)<<")";
1140  std::cout<<" Plane="<<plane_0;
1141  std::cout<<" Cell="<<cell_0;
1142 
1143  std::cout<<" ";
1144 
1145  std::cout<<" Diblock="<<diblock;
1146  std::cout<<" DCM="<<dcm_id;
1147  std::cout<<" DCMLink="<<dcm_link;
1148  std::cout<<" Pixel="<<apd_pixel;
1149 
1150  std::cout<<"\n";
1151  std::cout<<"DAQChannel=";printHex(daq_channel);
1152  std::cout<<"(";printBinary(daq_channel);std::cout<<")";
1153 
1154  std::cout<<"\n";
1155 
1156  return true;
1157 }
static std::string GetName(int id)
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
offline_plane_t getPlaneOffline(lchan logicalchan) const
Returns the plane (detector wide) that the offline channel belongs to – Verified.
int getDetectorOffline(lchan logicalchan) const
Returns the detector that the offline channel belongs to – Verified.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
dcm_id_t getDCMOffline(lchan logicalchan) const
uint32_t offline_cell_t
< DAQ Channel Map Package
dcm_link_t getDCMLinkOffline(lchan logicalchan) const
dchan encodeDChan(lchan logicalchan)
offline_cell_t getCellOffline(lchan logicalchan) const
Returns the cell the cell on the current plane that the offline channel belongs to – Verified...
OStream cout
Definition: OStream.cxx:6
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
uint32_t diblock_t
Type for diblocks and blocks.
uint32_t dchan
< DAQ Channel Map Package
diblock_t getDiBlockOffline(lchan logicalchan) const
Returns the DiBlock that the offline channel is on – Verified.
pixel_t getPixelOffline(lchan logicalchan) const
apd_pixel_t pixel2APDPixel(pixel_t) const
APDPixel number from Pixel.

Member Data Documentation

DAQChannelMapOLD * DAQChannelMapOLD::_instanceID = NULL
staticprivate

Instance pointer for singleton class.

Definition at line 244 of file DAQChannelMapOLD.h.

Referenced by getInstance().


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