Skip to content

Various small fixes

Sylvain Fargier requested to merge wip-sfa into master

Integrate request from Laurent Tassan Got moving private constructors to protected, in addition to some CI work:

Object : ntoflib modification

Proposition:

In ReaderStructACQC.h downgrade the protection level of

      std::vector<int16_t> pulse16_;                      //!< Save the data of the pulse in memory (data on 16 bits)
      std::vector<int8_t> pulse8_;                        //!< Save the data of the pulse in memory (data on 8 bits)
      std::vector<PULSE_DATA_t> correctPulseCollection_;  //!< Save the data of the ACQC if they are collapsed

from 'private' to 'protected'.

Motivation:

When processing the data (raw2root program) the pulse shape analysis routine (PSA) (there is one for each type of detector), receives the frame to be processed through a ReaderStructACQC object which encapsulates the frame as a vector.

In some cases we need to preprocess the data, like frequency filtering, before sending it to the PSA routine. The obvious structure would be to define a special PSA routine which preprocesses the data and call the standard PSA providing it with the new frame.

As all the prototypes of PSA routines are identical and transfer the frame as a ReaderStructACQC object containing the frame, we have to be able to manipulate the frame inside the class ReaderStructACQC or a derived class. This is impossible currently because the frames are 'private' and there is no method giving access to the frame for modification. The only way the frames are filled is through a function reading the data from file.

If the frames are declared as 'protected', it becomes possible to create a class derived from ReaderStructACQC, let's call it HandleStructACQC, with a method for modifying the frame. The structure of the calling code would be:

       ReaderStructACQC A ; // filled by reading the data file
       HandleStructACQC B=A ;  // Tranfer the data to the derived object
            // Here modify  the data in B
           .....
            // Call the standard PSA
       PPAC::analysis(...,B,......) ;

Risks

  • Is backward compatibility guaranted ?

    Yes it is, nothing has to be changed in the existing programs using the library.

  • Is there a higher risk of corrupting the data ?

    No because the original frame is still embedded in the ReaderStructACQC object for which no access is provided for modifying the data. The transfer of the data by B=A makes a full copy of the vectors of data into the derived HandleStructACQC object, in which modifications can be applied, but they leave intact the original data.

Merge request reports