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

A class for loading and converting MUX position parameters. More...

#include <TMUXPositionConverter.h>

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

Public Member Functions

 TMUXPositionConverter ()
 Default constructor.
 
 ~TMUXPositionConverter () override
 Default destructor.
 
Double_t Convert (Double_t val) const override
 Converts a value based on the loaded parameters.
 
Bool_t LoadString (const TString &str) override
 Loads numeric parameters from a string.
 
void Print (Option_t *opt="") const override
 Prints the loaded parameters.
 

Private Member Functions

 ClassDefOverride (TMUXPositionConverter, 2)
 ROOT macro for class definition.
 

Private Attributes

std::vector< Double_t > fParams
 A vector to store the loaded numeric parameters.
 

Detailed Description

A class for loading and converting MUX position parameters.

The TMUXPositionConverter class provides functionality to load numeric parameters from a file and convert MUX position signals into silicon-strip detector strip numbers using binary search. It inherits from TConverterBase.

Example Steering File

Processor:
- name: MyTParameterArrayLoader
type: art::TParameterArrayLoader
parameter:
FileFormat: text # [TString] file format : text (default), yaml
FileName: path/to/file # [TString] input filename
Name: parameter # [TString] name of parameter array output
OutputTransparency: 0 # [Bool_t] Output is persistent if false (default)
Type: TParameterObject # [TString] type(class) of parameter
Verbose: 1 # [Int_t] verbose level (default 1 : non quiet)

Definition at line 40 of file TMUXPositionConverter.h.

Constructor & Destructor Documentation

◆ TMUXPositionConverter()

art::crib::TMUXPositionConverter::TMUXPositionConverter ( )
default

Default constructor.

◆ ~TMUXPositionConverter()

art::crib::TMUXPositionConverter::~TMUXPositionConverter ( )
overridedefault

Default destructor.

Member Function Documentation

◆ ClassDefOverride()

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

ROOT macro for class definition.

◆ Convert()

Double_t art::crib::TMUXPositionConverter::Convert ( Double_t val) const
override

Converts a value based on the loaded parameters.

Parameters
valThe input value to be converted.
Returns
The index of the boundary, or kInvalidI if the value is out of range or if no parameters have been loaded.
  • Checks if fParams is empty. If so, returns kInvalidI and logs a warning.
  • Uses std::lower_bound to find the first element in fParams not less than val.
  • If val is out of range (less than the first or greater than the last element), returns kInvalidI.
  • Otherwise, returns the index of the boundary just below val.

Definition at line 35 of file TMUXPositionConverter.cc.

◆ LoadString()

Bool_t art::crib::TMUXPositionConverter::LoadString ( const TString & str)
override

Loads numeric parameters from a string.

Parameters
strA TString containing the parameters to load.
Returns
True if parameters were successfully loaded; otherwise, false.
  • Strips leading and trailing spaces and removes comments starting with #.
  • Replaces commas and tabs with spaces, and normalizes multiple spaces into a single space.
  • Splits the string into tokens, attempts to convert each token to a Double_t, and stores valid values in fParams.
  • Invalid tokens are skipped, and a warning is logged.
  • After parsing, fParams is sorted to prepare for binary search operations.

Definition at line 57 of file TMUXPositionConverter.cc.

◆ Print()

void art::crib::TMUXPositionConverter::Print ( Option_t * opt = "") const
override

Prints the loaded parameters.

Parameters
optOptional string parameter (currently unused).

Iterates over all elements in fParams and logs their values using ROOT's Info function.

Definition at line 103 of file TMUXPositionConverter.cc.

Member Data Documentation

◆ fParams

std::vector<Double_t> art::crib::TMUXPositionConverter::fParams
private

A vector to store the loaded numeric parameters.

Definition at line 74 of file TMUXPositionConverter.h.


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