ARTEMIS-CRIB
 
Loading...
Searching...
No Matches
art::crib::TMUXCalibrationProcessor Class Reference

Handles the calibration of timing, charge, and position data in the MUX system. More...

#include <TMUXCalibrationProcessor.h>

Inheritance diagram for art::crib::TMUXCalibrationProcessor:
[legend]
Collaboration diagram for art::crib::TMUXCalibrationProcessor:
[legend]

Public Member Functions

 TMUXCalibrationProcessor ()
 Constructor.
 
 ~TMUXCalibrationProcessor () override
 Destructor.
 
void Init (TEventCollection *col) override
 Initializes the processor by setting up input and output collections.
 
void Process () override
 Processes the input data, applies calibration, and stores the results.
 

Private Member Functions

 TMUXCalibrationProcessor (const TMUXCalibrationProcessor &rhs)=delete
 
double CalibrateValue (double raw, int id, const TClonesArray *converterArray) const
 Calibrates a raw value (e.g., timing or charge) using the specified converter array.
 
 ClassDefOverride (TMUXCalibrationProcessor, 2)
 ROOT class definition macro.
 
double ConvertPosition (double pos, int id) const
 Converts a raw position value to a detector ID using the position converter array.
 
TMUXCalibrationProcessoroperator= (const TMUXCalibrationProcessor &rhs)=delete
 

Private Attributes

TClonesArray * fChargeConverterArray
 ! Pointer to the charge converter array.
 
TString fChargeConverterArrayName
 Name of the charge converter array parameter.
 
Bool_t fHasReflection
 Indicates whether to apply reflection to the detector ID.
 
TClonesArray ** fInData
 ! Pointer to the input data collection.
 
TString fInputColName
 Name of the input collection.
 
Bool_t fInputIsDigital
 Indicates whether the input data is digital.
 
TClonesArray * fOutData
 ! Pointer to the output data collection.
 
TString fOutputColName
 Name of the output collection.
 
TClonesArray * fPositionConverterArray
 ! Pointer to the position converter array.
 
TString fPositionConverterArrayName
 Name of the position converter array parameter.
 
TClonesArray * fTimingConverterArray
 ! Pointer to the timing converter array.
 
TString fTimingConverterArrayName
 Name of the timing converter array parameter.
 

Detailed Description

Handles the calibration of timing, charge, and position data in the MUX system.

This class reads input data from a TClonesArray, applies calibration transformations using affine converters for timing and charge, and custom MUX converters for position. The calibrated data is then stored in another TClonesArray.

Example Steering File

Processor:
- name: MyTMUXCalibrationProcessor
type: art::crib::TMUXCalibrationProcessor
parameter:
ChargeConverterArray: no_conversion # [TString] Energy parameter object of TAffineConverter
HasReflection: 0 # [Bool_t] Reverse strip order (0--7) if true
InputCollection: mux_raw # [TString] Array of TMUXData objects
InputIsDigital: 1 # [Bool_t] Add randomness if true
OutputCollection: mux_cal # [TString] Output array of TTimingChargeData objects
OutputTransparency: 0 # [Bool_t] Output is persistent if false (default)
PositionConverterArray: no_conversion # [TString] Position parameter object of TMUXPositionConverter
TimingConverterArray: no_conversion # [TString] Timing parameter object of TAffineConverter
Verbose: 1 # [Int_t] verbose level (default 1 : non quiet)

Definition at line 46 of file TMUXCalibrationProcessor.h.

Constructor & Destructor Documentation

◆ TMUXCalibrationProcessor() [1/2]

art::crib::TMUXCalibrationProcessor::TMUXCalibrationProcessor ( )

Constructor.

Definition at line 36 of file TMUXCalibrationProcessor.cc.

◆ ~TMUXCalibrationProcessor()

art::crib::TMUXCalibrationProcessor::~TMUXCalibrationProcessor ( )
override

Destructor.

Cleans up allocated resources.

Definition at line 61 of file TMUXCalibrationProcessor.cc.

◆ TMUXCalibrationProcessor() [2/2]

art::crib::TMUXCalibrationProcessor::TMUXCalibrationProcessor ( const TMUXCalibrationProcessor & rhs)
privatedelete

Member Function Documentation

◆ CalibrateValue()

double art::crib::TMUXCalibrationProcessor::CalibrateValue ( double raw,
int id,
const TClonesArray * converterArray ) const
private

Calibrates a raw value (e.g., timing or charge) using the specified converter array.

Parameters
rawThe raw value to calibrate.
idThe index of the converter to use.
converterArrayThe array of converters to use for calibration.
Returns
The calibrated value, or the raw value if no converter is available.

Calibrates a raw value (such as timing or charge) using the specified converter array. If the input is digital (fInputIsDigital), a random value is added to the raw input to simulate analog noise. If the converter array is not available or the conversion fails, the raw value is returned unchanged.

Definition at line 185 of file TMUXCalibrationProcessor.cc.

◆ ClassDefOverride()

