Jonathan ¡Davies ¡ DAQ ¡Simula3ons, ¡2016 ¡
18 ¡August ¡2016 ¡
Hardware ¡Mapper ¡Service ¡
Jonathan Davies 1 ¡
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
18 ¡August ¡2016 ¡
Jonathan Davies 1 ¡
18 ¡August ¡2016 ¡ Jonathan Davies 2 ¡
different ¡levels ¡of ¡hardware ¡within ¡the ¡DUNE ¡detector: ¡
(std::vector<raw::RawDigits>) ¡
par?cular ¡hardware ¡“Element” ¡
“Element” ¡
18 ¡August ¡2016 ¡ Jonathan Davies 3 ¡
hardware ¡
¡
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 ¡
Using_the_DAQTriggerSim_module ¡ ¡ ¡
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
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
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
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
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
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 ¡
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 ¡
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... ¡
18 ¡August ¡2016 ¡ Jonathan Davies 12 ¡
geometry ¡used: ¡
quick ¡
APAs ¡
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 ¡
18 ¡August ¡2016 ¡ Jonathan Davies 13 ¡
from ¡a ¡par?cular ¡piece ¡of ¡hardware ¡
themselves, ¡but ¡may ¡make ¡things ¡easier ¡for ¡new ¡people) ¡