1 / 13

Classes to decode and display raw data

Classes to decode and display raw data. F. Cafagna. Once upon a time …. … a dialog between collegues …. Intro. I was just kidding, of course. Things are more linear … One important message was: be flexible, try to generalize.

ila-ross
Download Presentation

Classes to decode and display raw data

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Classes to decode and display raw data F. Cafagna

  2. Once upon a time … … a dialog between collegues … F.S. Cafagna, 1st Balloon Software meeting, IRAP

  3. Intro I was just kidding, of course. Things are more linear … One important message was: be flexible, try to generalize. In this approach I have also tried to minimize memory copies and footprints, trying to leverage the general programming (i.e. using templates). F.S. Cafagna, 1st Balloon Software meeting, IRAP

  4. From ASIC to MAPMT From Pierre B. We have two categories of mapping between the ASIC and the MAPMT channels: ASIC_ACE, or ASIC_BDF F.S. Cafagna, 1st Balloon Software meeting, IRAP

  5. From ASIC to MAPMT I have noticed that ASIC channels are decremented by a fixed number, in group. Then the channel number «jumps» to another number and the decrement rools over. F.S. Cafagna, 1st Balloon Software meeting, IRAP

  6. From ASIC to MAPMT • Thanks to this nice features, I decided to write a pointer class that could «navigate and jump» into the data buffer. • This class is called: jumper_iterator. • The template parameters define: • The data buffer type, i.e. PDM data type; • The data type, i.e. ASIC data type; • The GROUP, DECREMENT, START and memory OFFSET; • The type and amount of jumps. • It is a derived class from the base class: base_jumper_iterator • It behaves like a random access iterator, so has been defined the operators: *, [], ++, = F.S. Cafagna, 1st Balloon Software meeting, IRAP

  7. From ASIC to MAPMT • Example of usage: typedefpdm::utils::asicbdf::jumper_iterator_typejumper_iterator_bdf_type; jumper_iterator_bdf_type pmt110B_1(&data[event_header_offset+0]), pmt110B_2; // Extract the data using the postincrement For(inti=0; i<MAPMT_CHANNELS; ++i) std::cout << “ Ch: “ << i<< “, counts: “ << pmt110B_1++ << std::endl; // Extract data using the random access operator pmt110B_2=&data[event_header_offset+0]); // Extract the data collected by the PMT channel 10 (counting from 0) Std::cout << “ Ch: 10” << pmt110B_2[10] << std::endl; • Pros: no memory copy, high granularity, small memory footprint, can be used with standard algorithms. F.S. Cafagna, 1st Balloon Software meeting, IRAP

  8. MAPMT pixels • A MAPMT channel, must be mapped to a corresponding pixel. • This can be done with the template class: pixels • This class converts MAPMT channels into pixels in the system of reference of the MAPMT F.S. Cafagna, 1st Balloon Software meeting, IRAP

  9. In a EC the MAPMT are rotated by 90 degrees. In the EC system of reference you can imagine that B is A rotated by 90 degrees around the EC center, C is and A rotated by 180 and D by 270. I wrote the class: rotation, that is able to rotate a pixels class. In the same way a class: translation, is able to translate a pixels class. Up to three transformation, in any order, can be executed in the: transformation class. EC pixels F.S. Cafagna, 1st Balloon Software meeting, IRAP

  10. For example, if j is a given B channel, to obtain the pixel position in the EC system of reference, (centered in the EC) you have to: Create a pixels object; Obtain the pixels pair in the A system of reference; Rotate the pixels pair 90° clockwise; Translate the pixels pair by (1,1) pixel, to avoid to have empty rows in correspondence of the axis. EC pixels F.S. Cafagna, 1st Balloon Software meeting, IRAP

  11. The pixels of the EC itself can be transformed in the same way. For the actual configuration, you can think about the EC, as rotated and translated into the PDM. The same pixels rototranslation can be applied to the EC pixels. EC pixels F.S. Cafagna, 1st Balloon Software meeting, IRAP

  12. EC PixelsExample // Plot just the central EC Intirow=2, icol=2; // Calculate the displacement, in pixel of the center of the EC respect to the PDM system of reference intix = irow * 16 + 8; intiy = icol * 16 + 8; //Please note that the PDM system of referenceislefthanded and with the origin on the topmostleft corner of the PDM // Create the transformation and use it to translate the EC pdm::utils::pixels::pixels_translation_typeectopdm(ix,iy); pdm::utils::pixels::pixels_translation_typeectopdmg(ectopdm.boost()); // Create a temporarypair pdm::utils::pixels::pixels_type::pair_typetemp; // Create the pixel of the MAPMT A pdm::utils::pixels::pixels_typea; constintPMTXROW=12, PMTXCOL=2; intpmt=0; // Loop over the MAPMT D channelsand translatethemintopixels // For every EC the MAPMT for (int i = 0; i < pdm::mapmt::CHANNELS; ++i){ // The fourth MAPMT of and EC is of C type // From the C MAPMT to the EC system of reference // From the EC to the PDM system of reference temp= pdm::utils::pixels::atod(a(i)); temp= pdm::utils::pixels::dtoec(temp); temp= ectopdmg(temp); // Set the PMT number to be used to retrive the jumper iterator from the pdmvector pmt=irow*PMTXROW + icol* PMTXCOL + 7; // Save the data from the jumperiterator asicch.SetBinContent(temp.first, temp.second, pdm[pmt]->get_position(i) ); } // for CHANNELS F.S. Cafagna, 1st Balloon Software meeting, IRAP

  13. Conclusion The set of classes gives you the capability of navigate in the data buffer, without copying it and extracting just the information that you need. It offers you a fully configurable set of transformations to set play with the pixels. You can decide to plot just one EC in its system of reference, or to extract just one MAPMT data. The library is header only, i.e. no binaries are needed and should be fully portable. FaustoGuarino & Francesco Perfetto are porting it to OFFLINE framework. WE NEED TO AGREE ON A STANDARD NOMENCLATURE AND SYSTEM OF REFERENCE! F.S. Cafagna, 1st Balloon Software meeting, IRAP

More Related