This class contains static methods to make them accessible from pyROOT.
More...
#include <ECLDspUtilities.h>
|
| ECLDspUtilities () |
| Private constructor since class only contains static methods, no need to create an instance.
|
|
|
static int | pedestal_fit_initialized = 0 |
| Flag indicating whether arrays fg31,fg32 are filled.
|
|
static float | pedfit_fg31 [768] = {} |
| DSP coefficients used to determine amplitude in pedestalFit.
|
|
static float | pedfit_fg32 [768] = {} |
| DSP coefficients used to determine time in pedestalFit.
|
|
This class contains static methods to make them accessible from pyROOT.
Definition at line 41 of file ECLDspUtilities.h.
◆ initPedestalFit()
Load DSP coefficients used in the pedestal fit function.
If it is not done explicitly, pedestalFit will do it internally when it is called the first time.
However, it is preferable to call it explicitly, in a thread-safe context.
Definition at line 320 of file ECLDspUtilities.cc.
323 TFile* file =
new TFile(path.c_str(),
"read");
324 if (!file->IsOpen()) {
325 B2FATAL(
"Unable to load coefficients for ECL pedestal fit");
327 TTree* tree = (TTree*)file->Get(
"dsp_coefs");
328 int nentries = tree->GetEntries();
329 float fg31_i, fg32_i;
330 tree->SetBranchAddress(
"fg31", &fg31_i);
331 tree->SetBranchAddress(
"fg32", &fg32_i);
333 for (
int i = 0; i < nentries; i++) {
static int pedestal_fit_initialized
Flag indicating whether arrays fg31,fg32 are filled.
static float pedfit_fg32[768]
DSP coefficients used to determine time in pedestalFit.
static float pedfit_fg31[768]
DSP coefficients used to determine amplitude in pedestalFit.
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
◆ pedestalFit()
Fit pedestal part of the signal waveform (first 16 samples) This method will fit the first 16 samples of the waveform and return the amplitude of the peak found in that region.
- Parameters
-
[in] | adc | vector of waveform samples (size >= 16) |
- Returns
- struct with fit results
Definition at line 343 of file ECLDspUtilities.cc.
◆ readEclDsp()
ECLDspData * readEclDsp |
( |
const char * |
raw_file, |
|
|
int |
boardNumber |
|
) |
| |
|
static |
Convert ECLDspData from *.dat file to Root object.
- Parameters
-
[in] | raw_file | Path to dsp??.dat file. |
[in] | boardNumber | Number of shaperDSP board, from 1 to 52*12 |
- Returns
- ECLDspData object
Definition at line 46 of file ECLDspUtilities.cc.
◆ shapeFitter()
ECLShapeFit shapeFitter |
( |
int |
cid, |
|
|
std::vector< int > |
adc, |
|
|
int |
ttrig, |
|
|
bool |
adjusted_timing = true |
|
) |
| |
|
static |
Emulate shape fitting algorithm from ShaperDSP using algorithm from ecl/utility/src/ECLDspEmulator.cc See ecl/examples/eclShapeFitter.py for usage example.
- Parameters
-
[in] | cid | CellID, 1..8736 |
[in] | adc[31] | Waveform data from ECLDsp dataobject |
[in] | ttrig | Trigger time from ECLTrig dataobject |
[in] | adjusted_timing | Optional. Use adjusted formula to determine fit time. Implemented in ShaperDSP firmware since exp 14. If true, algorithm will determine time near 0 with higher precision, time of low-energy hits will be one of {-4,0,4} If false, time will be one of {-32, -16, 0} |
Definition at line 253 of file ECLDspUtilities.cc.
◆ writeEclDsp()
void writeEclDsp |
( |
const char * |
raw_file, |
|
|
ECLDspData * |
obj |
|
) |
| |
|
static |
Convert ECLDspData from Root object to *.dat file.
- Parameters
-
[in] | raw_file | Path to dsp??.dat file to be created. |
[in] | obj | Object to be written |
Definition at line 131 of file ECLDspUtilities.cc.
The documentation for this class was generated from the following files: