49#ifndef TILESIMALGS_TILEDIGITSFROMPULSE_H
50#define TILESIMALGS_TILEDIGITSFROMPULSE_H
62#include "GaudiKernel/ServiceHandle.h"
63#include "GaudiKernel/Algorithm.h"
64#include "GaudiKernel/ToolHandle.h"
66#include "CLHEP/Random/RandomEngine.h"
99 virtual StatusCode
execute()
override;
100 virtual StatusCode
finalize()
override;
116 "TileCondToolNoiseSample",
"TileCondToolNoiseSample",
"Tile sample noise tool"};
119 "TileDigitsContainer",
"TileDigitsCnt",
"Output Tile digits container key"};
122 "TileRawChannelContainer",
"TrueAmp",
"Output Tile raw channel container key"};
124 ServiceHandle <IAthRNGSvc>
m_rndmSvc{
this,
"RndmSvc",
"AthRNGSvc",
""};
166 std::vector<std::vector<std::vector<std::vector<float>>>>
m_PUAmp;
191 bool makeDist(TFile*&
file, TH1F*& hist,
const std::string& fileName,
const std::string& histName=
"h_Eopt_hi");
192 bool makeDist(TFile*&
file, std::vector<std::vector<TH1F*>>& hists,
const std::string& fileName);
194 void addPileUp(
double &n_inTimeAmp,
int gain,
int ros,
int drawer,
int channel);
Property holding a SG store/key/clid from which a WriteHandle is made.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
manage multiple RandomEngines in thread-safe way.
Property holding a SG store/key/clid from which a WriteHandle is made.
TFile * m_pileup_AmpDistFile
File containing amplitude histograms for PU pulses.
bool m_useOotADist
Set to TRUE in order to use a distribution for the out-of-time amplitude instead of a constant value.
TFile * m_itFile
File that holds the distribution of in-time amplitudes.
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
std::string m_itADistHistName
Name of histogram for in-time amplitude distribution.
std::string m_itADistFileName
Filename of file to use for amplitude distribution of in-time pulses.
bool m_chanNoise
Add channel specific noise.
const TileHWID * m_tileHWID
virtual StatusCode initialize() override
initialize method
virtual StatusCode finalize() override
finalize method
std::string m_outputContainer
Name of the output TileDigitsContainer.
double m_ootAmp
Amplitude of out-of-time pulse.
std::string m_ootADistFileName
Filename of file to use for amplitude distribution of out-of-time pulses.
TH1F * m_ootDist
Histogram to hold the distribution of out-of-time amplitudes.
std::string m_ootADistHistName
Name of histogram for out-of-time amplitude distribution.
bool m_simPulseChain
Simulate continous output of readout for HL-LHC paradigm.
TFile * m_ootFile
File that holds the distribution of out-of-time amplitudes.
TileFragHash::TYPE m_rChType
Type of TileRawChannels (Digitizar, OF1, OF2, Fit, etc.)(see TileFragHash.h)
TileSampleBuffer * m_buf
Buffer class to hold generated pulses.
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
TFile * m_ootOffsetFile
File that holds the distribution of out-of-time timing offsets.
virtual StatusCode execute() override
execute method
double m_itOffset
In-time pulse offset from nominal time.
void addPileUpSample(int gain, int ros, int drawer, int channel)
Fill only a BC with pile-up amplitude.
std::vector< std::vector< std::vector< std::vector< float > > > > m_PUAmp
std::unique_ptr< TRandom3 > m_random
double m_ped_HG
Pedestal value for HG if specific channel pedestal is not used.
double m_GNAmpTwo
Amplitude of second gaussian of double gaussian noise.
float m_gausC2C
RMS for the in-time pulse offset (channel-to-channel phase variation)
std::string m_ootOffsetFileName
File name for offset timing distribution histogram.
bool m_useOffsetHisto
Internally used to keep track of wether a histogram has been opened or not.
TileRawChannelUnit::UNIT m_rChUnit
Units used for the TileRawChannels (ADC, pCb, etc.)(see TileInfo.h)
const TileInfo * m_tileInfo
int m_nPul
number of pileup pulses
double m_GNAmpOne
Amplitude of first gaussian of double gaussian noise.
double m_ootOffset
Out-of-time pulse offset from nominal time.
TH1F * m_ootOffsetDist
Histogram to hold the distribution of out-of-time timing offsets.
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainerKey
virtual ~TileDigitsFromPulse()
TilePulseShape * m_ps[2]
Class for defining pulse.
double m_GNSigmaTwo
Standard deviation of second gaussian of double gaussian noise.
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service to use.
TileSampleGenerator * m_tsg
Pulse generating class.
double m_itAPulseProb
Probability to add an in-time pulse.
bool m_simQIE
Raw PMT pulses are generated if the option is set to true.
double m_imperfectionMean
Mean value of pulse shape broadening.
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
std::string m_pileupAmpDistFileName
Filename for PU amplitude distribution histograms.
bool makeDist(TFile *&file, TH1F *&hist, const std::string &fileName, const std::string &histName="h_Eopt_hi")
Method to read distribution from file.
TH1F * m_itDist
Histogram to hold the distribution of in-time amplitudes.
double m_GNSigmaOne
Standard deviation of first gaussian of double gaussian noise.
int m_AmpDistLowLim
Set all bins to the left of this bin to 0 in the amplitude distribution histograms.
double m_ped_LG
Pedestal value for LG if specific channel pedestal is not used.
double m_imperfectionRms
RMS of pulse shape broadening.
float m_pileUpFraction
Probability that an out-of-time component will be added.
TileDigitsFromPulse(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::vector< TH1F * > > m_pileup_AmpDists
Matrix of PU amplitude distribution histograms (PU per partition and channel)
bool m_useItADist
Set to TRUE in order to use a distribution for the in-time amplitude instead of a constant value.
bool m_chanPed
Use channel specific pedestal value if true.
void addPileUp(double &n_inTimeAmp, int gain, int ros, int drawer, int channel)
Fill vector with pile-up amplitudes.
bool m_gaussNoise
Set to TRUE in order to create noise from double gaussian.
std::string m_ootOffsetHistName
Name of the histogram for timing offset distribution.
int m_nSamples
number of read out samples
int m_BunchSpacing
Time between pulses in ms 25, 50 or 75.
double m_inTimeAmp
Amplitude of in-time pulse.
Helper class for TileCal online (hardware) identifiers.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)