Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
daqchannelmap::TestBeamDAQChannelMap Class Reference

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

Inheritance diagram for daqchannelmap::TestBeamDAQChannelMap:
daqchannelmap::DAQChannelMap

Public Member Functions

dchan encodeDChan (lchan logicalchan) const
 Convert a logical channel ID to a DAQ channel id. More...
 
lchan encodeLChan (dchan daqchan) const
 Convert a DAQ channel ID to a logical channel id. More...
 
block_t computeBlock (lchan logicalchan) const
 Which block is this lchan in? More...
 
plane_t computePlaneInBlock (lchan logicalchan) const
 Which global plane in this lchan in? More...
 
unsigned int computeModule (lchan logicalchan) const
 Which module in this lchan in? More...
 
fiber_t computeFiberInModule (dchan daqchan) const
 Which fiber does this dchan readout? More...
 
DetView_TYPE getView (dchan daqchan) const
 Which view (X or Y) does this daq channel readout? More...
 
unsigned int getTotalNumberOfDiblocks () const
 How many diblocks does the detector have? More...
 
unsigned int getNumberOfDCM (DiBlock_TYPE dbt) const
 How many DCMs does this diblock have? More...
 
DiBlock_TYPE getDiBlockType (dchan chan) const
 What format is the diblock? Only relevant in NDOS. More...
 
 TestBeamDAQChannelMap ()
 
virtual ~TestBeamDAQChannelMap ()
 
