Bartender LYSO
Digitizer simulation for the LYSO calorimeter prototype
Loading...
Searching...
No Matches
BarLYSO Class Reference

Class for managing waveform construction for all events and channels. More...

#include <bar.hh>

Collaboration diagram for BarLYSO:

Public Member Functions

 BarLYSO (const char *inputFilename, Int_t threadID)
 Constructor of the class.
 
 ~BarLYSO ()
 Destructor of the class.
 
void SetParsDistro ()
 Sets the 3D histogram hPars.
 
void InitializeBaselines (Int_t event)
 Method to initialize the entire fFront and fBack with a noise baseline.
 
void ClearContainers ()
 Method to add a I-Phel waveform to the corresponding event and channel of the Front-Detector.
 
void SetSamplingTimes ()
 
void SetFrontWaveform (Int_t channel, Double_t start)
 
void SetBackWaveform (Int_t channel, Double_t start)
 Method to add a I-Phel waveform to the corresponding event and channel of the Back-Detector.
 
void SaveEvent ()
 Saves all the samples from fFront and fBack into a text file.
 
void SaveBar ()
 
void SetSigmaNoise (Double_t newSigmaNoise)
 Set fSigmaNoise, the noise of the DAQ.
 
void SetInputFilename (std::string newInputFilename)
 Set the name of the text file of the best fit parameters data.
 
void SetChargeCuts (Double_t min, Double_t max)
 Set the cuts in the charge spectrum of input best fit parameters data.
 
void SetHisto_A (Double_t nbins, Double_t min, Double_t max)
 Set the number of bins, the lower and the upper limit related to parameter A for the histogram hPars.
 
void SetHisto_Tau_rise (Double_t nbins, Double_t min, Double_t max)
 Set the number of bins, the lower and the upper limit related to parameter Tau_rise for the histogram hPars.
 
void SetHisto_Tau_dec (Double_t nbins, Double_t min, Double_t max)
 Set the number of bins, the lower and the upper limit related to parameter Tau_dec for the histogram hPars.
 
void SetEvents (Int_t events)
 
Int_t GetEvents () const
 Returns the number of events in the run.
 
Int_t GetID () const
 Returns the ID of the Monte Carlo.
 
DAQGetDAQ () const
 

Private Member Functions

std::string GenerateOutputFilename (const char *inputFilename)
 
Double_t Add_Noise ()
 Returns the value of the noise.
 
Double_t Wave_OnePhel (Double_t t, Double_t A, Double_t tau_rise, Double_t tau_dec, Double_t timePhel)
 Returns the value at t of the analytical form of the One Photo-Electron waveform.
 

Private Attributes

Int_t fEvent
 Number of events in the run.
 
Int_t fID
 Run ID of the Monte Carlo.
 
Int_t EVENTS
 
Int_t fThreadID
 
std::vector< std::vector< Double_t > > fFront
 Container for Front-Detector waveforms: a 3-dimensional matrix with indices for event, channel, and bin.
 
std::vector< std::vector< Double_t > > fBack
 Container for Back-Detector waveforms: a 3-dimensional matrix with indices for event, channel, and bin.
 
std::vector< std::vector< Double_t > > fTimes_F
 
std::vector< std::vector< Double_t > > fTimes_B
 
TH3D * hPars
 3D Histogram of One-Phel waveform parameters from which sampling will occur
 
TRandom3 * fRandPars
 Random generator for SetFrontWaveform() and SetBackWaveform()
 
TRandom3 * fRandNoise
 Random generator for Add_Noise()
 
Double_t fSigmaNoise
 Noise of the DAQ, evaluated as the stDev of the pedestal distribution.
 
std::string fInputFilename
 Name of the txt file of the best fit parameters data. See the introduction for more details about the file format.
 
Double_t fChargeCuts [2]
 Cuts in the charge spectrum of input best fit parameters data; [0] represents the minimum, [1] represents the maximum.
 
Double_t fHisto_A [3]
 Settings for histogram hPars related to parameter A: [0] for number of bins, [1] for the lower limit, [2] for the upper limit.
 
Double_t fHisto_Tau_rise [3]
 Settings for histogram hPars related to parameter Tau_rise: [0] for number of bins, [1] for the lower limit, [2] for the upper limit.
 
Double_t fHisto_Tau_dec [3]
 Settings for histogram hPars related to parameter Tau_dec: [0] for number of bins, [1] for the lower limit, [2] for the upper limit.
 
DAQfDAQ
 
TFile * fOutFile = nullptr
 
TTree * fOutTree = nullptr
 

Detailed Description

Class for managing waveform construction for all events and channels.

Definition at line 27 of file bar.hh.

Constructor & Destructor Documentation

◆ BarLYSO()

BarLYSO::BarLYSO ( const char * inputFilename,
Int_t threadID )

Constructor of the class.

It takes as argument the MC-filename and sets the simulation ID (fID)

Parameters
inputFilenameMC-filename used in the simulation.

Definition at line 11 of file bar.cc.

