Hardware Mapper Service 1 18 August 2016 Jonathan Davies - - PowerPoint PPT Presentation

hardware mapper service
SMART_READER_LITE
LIVE PREVIEW

Hardware Mapper Service 1 18 August 2016 Jonathan Davies - - PowerPoint PPT Presentation

Jonathan Davies DAQ Simula3ons, 2016 Hardware Mapper Service 1 18 August 2016 Jonathan Davies Mo3va3on Hardware Mapper Service Trigger algorithms (or


slide-1
SLIDE 1

Jonathan ¡Davies ¡ DAQ ¡Simula3ons, ¡2016 ¡

18 ¡August ¡2016 ¡

Hardware ¡Mapper ¡Service ¡

Jonathan Davies 1 ¡

slide-2
SLIDE 2

Mo3va3on ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 2 ¡

  • Trigger ¡algorithms ¡(or ¡algorithms ¡that ¡generate ¡primi?ves) ¡could ¡live ¡at ¡many ¡

different ¡levels ¡of ¡hardware ¡within ¡the ¡DUNE ¡detector: ¡

  • APA ¡– ¡detector ¡has ¡many ¡APAs ¡
  • APAGroup ¡– ¡some ¡collec?on ¡of ¡APAs ¡
  • Board ¡– ¡APAs ¡could ¡have ¡many ¡read ¡out ¡boards ¡
  • ASIC ¡– ¡Boards ¡could ¡see ¡many ¡ASICs, ¡could ¡have ¡a ¡primi?ve ¡per ¡ASIC ¡
  • Offline ¡soSware ¡/ ¡simula?on ¡only ¡supplies ¡ALL ¡channels ¡in ¡the ¡detector ¡

(std::vector<raw::RawDigits>) ¡

  • Need ¡a ¡service ¡that ¡users ¡can ¡interrogate ¡to ¡supply ¡a ¡subset ¡of ¡channels ¡for ¡a ¡

par?cular ¡hardware ¡“Element” ¡

  • Need ¡to ¡be ¡able ¡to ¡tag ¡a ¡trigger ¡primi?ve ¡as ¡coming ¡from ¡a ¡par?cular ¡hardware ¡

“Element” ¡

slide-3
SLIDE 3

Requirements ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 3 ¡

  • Able ¡to ¡dynamically ¡adjust ¡to ¡different ¡geometries ¡
  • Does ¡all ¡the ¡heavy ¡liSing ¡upon ¡ini?alisa?on ¡
  • Exposes ¡easy ¡to ¡use ¡func?ons ¡and ¡return ¡types ¡for ¡users ¡ ¡
  • std::vector<ChannelID_t> ¡ ¡
  • pass ¡it ¡a ¡vector ¡of ¡all ¡channel’s ¡raw ¡digits, ¡it ¡returns ¡a ¡subset ¡as ¡a ¡vector ¡
  • Defines ¡some ¡class ¡for ¡iden?fying ¡various ¡types ¡of ¡hardware ¡element ¡
  • Integrate ¡this ¡class ¡into ¡the ¡BasicTrigger ¡data ¡product ¡-­‑> ¡insert ¡into ¡event ¡
  • i.e. ¡We ¡got ¡a ¡trigger ¡of ¡some ¡type ¡with ¡some ¡parameters ¡from ¡this ¡piece ¡of ¡

hardware ¡

  • Can ¡be ¡expanded ¡to ¡include ¡new ¡“Hardware ¡Elements” ¡that ¡we ¡have ¡not ¡thought

¡

  • f ¡yet ¡
slide-4
SLIDE 4

What’s ¡Been ¡Done? ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 4 ¡

I’ve ¡wriGen ¡a ¡v1.0 ¡– ¡most ¡of ¡the ¡core ¡func3onality ¡is ¡in ¡place! ¡ ¡ HardwareMapperService{.h,_service.cc}, ¡TestHardwareMapper_module.cc, ¡ HardwareElements.h ¡+ ¡some ¡fcls ¡ ¡ Lives ¡within ¡the ¡dunetpc ¡repository ¡ ¡DAQTriggerSim/Service ¡ ¡DAQTriggerSim/TestHardwareMapper ¡ ¡DAQTriggerSim/TriggerDataProducts ¡ ¡ On ¡the ¡DAQ ¡trigger ¡Sim ¡feature ¡branch, ¡which ¡is ¡where ¡Michael’s ¡trigger ¡code ¡exists ¡ ¡feature/mbaird42_DAQtriggerSim ¡ ¡ I ¡refer ¡you ¡to ¡Michael’s ¡“geing ¡started” ¡wiki ¡for ¡how ¡to ¡get ¡going ¡with ¡the ¡trigger ¡

  • framework. ¡hkps://cdcvs.fnal.gov/redmine/projects/dunetpc/wiki/

Using_the_DAQTriggerSim_module ¡ ¡ ¡

slide-5
SLIDE 5

Some ¡Code ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 5 ¡

¡ ¡ void printTPCMap(unsigned int num_tpcs_to_print=10); void printAPAMap(unsigned int num_apas_to_print=10); void printHardwareMaps(); //jpd -- prints both the tpc and apa maps void printGeometryInfo(); //jpd -- testing function to print geometry information once loaded unsigned int getNAPAs() const { return fAPAMap.size();} unsigned int getNTPCs() const { return fTPCMap.size();} //jpd -- These are the main user accessible functions - dish out vectors

  • f channel ids

std::vector<raw::ChannelID_t> const& getTPCChannels(Hardware::ID tpc_id); std::vector<raw::ChannelID_t> const& getAPAChannels(Hardware::ID apa_id); DAQTriggerSim/Service/HardwareMapperService.h Some of the public member functions exposed to users

slide-6
SLIDE 6

Some ¡Code ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 6 ¡

¡ ¡ DAQTriggerSim/TriggerDataProducts/HardwareElements.h namespace Hardware Typedef ID -> unsigned int HardwareID -> class containing std::string fType;//(i.e. “APA”) ID fID;//(i.e. APA “2”) Element -> same as (inherits from) HardwareID but with list of channels exposes addChannel, getChannels ASIC, Board, TPC, APA, APAGroup, Cryostat

  • > these are all specialisations of Element
slide-7
SLIDE 7

Some ¡Code ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 7 ¡

¡ ¡ DAQTriggerSim/TestHardwareMapper/TestHardwareMapper_module.cc

art::ServiceHandle<HardwareMapperService> mapperService; mapperService->printGeometryInfo(); unsigned int num_tpcs = mapperService->getNTPCs(); for(unsigned int tpc_id = 0; tpc_id < num_tpcs; tpc_id++){ //jpd -- now get the vector of channels std::vector<raw::ChannelID_t> tpc_channel_vector = mapperService->getTPCChannels(tpc_id); INFO << "Got TPC number: " << tpc_id << " - it has " << tpc_channel_vector.size() << " channels" << " - first channel is " << tpc_channel_vector.at(0) << std::endl; }//loop over TPCs unsigned int num_apas = mapperService->getNAPAs(); for(unsigned int apa_id = 0; apa_id < num_apas; apa_id++){ //jpd -- now get the vector of channels std::vector<raw::ChannelID_t> apa_channel_vector = mapperService->getAPAChannels(apa_id); INFO << "Got APA number: " << apa_id << " - it has " << apa_channel_vector.size() << " channels" << " - first channel is " << apa_channel_vector.at(0) << std::endl; }//loop over APAs

slide-8
SLIDE 8

Some ¡Code ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 8 ¡

¡ ¡ DAQTriggerSim/TestHardwareMapper/TestHardwareMapper_module.cc

art::ServiceHandle<HardwareMapperService> mapperService; mapperService->printGeometryInfo(); unsigned int num_tpcs = mapperService->getNTPCs(); for(unsigned int tpc_id = 0; tpc_id < num_tpcs; tpc_id++){ //jpd -- now get the vector of channels std::vector<raw::ChannelID_t> tpc_channel_vector = mapperService->getTPCChannels(tpc_id); INFO << "Got TPC number: " << tpc_id << " - it has " << tpc_channel_vector.size() << " channels" << " - first channel is " << tpc_channel_vector.at(0) << std::endl; }//loop over TPCs unsigned int num_apas = mapperService->getNAPAs(); for(unsigned int apa_id = 0; apa_id < num_apas; apa_id++){ //jpd -- now get the vector of channels std::vector<raw::ChannelID_t> apa_channel_vector = mapperService->getAPAChannels(apa_id); INFO << "Got APA number: " << apa_id << " - it has " << apa_channel_vector.size() << " channels" << " - first channel is " << apa_channel_vector.at(0) << std::endl; }//loop over APAs

slide-9
SLIDE 9

Some ¡Output ¡– ¡Using ¡35t ¡Geometry ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 9 ¡

¡ ¡

INFO FN: HardwareMapperService::HardwareMapperService(const fhicl::ParameterSet&, art::ActivityRegistry&) INFO FN: void HardwareMapperService::fillHardwareMaps() INFO FN: void HardwareMapperService::fillTPCMap() INFO : Filling TPC Map INFO : Finished filling TPC Map INFO : INFO FN: void HardwareMapperService::fillAPAMap() INFO : Filling APA Map INFO : Finished filling APA Map INFO : INFO FN: void HardwareMapperService::printGeometryInfo() INFO : INFO : DetectorName: dune35t4apa_v6 INFO : TotalMass: 4.47434e+09 INFO : Ncryostats: 1 INFO : TotalNTPC: 8 INFO : Nchannels: 2048 INFO FN: void HardwareMapperService::printHardwareMaps() INFO : INFO FN: void HardwareMapperService::printTPCMap(unsigned int) INFO : Printing the first: 8 TPCs INFO : TPC: 0 has 400 channels of which 400 are unique: 0 1 2 3 4 5 6 7 8 9 INFO : TPC: 1 has 400 channels of which 400 are unique: 0 1 2 3 4 5 6 7 8 9 INFO : TPC: 2 has 400 channels of which 400 are unique: 512 513 514 515 516 517 518 519 520 521 INFO : TPC: 3 has 400 channels of which 400 are unique: 512 513 514 515 516 517 518 519 520 521 INFO : TPC: 4 has 400 channels of which 400 are unique: 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 INFO : TPC: 5 has 400 channels of which 400 are unique: 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 INFO : TPC: 6 has 400 channels of which 400 are unique: 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 INFO : TPC: 7 has 400 channels of which 400 are unique: 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 INFO : INFO : Total Channels: 3200 INFO : INFO FN: void HardwareMapperService::printAPAMap(unsigned int) INFO : Printing the first: 4 APAs INFO : APA: 0 has 512 channels of which 512 are unique: 0 1 2 3 4 5 6 7 8 9 INFO : APA: 1 has 512 channels of which 512 are unique: 512 513 514 515 516 517 518 519 520 521 INFO : APA: 2 has 512 channels of which 512 are unique: 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 INFO : APA: 3 has 512 channels of which 512 are unique: 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 INFO : INFO : Total Channels: 2048 INFO :

INFO : Got APA number: 0 - it has 512 channels - first channel is 0 INFO : Got APA number: 1 - it has 512 channels - first channel is 512 INFO : Got APA number: 2 - it has 512 channels - first channel is 1024 INFO : Got APA number: 3 - it has 512 channels - first channel is 1536 INFO : Got TPC number: 0 - it has 400 channels - first channel is 0 INFO : Got TPC number: 1 - it has 400 channels - first channel is 0 INFO : Got TPC number: 2 - it has 400 channels - first channel is 512 INFO : Got TPC number: 3 - it has 400 channels - first channel is 512 INFO : Got TPC number: 4 - it has 400 channels - first channel is 1024 INFO : Got TPC number: 5 - it has 400 channels - first channel is 1024 INFO : Got TPC number: 6 - it has 400 channels - first channel is 1536 INFO : Got TPC number: 7 - it has 400 channels - first channel is 1536

Output ¡from ¡ini3alisa3on ¡ Output ¡from ¡“printGeometry()” ¡ Output ¡from ¡loop ¡over ¡APAs ¡ and ¡TPCs ¡

services.user: @local::dune35t_services services.user.hardwaremapper: @local::standard_hardwaremapper ¡

slide-10
SLIDE 10

Some ¡Output ¡– ¡Using ¡FD ¡Geometry ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 10 ¡

¡ ¡

INFO : DetectorName: dune10kt_v1 INFO : TotalMass: 3.58457e+09 INFO : Ncryostats: 1 INFO : TotalNTPC: 300 INFO : Nchannels: 384000 INFO : NOpChannels: 18000 INFO : INFO : Printing the first: 300 TPCs ... INFO : TPC: 2 has 2080 channels of which 2080 are unique: 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 INFO : TPC: 3 has 2080 channels of which 2080 are unique: 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 INFO : TPC: 4 has 2080 channels of which 2080 are unique: 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 INFO : TPC: 5 has 2080 channels of which 2080 are unique: 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 INFO : TPC: 6 has 2080 channels of which 2080 are unique: 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 INFO : TPC: 7 has 2080 channels of which 2080 are unique: 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 INFO : TPC: 8 has 2080 channels of which 2080 are unique: 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 INFO : TPC: 9 has 2080 channels of which 2080 are unique: 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 INFO : TPC: 10 has 2080 channels of which 2080 are unique: 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 INFO : TPC: 11 has 2080 channels of which 2080 are unique: 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 ... INFO : APA: 1 has 2560 channels of which 2560 are unique: 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 INFO : APA: 2 has 2560 channels of which 2560 are unique: 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 INFO : APA: 3 has 2560 channels of which 2560 are unique: 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 INFO : APA: 4 has 2560 channels of which 2560 are unique: 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 INFO : APA: 5 has 2560 channels of which 2560 are unique: 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 ...

Output ¡from ¡ “printGeometry()” ¡ I’ve ¡deleted ¡some ¡lines ¡here ¡since ¡there ¡are ¡300 ¡TPCs! ¡ Note ¡that ¡there ¡are ¡2 ¡TPCs ¡per ¡APA ¡(one ¡in ¡front, ¡one ¡behind) ¡ hence ¡the ¡shared ¡channels ¡

services.user: @local::dunefd_services services.user.hardwaremapper: @local::standard_hardwaremapper ¡

slide-11
SLIDE 11

Geometry ¡Op3ons ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 11 ¡

¡ ¡

services.user.Geometry: @local::dunefd_geo services.user.Geometry: @local::dune10kt_geo services.user.Geometry: @local::dunedphase10kt_geo services.user.Geometry: @local::dune10kt_workspace_geo services.user.Geometry: @local::dune10kt_1x2x6_geo services.user.Geometry: @local::dunedphase10kt_workspace_geo services.user.Geometry: @local::dune10kt_45deg_workspace_geo services.user.Geometry: @local::dune10kt_45deg_1x2x6_geo services.user.Geometry: @local::dune10kt_3mmpitch_workspace_geo services.user.Geometry: @local::dune10kt_3mmpitch_1x2x6_geo services.user.Geometry: @local::protodune_geo services.user.Geometry: @local::dune35t_geo services.user.Geometry: @local::larnd_geo dunetpc/dune/Geometry/geometry_dune.fcl dunefd_geo: { ... }

Has ¡lines ¡like ¡the ¡following, ¡which ¡define ¡different ¡detector ¡geometries: ¡ Listed ¡below ¡are ¡all ¡the ¡op?ons ¡that ¡I ¡found ¡and ¡how ¡to ¡set ¡them ¡in ¡a ¡user’s ¡fcl ¡ I’ve ¡run ¡ TestHardwareMapper_module.cc ¡ via ¡testhardwaremapper_job.fcl ¡ with ¡all ¡of ¡these ¡geometries ¡ successfully... ¡

slide-12
SLIDE 12

Conclusions ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 12 ¡

  • Now ¡have ¡a ¡v1.0 ¡HardwareMapperService ¡
  • Dynamically ¡changes ¡according ¡to ¡the ¡fcl ¡configured ¡

geometry ¡used: ¡

  • Does ¡the ¡heavy ¡liSing ¡on ¡ini?alisa?on, ¡so ¡it ¡should ¡be ¡

quick ¡

  • Exposes ¡easy ¡to ¡use ¡func3ons: ¡
  • Defines ¡classes ¡for ¡“Hardware ¡Elements” ¡
  • Taught ¡it ¡about ¡“TPCs” ¡and ¡“APAs”, ¡
  • Easily ¡expandable ¡to ¡other ¡hardware ¡elements ¡
  • We ¡just ¡need ¡to ¡know ¡how ¡Boards ¡/ ¡ASICs ¡relate ¡to ¡

APAs ¡

  • i.e. ¡how ¡many ¡per ¡APA? ¡How ¡many ¡channels ¡

per ¡Element? ¡Are ¡collec?on ¡/ ¡induc?on ¡wires ¡ treated ¡differently? ¡ ¡

unsigned int getNAPAs() const { return fAPAMap.size();} unsigned int getNTPCs() const { return fTPCMap.size();} std::vector<raw::ChannelID_t> const& getTPCChannels(Hardware::ID tpc_id); std::vector<raw::ChannelID_t> const& getAPAChannels(Hardware::ID apa_id); services.user: @local::dune35t_services services.user: @local::dunefd_services services.user.hardwaremapper: @local::standard_hardwaremapper ¡

slide-13
SLIDE 13

Next ¡Steps ¡ Hardware ¡Mapper ¡Service ¡

18 ¡August ¡2016 ¡ Jonathan Davies 13 ¡

  • Find ¡out ¡some ¡informa?on ¡about ¡Boards ¡/ ¡ASICs ¡/ ¡channels ¡within ¡APAs ¡
  • Work ¡on ¡adding ¡Hardware::HardwareID ¡to ¡BasicTrigger ¡object ¡to ¡tag ¡a ¡trigger ¡as ¡coming ¡

from ¡a ¡par?cular ¡piece ¡of ¡hardware ¡

  • Write ¡func?ons ¡to ¡take ¡ALL ¡channels ¡in ¡event ¡and ¡return ¡subset ¡(the ¡user ¡could ¡do ¡this ¡

themselves, ¡but ¡may ¡make ¡things ¡easier ¡for ¡new ¡people) ¡

  • Take ¡on ¡board ¡the ¡helpful ¡comments ¡from ¡this ¡group ¡
  • Expand ¡to ¡include ¡the ¡op?cal ¡system ¡