dchan encodeDChan (int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
 
lchan encodeLChan (int detId, plane_t plane, cell_t cell) const
 
int getDetector (uint32_t anychan) const
 
diblock_t getDiBlock (dchan daqchan) const
 Decode the diblock ID from a dchan. More...
 
dcm_id_t getDCM (dchan daqchan) const
 Decode the dcm ID from a dchan. More...
 
feb_t getFEB (dchan daqchan) const
 Decode the feb id from a dchan. More...
 
pixel_t getPixel (dchan daqchan) const
 Decode the pixel id from a dchan. More...
 
plane_t getPlane (lchan logicalchan) const
 Decode the plane number from an lchan. More...
 
cell_t getCell (lchan logicalchan) const
 Decode the cell number from an lchan. More...
 

Static Public Member Functions

static DAQChannelMapgetInstance (int detID)
 

Private Member Functions

dcm_id_t computeDCM (plane_t plane, fiber_t fiber) const
 
feb_t computeFEB (plane_t plane, fiber_t fiber) const
 
pixel_t computePixel (fiber_t fiber) const
 
plane_t computePlane (diblock_t diblock, dcm_id_t dcm, feb_t feb) const
 
cell_t computeCell (dcm_id_t dcm, feb_t feb, pixel_t pixel) const
 
pixel_t FiberToPixel (fiber_t fiber) const
 
fiber_t PixelToFiber (pixel_t pixel) const
 
bool printBinary (uint32_t) const
 
bool printHex (uint32_t) const
 

Detailed Description

Definition at line 9 of file TestBeamDAQChannelMap.h.

Constructor & Destructor Documentation

TestBeamDAQChannelMap::TestBeamDAQChannelMap ( )

Definition at line 15 of file TestBeamDAQChannelMap.cpp.

15 { }
TestBeamDAQChannelMap::~TestBeamDAQChannelMap ( )
virtual

Definition at line 19 of file TestBeamDAQChannelMap.cpp.

19 { }

Member Function Documentation

block_t TestBeamDAQChannelMap::computeBlock ( lchan  logicalchan) const
virtual

Which block is this lchan in?

Implements daqchannelmap::DAQChannelMap.

Definition at line 224 of file TestBeamDAQChannelMap.cpp.

References elec2geo::block, daqchannelmap::DAQChannelMap::getPlane(), and NDAPDHVSetting::plane.

225 {
226  plane_t plane = getPlane(logicalchan);
227  block_t block = -1;
228 
229  if (plane < 32) block = 0;
230  else block = 1;
231 
232  return block;
233 }
block
print "ROW IS " print row
Definition: elec2geo.py:31
uint32_t plane_t
Type for plane.
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
cell_t TestBeamDAQChannelMap::computeCell ( dcm_id_t  dcm,
feb_t  feb,
pixel_t  pixel 
) const
private

Definition at line 194 of file TestBeamDAQChannelMap.cpp.

References getBrightness::cell, PixelToFiber(), and daqchannelmap::TB_NUM_CELLS_PLANE.

Referenced by encodeLChan().

197 {
198 
199  // Pixel only goes up to 31, not 63. Need to use feb to figure out which module
200 
201  cell_t cell = -1;
202  unsigned int module = 99;
203  if (dcm == 3){
204  // Check exceptions
205  if (feb==0 || feb==4 || feb==3 || feb==7)
206  module = 0;
207  else
208  module = 1;
209  }
210  else{
211  if (feb < 16 || feb > 47)
212  module = 0;
213  else
214  module = 1;
215  }
216 
217  cell = (TB_NUM_CELLS_PLANE - 1 - (1-module)*32 - PixelToFiber(pixel));
218  // }
219  return cell;
220 }
fiber_t PixelToFiber(pixel_t pixel) const
dcm_id_t TestBeamDAQChannelMap::computeDCM ( plane_t  plane,
fiber_t  fiber 
) const
private

Definition at line 82 of file TestBeamDAQChannelMap.cpp.

Referenced by encodeDChan().

84 {
85  //
86  // DCM number calculation using global plane number and cell number
87  // in plane.
88  //
89 
90  // First check exception list for dcm3
91  // 4 planes on dcm 3
92  if (plane==16 || plane==17 || plane==48 || plane==49) return 3;
93 
94  // Then set the other dcms. Block 0 has 32 planes (0-31), block 1 has remaining 31 (32-62).
95  else if (plane < 32){
96  return 1;
97  }
98  //else if (plane>=32){
99  return 2;
100  //}
101 }
feb_t TestBeamDAQChannelMap::computeFEB ( plane_t  plane,
fiber_t  fiber 
) const
private

Definition at line 108 of file TestBeamDAQChannelMap.cpp.

References APDHVSetting::feb.

Referenced by encodeDChan().

109 {
110  //
111  // computes local module in the DCM (output is 0 or 1).
112  // Note: dcm 3 does not follow same pattern
113  //
114 
115  unsigned int module = 99;
116  // Initialize to a nonsensical number.
117  feb_t feb = -1;
118 
119 
120  if (plane%2 == 0){
121  // Vertical modules
122  module = 1 - (fiber/32) % 2; // 0 or 1
123 
124  // Check planes on dcm 3 first
125  if (plane==16)
126  feb = module; // 0,1
127  else if
128  (plane==48)
129  feb = module + 4; // 4,5
130 
131  // All other (vertical) planes
132  else
133  feb = 16*module + (plane%32)/2; // 0,16,1,17,...
134  }
135  else {
136  // horizontal modules
137  module = (fiber/32) % 2; // 0 or 1
138 
139  // Check planes on dcm 3 first
140  if (plane==17)
141  feb = module + 2; // 2,3
142  else if (plane==49)
143  feb = module + 6; // 6,7
144 
145  // All other (horizontal) planes
146  else
147  feb = 32 + 16*module + (plane%32 - 1)/2; // 32,48,33,49,...
148  }
149 
150  return feb;
151 }
uint32_t feb_t
Type for DCM link port. Counts from 0.
fiber_t TestBeamDAQChannelMap::computeFiberInModule ( dchan  daqchan) const
virtual

Which fiber does this dchan readout?

Implements daqchannelmap::DAQChannelMap.

Definition at line 274 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::DAQChannelMap::getPixel(), and PixelToFiber().

275 {
276  pixel_t pixel = getPixel(daqchan);
277  fiber_t fiber = PixelToFiber(pixel);
278 
279  return fiber;
280 }
uint32_t pixel_t
Type for physical pixel on APD.
fiber_t PixelToFiber(pixel_t pixel) const
pixel_t getPixel(dchan daqchan) const
Decode the pixel id from a dchan.
unsigned int TestBeamDAQChannelMap::computeModule ( lchan  logicalchan) const
virtual

Which module in this lchan in?

Implements daqchannelmap::DAQChannelMap.

Definition at line 262 of file TestBeamDAQChannelMap.cpp.

References getBrightness::cell, and daqchannelmap::DAQChannelMap::getCell().

263 {
264  cell_t cell = getCell(logicalchan);
265  //
266  // cell over 32 will return an integer value corresponding with the
267  // module in which the cell resides. This function appears to be unused.
268  //
269  return cell/32;
270 }
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
pixel_t TestBeamDAQChannelMap::computePixel ( fiber_t  fiber) const
private

Definition at line 155 of file TestBeamDAQChannelMap.cpp.

References FiberToPixel().

Referenced by encodeDChan().

156 {
157  //
158  // Get a value between 0 and 31 corresponding with fiber in local
159  // module which is needed for mapping to pixel on APD.
160  //
161  fiber_t local_fiber = fiber % 32;
162  return FiberToPixel(local_fiber);
163 }
pixel_t FiberToPixel(fiber_t fiber) const
plane_t TestBeamDAQChannelMap::computePlane ( diblock_t  diblock,
dcm_id_t  dcm,
feb_t  feb 
) const
private

Definition at line 167 of file TestBeamDAQChannelMap.cpp.

References NDAPDHVSetting::plane.

Referenced by encodeLChan().

170 {
171  plane_t plane = -1;
172  // Check for 4 planes on dcm3
173  if (dcm == 3) {
174  if (feb==0 || feb==1) plane = 16;
175  else if (feb==2 || feb==3) plane = 17;
176  else if (feb==4 || feb==5) plane = 48;
177  else plane = 49;
178  }
179 
180  else {
181  //if (dcm == 1 || dcm == 2){
182  // Vertical modules
183  if (feb < 32)
184  plane = (feb % 16)*2 + (dcm-1)*32; // 2n
185  // Horizontal modules
186  else
187  plane = (feb % 16)*2 + 1 + (dcm-1)*32; // 2n+1
188  }
189  return plane;
190 }
uint32_t plane_t
Type for plane.
plane_t TestBeamDAQChannelMap::computePlaneInBlock ( lchan  logicalchan) const
virtual

Which global plane in this lchan in?

Implements daqchannelmap::DAQChannelMap.

Definition at line 251 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::DAQChannelMap::getPlane(), and NDAPDHVSetting::plane.

252 {
253  plane_t plane = getPlane(logicalchan);
254  //
255  // Extra plane on block 0
256  //
257  return plane%32;
258 }
uint32_t plane_t
Type for plane.
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
dchan TestBeamDAQChannelMap::encodeDChan ( lchan  logicalchan) const
virtual

Convert a logical channel ID to a DAQ channel id.

Implements daqchannelmap::DAQChannelMap.

Definition at line 23 of file TestBeamDAQChannelMap.cpp.

References getBrightness::cell, computeDCM(), computeFEB(), computePixel(), febshutoff_auto::dcm, runNovaSAM::detector, geo2elec::diblock, daqchannelmap::DAQChannelMap::encodeDChan(), APDHVSetting::feb, daqchannelmap::DAQChannelMap::getCell(), daqchannelmap::DAQChannelMap::getDetector(), daqchannelmap::DAQChannelMap::getPlane(), NDAPDHVSetting::plane, and daqchannelmap::TB_NUM_CELLS_PLANE.

24 {
25  const int detector = getDetector(logicalchan);
26  const plane_t plane = getPlane(logicalchan);
27  const cell_t cell = getCell(logicalchan);
28  const diblock_t diblock = 1;
29  fiber_t fiber = -1; // initialize to some crazy value.
30  //
31  // For testbeam, snouts are on opposite side of detector.
32  // this means fiber and cell numbers are opposite each other
33  // for both horizontal and vertical modules.
34  //
35  fiber = TB_NUM_CELLS_PLANE - 1 - cell;
36 
37  const dcm_id_t dcm = computeDCM(plane, fiber);
38  const feb_t feb = computeFEB(plane, fiber);
39  const pixel_t pixel = computePixel(fiber);
40 
41  return DAQChannelMap::encodeDChan(detector, diblock, dcm, feb, pixel);
42 }
int getDetector(uint32_t anychan) const
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
uint32_t pixel_t
Type for physical pixel on APD.
pixel_t computePixel(fiber_t fiber) const
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
uint32_t feb_t
Type for DCM link port. Counts from 0.
dcm_id_t computeDCM(plane_t plane, fiber_t fiber) const
uint32_t dcm_id_t
Type for DCM number, counts from 1.
uint32_t plane_t
Type for plane.
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
uint32_t diblock_t
Type for diblocks and blocks.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
feb_t computeFEB(plane_t plane, fiber_t fiber) const
dchan DAQChannelMap::encodeDChan ( int  detID,
diblock_t  diblock,
dcm_id_t  dcm,
feb_t  feb,
pixel_t  pixel 
) const
inherited

Encode DAQ format information into a single 32 bit identifier.

Parameters
detID- detector ID from NovaDAQConventions
diblock- diblock ID number. Starts from 1
dcm- DCM id within diblock, starts from 1
feb- FEB id within DCM, starts from 0
pixel- pixel id within FEB, starts from 0
Returns
32-bit encoded channel "DAQ" ID

Definition at line 65 of file DAQChannelMap.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.

Referenced by cmap::dataprov::CMap::AddException(), chaninfo::BadChanValidate::BadChansFromOM(), dprf::ChannelPlots::beginRun(), calib::PEResponse::beginRun(), chaninfo::FindSwappedChannels::beginSubRun(), calib::PCHitsList::CellHitToPCHit(), cmap::dataprov::CMap::computeBlock(), rsim::ReadoutSim::CreateRawDigits(), daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), daqchannelmap::NearDetDAQChannelMap::encodeDChan(), daqchannelmap::FarDetDAQChannelMap::encodeDChan(), encodeDChan(), cmap::dataprov::CMap::encodeDChan(), cmap::dataprov::CMap::encodeLChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), dqsf::DQSpillFlags::FillCountVars(), raw2daq::RawDigit2DAQHit::FillDAQHits(), mcdatadaq::DAQSimulator::fillMicroSlices(), cmap::dataprov::CMap::getCell(), calib::DriftResponseCalc::GetChanID(), evd::GeometryDrawer::GetDCMBoxes(), nova::dbi::RunHistory::GetFEB(), nova::dbi::RunHistory::GetGain(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), calib::Calibrator::GetPECorrToGeVScale(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::GetPixelGain(), nova::dbi::RunHistory::GetPixelGains(), cmap::dataprov::CMap::getPlane(), nova::dbi::RunHistory::GetThreshold(), calib::Calibrator::GetTimingOffset(), nova::dbi::RunHistory::HasAPD(), chaninfo::BadChanList::InDroppedDCM(), mcdatadaq::DAQSimulator::init(), chaninfo::BadChanList::IsBadUncached(), nova::dbi::RunHistory::IsCooled(), chaninfo::BadChanList::LoadNewData(), nova::dbi::RunHistory::LoadPedestals(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), chaninfo::BadChanList::NBadInSubRun(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), daq2raw::OnlineUnpack::ProcessRawEvent_(), calib::ResizeDetector::produce(), rsim::ReadoutSim::produce(), nova::dbi::RunHistory::PullAPDInfoFromDB(), rawp::CheckDAQChannelMap::Reco(), DAQChannelMapTests::testBasicChannelGetOnline(), DAQChannelMapTests::testViewLookups(), and om::RawEventUnpacker::UnpackNanoSlice().

70 {
71  dchan chan = 0x0;
77  return chan;
78 }
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 TestBeamDAQChannelMap::encodeLChan ( dchan  daqchan) const
virtual

Convert a DAQ channel ID to a logical channel id.

Implements daqchannelmap::DAQChannelMap.

Definition at line 46 of file TestBeamDAQChannelMap.cpp.

References getBrightness::cell, computeCell(), computePlane(), febshutoff_auto::dcm, runNovaSAM::detector, geo2elec::diblock, daqchannelmap::DAQChannelMap::encodeLChan(), APDHVSetting::feb, daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDetector(), daqchannelmap::DAQChannelMap::getDiBlock(), daqchannelmap::DAQChannelMap::getFEB(), daqchannelmap::DAQChannelMap::getPixel(), and NDAPDHVSetting::plane.

47 {
48  const int detector = getDetector(daqchan);
49  const diblock_t diblock = getDiBlock(daqchan);
50  const dcm_id_t dcm = getDCM(daqchan);
51  const feb_t feb = getFEB(daqchan);
52  const pixel_t pixel = getPixel(daqchan);
53 
54  const plane_t plane = computePlane(diblock, dcm, feb);
55  const cell_t cell = computeCell(dcm, feb, pixel);
56 
57  return DAQChannelMap::encodeLChan(detector, plane, cell);
58 }
int getDetector(uint32_t anychan) const
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
plane_t computePlane(diblock_t diblock, dcm_id_t dcm, feb_t feb) const
uint32_t pixel_t
Type for physical pixel on APD.
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
uint32_t feb_t
Type for DCM link port. Counts from 0.
uint32_t dcm_id_t
Type for DCM number, counts from 1.
pixel_t getPixel(dchan daqchan) const
Decode the pixel id from a dchan.
uint32_t plane_t
Type for plane.
cell_t computeCell(dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t diblock_t
Type for diblocks and blocks.
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
lchan DAQChannelMap::encodeLChan ( int  detId,
plane_t  plane,
cell_t  cell 
) const
inherited

Encode logical format information (physical detector coordinates) into a single 32 bit identifier.

Parameters
detID- detector ID from NovaDAQConventions
plane- global plane number, starts from 0 at south
cell- global cell number, starts from 0 at bottom
Returns
32-bit encoded channel "logical" ID

Definition at line 82 of file DAQChannelMap.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.

Referenced by cmap::dataprov::CMap::AddException(), align::AlignInspect::analyze(), dprf::ChannelPlots::analyze(), dprf::TrackPlots::analyze(), align::SplitTracks::analyze(), chaninfo::BadChanValidate::BadChansFromOM(), dprf::ChannelPlots::beginRun(), calib::PEResponse::beginRun(), chaninfo::FindSwappedChannels::beginSubRun(), slicer::Slicer::BlockSlice(), calib::PCHitsList::CellHitToPCHit(), rsim::ReadoutSim::CreateRawDigits(), daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), daqchannelmap::NearDetDAQChannelMap::encodeLChan(), daqchannelmap::FarDetDAQChannelMap::encodeLChan(), encodeLChan(), cmap::dataprov::CMap::encodeLChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), daq2raw::DAQHit2Raw::FillRawDigits(), cmap::dataprov::CMap::GetCell(), calib::DriftResponseCalc::GetChanID(), evd::GeometryDrawer::GetDCMBoxes(), nova::dbi::RunHistory::GetFEB(), nova::dbi::RunHistory::GetGain(), calib::Calibrator::GetPECorrToGeVScale(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::GetPixelGain(), nova::dbi::RunHistory::GetPixelGains(), cmap::dataprov::CMap::GetPlane(), nova::dbi::RunHistory::GetThreshold(), calib::Calibrator::GetTimingOffset(), nova::dbi::RunHistory::HasAPD(), chaninfo::BadChanList::InDroppedDCM(), chaninfo::BadChanList::IsBadUncached(), nova::dbi::RunHistory::IsCooled(), chaninfo::BadChanList::LoadNewData(), nova::dbi::RunHistory::LoadPedestals(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), chaninfo::BadChanList::NBadInSubRun(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), daq2raw::OnlineUnpack::ProcessRawEvent_(), rsim::ReadoutSim::produce(), lem::GenFromLib::readNext(), rawp::CheckDAQChannelMap::Reco(), DAQChannelMapTests::testBasicChannelGetOffline(), DAQChannelMapTests::testBasicOfflineChannelGet(), DAQChannelMapTests::testDiBlockLookupsOffline(), DAQChannelMapTests::testPlaneLookupsOffline(), DAQChannelMapTests::testViewLookups(), DAQChannelMapTests::testViewLookupsOffline(), and om::RawEventUnpacker::UnpackNanoSlice().

pixel_t TestBeamDAQChannelMap::FiberToPixel ( fiber_t  fiber) const
private

Definition at line 244 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::fibertopixel.

Referenced by computePixel().

245 {
246  return fibertopixel[fiber];
247 }
const unsigned int fibertopixel[]
cell_t DAQChannelMap::getCell ( lchan  logicalchan) const
inherited

Decode the cell number from an lchan.

Definition at line 155 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, febshutoff_auto::chan, daqchannelmap::ERROR_CELL_OUTRANGE, daqchannelmap::MASK_OFFLINE_CELL, daqchannelmap::NUM_CELLS, and daqchannelmap::SHIFT_OFFLINE_CELL.

Referenced by dprf::ChannelPlots::analyze(), comi::DataCheck::analyze(), chaninfo::BadChanValidate::BadChansFromOM(), dprf::ChannelPlots::beginRun(), calib::PEResponse::beginRun(), chaninfo::FindSwappedChannels::beginSubRun(), daqchannelmap::NearDetDAQChannelMap::computeModule(), computeModule(), daqchannelmap::FarDetDAQChannelMap::computeModule(), daqchannelmap::NDOSDAQChannelMap::computeModule(), daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), daqchannelmap::NearDetDAQChannelMap::encodeDChan(), encodeDChan(), daqchannelmap::FarDetDAQChannelMap::encodeDChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), cmap::dataprov::CMap::getCell(), cmap::dataprov::CMap::GetCell(), chaninfo::BadChanList::LoadNewData(), nova::dbi::RunHistory::LoadPedestals(), chaninfo::BadChanList::NBadInSubRun(), and om::RawEventUnpacker::UnpackNanoSlice().