◆ ~BarLYSO()

BarLYSO::~BarLYSO ( )

Destructor of the class.

Definition at line 45 of file bar.cc.

Member Function Documentation

◆ Add_Noise()

Double_t BarLYSO::Add_Noise ( )
inlineprivate

Returns the value of the noise.

This function provides a random value sampled from a normal distribution \(N\)(0, sigmaNoise). It's important to note that the value of \( \sigma \) should be derived from experimental data, based on the pedestal's distribution.

Definition at line 197 of file bar.hh.

◆ ClearContainers()

void BarLYSO::ClearContainers ( )

Method to add a I-Phel waveform to the corresponding event and channel of the Front-Detector.

This function samples parameters ( \(A \), \( \tau_{RISE} \), \( \tau_{DEC} \)) from hPars, evaluates Wave_OnePhel() in each bin, and finally sums it at the correct event and channel indices of fFront.

Parameters
eventEvent index
channelChannel index
startScintillation photon arrival time, provided to Wave_OnePhel() as the timePhel ( \( t_{phel} \)) input parameter

Definition at line 219 of file bar.cc.

◆ GenerateOutputFilename()

string BarLYSO::GenerateOutputFilename ( const char * inputFilename)
private

Definition at line 68 of file bar.cc.

◆ GetDAQ()

DAQ * BarLYSO::GetDAQ ( ) const
inline

Definition at line 156 of file bar.hh.

◆ GetEvents()

Int_t BarLYSO::GetEvents ( ) const
inline

Returns the number of events in the run.

Definition at line 154 of file bar.hh.

◆ GetID()

Int_t BarLYSO::GetID ( ) const
inline

Returns the ID of the Monte Carlo.

Definition at line 155 of file bar.hh.

◆ InitializeBaselines()

void BarLYSO::InitializeBaselines ( Int_t event)

Method to initialize the entire fFront and fBack with a noise baseline.

This function sets the number of events in the run (EVENTS = newEvents) and fills every bin in every channel and event with Add_Noise()

Parameters
newEventsNumber of events in the MC-Simulation

Definition at line 210 of file bar.cc.

◆ SaveBar()

void BarLYSO::SaveBar ( )

Definition at line 282 of file bar.cc.

◆ SaveEvent()

void BarLYSO::SaveEvent ( )

Saves all the samples from fFront and fBack into a text file.

This method is designed to save the data samples contained in the objects fFront and fBack into a text file. The file naming convention is based on the RunID fID extracted from the MC input file. The output file is named as "BarID_fID.txt". Refer to the introduction for details about the file format.

Definition at line 263 of file bar.cc.

◆ SetBackWaveform()

void BarLYSO::SetBackWaveform ( Int_t channel,
Double_t start )

Method to add a I-Phel waveform to the corresponding event and channel of the Back-Detector.

This function samples parameters ( \(A \), \( \tau_{RISE} \), \( \tau_{DEC} \)) from hPars, evaluates Wave_OnePhel() in each bin, and finally sums it at the correct event and channel indices of fBack.

Parameters
eventEvent index
channelChannel index
startScintillation photon arrival time, provided to Wave_OnePhel() as the timePhel ( \( t_{phel} \)) input parameter

Definition at line 248 of file bar.cc.

◆ SetChargeCuts()

void BarLYSO::SetChargeCuts ( Double_t min,
Double_t max )
inline

Set the cuts in the charge spectrum of input best fit parameters data.

Definition at line 117 of file bar.hh.

◆ SetEvents()

void BarLYSO::SetEvents ( Int_t events)
inline

Definition at line 153 of file bar.hh.

◆ SetFrontWaveform()

void BarLYSO::SetFrontWaveform ( Int_t channel,
Double_t start )

Definition at line 233 of file bar.cc.

◆ SetHisto_A()

void BarLYSO::SetHisto_A ( Double_t nbins,
Double_t min,
Double_t max )
inline

Set the number of bins, the lower and the upper limit related to parameter A for the histogram hPars.

Definition at line 126 of file bar.hh.

◆ SetHisto_Tau_dec()

void BarLYSO::SetHisto_Tau_dec ( Double_t nbins,
Double_t min,
Double_t max )
inline

Set the number of bins, the lower and the upper limit related to parameter Tau_dec for the histogram hPars.

Definition at line 146 of file bar.hh.

◆ SetHisto_Tau_rise()

void BarLYSO::SetHisto_Tau_rise ( Double_t nbins,
Double_t min,
Double_t max )
inline

Set the number of bins, the lower and the upper limit related to parameter Tau_rise for the histogram hPars.

Definition at line 136 of file bar.hh.

◆ SetInputFilename()

void BarLYSO::SetInputFilename ( std::string newInputFilename)
inline

Set the name of the text file of the best fit parameters data.

Definition at line 112 of file bar.hh.

◆ SetParsDistro()

void BarLYSO::SetParsDistro ( )

Sets the 3D histogram hPars.