art::crib::TMUXCalibrationProcessor::ClassDefOverride ( TMUXCalibrationProcessor ,
2  )
private

ROOT class definition macro.

◆ ConvertPosition()

double art::crib::TMUXCalibrationProcessor::ConvertPosition ( double pos,
int id ) const
private

Converts a raw position value to a detector ID using the position converter array.

Parameters
posThe raw position value to convert.
idThe index of the converter to use.
Returns
The converted detector ID, or a default invalid value if conversion fails.

Converts a raw position value to a detector ID by using the position converter array. If the position converter array is not available or the conversion fails, an invalid value (kInvalidD) is returned.

Definition at line 172 of file TMUXCalibrationProcessor.cc.

◆ Init()

void art::crib::TMUXCalibrationProcessor::Init ( TEventCollection * col)
override

Initializes the processor by setting up input and output collections.

Parameters
colA pointer to the TEventCollection for managing data collections.

This method initializes the processor by:

  • Retrieving the input and output data collections based on user configuration.
  • Setting up the converter arrays (fTimingConverterArray, fChargeConverterArray, fPositionConverterArray) based on the specified parameters.
  • Logging warnings if parameters are not set or if required converters are missing.

If the required position converter array is not provided, the processor is put into an error state.

Definition at line 76 of file TMUXCalibrationProcessor.cc.

◆ operator=()

TMUXCalibrationProcessor & art::crib::TMUXCalibrationProcessor::operator= ( const TMUXCalibrationProcessor & rhs)
privatedelete

◆ Process()

void art::crib::TMUXCalibrationProcessor::Process ( )
override

Processes the input data, applies calibration, and stores the results.

The Process method performs the following steps:

  1. Clears the output data collection to prepare for new entries.
  2. Checks the validity of the input data:
    • If no data is present (nData == 0), the method exits as this is a valid condition.
    • If multiple data entries are found, a warning is logged and the method exits, as multi-data processing is not supported.
  3. Retrieves the first entry in the input collection and casts it to TMUXData.
  4. Converts the position data (P1) to a detector ID.
  5. Applies reflection to the detector ID if fHasReflection is enabled.
  6. Calibrates the charge and timing values using the respective converter arrays.
  7. Stores the calibrated data in the output collection.

Definition at line 131 of file TMUXCalibrationProcessor.cc.

Member Data Documentation

◆ fChargeConverterArray

TClonesArray* art::crib::TMUXCalibrationProcessor::fChargeConverterArray
private

! Pointer to the charge converter array.

Definition at line 80 of file TMUXCalibrationProcessor.h.

◆ fChargeConverterArrayName

TString art::crib::TMUXCalibrationProcessor::fChargeConverterArrayName
private

Name of the charge converter array parameter.

Definition at line 76 of file TMUXCalibrationProcessor.h.

◆ fHasReflection

Bool_t art::crib::TMUXCalibrationProcessor::fHasReflection
private

Indicates whether to apply reflection to the detector ID.

Definition at line 83 of file TMUXCalibrationProcessor.h.

◆ fInData

TClonesArray** art::crib::TMUXCalibrationProcessor::fInData
private

! Pointer to the input data collection.

Definition at line 72 of file TMUXCalibrationProcessor.h.

◆ fInputColName

TString art::crib::TMUXCalibrationProcessor::fInputColName
private

Name of the input collection.

Definition at line 70 of file TMUXCalibrationProcessor.h.

◆ fInputIsDigital

Bool_t art::crib::TMUXCalibrationProcessor::fInputIsDigital
private

Indicates whether the input data is digital.

Definition at line 84 of file TMUXCalibrationProcessor.h.

◆ fOutData

TClonesArray* art::crib::TMUXCalibrationProcessor::fOutData
private

! Pointer to the output data collection.

Definition at line 73 of file TMUXCalibrationProcessor.h.

◆ fOutputColName

TString art::crib::TMUXCalibrationProcessor::fOutputColName
private

Name of the output collection.

Definition at line 71 of file TMUXCalibrationProcessor.h.

◆ fPositionConverterArray

TClonesArray* art::crib::TMUXCalibrationProcessor::fPositionConverterArray
private

! Pointer to the position converter array.

Definition at line 81 of file TMUXCalibrationProcessor.h.

◆ fPositionConverterArrayName

TString art::crib::TMUXCalibrationProcessor::fPositionConverterArrayName
private

Name of the position converter array parameter.

Definition at line 77 of file TMUXCalibrationProcessor.h.

◆ fTimingConverterArray

TClonesArray* art::crib::TMUXCalibrationProcessor::fTimingConverterArray
private

! Pointer to the timing converter array.

Definition at line 79 of file TMUXCalibrationProcessor.h.

◆ fTimingConverterArrayName

TString art::crib::TMUXCalibrationProcessor::fTimingConverterArrayName
private

Name of the timing converter array parameter.

Definition at line 75 of file TMUXCalibrationProcessor.h.


The documentation for this class was generated from the following files:
return to the guide