156 {
158  0,
159  NUM_CELLS*
160  NUM_PLANES_DIBLOCK[getDetectorOffline(chan)]*
161  NUM_DIBLOCK_DET[getDetectorOffline(chan)],
163 }
#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)
dcm_id_t DAQChannelMap::getDCM ( dchan  daqchan) const
inherited

Decode the dcm ID from a dchan.

Definition at line 115 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_DCM_OUTRANGE, daqchannelmap::MASK_DCMID, daqchannelmap::MAX_DCM, daqchannelmap::MIN_DCM, and daqchannelmap::SHIFT_DCMID.

Referenced by febstat::FEBShutoff::analyze(), dprf::TrackPlots::analyze(), febstat::EventFEBStatus::analyze(), comi::DataCheck::analyze(), comi::NearlineAna::analyze(), calib::DriftResponseCalc::beginRun(), calib::PCHitsList::CellHitToPCHit(), airshower::AirSlicer::CountActiveDCM(), chaninfo::BadChanList::CountDCMHits(), daqchannelmap::NearDetDAQChannelMap::encodeLChan(), daqchannelmap::FarDetDAQChannelMap::encodeLChan(), encodeLChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), dqsf::DQSpillFlags::FillCountVars(), mcdatadaq::DAQSimulator::fillMicroSlices(), DataCheck::HardwareStatusCheck::filter(), calib::DriftResponseCalc::GetChanID(), cmap::dataprov::CMap::getDCM(), evd::GeometryDrawer::GetDCMBoxes(), nova::dbi::RunHistory::GetFEB(), calib::Calibrator::getFebType(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::GetThreshold(), calib::Calibrator::GetTimingOffset(), daqchannelmap::NearDetDAQChannelMap::getView(), daqchannelmap::FarDetDAQChannelMap::getView(), getView(), nova::dbi::RunHistory::HasAPD(), chaninfo::BadChanList::InDroppedDCM(), chaninfo::BadChanList::IsBadUncached(), nova::dbi::RunHistory::IsCooled(), chaninfo::BadChanList::LoadNewData(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), mcdatadaq::DAQSimulator::print(), daq2raw::OnlineUnpack::ProcessRawEvent_(), MergeTBDaqCollections::MergeTBDaqCollections::produce(), and calib::DriftCorrection::respondToCloseOutputFiles().

116 {
118  MIN_DCM,
119  MAX_DCM,
121 }
#define BITFIELDGET(block, mask, shift)
Definition: BitFields.h:23
DCM ID, (6bit), valid range 1-12.
#define BOUNDSCHECK(value, min, max, err)
Definition: boundscheck.h:22
int DAQChannelMap::getDetector ( uint32_t  anychan) const
inherited

Return the detector type given either a dchan or an lchan identifier - in this case the decoding is the same

Definition at line 95 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_UNKNOWN_DET, novadaq::cnv::kNDetector, novadaq::cnv::kUNKNOWN_DET, daqchannelmap::MASK_DETECTOR, and daqchannelmap::SHIFT_DETECTOR.

Referenced by daqchannelmap::NearDetDAQChannelMap::encodeDChan(), encodeDChan(), daqchannelmap::FarDetDAQChannelMap::encodeDChan(), daqchannelmap::NearDetDAQChannelMap::encodeLChan(), encodeLChan(), daqchannelmap::FarDetDAQChannelMap::encodeLChan(), cmap::dataprov::CMap::getDetector(), daqchannelmap::DAQChannelMap::getPlane(), daq2raw::OnlineUnpack::ProcessRawEvent_(), calib::DriftCorrection::respondToCloseOutputFiles(), DAQChannelMapTests::testBasicChannelGetOnline(), DAQChannelMapTests::testBasicOfflineChannelGet(), and DAQChannelMapTests::testViewLookups().

diblock_t DAQChannelMap::getDiBlock ( dchan  daqchan) const
inherited

Decode the diblock ID from a dchan.

Definition at line 105 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_DIBLOCK_OUTRANGE, daqchannelmap::MASK_DIBLOCK, daqchannelmap::MAX_DIBLOCK, daqchannelmap::MIN_DIBLOCK, and daqchannelmap::SHIFT_DIBLOCK.

Referenced by dprf::TrackPlots::analyze(), comi::DataCheck::analyze(), comi::NearlineAna::analyze(), calib::DriftResponseCalc::beginRun(), calib::PCHitsList::CellHitToPCHit(), airshower::AirSlicer::CountActiveDCM(), chaninfo::BadChanList::CountDCMHits(), novaddt::ContainedSlice::defineContainmentRegion(), daqchannelmap::NearDetDAQChannelMap::encodeLChan(), daqchannelmap::FarDetDAQChannelMap::encodeLChan(), encodeLChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), dqsf::DQSpillFlags::FillCountVars(), mcdatadaq::DAQSimulator::fillMicroSlices(), DataCheck::HardwareStatusCheck::filter(), calib::DriftResponseCalc::GetChanID(), evd::GeometryDrawer::GetDCMBoxes(), cmap::dataprov::CMap::getDiBlock(), daqchannelmap::NearDetDAQChannelMap::getDiBlockType(), nova::dbi::RunHistory::GetFEB(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), calib::Calibrator::GetPECorrToGeVScale(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::GetThreshold(), calib::Calibrator::GetTimingOffset(), daqchannelmap::NearDetDAQChannelMap::getView(), nova::dbi::RunHistory::HasAPD(), chaninfo::BadChanList::InDroppedDCM(), chaninfo::BadChanList::IsBadUncached(), nova::dbi::RunHistory::IsCooled(), chaninfo::BadChanList::LoadNewData(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), mcdatadaq::DAQSimulator::print(), daq2raw::OnlineUnpack::ProcessRawEvent_(), calib::ResizeDetector::produce(), calib::DriftCorrection::respondToCloseOutputFiles(), DAQChannelMapTests::testBasicChannelGetOnline(), and DAQChannelMapTests::testViewLookups().

DiBlock_TYPE TestBeamDAQChannelMap::getDiBlockType ( dchan  chan) const
virtual

What format is the diblock? Only relevant in NDOS.

Implements daqchannelmap::DAQChannelMap.

Definition at line 298 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::AAFULL_DIBLOCK.

299 {
300  return AAFULL_DIBLOCK;
301 }
Identifier for diblocks of configuration A-AFULL (31/32) - TESTBEAM.
feb_t DAQChannelMap::getFEB ( dchan  daqchan) const
inherited

Decode the feb id from a dchan.

Definition at line 125 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_PORT_OUTRANGE, daqchannelmap::MASK_DCMPORT, daqchannelmap::MAX_PORT, daqchannelmap::MIN_PORT, and daqchannelmap::SHIFT_DCMPORT.

Referenced by febstat::FEBShutoff::analyze(), febstat::EventFEBStatus::analyze(), comi::DataCheck::analyze(), calib::PCHitsList::CellHitToPCHit(), daqchannelmap::NearDetDAQChannelMap::encodeLChan(), daqchannelmap::FarDetDAQChannelMap::encodeLChan(), encodeLChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), dqsf::DQSpillFlags::FillCountVars(), mcdatadaq::DCMSimulator::generateNanoSlice(), calib::DriftResponseCalc::GetChanID(), cmap::dataprov::CMap::getFEB(), nova::dbi::RunHistory::GetFEB(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::GetThreshold(), getView(), nova::dbi::RunHistory::HasAPD(), chaninfo::BadChanList::IsBadUncached(), nova::dbi::RunHistory::IsCooled(), chaninfo::BadChanList::LoadNewData(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), mcdatadaq::DAQSimulator::print(), daq2raw::OnlineUnpack::ProcessRawEvent_(), and calib::DriftCorrection::respondToCloseOutputFiles().

126 {
128  MIN_PORT,
129  MAX_PORT,
131 }
#define BITFIELDGET(block, mask, shift)
Definition: BitFields.h:23
#define BOUNDSCHECK(value, min, max, err)
Definition: boundscheck.h:22
DCM Link Port (8bit), valid range 0-63.
DAQChannelMap * DAQChannelMap::getInstance ( int  detID)
staticinherited

Definition at line 16 of file DAQChannelMap.cpp.

References om::cerr, allTimeWatchdog::endl, novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, and novadaq::cnv::kTESTBEAM.

Referenced by chaninfo::BadChanValidate::BadChansFromOM(), calib::PEResponse::beginRun(), chaninfo::BadChanList::CountDCMHits(), daqchannelmap::HardwareDisplay::DAQToPlaneInBlockModCell(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), novaddt::ContainedSlice::defineContainmentRegion(), calib::DCMTimingOffset::endJob(), chaninfo::FindSwappedChannels::filter(), nova::dbi::RunHistory::GetFEB(), nova::dbi::RunHistory::GetGain(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::GetPixelGain(), nova::dbi::RunHistory::GetPixelGains(), nova::dbi::RunHistory::GetThreshold(), nova::dbi::RunHistory::HasAPD(), chaninfo::BadChanList::InDroppedDCM(), chaninfo::BadChanList::IsBadUncached(), nova::dbi::RunHistory::IsCooled(), chaninfo::BadChanList::LoadNewData(), nova::dbi::RunHistory::LoadPedestals(), chaninfo::BadChanList::NBadInSubRun(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), cmap::CMap::postBeginRun(), novaddt::OnlineUnpack::ProcessRawEvent_(), daq2raw::OnlineUnpack::ProcessRawEvent_(), NovaDDTHitProducer::produce(), calib::ResizeDetector::produce(), calib::TimingCalibration::produce(), calib::PCHitsList::produce(), nova::dbi::RunHistory::PullAPDInfoFromDB(), DAQChannelMapTests::testBasicChannelGetOffline(), DAQChannelMapTests::testBasicChannelGetOnline(), DAQChannelMapTests::testBasicOfflineChannelGet(), DAQChannelMapTests::testDiBlockLookups(), DAQChannelMapTests::testDiBlockLookupsOffline(), DAQChannelMapTests::testPlaneLookupsOffline(), DAQChannelMapTests::testViewLookups(), DAQChannelMapTests::testViewLookupsOffline(), and om::RawEventUnpacker::UnpackNanoSlice().

17 {
18  static FarDetDAQChannelMap* FarDetInst = 0;
19  static NearDetDAQChannelMap* NearDetInst = 0;
20  static NDOSDAQChannelMap* NDOSInst = 0;
21  static TestBeamDAQChannelMap* TestBeamInst = 0;
22 
23  switch(detID) {
25  if (NearDetInst) { delete NearDetInst; NearDetInst = 0; }
26  if (NDOSInst) { delete NDOSInst; NDOSInst = 0; }
27  if (TestBeamInst){ delete TestBeamInst;TestBeamInst= 0; }
28  if (FarDetInst==0) FarDetInst = new FarDetDAQChannelMap();
29  return FarDetInst;
31  if (FarDetInst) { delete FarDetInst; FarDetInst = 0; }
32  if (NDOSInst) { delete NDOSInst; NDOSInst = 0; }
33  if (TestBeamInst){ delete TestBeamInst;TestBeamInst= 0; }
34  if (NearDetInst==0) NearDetInst = new NearDetDAQChannelMap();
35  return NearDetInst;
36  case novadaq::cnv::kNDOS :
37  if (FarDetInst) { delete FarDetInst; FarDetInst = 0; }
38  if (NearDetInst) { delete NearDetInst; NearDetInst = 0; }
39  if (TestBeamInst){ delete TestBeamInst;TestBeamInst= 0; }
40  if (NDOSInst==0) NDOSInst = new NDOSDAQChannelMap();
41  return NDOSInst;
43  if (FarDetInst) { delete FarDetInst; FarDetInst = 0; }
44  if (NearDetInst) { delete NearDetInst; NearDetInst = 0; }
45  if (NDOSInst) { delete NDOSInst; NDOSInst = 0; }
46  if (TestBeamInst==0) TestBeamInst = new TestBeamDAQChannelMap();
47  return TestBeamInst;
48  default:
49  std::cerr<<" No valid detector specified!!!!!"<<std::endl;
50  abort();
51  }
52  return 0;
53 }
OStream cerr
Definition: OStream.cxx:7
Far Detector at Ash River, MN.
Prototype Near Detector on the surface at FNAL.
Near Detector in the NuMI cavern.
unsigned int TestBeamDAQChannelMap::getNumberOfDCM ( DiBlock_TYPE  dbt) const
virtual

How many DCMs does this diblock have?

Implements daqchannelmap::DAQChannelMap.

Definition at line 291 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::TB_NUM_DCMS.

292 {
293  return TB_NUM_DCMS;
294 }
pixel_t DAQChannelMap::getPixel ( dchan  daqchan) const
inherited

Decode the pixel id from a dchan.

Definition at line 135 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, daqchannelmap::ERROR_PIXEL_OUTRANGE, daqchannelmap::MASK_PIXELID, daqchannelmap::MAX_PIXEL, daqchannelmap::MIN_PIXEL, and daqchannelmap::SHIFT_PIXELID.

Referenced by febstat::FEBShutoff::analyze(), calib::PCHitsList::CellHitToPCHit(), daqchannelmap::NearDetDAQChannelMap::computeFiberInModule(), computeFiberInModule(), daqchannelmap::FarDetDAQChannelMap::computeFiberInModule(), rsim::ReadoutSim::CreateRawDigits(), daqchannelmap::NearDetDAQChannelMap::encodeLChan(), daqchannelmap::FarDetDAQChannelMap::encodeLChan(), encodeLChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), dprf::ChannelPlots::FillFebRawPlots(), mcdatadaq::DCMSimulator::generateNanoSlice(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), nova::dbi::RunHistory::GetPedestal(), cmap::dataprov::CMap::getPixel(), nova::dbi::RunHistory::GetPixelGain(), nova::dbi::RunHistory::GetThreshold(), daqchannelmap::HardwareDisplay::PlaneCellToDAQ(), mcdatadaq::DAQSimulator::print(), daq2raw::OnlineUnpack::ProcessRawEvent_(), rsim::ReadoutSim::produce(), and DAQChannelMapTests::testBasicChannelGetOnline().

136 {
138  MIN_PIXEL,
139  MAX_PIXEL,
141 }
APD Pixel Number (8bit), valid range 0-31.
#define BITFIELDGET(block, mask, shift)
Definition: BitFields.h:23
#define BOUNDSCHECK(value, min, max, err)
Definition: boundscheck.h:22
plane_t DAQChannelMap::getPlane ( lchan  logicalchan) const
inherited

Decode the plane number from an lchan.

Definition at line 145 of file DAQChannelMap.cpp.

References BITFIELDGET, BOUNDSCHECK, febshutoff_auto::chan, daqchannelmap::ERROR_PLANE_OUTRANGE, daqchannelmap::DAQChannelMap::getDetector(), daqchannelmap::MASK_OFFLINE_PLANE, and daqchannelmap::SHIFT_OFFLINE_PLANE.

Referenced by dprf::ChannelPlots::analyze(), dprf::TrackPlots::analyze(), comi::DataCheck::analyze(), chaninfo::BadChanValidate::BadChansFromOM(), dprf::ChannelPlots::beginRun(), calib::PEResponse::beginRun(), chaninfo::FindSwappedChannels::beginSubRun(), daqchannelmap::NearDetDAQChannelMap::computeBlock(), computeBlock(), daqchannelmap::FarDetDAQChannelMap::computeBlock(), daqchannelmap::NearDetDAQChannelMap::computePlaneInBlock(), computePlaneInBlock(), daqchannelmap::FarDetDAQChannelMap::computePlaneInBlock(), daqchannelmap::HardwareDisplay::DAQToPlaneModCell(), daqchannelmap::NearDetDAQChannelMap::encodeDChan(), encodeDChan(), daqchannelmap::FarDetDAQChannelMap::encodeDChan(), chaninfo::FindSwappedChannels::fill_hist_and_tree(), cmap::dataprov::CMap::getPlane(), cmap::dataprov::CMap::GetPlane(), chaninfo::BadChanList::LoadNewData(), nova::dbi::RunHistory::LoadPedestals(), chaninfo::BadChanList::NBadInSubRun(), calib::ResizeDetector::produce(), and om::RawEventUnpacker::UnpackNanoSlice().

146 {
148  0,
149  NUM_PLANES_DIBLOCK[getDetector(chan)]*
150  NUM_DIBLOCK_DET[getDetector(chan)], ERROR_PLANE_OUTRANGE);
151 }
int getDetector(uint32_t anychan) const
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
unsigned int TestBeamDAQChannelMap::getTotalNumberOfDiblocks ( ) const
virtual