This function takes all the best-fit parameters ( \(A \), \( \tau_{RISE} \), \( \tau_{DEC} \)) obtained from the fitted I-Phel data waveforms, defines and populates the histogram hPars (from which sampling will occur) with settings fHisto_A, fHisto_Tau_rise and fHisto_Tau_dec. It specifically considers entries within the charge range [fChargeCuts[0], fChargeCuts[1]] and with a converged fit status.

Definition at line 157 of file bar.cc.

◆ SetSamplingTimes()

void BarLYSO::SetSamplingTimes ( )

Definition at line 116 of file bar.cc.

◆ SetSigmaNoise()

void BarLYSO::SetSigmaNoise ( Double_t newSigmaNoise)
inline

Set fSigmaNoise, the noise of the DAQ.

Definition at line 111 of file bar.hh.

◆ Wave_OnePhel()

Double_t BarLYSO::Wave_OnePhel ( Double_t t,
Double_t A,
Double_t tau_rise,
Double_t tau_dec,
Double_t timePhel )
private

Returns the value at t of the analytical form of the One Photo-Electron waveform.

\[ \text{wave}(t) = -A \Bigg( \exp \Bigg( -\frac{t - t_{phel}}{\tau_{\text{RISE}}} \Bigg) - \exp \Bigg( -\frac{t - t_{phel}}{\tau_{\text{DEC}}} \Bigg) \Bigg) \theta( t - t_{phel} ) \]

Definition at line 193 of file bar.cc.

Member Data Documentation

◆ EVENTS

Int_t BarLYSO::EVENTS
private

Definition at line 161 of file bar.hh.

◆ fBack

std::vector<std::vector<Double_t> > BarLYSO::fBack
private

Container for Back-Detector waveforms: a 3-dimensional matrix with indices for event, channel, and bin.

Definition at line 165 of file bar.hh.

◆ fChargeCuts

Double_t BarLYSO::fChargeCuts[2]
private

Cuts in the charge spectrum of input best fit parameters data; [0] represents the minimum, [1] represents the maximum.

Definition at line 177 of file bar.hh.

◆ fDAQ

DAQ* BarLYSO::fDAQ
private

Definition at line 182 of file bar.hh.

◆ fEvent

Int_t BarLYSO::fEvent
private

Number of events in the run.

Definition at line 159 of file bar.hh.

◆ fFront

std::vector<std::vector<Double_t> > BarLYSO::fFront
private

Container for Front-Detector waveforms: a 3-dimensional matrix with indices for event, channel, and bin.

Definition at line 164 of file bar.hh.

◆ fHisto_A

Double_t BarLYSO::fHisto_A[3]
private

Settings for histogram hPars related to parameter A: [0] for number of bins, [1] for the lower limit, [2] for the upper limit.

Definition at line 178 of file bar.hh.

◆ fHisto_Tau_dec

Double_t BarLYSO::fHisto_Tau_dec[3]
private

Settings for histogram hPars related to parameter Tau_dec: [0] for number of bins, [1] for the lower limit, [2] for the upper limit.

Definition at line 180 of file bar.hh.

◆ fHisto_Tau_rise

Double_t BarLYSO::fHisto_Tau_rise[3]
private

Settings for histogram hPars related to parameter Tau_rise: [0] for number of bins, [1] for the lower limit, [2] for the upper limit.

Definition at line 179 of file bar.hh.

◆ fID

Int_t BarLYSO::fID
private

Run ID of the Monte Carlo.

Definition at line 160 of file bar.hh.

◆ fInputFilename

std::string BarLYSO::fInputFilename
private

Name of the txt file of the best fit parameters data. See the introduction for more details about the file format.

Definition at line 176 of file bar.hh.

◆ fOutFile

TFile* BarLYSO::fOutFile = nullptr
private

Definition at line 186 of file bar.hh.

◆ fOutTree

TTree* BarLYSO::fOutTree = nullptr
private

Definition at line 187 of file bar.hh.

◆ fRandNoise

TRandom3* BarLYSO::fRandNoise
private

Random generator for Add_Noise()

Definition at line 172 of file bar.hh.

◆ fRandPars

TRandom3* BarLYSO::fRandPars
private

Random generator for SetFrontWaveform() and SetBackWaveform()

Definition at line 171 of file bar.hh.

◆ fSigmaNoise

Double_t BarLYSO::fSigmaNoise
private

Noise of the DAQ, evaluated as the stDev of the pedestal distribution.

Definition at line 174 of file bar.hh.

◆ fThreadID

Int_t BarLYSO::fThreadID
private

Definition at line 162 of file bar.hh.

◆ fTimes_B

std::vector<std::vector<Double_t> > BarLYSO::fTimes_B
private

Definition at line 167 of file bar.hh.

◆ fTimes_F

std::vector<std::vector<Double_t> > BarLYSO::fTimes_F
private

Definition at line 166 of file bar.hh.

◆ hPars

TH3D* BarLYSO::hPars
private

3D Histogram of One-Phel waveform parameters from which sampling will occur

Definition at line 169 of file bar.hh.


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