Notes on integrating DAQChannelMap into offline development

General things that needed to be changed:

  • To all CMap calls, change "cmap->function()" to "cmap->Map()->function()." Except for the calls to GetPlane and GetCell.
  • pass detector ID (or whatever that variable is locally called) to all dachannelmap getInstance() calls
  • change all calls to "getDCMLink" to "getFEB"
  • change all "dcm_link_t" to "feb_t"
  • remove all instances of the daqchannelmap function "map->l2d(det,plane,cell)" and replace it with "map->encodeDChan(map->encodeLChan(det,plane,cell))"
  • replace all instance of "map->get{thing}Offline(lchan)" with "map->get{thing}(either lchan or dchan)" -- must be careful here to pass the correct chan depending on the thing-type. EX: If the thing was DCM and you only had an lchan, then you have to encode a DChan with the lchan and then call "map->getDCM(dchan)"
  • change "offline_cell_t" to "cell_t" and "online_cell_t" to "fiber_t"

Specific changes to CMap:

  • no longer inherits from DAQChannelMap
  • remove the getInstance function
  • add _detId as a private member function that gets initialized in the constructor
  • add a "Map()" as a function that simply returns daqchannelmap::DAQChannelMap::getInstance(_detId)"

Notes on specific packages:

  • the iter->GetNextKey thing
  • the "empty" constructor that sets detId to UNKNOWN det type will give daqcmap fits if it tries to use it
  • the row+col thing
  • uses Pixel2APDpixel and it looks suspicious...
  • svn remove the HardwareMapping code

General notes on bad usage of cmap and daqchannelmap
  • In lots of places, I saw people declaring an object of type CMap and calling it "cmap" and then in a separate function, declaring an object of type DAQChannelMap and calling it "cmap." Pick a different name...
  • Some offline code uses CMap and some uses DAQChannelMap (and some uses both within the same code.) Shouldn't all offline code use CMap?
  • I believe that a raw digit has both the lchan and the dchan, but some code uses the dchan and some code gets the lchan and then converts it.