How many diblocks does the detector have?

Implements daqchannelmap::DAQChannelMap.

Definition at line 284 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::TB_NUM_DIBLOCKS.

285 {
286  return TB_NUM_DIBLOCKS;
287 }
DetView_TYPE TestBeamDAQChannelMap::getView ( dchan  daqchan) const
virtual

Which view (X or Y) does this daq channel readout?

Implements daqchannelmap::DAQChannelMap.

Definition at line 62 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getFEB(), daqchannelmap::X_VIEW, and daqchannelmap::Y_VIEW.

63 {
64  // One dcm for block0, one for block1.
65  // dcm3 will have febs on both blocks
66 
67  // Top: feb 0,1,4,5, side: feb 2,3,6,7.
68  if (getDCM(d)==3){
69  if (getFEB(d)==0 || getFEB(d)==1 || getFEB(d)==4 || getFEB(d)==5) return X_VIEW;
70  else return Y_VIEW;
71  }
72 
73  else {
74  // FEB 0-31 on top, 32-63 on side.
75  if (getFEB(d) < 32) return X_VIEW;
76  else return Y_VIEW;
77  }
78 }
Identifier for the Y measuring view of the detector (side)
Identifier for the X measuring view of the detector (top)
Float_t d
Definition: plot.C:236
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
fiber_t TestBeamDAQChannelMap::PixelToFiber ( pixel_t  pixel) const
private

Definition at line 237 of file TestBeamDAQChannelMap.cpp.

References daqchannelmap::pixeltofiber.

Referenced by computeCell(), and computeFiberInModule().

238 {
239  return pixeltofiber[pixel];
240 }
const unsigned int pixeltofiber[]
bool daqchannelmap::TestBeamDAQChannelMap::printBinary ( uint32_t  ) const
private
bool daqchannelmap::TestBeamDAQChannelMap::printHex ( uint32_t  ) const
private

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